@hyperpuncher/pi-ui 0.38.2
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.
- package/LICENSE +21 -0
- package/README.md +161 -0
- package/dist/npm/server-main.js +633 -0
- package/package.json +77 -0
- package/static/app/attachment-file.js +99 -0
- package/static/app/basecoat.js +57 -0
- package/static/app/code-copy.js +32 -0
- package/static/app/dialogs.js +153 -0
- package/static/app/display-refresh.js +125 -0
- package/static/app/display-refresh_test.ts +86 -0
- package/static/app/file-links.js +69 -0
- package/static/app/file-links_test.ts +13 -0
- package/static/app/file-transfer.js +463 -0
- package/static/app/file-transfer_test.ts +174 -0
- package/static/app/main.js +122 -0
- package/static/app/message-scroll.js +343 -0
- package/static/app/message-scroll_test.ts +28 -0
- package/static/app/model-search.js +37 -0
- package/static/app/model-search_test.ts +31 -0
- package/static/app/pickers.js +289 -0
- package/static/app/pickers_test.ts +40 -0
- package/static/app/prompt-history.js +100 -0
- package/static/app/prompt-history_test.ts +51 -0
- package/static/app/prompt.js +99 -0
- package/static/app/session-performance.js +56 -0
- package/static/app/vim-scroll.js +161 -0
- package/static/app/window-focus.js +43 -0
- package/static/app/window-focus_test.ts +83 -0
- package/static/app.css +2 -0
- package/static/basecoat.vendor.js +1 -0
- package/static/build/chunks/abap-sc56dbra.js +1 -0
- package/static/build/chunks/actionscript-3-8wkk0yve.js +1 -0
- package/static/build/chunks/ada-wkh6yxhp.js +1 -0
- package/static/build/chunks/ahk-vk45ms9x.js +1 -0
- package/static/build/chunks/ahk2-ap9fnbvc.js +1 -0
- package/static/build/chunks/andromeeda-zy6mvqwb.js +1 -0
- package/static/build/chunks/angular-html-61dpttc3.js +1 -0
- package/static/build/chunks/angular-ts-hwtqv276.js +1 -0
- package/static/build/chunks/apache-750k8mss.js +1 -0
- package/static/build/chunks/apex-vpts0jxm.js +1 -0
- package/static/build/chunks/apl-jkh6rwt8.js +1 -0
- package/static/build/chunks/applescript-zb2jfj46.js +1 -0
- package/static/build/chunks/ara-4yjpz89z.js +1 -0
- package/static/build/chunks/asciidoc-5xj8s3ay.js +1 -0
- package/static/build/chunks/asm-x6ejak5x.js +1 -0
- package/static/build/chunks/astro-9cd9b7yr.js +1 -0
- package/static/build/chunks/aurora-x-gp6v3669.js +1 -0
- package/static/build/chunks/awk-mpdee6bv.js +1 -0
- package/static/build/chunks/ayu-dark-hbtcbdtr.js +1 -0
- package/static/build/chunks/ayu-light-m7rwwssv.js +1 -0
- package/static/build/chunks/ayu-mirage-5z71k1jj.js +1 -0
- package/static/build/chunks/ballerina-7c4wt1p4.js +1 -0
- package/static/build/chunks/bat-9778z743.js +1 -0
- package/static/build/chunks/beancount-xs0qfpeg.js +1 -0
- package/static/build/chunks/berry-pmbyf94p.js +1 -0
- package/static/build/chunks/bibtex-nnkgf3bz.js +1 -0
- package/static/build/chunks/bicep-vqhsh01p.js +1 -0
- package/static/build/chunks/bird2-za6bpr1n.js +1 -0
- package/static/build/chunks/blade-s6ew6vqn.js +1 -0
- package/static/build/chunks/bsl-z36cmzeg.js +1 -0
- package/static/build/chunks/c-kmp7y11e.js +1 -0
- package/static/build/chunks/c3-1g0cgjqv.js +1 -0
- package/static/build/chunks/cadence-a23a7f13.js +1 -0
- package/static/build/chunks/cairo-r6vd4awx.js +1 -0
- package/static/build/chunks/catppuccin-frappe-05b7n5ms.js +1 -0
- package/static/build/chunks/catppuccin-latte-c7x59n84.js +1 -0
- package/static/build/chunks/catppuccin-macchiato-xq6zfjrk.js +1 -0
- package/static/build/chunks/catppuccin-mocha-xreqmgt9.js +1 -0
- package/static/build/chunks/chapel-717mc8q1.js +1 -0
- package/static/build/chunks/clarity-g6gq1dzn.js +1 -0
- package/static/build/chunks/clojure-pm54sv44.js +1 -0
- package/static/build/chunks/cmake-f1skxqyd.js +1 -0
- package/static/build/chunks/cobol-mys3qens.js +1 -0
- package/static/build/chunks/code-theme-y49p9zss.js +5 -0
- package/static/build/chunks/codeowners-1ys5r05d.js +1 -0
- package/static/build/chunks/codeql-tdw0bqwy.js +1 -0
- package/static/build/chunks/coffee-t9hejzk2.js +1 -0
- package/static/build/chunks/common-lisp-9hjzm22t.js +1 -0
- package/static/build/chunks/coq-fjr6d63p.js +1 -0
- package/static/build/chunks/cpp-1r5860gr.js +1 -0
- package/static/build/chunks/crystal-a1jynptt.js +1 -0
- package/static/build/chunks/csharp-4zp5c1yn.js +1 -0
- package/static/build/chunks/css-j5q0mhnm.js +1 -0
- package/static/build/chunks/csv-a39nx9ry.js +1 -0
- package/static/build/chunks/cue-tg9vgj1q.js +1 -0
- package/static/build/chunks/cypher-p1j7vh0k.js +1 -0
- package/static/build/chunks/d-1f7cc6re.js +1 -0
- package/static/build/chunks/dark-plus-zvzcxs8s.js +1 -0
- package/static/build/chunks/dart-8jekq66r.js +1 -0
- package/static/build/chunks/dax-2aph6zqg.js +1 -0
- package/static/build/chunks/desktop-fqy4qx2w.js +1 -0
- package/static/build/chunks/diff-hqj2qf6m.js +1 -0
- package/static/build/chunks/docker-cht4a1ht.js +1 -0
- package/static/build/chunks/dotenv-txd2x2vy.js +1 -0
- package/static/build/chunks/dracula-6abcnchd.js +1 -0
- package/static/build/chunks/dracula-soft-zyfsdrw6.js +1 -0
- package/static/build/chunks/dream-maker-0gsm31aq.js +1 -0
- package/static/build/chunks/edge-9h036g3s.js +1 -0
- package/static/build/chunks/elixir-7pyn80vc.js +1 -0
- package/static/build/chunks/elm-62v0vnec.js +1 -0
- package/static/build/chunks/emacs-lisp-58kh6hv8.js +1 -0
- package/static/build/chunks/erb-947psegf.js +1 -0
- package/static/build/chunks/erlang-vbf5hbwd.js +1 -0
- package/static/build/chunks/everforest-dark-g7rhmq33.js +1 -0
- package/static/build/chunks/everforest-light-spn7qghr.js +1 -0
- package/static/build/chunks/fennel-h323g5dt.js +1 -0
- package/static/build/chunks/fish-7qbmmjce.js +1 -0
- package/static/build/chunks/fluent-3sdffhr3.js +1 -0
- package/static/build/chunks/fonts-pcnzbv4q.js +1 -0
- package/static/build/chunks/fortran-fixed-form-azemmg4k.js +1 -0
- package/static/build/chunks/fortran-free-form-5njt96mh.js +1 -0
- package/static/build/chunks/fsharp-9eex114p.js +1 -0
- package/static/build/chunks/gdresource-v8yzpggb.js +1 -0
- package/static/build/chunks/gdscript-1snw12w7.js +1 -0
- package/static/build/chunks/gdshader-fmknssp0.js +1 -0
- package/static/build/chunks/genie-4gwgqcc6.js +1 -0
- package/static/build/chunks/gherkin-vjt0p14p.js +1 -0
- package/static/build/chunks/git-commit-z15avpkz.js +1 -0
- package/static/build/chunks/git-rebase-wj5kdx44.js +1 -0
- package/static/build/chunks/github-dark-default-q5m3jmep.js +1 -0
- package/static/build/chunks/github-dark-dimmed-0v34f529.js +1 -0
- package/static/build/chunks/github-dark-high-contrast-62grsqa6.js +1 -0
- package/static/build/chunks/github-dark-r3j6b7er.js +1 -0
- package/static/build/chunks/github-light-default-xgca5we2.js +1 -0
- package/static/build/chunks/github-light-high-contrast-0ee3g9rt.js +1 -0
- package/static/build/chunks/github-light-z1qp6zt5.js +1 -0
- package/static/build/chunks/gleam-znte7hjc.js +1 -0
- package/static/build/chunks/glimmer-js-nph8hwdq.js +1 -0
- package/static/build/chunks/glimmer-ts-fzpx4w3e.js +1 -0
- package/static/build/chunks/glsl-mzc3yta4.js +1 -0
- package/static/build/chunks/gn-3cqh8dtz.js +1 -0
- package/static/build/chunks/gnuplot-r8spf6zm.js +1 -0
- package/static/build/chunks/go-ac27dc57.js +1 -0
- package/static/build/chunks/graphql-f6vq7p23.js +1 -0
- package/static/build/chunks/groovy-p8r8bd0c.js +1 -0
- package/static/build/chunks/gruvbox-dark-hard-0zvxnx0e.js +1 -0
- package/static/build/chunks/gruvbox-dark-medium-qvjwy81n.js +1 -0
- package/static/build/chunks/gruvbox-dark-soft-mhtpt38s.js +1 -0
- package/static/build/chunks/gruvbox-light-hard-nrwjbbts.js +1 -0
- package/static/build/chunks/gruvbox-light-medium-qbwkw432.js +1 -0
- package/static/build/chunks/gruvbox-light-soft-rmkm778k.js +1 -0
- package/static/build/chunks/hack-a2wva0c2.js +1 -0
- package/static/build/chunks/haml-hmfn055t.js +1 -0
- package/static/build/chunks/handlebars-54kh2jwn.js +1 -0
- package/static/build/chunks/haskell-vkvkgtsh.js +1 -0
- package/static/build/chunks/haxe-yk1p58qs.js +1 -0
- package/static/build/chunks/hcl-mq3znmzm.js +1 -0
- package/static/build/chunks/hjson-ma7dfjrp.js +1 -0
- package/static/build/chunks/hlsl-jcfmchrk.js +1 -0
- package/static/build/chunks/horizon-bright-9s4tt51x.js +1 -0
- package/static/build/chunks/horizon-fm23m9qj.js +1 -0
- package/static/build/chunks/houston-fx2psmvq.js +1 -0
- package/static/build/chunks/html-derivative-xw79bbzd.js +1 -0
- package/static/build/chunks/html-nawteed7.js +1 -0
- package/static/build/chunks/http-72kn3sp8.js +1 -0
- package/static/build/chunks/hurl-eve0v3e8.js +1 -0
- package/static/build/chunks/hxml-8pcfrsh9.js +1 -0
- package/static/build/chunks/hy-989jkx6q.js +1 -0
- package/static/build/chunks/imba-cm19z6hg.js +1 -0
- package/static/build/chunks/index-gt9ev6v8.js +518 -0
- package/static/build/chunks/ini-a7zcn1v0.js +1 -0
- package/static/build/chunks/java-mjc9q3md.js +1 -0
- package/static/build/chunks/javascript-n8j33v1m.js +1 -0
- package/static/build/chunks/jinja-a6q4x5tm.js +1 -0
- package/static/build/chunks/jison-nj6cbyz2.js +1 -0
- package/static/build/chunks/json-bvza2dkb.js +1 -0
- package/static/build/chunks/json5-a53a0ked.js +1 -0
- package/static/build/chunks/jsonc-5tyv9mjd.js +1 -0
- package/static/build/chunks/jsonl-prv0dcjv.js +1 -0
- package/static/build/chunks/jsonnet-5gdjahsx.js +1 -0
- package/static/build/chunks/jssm-mwsp2p7j.js +1 -0
- package/static/build/chunks/jsx-75v76p5q.js +1 -0
- package/static/build/chunks/julia-45twp29b.js +1 -0
- package/static/build/chunks/just-ct7367ec.js +1 -0
- package/static/build/chunks/kanagawa-dragon-fbqq2bhk.js +1 -0
- package/static/build/chunks/kanagawa-lotus-zgxv1mgm.js +1 -0
- package/static/build/chunks/kanagawa-wave-wedn0ksa.js +1 -0
- package/static/build/chunks/kdl-n6ez9ngv.js +1 -0
- package/static/build/chunks/kotlin-ghtz1y98.js +1 -0
- package/static/build/chunks/kusto-43yprh9t.js +1 -0
- package/static/build/chunks/laserwave-2fz4nxs5.js +1 -0
- package/static/build/chunks/latex-httjryda.js +1 -0
- package/static/build/chunks/lean-49ww85t0.js +1 -0
- package/static/build/chunks/less-47m6fdq2.js +1 -0
- package/static/build/chunks/light-plus-5tghbj4b.js +1 -0
- package/static/build/chunks/liquid-r4gqgph0.js +1 -0
- package/static/build/chunks/llvm-zesbzx6h.js +1 -0
- package/static/build/chunks/log-n0g1tx1y.js +1 -0
- package/static/build/chunks/logo-j5ze60v0.js +1 -0
- package/static/build/chunks/lua-15pct4hw.js +1 -0
- package/static/build/chunks/luau-75hm4mxn.js +1 -0
- package/static/build/chunks/main-02cnngb2.js +2 -0
- package/static/build/chunks/main-06tnp3sh.js +2 -0
- package/static/build/chunks/main-0a9vnbak.js +2 -0
- package/static/build/chunks/main-0b281zv9.js +2 -0
- package/static/build/chunks/main-0nb87rgr.js +2 -0
- package/static/build/chunks/main-0w2eqgkm.js +2 -0
- package/static/build/chunks/main-1n8jg8rf.js +2 -0
- package/static/build/chunks/main-1q6650cv.js +2 -0
- package/static/build/chunks/main-1swy7s7h.js +2 -0
- package/static/build/chunks/main-1xeedcwa.js +2 -0
- package/static/build/chunks/main-2xnnvrcx.js +2 -0
- package/static/build/chunks/main-2zhgrhtb.js +2 -0
- package/static/build/chunks/main-3r9xmt0z.js +2 -0
- package/static/build/chunks/main-3s35k63z.js +2 -0
- package/static/build/chunks/main-3srxnktc.js +2 -0
- package/static/build/chunks/main-4sa6jbv9.js +2 -0
- package/static/build/chunks/main-61mzprk0.js +9 -0
- package/static/build/chunks/main-689tj0r4.js +2 -0
- package/static/build/chunks/main-6e7tjcht.js +2 -0
- package/static/build/chunks/main-6hjptvkk.js +2 -0
- package/static/build/chunks/main-6v87p7j0.js +2 -0
- package/static/build/chunks/main-77tx7a8q.js +2 -0
- package/static/build/chunks/main-7fchxg57.js +7 -0
- package/static/build/chunks/main-83kpz2vm.js +2 -0
- package/static/build/chunks/main-8vy6mdxc.js +2 -0
- package/static/build/chunks/main-98b1m2e8.js +2 -0
- package/static/build/chunks/main-9hkj1fvj.js +2 -0
- package/static/build/chunks/main-9r4kp1re.js +2 -0
- package/static/build/chunks/main-9rd1xskg.js +2 -0
- package/static/build/chunks/main-9rh1hxyw.js +2 -0
- package/static/build/chunks/main-9v5c2hm4.js +2 -0
- package/static/build/chunks/main-aw75bv70.js +2 -0
- package/static/build/chunks/main-b1wctdb9.js +2 -0
- package/static/build/chunks/main-brrygrcd.js +2 -0
- package/static/build/chunks/main-bxkfh3s9.js +2 -0
- package/static/build/chunks/main-capt12kv.js +2 -0
- package/static/build/chunks/main-cbea0k4t.js +2 -0
- package/static/build/chunks/main-cs7592x8.js +2 -0
- package/static/build/chunks/main-d04rg092.js +2 -0
- package/static/build/chunks/main-d4pbngvb.js +2 -0
- package/static/build/chunks/main-d96ygjmk.js +2 -0
- package/static/build/chunks/main-dbxf9vvb.js +2 -0
- package/static/build/chunks/main-e0bf1hc7.js +2 -0
- package/static/build/chunks/main-e1qp4v0e.js +2 -0
- package/static/build/chunks/main-ed67cb17.js +2 -0
- package/static/build/chunks/main-ef0zm6td.js +2 -0
- package/static/build/chunks/main-epkkzhsq.js +2 -0
- package/static/build/chunks/main-f1t9zy21.js +2 -0
- package/static/build/chunks/main-g4ry2z87.js +2 -0
- package/static/build/chunks/main-h9p54b6w.js +2 -0
- package/static/build/chunks/main-hp9qyk20.js +2 -0
- package/static/build/chunks/main-hv1v7a2c.js +2 -0
- package/static/build/chunks/main-jr2gz2ea.js +2 -0
- package/static/build/chunks/main-kktqjawn.js +2 -0
- package/static/build/chunks/main-knre9pdj.js +2 -0
- package/static/build/chunks/main-m9qkdc8e.js +2 -0
- package/static/build/chunks/main-mcptmf3e.js +2 -0
- package/static/build/chunks/main-mmmydrw7.js +2 -0
- package/static/build/chunks/main-mqmtpd6m.js +2 -0
- package/static/build/chunks/main-n8b99y0n.js +2 -0
- package/static/build/chunks/main-nex51cmy.js +2 -0
- package/static/build/chunks/main-nzkzztjw.js +2 -0
- package/static/build/chunks/main-p5c2apac.js +2 -0
- package/static/build/chunks/main-p8efbnm1.js +2 -0
- package/static/build/chunks/main-q9q129d1.js +2 -0
- package/static/build/chunks/main-qbf61mtn.js +2 -0
- package/static/build/chunks/main-rb1nkcm0.js +2 -0
- package/static/build/chunks/main-spgna5r3.js +2 -0
- package/static/build/chunks/main-tqpmccz6.js +2 -0
- package/static/build/chunks/main-v7n0f428.js +2 -0
- package/static/build/chunks/main-v9j8veta.js +2 -0
- package/static/build/chunks/main-w5g9070a.js +2 -0
- package/static/build/chunks/main-wbpws0v9.js +2 -0
- package/static/build/chunks/main-wcnadmhs.js +1530 -0
- package/static/build/chunks/main-x61973bh.js +2 -0
- package/static/build/chunks/main-xqc8f31a.js +2 -0
- package/static/build/chunks/main-xtaq3qt4.js +2 -0
- package/static/build/chunks/main-xvgwadfa.js +2 -0
- package/static/build/chunks/main-y0dvfpw7.js +2 -0
- package/static/build/chunks/main-ynjqm60c.js +2 -0
- package/static/build/chunks/main-ypk8hvc0.js +2 -0
- package/static/build/chunks/main-zjsthwaz.js +2 -0
- package/static/build/chunks/main-zy79z3j0.js +2 -0
- package/static/build/chunks/make-82gdkt9b.js +1 -0
- package/static/build/chunks/markdown-5tkrg1ah.js +1 -0
- package/static/build/chunks/marko-qafrqcsm.js +1 -0
- package/static/build/chunks/material-theme-darker-fnv6smqw.js +1 -0
- package/static/build/chunks/material-theme-lighter-35th362e.js +1 -0
- package/static/build/chunks/material-theme-ocean-4dq3ahw3.js +1 -0
- package/static/build/chunks/material-theme-p7k291d1.js +1 -0
- package/static/build/chunks/material-theme-palenight-yhd4pmvh.js +1 -0
- package/static/build/chunks/matlab-mbnxwt6q.js +1 -0
- package/static/build/chunks/mdc-w29armgh.js +1 -0
- package/static/build/chunks/mdx-53tq2vwd.js +1 -0
- package/static/build/chunks/mermaid-kp8v57t9.js +1 -0
- package/static/build/chunks/min-dark-rtx0tqrz.js +1 -0
- package/static/build/chunks/min-light-5m66fg5h.js +1 -0
- package/static/build/chunks/mipsasm-may8rjf3.js +1 -0
- package/static/build/chunks/mojo-ezqmbs71.js +1 -0
- package/static/build/chunks/monokai-79awbcqn.js +1 -0
- package/static/build/chunks/moonbit-57vh5qgn.js +1 -0
- package/static/build/chunks/move-71jrpzz7.js +1 -0
- package/static/build/chunks/narrat-n4xxr8p6.js +1 -0
- package/static/build/chunks/nextflow-c0gn0hzt.js +1 -0
- package/static/build/chunks/nextflow-groovy-13xg49y5.js +1 -0
- package/static/build/chunks/nginx-vtb8rwdx.js +1 -0
- package/static/build/chunks/night-owl-light-05jd94v7.js +1 -0
- package/static/build/chunks/night-owl-y5p2e2yz.js +1 -0
- package/static/build/chunks/nim-nfvgqc30.js +1 -0
- package/static/build/chunks/nix-rkxmnaat.js +1 -0
- package/static/build/chunks/nord-akta5pm4.js +1 -0
- package/static/build/chunks/nsis-6c1fw7sy.js +1 -0
- package/static/build/chunks/nushell-pvtw3a6j.js +1 -0
- package/static/build/chunks/objective-c-jd7171g7.js +1 -0
- package/static/build/chunks/objective-cpp-6v7n9hk7.js +1 -0
- package/static/build/chunks/ocaml-kjv8t7w5.js +1 -0
- package/static/build/chunks/odin-58v0n0xa.js +1 -0
- package/static/build/chunks/one-dark-pro-pbp84hvh.js +1 -0
- package/static/build/chunks/one-light-jpadzfmm.js +1 -0
- package/static/build/chunks/openscad-0xnz3sah.js +1 -0
- package/static/build/chunks/org-xe4jzp20.js +1 -0
- package/static/build/chunks/pascal-f75emr3j.js +1 -0
- package/static/build/chunks/perl-zp07ased.js +1 -0
- package/static/build/chunks/php-fjm4srka.js +1 -0
- package/static/build/chunks/pierre-dark-2sng8cw6.js +1 -0
- package/static/build/chunks/pierre-dark-protanopia-deuteranopia-615mrd5v.js +1 -0
- package/static/build/chunks/pierre-dark-soft-xpc8stwc.js +1 -0
- package/static/build/chunks/pierre-dark-tritanopia-nw71c9hw.js +1 -0
- package/static/build/chunks/pierre-dark-vibrant-dtc0vftx.js +1 -0
- package/static/build/chunks/pierre-light-mtkcs9xq.js +1 -0
- package/static/build/chunks/pierre-light-protanopia-deuteranopia-d84wh0sh.js +1 -0
- package/static/build/chunks/pierre-light-soft-f0vxkd08.js +1 -0
- package/static/build/chunks/pierre-light-tritanopia-prpe8fpj.js +1 -0
- package/static/build/chunks/pierre-light-vibrant-y1syd51f.js +1 -0
- package/static/build/chunks/pkl-x0wayphd.js +1 -0
- package/static/build/chunks/plastic-5dg6r26t.js +1 -0
- package/static/build/chunks/plsql-259gvzn9.js +1 -0
- package/static/build/chunks/po-6kcxkqtd.js +1 -0
- package/static/build/chunks/poimandres-p8seewrs.js +1 -0
- package/static/build/chunks/polar-b1ev80vb.js +1 -0
- package/static/build/chunks/postcss-kxdxws93.js +1 -0
- package/static/build/chunks/powerquery-ved4pq1y.js +1 -0
- package/static/build/chunks/powershell-6j0w6ann.js +1 -0
- package/static/build/chunks/prisma-7r1mj2qq.js +1 -0
- package/static/build/chunks/prolog-7a8gwgvm.js +1 -0
- package/static/build/chunks/proto-s5e2jd7n.js +1 -0
- package/static/build/chunks/pug-8cxb8b6f.js +1 -0
- package/static/build/chunks/puppet-d1048c00.js +1 -0
- package/static/build/chunks/purescript-vqffe1a1.js +1 -0
- package/static/build/chunks/python-7z2eacwy.js +1 -0
- package/static/build/chunks/qml-51nrq0re.js +1 -0
- package/static/build/chunks/qmldir-q0jk1gzg.js +1 -0
- package/static/build/chunks/qss-6far86jw.js +1 -0
- package/static/build/chunks/r-qkm8ck5x.js +1 -0
- package/static/build/chunks/racket-mzbdy2fp.js +1 -0
- package/static/build/chunks/raku-se52tvjp.js +1 -0
- package/static/build/chunks/razor-y9b1j8td.js +1 -0
- package/static/build/chunks/rbs-00y9vc5r.js +1 -0
- package/static/build/chunks/red-tkj5bw1z.js +1 -0
- package/static/build/chunks/reg-9z4ax2nc.js +1 -0
- package/static/build/chunks/regexp-99svsrmp.js +1 -0
- package/static/build/chunks/rel-tf2jya2v.js +1 -0
- package/static/build/chunks/riscv-hpebp724.js +1 -0
- package/static/build/chunks/ron-s3mfhwnh.js +1 -0
- package/static/build/chunks/rose-pine-dawn-apmj5y1p.js +1 -0
- package/static/build/chunks/rose-pine-moon-mgx7zgjy.js +1 -0
- package/static/build/chunks/rose-pine-vgbee1jh.js +1 -0
- package/static/build/chunks/rosmsg-vgsgfpe4.js +1 -0
- package/static/build/chunks/rst-xnf3rrzd.js +1 -0
- package/static/build/chunks/ruby-gysj44ty.js +1 -0
- package/static/build/chunks/rust-bzv74qkx.js +1 -0
- package/static/build/chunks/sas-t4zftd7j.js +1 -0
- package/static/build/chunks/sass-tnsj7t5t.js +1 -0
- package/static/build/chunks/scala-vsjg5eg2.js +1 -0
- package/static/build/chunks/scheme-yhv7mnk9.js +1 -0
- package/static/build/chunks/scss-vt2fyer8.js +1 -0
- package/static/build/chunks/sdbl-jv670bae.js +1 -0
- package/static/build/chunks/shaderlab-csszkf9s.js +1 -0
- package/static/build/chunks/shellscript-t3jf42zg.js +1 -0
- package/static/build/chunks/shellsession-e1m2zj1m.js +1 -0
- package/static/build/chunks/slack-dark-ntnagayj.js +1 -0
- package/static/build/chunks/slack-ochin-kge218j8.js +1 -0
- package/static/build/chunks/smalltalk-q8bgts0p.js +1 -0
- package/static/build/chunks/smithy-m7r7jeg3.js +1 -0
- package/static/build/chunks/snazzy-light-57mzezsa.js +1 -0
- package/static/build/chunks/solarized-dark-0r80rpr7.js +1 -0
- package/static/build/chunks/solarized-light-1e0p6z46.js +1 -0
- package/static/build/chunks/solidity-vb1zcsry.js +1 -0
- package/static/build/chunks/soy-bzh2aynk.js +1 -0
- package/static/build/chunks/sparql-6t8g6rdd.js +1 -0
- package/static/build/chunks/splunk-50bpjgv6.js +1 -0
- package/static/build/chunks/sql-kkaf039q.js +1 -0
- package/static/build/chunks/ssh-config-715bkrac.js +1 -0
- package/static/build/chunks/stata-zhvjkw4g.js +1 -0
- package/static/build/chunks/stylus-b8aj4z6s.js +1 -0
- package/static/build/chunks/surrealql-4w27b1xf.js +1 -0
- package/static/build/chunks/svelte-6vty1ayf.js +1 -0
- package/static/build/chunks/swift-2w2k3des.js +1 -0
- package/static/build/chunks/synthwave-84-007ndkbp.js +1 -0
- package/static/build/chunks/system-verilog-hzg0fpex.js +1 -0
- package/static/build/chunks/systemd-d3k4d1av.js +1 -0
- package/static/build/chunks/talonscript-fw295t4h.js +1 -0
- package/static/build/chunks/tasl-8n3br9kn.js +1 -0
- package/static/build/chunks/tcl-e485436v.js +1 -0
- package/static/build/chunks/templ-535cbmg6.js +1 -0
- package/static/build/chunks/terraform-k8aqghnt.js +1 -0
- package/static/build/chunks/tex-9yx3fnmk.js +1 -0
- package/static/build/chunks/tokyo-night-rvkd4sna.js +1 -0
- package/static/build/chunks/toml-bypjcbh1.js +1 -0
- package/static/build/chunks/ts-tags-zyfv802m.js +1 -0
- package/static/build/chunks/tsv-2n58sktq.js +1 -0
- package/static/build/chunks/tsx-gnkw8sgq.js +1 -0
- package/static/build/chunks/turtle-sf93b8kj.js +1 -0
- package/static/build/chunks/twig-8gw76pn3.js +1 -0
- package/static/build/chunks/typescript-077c9w1h.js +1 -0
- package/static/build/chunks/typespec-8r8ncprb.js +1 -0
- package/static/build/chunks/typst-yg6690gs.js +1 -0
- package/static/build/chunks/v-tdjz29z1.js +1 -0
- package/static/build/chunks/vala-trffggt0.js +1 -0
- package/static/build/chunks/vb-1dx16kyy.js +1 -0
- package/static/build/chunks/verilog-sv7hb60t.js +1 -0
- package/static/build/chunks/vesper-005phtef.js +1 -0
- package/static/build/chunks/vhdl-qck3dqgh.js +1 -0
- package/static/build/chunks/viml-m54vetp0.js +1 -0
- package/static/build/chunks/vitesse-black-sxfaa2kz.js +1 -0
- package/static/build/chunks/vitesse-dark-fhxvesec.js +1 -0
- package/static/build/chunks/vitesse-light-cygqrsgb.js +1 -0
- package/static/build/chunks/vue-html-5ex4htv4.js +1 -0
- package/static/build/chunks/vue-n8p10w4p.js +1 -0
- package/static/build/chunks/vue-vine-y2qnwmqn.js +1 -0
- package/static/build/chunks/vyper-r9v6ymtz.js +1 -0
- package/static/build/chunks/wasm-c0aw8acq.js +1 -0
- package/static/build/chunks/wasm-eftreyx0.js +1 -0
- package/static/build/chunks/wenyan-pn35fr2w.js +1 -0
- package/static/build/chunks/wgsl-akmafmem.js +1 -0
- package/static/build/chunks/wikitext-yp9d6pan.js +1 -0
- package/static/build/chunks/wit-rg9t2t2j.js +1 -0
- package/static/build/chunks/wolfram-m5vswcfg.js +1 -0
- package/static/build/chunks/workspace-review-3scrbyaw.js +1361 -0
- package/static/build/chunks/xml-8pftb6y7.js +1 -0
- package/static/build/chunks/xsl-w4bvqyjy.js +1 -0
- package/static/build/chunks/yaml-a56qt88c.js +1 -0
- package/static/build/chunks/zenscript-pp2pffj8.js +1 -0
- package/static/build/chunks/zig-53aewpf9.js +1 -0
- package/static/build/main.js +6 -0
- package/static/build/pierre-worker.js +156 -0
- package/static/favicon.svg +1 -0
- package/static/file-uri.js +18 -0
- package/static/file-uri_test.ts +35 -0
- package/static/icon-180.png +0 -0
- package/static/icon-192.png +0 -0
- package/static/icon-512.png +0 -0
- package/static/manifest.webmanifest +23 -0
- package/static/notification-icon.png +0 -0
- package/static/theme.js +17 -0
- package/static/vendor/datastar-inspector.min.js +1021 -0
- package/static/vendor/datastar.js +10 -0
|
@@ -0,0 +1,1530 @@
|
|
|
1
|
+
import{$ as yn,B as Nr,C as Fc,D as Rs,E as qr,F as ic,G as Is,H as Ms,I as Hs,J as Ps,K as hn,L as fn,M as pn,N as mn,O as z,P as Qd,Q as Yd,R as Jd,S as rd,T as od,U as Er,V as pc,W as Ki,X as bn,Y as _c,Z as Oc,_ as mc,aa as Dr,ba as ea,ca as le,da as ui,ea as ta,fa as hi,ga as ln,ha as yt,ia as $n,ja as Ee,ka as oe,pa as gn,qa as yr,ta as Fr}from"./main-7fchxg57.js";import{Pb as $r,Rb as Gc}from"./main-61mzprk0.js";import{ec as Gs,fc as p}from"./main-x61973bh.js";function se(e,t){return e-(t===0?0:1)}function ee(e,t){return se(e,t)+t}function ke(e){let t=e.length;if(e.charCodeAt(t-1)===10){if(t--,e.charCodeAt(t-1)===13)t--}return e.slice(0,t)}var jc=new TextEncoder,qc=new TextDecoder("utf-8",{ignoreBOM:!0}),Kc=/[\uD800-\uDFFF]/;var zt=new Uint8Array(1024);function Vr(){if(zt.length!==1024)zt=new Uint8Array(1024)}function Z(e){if(e.length===0)return e;if(Kc.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;if(zt.length<t)zt=new Uint8Array(t);let{written:n}=jc.encodeInto(e,zt);return qc.decode(zt.subarray(0,n))}function ws(e){for(let t of e.hunks){for(let n=0;n<t.hunkContent.length;n++){let i=t.hunkContent[n];if(i.type!=="change")continue;let r=Yc(e,i);if(r!=null)t.hunkContent.splice(n,1,...r),n+=r.length-1}Xc(t,e)}}function Xc(e,t){let{hunkContent:n}=e;for(let i=1;i<n.length;i++){let r=n[i],o=n[i-1];if(r.type!=="change"||r.additions>0&&r.deletions>0||o.type!=="context")continue;let s=r.additions>0,a=s?t.additionLines:t.deletionLines,l=s?r.additionLineIndex:r.deletionLineIndex,d=s?r.additions:r.deletions,c=a[l]??"";if(c.trim()!=="")continue;let u=!0;for(let v=1;v<d;v++)if(a[l+v]!==c){u=!1;break}if(!u)continue;let h=0;while(h<o.lines&&t.additionLines[o.additionLineIndex+o.lines-1-h]===c)h++;if(h===0)continue;if(i===1&&h===o.lines)continue;r.additionLineIndex-=h,r.deletionLineIndex-=h;let f=r.additionLineIndex+r.additions,m=r.deletionLineIndex+r.deletions,y=n[i+1];if(y?.type==="context")y.lines+=h,y.additionLineIndex=f,y.deletionLineIndex=m;else n.splice(i+1,0,{type:"context",lines:h,additionLineIndex:f,deletionLineIndex:m});if(o.lines-=h,o.lines===0)n.splice(i-1,1),i--}}function Yc(e,t){let{deletions:n,additions:i,deletionLineIndex:r,additionLineIndex:o}=t,s=Math.min(n,i),a=Math.abs(i-n);if(s===0||a===0||s*(a+1)>4096)return null;let l=[];for(let y=0;y<n;y++)l.push(ks(e.deletionLines[r+y]??""));let d=[];for(let y=0;y<i;y++)d.push(ks(e.additionLines[o+y]??""));let c=i>n,u=0,h=-1;for(let y=0;y<=a;y++){let v=0;for(let g=0;g<s;g++)v+=Zc(l[g+(c?0:y)],d[g+(c?y:0)]);if(y===0)h=v+s*0.5;else if(v>h)h=v,u=y}if(u===0)return null;let f=[],m=(y,v,g,S)=>{if(y>0||v>0)f.push({type:"change",deletions:y,additions:v,deletionLineIndex:g,additionLineIndex:S})};if(c)m(0,u,r,o),m(s,s,r,o+u),m(0,i-s-u,r+s,o+u+s);else m(u,0,r,o),m(s,s,r+u,o),m(n-s-u,0,r+u+s,o+s);return f}var Jc=/\s+/g;function ks(e){return e.replace(Jc,"")}function Zc(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),i=Math.min(e.length,t.length);if(i===0)return 0;let r=0;while(r<i&&e[r]===t[r])r++;let o=0;while(o<i-r&&e[e.length-1-o]===t[t.length-1-o])o++;return(r+o)/n}function Ns(e,t,n){try{return Qc(e,t,n)}finally{Vr()}}function Qc(e,t,n=!1){let i=lu(e),r=i?nu(e):iu(e),o,s=[];for(let a of r){if(i&&!qr.test(a)){if(o==null)o=Z(a);else if(n)throw Error("parsePatchContent: unknown file blob");else console.error("parsePatchContent: unknown file blob:",a);continue}else if(!i&&!ru(a)){if(o==null)o=Z(a);else if(n)throw Error("parsePatchContent: unknown file blob");else console.error("parsePatchContent: unknown file blob:",a);continue}let l=Ds(a,{cacheKey:t!=null?`${t}-${s.length}`:void 0,isGitDiff:i,throwOnError:n});if(l!=null)s.push(l)}return{patchMetadata:o,files:s}}function Kr(e,t){try{return Ds(e,t)}finally{Vr()}}function Ds(e,{cacheKey:t,isGitDiff:n=qr.test(e),oldFile:i,newFile:r,throwOnError:o=!1}={}){let s=0,a=Us(e,"@@ "),l,d=i==null||r==null,c=0,u=0;for(let h of a){let f=Fs(h),m=f[0];if(m==null){if(o)throw Error("parsePatchContent: invalid hunk");else console.error("parsePatchContent: invalid hunk",h);continue}let y=Os(m),v=0,g=0;if(y==null||l==null){if(l!=null){if(o)throw Error("parsePatchContent: Invalid hunk");else console.error("parsePatchContent: Invalid hunk",h);continue}if(l={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:!d&&i!=null&&r!=null?Ls(r.contents):[],deletionLines:!d&&i!=null&&r!=null?Ls(i.contents):[],cacheKey:As(t)},l.additionLines.length===1&&r?.contents==="")l.additionLines.length=0;if(l.deletionLines.length===1&&i?.contents==="")l.deletionLines.length=0;for(let L of f){if(L.startsWith("diff --git")){let O=L.trim().match(Hs),A=O?.[1]??O?.[2],R=O?.[3]??O?.[4];if(A==null||R==null){if(o)throw Error("parsePatchContent: invalid git diff header");else console.error("parsePatchContent: invalid git diff header",L);continue}if(l.name=Z(R.trim()),A!==R)l.prevName=Z(A.trim());continue}let I=L.startsWith("---")||L.startsWith("+++")?L.match(n?Ms:Is):null;if(I!=null){let[,O,A]=I;if(O==="---"&&A!=="/dev/null"){let R=Z(A.trim());l.prevName=R,l.name=R}else if(O==="+++"&&A!=="/dev/null")l.name=Z(A.trim())}else if(n){if(L.startsWith("new mode "))l.mode=Z(L.slice(8).trim());if(L.startsWith("old mode "))l.prevMode=Z(L.slice(8).trim());if(L.startsWith("new file mode"))l.type="new",l.mode=Z(L.slice(13).trim());if(L.startsWith("deleted file mode"))l.type="deleted",l.mode=Z(L.slice(17).trim());if(L.startsWith("similarity index"))if(L.startsWith("similarity index 100%"))l.type="rename-pure";else l.type="rename-changed";if(L.startsWith("index ")){let[,O,A,R]=L.trim().match(Ps)??[];if(O!=null)l.prevObjectId=Z(O);if(A!=null)l.newObjectId=Z(A);if(R!=null)l.mode=Z(R)}if(L.startsWith("rename from "))l.prevName=Z(L.slice(12).trim());if(L.startsWith("rename to "))l.name=Z(L.slice(10).trim())}}continue}let S,b;while(f.length>0&&(f[f.length-1]===`
|
|
2
|
+
`||f[f.length-1]==="\r"||f[f.length-1]===`\r
|
|
3
|
+
`||f[f.length-1]===""))f.pop();let{additionStart:x,deletionStart:C}=y;c=d?c:C-1,u=d?u:x-1;let k={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:y.additionCount,additionStart:x,additionLines:v,deletionCount:y.deletionCount,deletionStart:C,deletionLines:g,deletionLineIndex:c,additionLineIndex:u,hunkContent:[],hunkContext:As(y.hunkContext),hunkSpecs:Z(m),noEOFCRAdditions:!1,noEOFCRDeletions:!1},w=0,T=0;for(let L=1;L<f.length;L++){let I=f[L];if(w>=k.additionCount&&T>=k.deletionCount&&!I.startsWith("\\")){if(o&&ou(I)&&!su(I))throw Error("parsePatchContent: hunk has more lines than expected");break}let O=I[0];if(O!=="+"&&O!=="-"&&O!==" "&&O!=="\\"){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${O}", full line: "${I}"`),console.error("processFile: invalid rawLine:",I);continue}let A=du(O);if(A==="addition"){if(o&&w>=k.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");let R=Gr(I);if(S==null||S.type!=="change")S=Wr("change",c,u),k.hunkContent.push(S);if(u++,w++,d)l.additionLines.push(R);S.additions++,v++,b="addition"}else if(A==="deletion"){if(o&&T>=k.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");let R=Gr(I);if(S==null||S.type!=="change")S=Wr("change",c,u),k.hunkContent.push(S);if(c++,T++,d)l.deletionLines.push(R);S.deletions++,g++,b="deletion"}else if(A==="context"){if(o&&(T>=k.deletionCount||w>=k.additionCount))throw Error("parsePatchContent: hunk has too many context lines");let R=Gr(I);if(S==null||S.type!=="context")S=Wr("context",c,u),k.hunkContent.push(S);if(u++,c++,w++,T++,d)l.deletionLines.push(R),l.additionLines.push(R);S.lines++,b="context"}else if(A==="metadata"&&S!=null){if(S.type==="context")k.noEOFCRAdditions=!0,k.noEOFCRDeletions=!0;else if(b==="deletion")k.noEOFCRDeletions=!0;else if(b==="addition")k.noEOFCRAdditions=!0;if(d&&(b==="addition"||b==="context")){let R=l.additionLines.length-1;if(R>=0)l.additionLines[R]=ke(l.additionLines[R])}if(d&&(b==="deletion"||b==="context")){let R=l.deletionLines.length-1;if(R>=0)l.deletionLines[R]=ke(l.deletionLines[R])}}}if(o&&(w!==k.additionCount||T!==k.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");k.additionLines=v,k.deletionLines=g,k.collapsedBefore=Math.max(se(k.additionStart,k.additionCount)-s,0),l.hunks.push(k),s=ee(k.additionStart,k.additionCount);for(let L of k.hunkContent)if(L.type==="context")k.splitLineCount+=L.lines,k.unifiedLineCount+=L.lines;else k.splitLineCount+=Math.max(L.additions,L.deletions),k.unifiedLineCount+=L.deletions+L.additions;k.splitLineStart=l.splitLineCount+k.collapsedBefore,k.unifiedLineStart=l.unifiedLineCount+k.collapsedBefore,l.splitLineCount+=k.collapsedBefore+k.splitLineCount,l.unifiedLineCount+=k.collapsedBefore+k.unifiedLineCount}if(l==null)return;if(o&&d&&!n&&l.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(l.hunks.length>0&&!d&&l.additionLines.length>0&&l.deletionLines.length>0){let h=l.hunks[l.hunks.length-1],f=ee(h.additionStart,h.additionCount),m=l.additionLines.length,y=Math.max(m-f,0);l.splitLineCount+=y,l.unifiedLineCount+=y}if(!n){if(l.prevName!=null&&l.name!==l.prevName)if(l.hunks.length>0)l.type="rename-changed";else l.type="rename-pure";else if((i==null||i.contents==="")&&r!=null&&r.contents!=="")l.type="new";else if(i!=null&&i.contents!==""&&(r==null||r.contents===""))l.type="deleted"}if(l.type!=="rename-pure"&&l.type!=="rename-changed")l.prevName=void 0;return ws(l),l}function eu(e,t,n=!1){let i=[],r=tu(e)?e.split(Rs):[e];for(let o of r)try{i.push(Ns(o,t!=null?`${t}-${i.length}`:void 0,n))}catch(s){if(n)throw s;else console.error(s)}return i}function tu(e){return e.startsWith("From ")||e.includes(`
|
|
4
|
+
From `)}function Ls(e){let t=Fs(e);for(let n=0;n<t.length;n++)t[n]=Z(t[n]);return t}function Fs(e){if(e.length===0)return[""];let t=[],n=0;for(;;){let i=e.indexOf(`
|
|
5
|
+
`,n);if(i===-1)break;t.push(e.slice(n,i+1)),n=i+1}if(n<e.length)t.push(e.slice(n));return t}function nu(e){return Us(e,"diff --git")}function iu(e){if(e.length===0)return[""];let t=[],n=0,i=0,r=0,o=0,s=!1;while(i<e.length){let a=jr(e,i);if(r<=0&&o<=0){if(_s(e,i)){if(i>n)t.push(e.slice(n,i));n=i,s=!0,i=jr(e,a);continue}if(s&&e.startsWith("@@ -",i)){let d=Os(e.slice(i,a));if(d!=null)r=d.deletionCount,o=d.additionCount}i=a;continue}let l=e[i];if(l==="\\"){i=a;continue}if(l===" ")r=Math.max(r-1,0),o=Math.max(o-1,0);else if(l==="-")r=Math.max(r-1,0);else if(l==="+")o=Math.max(o-1,0);i=a}return t.push(e.slice(n)),t}function ru(e){return _s(e,0)}function _s(e,t){let n=jr(e,t);return Es(e,t,"---")&&Es(e,n,"+++")}function Es(e,t,n){if(!e.startsWith(n,t))return!1;let i=e[t+n.length];if(i!==" "&&i!=="\t")return!1;for(let r=t+n.length+1;r<e.length;r++){let o=e[r];if(o===`
|
|
6
|
+
`||o==="\r")break;if(o!==" "&&o!=="\t")return!0}return!1}function jr(e,t){let n=e.indexOf(`
|
|
7
|
+
`,t);return n===-1?e.length:n+1}function ou(e){let t=e[0];return t==="+"||t==="-"||t===" "}function su(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==" "&&n!=="\t"&&n!==`
|
|
8
|
+
`&&n!=="\r")return!1}return!0}function Os(e){if(!e.startsWith("@@ -"))return;let t=4,n=ii(e,t);if(n==null)return;let i=n.value;t=n.endIndex;let r=1;if(e[t]===","){let c=ii(e,t+1);if(c==null)return;r=c.value,t=c.endIndex}if(e[t]!==" "||e[t+1]!=="+")return;t+=2;let o=ii(e,t);if(o==null)return;let s=o.value;t=o.endIndex;let a=1;if(e[t]===","){let c=ii(e,t+1);if(c==null)return;a=c.value,t=c.endIndex}if(e[t]!==" "||e[t+1]!=="@"||e[t+2]!=="@")return;let l,d=t+3;if(e[d]===" ")l=au(e.slice(d+1));return{additionCount:a,additionStart:s,deletionCount:r,deletionStart:i,hunkContext:l}}function ii(e,t){let n=t,i=0;for(;n<e.length;n++){let r=e.charCodeAt(n)-48;if(r<0||r>9)break;i=i*10+r}if(n===t)return;return{value:i,endIndex:n}}function au(e){if(e.endsWith(`\r
|
|
9
|
+
`))return e.slice(0,-2);if(e.endsWith(`
|
|
10
|
+
`))return e.slice(0,-1);return e}function lu(e){return e.startsWith("diff --git")||e.includes(`
|
|
11
|
+
diff --git`)}function Us(e,t){if(e.length===0)return[""];let n=`
|
|
12
|
+
${t}`,i=e.startsWith(t)?0:Ts(e,n,0);if(i===-1)return[e];let r=[];if(i>0)r.push(e.slice(0,i));let o=i;for(;;){let s=Ts(e,n,o+1);if(s===-1)break;r.push(e.slice(o,s)),o=s}return r.push(e.slice(o)),r}function Ts(e,t,n){let i=e.indexOf(t,n);return i===-1?-1:i+1}function As(e){return e==null?e:Z(e)}function du(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function Gr(e){let t=e.slice(1);return Z(t===""?`
|
|
13
|
+
`:t)}function Wr(e,t,n){if(e==="change")return{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t};return{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}var je=new Map,ri=new Map,zs=new Map,Bt=new Set;function Xr(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Bt.has(n.name))continue;let i=je.get(n.name);if(i==null)i=n,je.set(n.name,i);Bt.add(i.name),t.loadLanguageSync(i.data)}}function oi(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var{defineProperty:Yr,getOwnPropertyDescriptor:cu,getOwnPropertyNames:uu}=Object,hu=Object.prototype.hasOwnProperty,$s=(e,t)=>{let n={};for(var i in e)Yr(n,i,{get:e[i],enumerable:!0});if(!t)Yr(n,Symbol.toStringTag,{value:"Module"});return n},Bs=(e,t,n,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var r=uu(t),o=0,s=r.length,a;o<s;o++)if(a=r[o],!hu.call(e,a)&&a!==n)Yr(e,a,{get:((l)=>t[l]).bind(null,a),enumerable:!(i=cu(t,a))||i.enumerable})}return e},Vs=(e,t,n)=>(Bs(e,t,"default"),n&&Bs(n,t,"default"));var si=[{id:"abap",name:"ABAP",import:()=>import("./abap-sc56dbra.js")},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:()=>import("./actionscript-3-8wkk0yve.js")},{id:"ada",name:"Ada",import:()=>import("./ada-wkh6yxhp.js")},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:()=>import("./ahk-vk45ms9x.js")},{id:"ahk2",name:"AutoHotkey2",import:()=>import("./ahk2-ap9fnbvc.js")},{id:"angular-html",name:"Angular HTML",import:()=>import("./angular-html-61dpttc3.js")},{id:"angular-ts",name:"Angular TypeScript",import:()=>import("./angular-ts-hwtqv276.js")},{id:"apache",name:"Apache Conf",import:()=>import("./apache-750k8mss.js")},{id:"apex",name:"Apex",import:()=>import("./apex-vpts0jxm.js")},{id:"apl",name:"APL",import:()=>import("./apl-jkh6rwt8.js")},{id:"applescript",name:"AppleScript",import:()=>import("./applescript-zb2jfj46.js")},{id:"ara",name:"Ara",import:()=>import("./ara-4yjpz89z.js")},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>import("./asciidoc-5xj8s3ay.js")},{id:"asm",name:"Assembly",import:()=>import("./asm-x6ejak5x.js")},{id:"astro",name:"Astro",import:()=>import("./astro-9cd9b7yr.js")},{id:"awk",name:"AWK",import:()=>import("./awk-mpdee6bv.js")},{id:"ballerina",name:"Ballerina",import:()=>import("./ballerina-7c4wt1p4.js")},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:()=>import("./bat-9778z743.js")},{id:"beancount",name:"Beancount",import:()=>import("./beancount-xs0qfpeg.js")},{id:"berry",name:"Berry",aliases:["be"],import:()=>import("./berry-pmbyf94p.js")},{id:"bibtex",name:"BibTeX",import:()=>import("./bibtex-nnkgf3bz.js")},{id:"bicep",name:"Bicep",import:()=>import("./bicep-vqhsh01p.js")},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:()=>import("./bird2-za6bpr1n.js")},{id:"blade",name:"Blade",import:()=>import("./blade-s6ew6vqn.js")},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>import("./bsl-z36cmzeg.js")},{id:"c",name:"C",import:()=>import("./c-kmp7y11e.js")},{id:"c3",name:"C3",import:()=>import("./c3-1g0cgjqv.js")},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>import("./cadence-a23a7f13.js")},{id:"cairo",name:"Cairo",import:()=>import("./cairo-r6vd4awx.js")},{id:"chapel",name:"Chapel",aliases:["chpl"],import:()=>import("./chapel-717mc8q1.js")},{id:"clarity",name:"Clarity",import:()=>import("./clarity-g6gq1dzn.js")},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>import("./clojure-pm54sv44.js")},{id:"cmake",name:"CMake",import:()=>import("./cmake-f1skxqyd.js")},{id:"cobol",name:"COBOL",import:()=>import("./cobol-mys3qens.js")},{id:"codeowners",name:"CODEOWNERS",import:()=>import("./codeowners-1ys5r05d.js")},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>import("./codeql-tdw0bqwy.js")},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>import("./coffee-t9hejzk2.js")},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>import("./common-lisp-9hjzm22t.js")},{id:"coq",name:"Rocq",import:()=>import("./coq-fjr6d63p.js")},{id:"cpp",name:"C++",aliases:["c++"],import:()=>import("./cpp-1r5860gr.js")},{id:"crystal",name:"Crystal",import:()=>import("./crystal-a1jynptt.js")},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>import("./csharp-4zp5c1yn.js")},{id:"css",name:"CSS",import:()=>import("./css-j5q0mhnm.js")},{id:"csv",name:"CSV",import:()=>import("./csv-a39nx9ry.js")},{id:"cue",name:"CUE",import:()=>import("./cue-tg9vgj1q.js")},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>import("./cypher-p1j7vh0k.js")},{id:"d",name:"D",import:()=>import("./d-1f7cc6re.js")},{id:"dart",name:"Dart",import:()=>import("./dart-8jekq66r.js")},{id:"dax",name:"DAX",import:()=>import("./dax-2aph6zqg.js")},{id:"desktop",name:"Desktop",import:()=>import("./desktop-fqy4qx2w.js")},{id:"diff",name:"Diff",import:()=>import("./diff-hqj2qf6m.js")},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>import("./docker-cht4a1ht.js")},{id:"dotenv",name:"dotEnv",import:()=>import("./dotenv-txd2x2vy.js")},{id:"dream-maker",name:"Dream Maker",import:()=>import("./dream-maker-0gsm31aq.js")},{id:"edge",name:"Edge",import:()=>import("./edge-9h036g3s.js")},{id:"elixir",name:"Elixir",import:()=>import("./elixir-7pyn80vc.js")},{id:"elm",name:"Elm",import:()=>import("./elm-62v0vnec.js")},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>import("./emacs-lisp-58kh6hv8.js")},{id:"erb",name:"ERB",import:()=>import("./erb-947psegf.js")},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>import("./erlang-vbf5hbwd.js")},{id:"fennel",name:"Fennel",import:()=>import("./fennel-h323g5dt.js")},{id:"fish",name:"Fish",import:()=>import("./fish-7qbmmjce.js")},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>import("./fluent-3sdffhr3.js")},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>import("./fortran-fixed-form-azemmg4k.js")},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>import("./fortran-free-form-5njt96mh.js")},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>import("./fsharp-9eex114p.js")},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:()=>import("./gdresource-v8yzpggb.js")},{id:"gdscript",name:"GDScript",aliases:["gd"],import:()=>import("./gdscript-1snw12w7.js")},{id:"gdshader",name:"GDShader",import:()=>import("./gdshader-fmknssp0.js")},{id:"genie",name:"Genie",import:()=>import("./genie-4gwgqcc6.js")},{id:"gherkin",name:"Gherkin",import:()=>import("./gherkin-vjt0p14p.js")},{id:"git-commit",name:"Git Commit Message",import:()=>import("./git-commit-z15avpkz.js")},{id:"git-rebase",name:"Git Rebase Message",import:()=>import("./git-rebase-wj5kdx44.js")},{id:"gleam",name:"Gleam",import:()=>import("./gleam-znte7hjc.js")},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>import("./glimmer-js-nph8hwdq.js")},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>import("./glimmer-ts-fzpx4w3e.js")},{id:"glsl",name:"GLSL",import:()=>import("./glsl-mzc3yta4.js")},{id:"gn",name:"GN",import:()=>import("./gn-3cqh8dtz.js")},{id:"gnuplot",name:"Gnuplot",import:()=>import("./gnuplot-r8spf6zm.js")},{id:"go",name:"Go",import:()=>import("./go-ac27dc57.js")},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>import("./graphql-f6vq7p23.js")},{id:"groovy",name:"Groovy",import:()=>import("./groovy-p8r8bd0c.js")},{id:"hack",name:"Hack",import:()=>import("./hack-a2wva0c2.js")},{id:"haml",name:"Ruby Haml",import:()=>import("./haml-hmfn055t.js")},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>import("./handlebars-54kh2jwn.js")},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>import("./haskell-vkvkgtsh.js")},{id:"haxe",name:"Haxe",import:()=>import("./haxe-yk1p58qs.js")},{id:"hcl",name:"HashiCorp HCL",import:()=>import("./hcl-mq3znmzm.js")},{id:"hjson",name:"Hjson",import:()=>import("./hjson-ma7dfjrp.js")},{id:"hlsl",name:"HLSL",import:()=>import("./hlsl-jcfmchrk.js")},{id:"html",name:"HTML",import:()=>import("./html-nawteed7.js")},{id:"html-derivative",name:"HTML (Derivative)",import:()=>import("./html-derivative-xw79bbzd.js")},{id:"http",name:"HTTP",import:()=>import("./http-72kn3sp8.js")},{id:"hurl",name:"Hurl",import:()=>import("./hurl-eve0v3e8.js")},{id:"hxml",name:"HXML",import:()=>import("./hxml-8pcfrsh9.js")},{id:"hy",name:"Hy",import:()=>import("./hy-989jkx6q.js")},{id:"imba",name:"Imba",import:()=>import("./imba-cm19z6hg.js")},{id:"ini",name:"INI",aliases:["properties"],import:()=>import("./ini-a7zcn1v0.js")},{id:"java",name:"Java",import:()=>import("./java-mjc9q3md.js")},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>import("./javascript-n8j33v1m.js")},{id:"jinja",name:"Jinja",import:()=>import("./jinja-a6q4x5tm.js")},{id:"jison",name:"Jison",import:()=>import("./jison-nj6cbyz2.js")},{id:"json",name:"JSON",import:()=>import("./json-bvza2dkb.js")},{id:"json5",name:"JSON5",import:()=>import("./json5-a53a0ked.js")},{id:"jsonc",name:"JSON with Comments",import:()=>import("./jsonc-5tyv9mjd.js")},{id:"jsonl",name:"JSON Lines",import:()=>import("./jsonl-prv0dcjv.js")},{id:"jsonnet",name:"Jsonnet",import:()=>import("./jsonnet-5gdjahsx.js")},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>import("./jssm-mwsp2p7j.js")},{id:"jsx",name:"JSX",import:()=>import("./jsx-75v76p5q.js")},{id:"julia",name:"Julia",aliases:["jl"],import:()=>import("./julia-45twp29b.js")},{id:"just",name:"Just",aliases:["justfile"],import:()=>import("./just-ct7367ec.js")},{id:"kdl",name:"KDL",import:()=>import("./kdl-n6ez9ngv.js")},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>import("./kotlin-ghtz1y98.js")},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>import("./kusto-43yprh9t.js")},{id:"latex",name:"LaTeX",import:()=>import("./latex-httjryda.js")},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>import("./lean-49ww85t0.js")},{id:"less",name:"Less",import:()=>import("./less-47m6fdq2.js")},{id:"liquid",name:"Liquid",import:()=>import("./liquid-r4gqgph0.js")},{id:"llvm",name:"LLVM IR",import:()=>import("./llvm-zesbzx6h.js")},{id:"log",name:"Log file",import:()=>import("./log-n0g1tx1y.js")},{id:"logo",name:"Logo",import:()=>import("./logo-j5ze60v0.js")},{id:"lua",name:"Lua",import:()=>import("./lua-15pct4hw.js")},{id:"luau",name:"Luau",import:()=>import("./luau-75hm4mxn.js")},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>import("./make-82gdkt9b.js")},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>import("./markdown-5tkrg1ah.js")},{id:"marko",name:"Marko",import:()=>import("./marko-qafrqcsm.js")},{id:"matlab",name:"MATLAB",import:()=>import("./matlab-mbnxwt6q.js")},{id:"mdc",name:"MDC",import:()=>import("./mdc-w29armgh.js")},{id:"mdx",name:"MDX",import:()=>import("./mdx-53tq2vwd.js")},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>import("./mermaid-kp8v57t9.js")},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>import("./mipsasm-may8rjf3.js")},{id:"mojo",name:"Mojo",import:()=>import("./mojo-ezqmbs71.js")},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>import("./moonbit-57vh5qgn.js")},{id:"move",name:"Move",import:()=>import("./move-71jrpzz7.js")},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>import("./narrat-n4xxr8p6.js")},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>import("./nextflow-c0gn0hzt.js")},{id:"nextflow-groovy",name:"Nextflow Groovy",import:()=>import("./nextflow-groovy-13xg49y5.js")},{id:"nginx",name:"Nginx",import:()=>import("./nginx-vtb8rwdx.js")},{id:"nim",name:"Nim",import:()=>import("./nim-nfvgqc30.js")},{id:"nix",name:"Nix",import:()=>import("./nix-rkxmnaat.js")},{id:"nsis",name:"NSIS",import:()=>import("./nsis-6c1fw7sy.js")},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>import("./nushell-pvtw3a6j.js")},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>import("./objective-c-jd7171g7.js")},{id:"objective-cpp",name:"Objective-C++",import:()=>import("./objective-cpp-6v7n9hk7.js")},{id:"ocaml",name:"OCaml",import:()=>import("./ocaml-kjv8t7w5.js")},{id:"odin",name:"Odin",import:()=>import("./odin-58v0n0xa.js")},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>import("./openscad-0xnz3sah.js")},{id:"org",name:"Org Markup",import:()=>import("./org-xe4jzp20.js")},{id:"pascal",name:"Pascal",import:()=>import("./pascal-f75emr3j.js")},{id:"perl",name:"Perl",import:()=>import("./perl-zp07ased.js")},{id:"php",name:"PHP",import:()=>import("./php-fjm4srka.js")},{id:"pkl",name:"Pkl",import:()=>import("./pkl-x0wayphd.js")},{id:"plsql",name:"PL/SQL",import:()=>import("./plsql-259gvzn9.js")},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>import("./po-6kcxkqtd.js")},{id:"polar",name:"Polar",import:()=>import("./polar-b1ev80vb.js")},{id:"postcss",name:"PostCSS",import:()=>import("./postcss-kxdxws93.js")},{id:"powerquery",name:"PowerQuery",import:()=>import("./powerquery-ved4pq1y.js")},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:()=>import("./powershell-6j0w6ann.js")},{id:"prisma",name:"Prisma",import:()=>import("./prisma-7r1mj2qq.js")},{id:"prolog",name:"Prolog",import:()=>import("./prolog-7a8gwgvm.js")},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>import("./proto-s5e2jd7n.js")},{id:"pug",name:"Pug",aliases:["jade"],import:()=>import("./pug-8cxb8b6f.js")},{id:"puppet",name:"Puppet",import:()=>import("./puppet-d1048c00.js")},{id:"purescript",name:"PureScript",import:()=>import("./purescript-vqffe1a1.js")},{id:"python",name:"Python",aliases:["py"],import:()=>import("./python-7z2eacwy.js")},{id:"qml",name:"QML",import:()=>import("./qml-51nrq0re.js")},{id:"qmldir",name:"QML Directory",import:()=>import("./qmldir-q0jk1gzg.js")},{id:"qss",name:"Qt Style Sheets",import:()=>import("./qss-6far86jw.js")},{id:"r",name:"R",import:()=>import("./r-qkm8ck5x.js")},{id:"racket",name:"Racket",import:()=>import("./racket-mzbdy2fp.js")},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>import("./raku-se52tvjp.js")},{id:"razor",name:"ASP.NET Razor",import:()=>import("./razor-y9b1j8td.js")},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:()=>import("./rbs-00y9vc5r.js")},{id:"reg",name:"Windows Registry Script",import:()=>import("./reg-9z4ax2nc.js")},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>import("./regexp-99svsrmp.js")},{id:"rel",name:"Rel",import:()=>import("./rel-tf2jya2v.js")},{id:"riscv",name:"RISC-V",import:()=>import("./riscv-hpebp724.js")},{id:"ron",name:"RON",import:()=>import("./ron-s3mfhwnh.js")},{id:"rosmsg",name:"ROS Interface",import:()=>import("./rosmsg-vgsgfpe4.js")},{id:"rst",name:"reStructuredText",import:()=>import("./rst-xnf3rrzd.js")},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>import("./ruby-gysj44ty.js")},{id:"rust",name:"Rust",aliases:["rs"],import:()=>import("./rust-bzv74qkx.js")},{id:"sas",name:"SAS",import:()=>import("./sas-t4zftd7j.js")},{id:"sass",name:"Sass",import:()=>import("./sass-tnsj7t5t.js")},{id:"scala",name:"Scala",import:()=>import("./scala-vsjg5eg2.js")},{id:"scheme",name:"Scheme",import:()=>import("./scheme-yhv7mnk9.js")},{id:"scss",name:"SCSS",import:()=>import("./scss-vt2fyer8.js")},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>import("./sdbl-jv670bae.js")},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>import("./shaderlab-csszkf9s.js")},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>import("./shellscript-t3jf42zg.js")},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>import("./shellsession-e1m2zj1m.js")},{id:"smalltalk",name:"GNU Smalltalk",import:()=>import("./smalltalk-q8bgts0p.js")},{id:"smithy",name:"Smithy",import:()=>import("./smithy-m7r7jeg3.js")},{id:"solidity",name:"Solidity",import:()=>import("./solidity-vb1zcsry.js")},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>import("./soy-bzh2aynk.js")},{id:"sparql",name:"SPARQL",import:()=>import("./sparql-6t8g6rdd.js")},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>import("./splunk-50bpjgv6.js")},{id:"sql",name:"SQL",import:()=>import("./sql-kkaf039q.js")},{id:"ssh-config",name:"SSH Config",import:()=>import("./ssh-config-715bkrac.js")},{id:"stata",name:"Stata",import:()=>import("./stata-zhvjkw4g.js")},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>import("./stylus-b8aj4z6s.js")},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:()=>import("./surrealql-4w27b1xf.js")},{id:"svelte",name:"Svelte",import:()=>import("./svelte-6vty1ayf.js")},{id:"swift",name:"Swift",import:()=>import("./swift-2w2k3des.js")},{id:"system-verilog",name:"SystemVerilog",import:()=>import("./system-verilog-hzg0fpex.js")},{id:"systemd",name:"Systemd Units",import:()=>import("./systemd-d3k4d1av.js")},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>import("./talonscript-fw295t4h.js")},{id:"tasl",name:"Tasl",import:()=>import("./tasl-8n3br9kn.js")},{id:"tcl",name:"Tcl",import:()=>import("./tcl-e485436v.js")},{id:"templ",name:"Templ",import:()=>import("./templ-535cbmg6.js")},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>import("./terraform-k8aqghnt.js")},{id:"tex",name:"TeX",import:()=>import("./tex-9yx3fnmk.js")},{id:"toml",name:"TOML",import:()=>import("./toml-bypjcbh1.js")},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>import("./ts-tags-zyfv802m.js")},{id:"tsv",name:"TSV",import:()=>import("./tsv-2n58sktq.js")},{id:"tsx",name:"TSX",import:()=>import("./tsx-gnkw8sgq.js")},{id:"turtle",name:"Turtle",import:()=>import("./turtle-sf93b8kj.js")},{id:"twig",name:"Twig",import:()=>import("./twig-8gw76pn3.js")},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>import("./typescript-077c9w1h.js")},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>import("./typespec-8r8ncprb.js")},{id:"typst",name:"Typst",aliases:["typ"],import:()=>import("./typst-yg6690gs.js")},{id:"v",name:"V",import:()=>import("./v-tdjz29z1.js")},{id:"vala",name:"Vala",import:()=>import("./vala-trffggt0.js")},{id:"vb",name:"Visual Basic",import:()=>import("./vb-1dx16kyy.js")},{id:"verilog",name:"Verilog",import:()=>import("./verilog-sv7hb60t.js")},{id:"vhdl",name:"VHDL",import:()=>import("./vhdl-qck3dqgh.js")},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>import("./viml-m54vetp0.js")},{id:"vue",name:"Vue",import:()=>import("./vue-n8p10w4p.js")},{id:"vue-html",name:"Vue HTML",import:()=>import("./vue-html-5ex4htv4.js")},{id:"vue-vine",name:"Vue Vine",import:()=>import("./vue-vine-y2qnwmqn.js")},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>import("./vyper-r9v6ymtz.js")},{id:"wasm",name:"WebAssembly",import:()=>import("./wasm-c0aw8acq.js")},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>import("./wenyan-pn35fr2w.js")},{id:"wgsl",name:"WGSL",import:()=>import("./wgsl-akmafmem.js")},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>import("./wikitext-yp9d6pan.js")},{id:"wit",name:"WebAssembly Interface Types",import:()=>import("./wit-rg9t2t2j.js")},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>import("./wolfram-m5vswcfg.js")},{id:"xml",name:"XML",import:()=>import("./xml-8pftb6y7.js")},{id:"xsl",name:"XSL",import:()=>import("./xsl-w4bvqyjy.js")},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>import("./yaml-a56qt88c.js")},{id:"zenscript",name:"ZenScript",import:()=>import("./zenscript-pp2pffj8.js")},{id:"zig",name:"Zig",import:()=>import("./zig-53aewpf9.js")}],Jr=Object.fromEntries(si.map((e)=>[e.id,e.import])),Zr=Object.fromEntries(si.flatMap((e)=>e.aliases?.map((t)=>[t,e.import])||[])),$t={...Jr,...Zr};var no={};Gs(no,{createOnigurumaEngine:()=>ci,getDefaultWasmLoader:()=>Au,loadWasm:()=>to,setDefaultWasmLoader:()=>Tu});var eo=class extends Error{constructor(e){super(e);this.name="ShikiError"}};function fu(){return 2147483648}function pu(){return typeof performance<"u"?performance.now():Date.now()}var mu=(e,t)=>e+(t-e%t)%t;async function gu(e){let t,n,i={};function r(f){n=f,i.HEAPU8=new Uint8Array(f),i.HEAPU32=new Uint32Array(f)}function o(f,m,y){i.HEAPU8.copyWithin(f,m,m+y)}function s(f){try{return t.grow(f-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}function a(f){let m=i.HEAPU8.length;f=f>>>0;let y=fu();if(f>y)return!1;for(let v=1;v<=4;v*=2){let g=m*(1+0.2/v);g=Math.min(g,f+100663296);let S=Math.min(y,mu(Math.max(f,g),65536));if(s(S))return!0}return!1}let l=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(f,m,y=1024){let v=m+y,g=m;while(f[g]&&!(g>=v))++g;if(g-m>16&&f.buffer&&l)return l.decode(f.subarray(m,g));let S="";while(m<g){let b=f[m++];if(!(b&128)){S+=String.fromCharCode(b);continue}let x=f[m++]&63;if((b&224)===192){S+=String.fromCharCode((b&31)<<6|x);continue}let C=f[m++]&63;if((b&240)===224)b=(b&15)<<12|x<<6|C;else b=(b&7)<<18|x<<12|C<<6|f[m++]&63;if(b<65536)S+=String.fromCharCode(b);else{let k=b-65536;S+=String.fromCharCode(55296|k>>10,56320|k&1023)}}return S}function c(f,m){return f?d(i.HEAPU8,f,m):""}let u={emscripten_get_now:pu,emscripten_memcpy_big:o,emscripten_resize_heap:a,fd_write:()=>0};async function h(){let m=await e({env:u,wasi_snapshot_preview1:u});t=m.memory,r(t.buffer),Object.assign(i,m),i.UTF8ToString=c}return await h(),i}var yu=Object.defineProperty,Su=(e,t,n)=>(t in e)?yu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,te=(e,t,n)=>Su(e,typeof t!=="symbol"?t+"":t,n),re=null;function vu(e){throw new eo(e.UTF8ToString(e.getLastOnigError()))}class li{constructor(e){te(this,"utf16Length"),te(this,"utf8Length"),te(this,"utf16Value"),te(this,"utf8Value"),te(this,"utf16OffsetToUtf8"),te(this,"utf8OffsetToUtf16");let t=e.length,n=li._utf8ByteLength(e),i=n!==t,r=i?new Uint32Array(t+1):null;if(i)r[t]=n;let o=i?new Uint32Array(n+1):null;if(i)o[n]=t;let s=new Uint8Array(n),a=0;for(let l=0;l<t;l++){let d=e.charCodeAt(l),c=d,u=!1;if(d>=55296&&d<=56319){if(l+1<t){let h=e.charCodeAt(l+1);if(h>=56320&&h<=57343)c=(d-55296<<10)+65536|h-56320,u=!0}}if(i){if(r[l]=a,u)r[l+1]=a;if(c<=127)o[a+0]=l;else if(c<=2047)o[a+0]=l,o[a+1]=l;else if(c<=65535)o[a+0]=l,o[a+1]=l,o[a+2]=l;else o[a+0]=l,o[a+1]=l,o[a+2]=l,o[a+3]=l}if(c<=127)s[a++]=c;else if(c<=2047)s[a++]=192|(c&1984)>>>6,s[a++]=128|(c&63)>>>0;else if(c<=65535)s[a++]=224|(c&61440)>>>12,s[a++]=128|(c&4032)>>>6,s[a++]=128|(c&63)>>>0;else s[a++]=240|(c&1835008)>>>18,s[a++]=128|(c&258048)>>>12,s[a++]=128|(c&4032)>>>6,s[a++]=128|(c&63)>>>0;if(u)l++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=s,this.utf16OffsetToUtf8=r,this.utf8OffsetToUtf16=o}static _utf8ByteLength(e){let t=0;for(let n=0,i=e.length;n<i;n++){let r=e.charCodeAt(n),o=r,s=!1;if(r>=55296&&r<=56319){if(n+1<i){let a=e.charCodeAt(n+1);if(a>=56320&&a<=57343)o=(r-55296<<10)+65536|a-56320,s=!0}}if(o<=127)t+=1;else if(o<=2047)t+=2;else if(o<=65535)t+=3;else t+=4;if(s)n++}return t}createString(e){let t=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}var di=class e{constructor(t){if(te(this,"id",++e.LAST_ID),te(this,"_onigBinding"),te(this,"content"),te(this,"utf16Length"),te(this,"utf8Length"),te(this,"utf16OffsetToUtf8"),te(this,"utf8OffsetToUtf16"),te(this,"ptr"),!re)throw new eo("Must invoke loadWasm first.");this._onigBinding=re,this.content=t;let n=new li(t);if(this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!e._sharedPtrInUse){if(!e._sharedPtr)e._sharedPtr=re.omalloc(1e4);e._sharedPtrInUse=!0,re.HEAPU8.set(n.utf8Value,e._sharedPtr),this.ptr=e._sharedPtr}else this.ptr=n.createString(re)}convertUtf8OffsetToUtf16(t){if(this.utf8OffsetToUtf16){if(t<0)return 0;if(t>this.utf8Length)return this.utf16Length;return this.utf8OffsetToUtf16[t]}return t}convertUtf16OffsetToUtf8(t){if(this.utf16OffsetToUtf8){if(t<0)return 0;if(t>this.utf16Length)return this.utf8Length;return this.utf16OffsetToUtf8[t]}return t}dispose(){if(this.ptr===e._sharedPtr)e._sharedPtrInUse=!1;else this._onigBinding.ofree(this.ptr)}};te(di,"LAST_ID",0);te(di,"_sharedPtr",0);te(di,"_sharedPtrInUse",!1);var Ws=di;class js{constructor(e){if(te(this,"_onigBinding"),te(this,"_ptr"),!re)throw new eo("Must invoke loadWasm first.");let t=[],n=[];for(let s=0,a=e.length;s<a;s++){let l=new li(e[s]);t[s]=l.createString(re),n[s]=l.utf8Length}let i=re.omalloc(4*e.length);re.HEAPU32.set(t,i/4);let r=re.omalloc(4*e.length);re.HEAPU32.set(n,r/4);let o=re.createOnigScanner(i,r,e.length);for(let s=0,a=e.length;s<a;s++)re.ofree(t[s]);if(re.ofree(r),re.ofree(i),o===0)vu(re);this._onigBinding=re,this._ptr=o}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,t,n){let i=0;if(typeof n==="number")i=n;if(typeof e==="string"){e=new Ws(e);let r=this._findNextMatchSync(e,t,!1,i);return e.dispose(),r}return this._findNextMatchSync(e,t,!1,i)}_findNextMatchSync(e,t,n,i){let r=this._onigBinding,o=r.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(t),i);if(o===0)return null;let s=r.HEAPU32,a=o/4,l=s[a++],d=s[a++],c=[];for(let u=0;u<d;u++){let h=e.convertUtf8OffsetToUtf16(s[a++]),f=e.convertUtf8OffsetToUtf16(s[a++]);c[u]={start:h,end:f,length:f-h}}return{index:l,captureIndices:c}}}function bu(e){return typeof e.instantiator==="function"}function Cu(e){return typeof e.default==="function"}function xu(e){return typeof e.data<"u"}function ku(e){return typeof Response<"u"&&e instanceof Response}function wu(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 ai;function to(e){if(ai)return ai;async function t(){re=await gu(async(n)=>{let i=e;if(i=await i,typeof i==="function")i=await i(n);if(typeof i==="function")i=await i(n);if(bu(i))i=await i.instantiator(n);else if(Cu(i))i=await i.default(n);else{if(xu(i))i=i.data;if(ku(i))if(typeof WebAssembly.instantiateStreaming==="function")i=await Lu(i)(n);else i=await Eu(i)(n);else if(wu(i))i=await Qr(i)(n);else if(i instanceof WebAssembly.Module)i=await Qr(i)(n);else if("default"in i&&i.default instanceof WebAssembly.Module)i=await Qr(i.default)(n)}if("instance"in i)i=i.instance;if("exports"in i)i=i.exports;return i})}return ai=t(),ai}function Qr(e){return(t)=>WebAssembly.instantiate(e,t)}function Lu(e){return(t)=>WebAssembly.instantiateStreaming(e,t)}function Eu(e){return async(t)=>{let n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}var qs;function Tu(e){qs=e}function Au(){return qs}async function ci(e){if(e)await to(e);return{createScanner(t){return new js(t.map((n)=>typeof n==="string"?n:n.source))},createString(t){return new Ws(t)}}}var io=$s({});Vs(io,no);var Ks=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>import("./andromeeda-zy6mvqwb.js")},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>import("./aurora-x-gp6v3669.js")},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>import("./ayu-dark-hbtcbdtr.js")},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>import("./ayu-light-m7rwwssv.js")},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>import("./ayu-mirage-5z71k1jj.js")},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>import("./catppuccin-frappe-05b7n5ms.js")},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>import("./catppuccin-latte-c7x59n84.js")},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>import("./catppuccin-macchiato-xq6zfjrk.js")},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>import("./catppuccin-mocha-xreqmgt9.js")},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>import("./dark-plus-zvzcxs8s.js")},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>import("./dracula-6abcnchd.js")},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>import("./dracula-soft-zyfsdrw6.js")},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>import("./everforest-dark-g7rhmq33.js")},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>import("./everforest-light-spn7qghr.js")},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>import("./github-dark-r3j6b7er.js")},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>import("./github-dark-default-q5m3jmep.js")},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>import("./github-dark-dimmed-0v34f529.js")},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>import("./github-dark-high-contrast-62grsqa6.js")},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>import("./github-light-z1qp6zt5.js")},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>import("./github-light-default-xgca5we2.js")},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>import("./github-light-high-contrast-0ee3g9rt.js")},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>import("./gruvbox-dark-hard-0zvxnx0e.js")},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>import("./gruvbox-dark-medium-qvjwy81n.js")},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>import("./gruvbox-dark-soft-mhtpt38s.js")},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>import("./gruvbox-light-hard-nrwjbbts.js")},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>import("./gruvbox-light-medium-qbwkw432.js")},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>import("./gruvbox-light-soft-rmkm778k.js")},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>import("./horizon-fm23m9qj.js")},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:()=>import("./horizon-bright-9s4tt51x.js")},{id:"houston",displayName:"Houston",type:"dark",import:()=>import("./houston-fx2psmvq.js")},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>import("./kanagawa-dragon-fbqq2bhk.js")},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>import("./kanagawa-lotus-zgxv1mgm.js")},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>import("./kanagawa-wave-wedn0ksa.js")},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>import("./laserwave-2fz4nxs5.js")},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>import("./light-plus-5tghbj4b.js")},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>import("./material-theme-p7k291d1.js")},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>import("./material-theme-darker-fnv6smqw.js")},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>import("./material-theme-lighter-35th362e.js")},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>import("./material-theme-ocean-4dq3ahw3.js")},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>import("./material-theme-palenight-yhd4pmvh.js")},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>import("./min-dark-rtx0tqrz.js")},{id:"min-light",displayName:"Min Light",type:"light",import:()=>import("./min-light-5m66fg5h.js")},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>import("./monokai-79awbcqn.js")},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>import("./night-owl-y5p2e2yz.js")},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>import("./night-owl-light-05jd94v7.js")},{id:"nord",displayName:"Nord",type:"dark",import:()=>import("./nord-akta5pm4.js")},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>import("./one-dark-pro-pbp84hvh.js")},{id:"one-light",displayName:"One Light",type:"light",import:()=>import("./one-light-jpadzfmm.js")},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>import("./plastic-5dg6r26t.js")},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>import("./poimandres-p8seewrs.js")},{id:"red",displayName:"Red",type:"dark",import:()=>import("./red-tkj5bw1z.js")},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>import("./rose-pine-vgbee1jh.js")},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>import("./rose-pine-dawn-apmj5y1p.js")},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>import("./rose-pine-moon-mgx7zgjy.js")},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>import("./slack-dark-ntnagayj.js")},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>import("./slack-ochin-kge218j8.js")},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>import("./snazzy-light-57mzezsa.js")},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>import("./solarized-dark-0r80rpr7.js")},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>import("./solarized-light-1e0p6z46.js")},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>import("./synthwave-84-007ndkbp.js")},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>import("./tokyo-night-rvkd4sna.js")},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>import("./vesper-005phtef.js")},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>import("./vitesse-black-sxfaa2kz.js")},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>import("./vitesse-dark-fhxvesec.js")},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>import("./vitesse-light-cygqrsgb.js")}],Xs=Object.fromEntries(Ks.map((e)=>[e.id,e.import]));var G=class extends Error{constructor(e){super(e);this.name="ShikiError"}};function xn(e,t){let n=typeof e==="string"?{}:{...e.colorReplacements},i=typeof e==="string"?e:e.name;for(let[r,o]of Object.entries(t?.colorReplacements||{}))if(typeof o==="string")n[r]=o;else if(r===i)Object.assign(n,o);return n}function qe(e,t){if(!e)return e;return t?.[e?.toLowerCase()]||e}function na(e){return Array.isArray(e)?e:[e]}async function ro(e){return Promise.resolve(typeof e==="function"?e():e).then((t)=>t.default||t)}function kn(e){return!e||["plaintext","txt","text","plain"].includes(e)}function oo(e){return e==="ansi"||kn(e)}function wn(e){return e==="none"}function so(e){return wn(e)}var Ru=/(\r?\n)/g;function Vt(e,t=!1){if(e.length===0)return[["",0]];let n=e.split(Ru),i=0,r=[];for(let o=0;o<n.length;o+=2){let s=t?n[o]+(n[o+1]||""):n[o];r.push([s,i]),i+=n[o].length,i+=n[o+1]?.length||0}return r}var Ys={light:"#333333",dark:"#bbbbbb"},Js={light:"#fffffe",dark:"#1e1e1e"},Zs="__shiki_resolved";function Gt(e){if(e?.[Zs])return e;let t={...e};if(t.tokenColors&&!t.settings)t.settings=t.tokenColors,delete t.tokenColors;t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){let a=t.settings?t.settings.find((l)=>!l.name&&!l.scope):void 0;if(a?.settings?.foreground)i=a.settings.foreground;if(a?.settings?.background)n=a.settings.background;if(!i&&t?.colors?.["editor.foreground"])i=t.colors["editor.foreground"];if(!n&&t?.colors?.["editor.background"])n=t.colors["editor.background"];if(!i)i=t.type==="light"?Ys.light:Ys.dark;if(!n)n=t.type==="light"?Js.light:Js.dark;t.fg=i,t.bg=n}if(!(t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope))t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0,o=new Map;function s(a){if(o.has(a))return o.get(a);r+=1;let l=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;if(t.colorReplacements?.[`#${l}`])return s(a);return o.set(a,l),l}t.settings=t.settings.map((a)=>{let l=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),d=a.settings?.background&&!a.settings.background.startsWith("#");if(!l&&!d)return a;let c={...a,settings:{...a.settings}};if(l){let u=s(a.settings.foreground);t.colorReplacements[u]=a.settings.foreground,c.settings.foreground=u}if(d){let u=s(a.settings.background);t.colorReplacements[u]=a.settings.background,c.settings.background=u}return c});for(let a of Object.keys(t.colors||{}))if(a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi")){if(!t.colors[a]?.startsWith("#")){let l=s(t.colors[a]);t.colorReplacements[l]=t.colors[a],t.colors[a]=l}}return Object.defineProperty(t,Zs,{enumerable:!1,writable:!1,value:!0}),t}async function ia(e){return[...new Set((await Promise.all(e.filter((t)=>!oo(t)).map(async(t)=>await ro(t).then((n)=>Array.isArray(n)?n:[n])))).flat())]}async function ra(e){return(await Promise.all(e.map(async(t)=>so(t)?null:Gt(await ro(t))))).filter((t)=>!!t)}function oa(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);while(t[e]){if(e=t[e],n.has(e))throw new G(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var Iu=class extends ta{_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,i={}){super(e);this._resolver=e,this._themes=t,this._langs=n,this._alias=i,this._themes.map((r)=>this.loadTheme(r)),this.loadLanguages(this._langs)}getTheme(e){if(typeof e==="string")return this._resolvedThemes.get(e);else return this.loadTheme(e)}loadTheme(e){let t=Gt(e);if(t.name)this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null;return t}getLoadedThemes(){if(!this._loadedThemesCache)this._loadedThemesCache=[...this._resolvedThemes.keys()];return this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);if(!t)t=ea.createFromRawTheme(e),this._textmateThemeCache.set(e,t);this._syncRegistry.setTheme(t)}getGrammar(e){return e=oa(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter((r)=>r.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases)e.aliases.forEach((r)=>{this._alias[r]=e.name});if(this._loadedLanguagesCache=null,t.size)for(let r of t)this._resolvedGrammars.delete(r.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(r.scopeName),this._syncRegistry?._grammars?.delete(r.scopeName),this.loadLanguage(this._langMap.get(r.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let i of e)this.resolveEmbeddedLanguages(i);let t=[...this._langGraph.entries()],n=t.filter(([i,r])=>!r);if(n.length){let i=t.filter(([r,o])=>{if(!o)return!1;return(o.embeddedLanguages||o.embeddedLangs)?.some((s)=>n.map(([a])=>a).includes(s))}).filter((r)=>!n.includes(r));throw new G(`Missing languages ${n.map(([r])=>`\`${r}\``).join(", ")}, required by ${i.map(([r])=>`\`${r}\``).join(", ")}`)}for(let[i,r]of t)this._resolver.addLanguage(r);for(let[i,r]of t)this.loadLanguage(r)}getLoadedLanguages(){if(!this._loadedLanguagesCache)this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])];return 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 n of t)this._langGraph.set(n,this._langMap.get(n))}},Mu=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:(n)=>e.createScanner(n),createOnigString:(n)=>e.createString(n)},t.forEach((n)=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){if(this._langs.set(e.name,e),e.aliases)e.aliases.forEach((t)=>{this._langs.set(t,e)});if(this._scopeToLang.set(e.scopeName,e),e.injectTo)e.injectTo.forEach((t)=>{if(!this._injections.get(t))this._injections.set(t,[]);this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),n=[];for(let i=1;i<=t.length;i++){let r=t.slice(0,i).join(".");n=[...n,...this._injections.get(r)||[]]}return n}},Cn=0;function ao(e){if(Cn+=1,e.warnings!==!1&&Cn>=10&&Cn%10===0)console.warn(`[Shiki] ${Cn} 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 G("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(Gt),r=new Iu(new Mu(e.engine,n),i,n,e.langAlias),o;function s(S){return oa(S,e.langAlias)}function a(S){v();let b=r.getGrammar(typeof S==="string"?S:S.name);if(!b)throw new G(`Language \`${S}\` not found, you may need to load it first`);return b}function l(S){if(S==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};v();let b=r.getTheme(S);if(!b)throw new G(`Theme \`${S}\` not found, you may need to load it first`);return b}function d(S){v();let b=l(S);if(o!==S)r.setTheme(b),o=S;return{theme:b,colorMap:r.getColorMap()}}function c(){return v(),r.getLoadedThemes()}function u(){return v(),r.getLoadedLanguages()}function h(...S){v(),r.loadLanguages(S.flat(1))}async function f(...S){return h(await ia(S))}function m(...S){v();for(let b of S.flat(1))r.loadTheme(b)}async function y(...S){return v(),m(await ra(S))}function v(){if(t)throw new G("Shiki instance has been disposed")}function g(){if(t)return;t=!0,r.dispose(),Cn-=1}return{setTheme:d,getTheme:l,getLanguage:a,getLoadedThemes:c,getLoadedLanguages:u,resolveLangAlias:s,loadLanguage:f,loadLanguageSync:h,loadTheme:y,loadThemeSync:m,dispose:g,[Symbol.dispose]:g}}async function lo(e){if(!e.engine)console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,i]=await Promise.all([ra(e.themes||[]),ia(e.langs||[]),e.engine]);return ao({...e,themes:t,langs:n,engine:i})}var sa=new WeakMap;function Ln(e,t){sa.set(e,t)}function Wt(e){return sa.get(e)}var fi=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(na(n).map((i)=>[i,hi])),t)}constructor(...t){if(t.length===2){let[n,i]=t;this.lang=i,this._stacks=n}else{let[n,i,r]=t;this.lang=i,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Hu(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Hu(e){let t=[],n=new Set;function i(r){if(n.has(r))return;n.add(r);let o=r?.nameScopesList?.scopeName;if(o)t.push(o);if(r.parent)i(r.parent)}return i(e),t}function Pu(e,t){if(!(e instanceof fi))throw new G("Invalid grammar state");return e.getInternalStack(t)}var Nu=/,/,Du=/ /;function co(e,t,n={}){let{theme:i=e.getLoadedThemes()[0]}=n;if(kn(e.resolveLangAlias(n.lang||"text"))||wn(i))return Vt(t).map((a)=>[{content:a[0],offset:a[1]}]);let{theme:r,colorMap:o}=e.setTheme(i),s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new G(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(r.name))throw new G(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return la(t,s,r,o,n)}function aa(...e){if(e.length===2)return Wt(e[1]);let[t,n,i={}]=e,{lang:r="text",theme:o=t.getLoadedThemes()[0]}=i;if(kn(r)||wn(o))throw new G("Plain language does not have grammar state");if(r==="ansi")throw new G("ANSI language does not have grammar state");let{theme:s,colorMap:a}=t.setTheme(o),l=t.getLanguage(r);return new fi(uo(n,l,s,a,i).stateStack,l.name,s.name)}function la(e,t,n,i,r){let o=uo(e,t,n,i,r),s=new fi(o.stateStack,t.name,n.name);return Ln(o.tokens,s),o.tokens}function uo(e,t,n,i,r){let o=xn(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:a=500,includeExplanation:l=!1}=r,d=Vt(e),c=r.grammarState?Pu(r.grammarState,n.name)??hi:r.grammarContextCode!=null?uo(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:hi,u=[],h=[];for(let f=0,m=d.length;f<m;f++){let[y,v]=d[f];if(y===""){u=[],h.push([]);continue}if(s>0&&y.length>=s){u=[],h.push([{content:y,offset:v,color:"",fontStyle:0}]);continue}let g,S,b;if(l&&l!=="tokenType")g=t.tokenizeLine(y,c,a),S=g.tokens,b=0;let x=t.tokenizeLine2(y,c,a),C=x.tokens.length/2;for(let k=0;k<C;k++){let w=x.tokens[2*k],T=k+1<C?x.tokens[2*k+2]:y.length;if(w===T)continue;let L=x.tokens[2*k+1],I=qe(i[ui.getForeground(L)],o),O=ui.getFontStyle(L),A={content:y.substring(w,T),offset:v+w,color:I,fontStyle:O};if(l==="tokenType")A.type=ui.getTokenType(L);else if(l){let R=[];if(l!=="scopeName")for(let F of n.settings){let M;switch(typeof F.scope){case"string":M=F.scope.split(Nu).map((N)=>N.trim());break;case"object":M=F.scope;break;default:continue}R.push({settings:F,selectors:M.map((N)=>N.split(Du))})}A.explanation=[];let _=0;while(w+_<T){let F=S[b],M=y.substring(F.startIndex,F.endIndex);_+=M.length,A.explanation.push({content:M,scopes:l==="scopeName"?Fu(F.scopes):_u(R,F.scopes)}),b+=1}}u.push(A)}h.push(u),u=[],c=x.ruleStack}return{tokens:h,stateStack:c}}function Fu(e){return e.map((t)=>({scopeName:t}))}function _u(e,t){let n=[];for(let i=0,r=t.length;i<r;i++){let o=t[i];n[i]={scopeName:o,themeMatches:Uu(e,o,t.slice(0,i))}}return n}function Qs(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Ou(e,t,n){if(!Qs(e.at(-1),t))return!1;let i=e.length-2,r=n.length-1;while(i>=0&&r>=0){if(Qs(e[i],n[r]))i-=1;r-=1}if(i===-1)return!0;return!1}function Uu(e,t,n){let i=[];for(let{selectors:r,settings:o}of e)for(let s of r)if(Ou(s,t,n)){i.push(o);break}return i}function pi(e,t,n,i=co){let r=Object.entries(n.themes).filter((d)=>d[1]).map((d)=>({color:d[0],theme:d[1]})),o=r.map((d)=>{let c=i(e,t,{...n,theme:d.theme});return{tokens:c,state:Wt(c),theme:typeof d.theme==="string"?d.theme:d.theme.name}}),s=zu(...o.map((d)=>d.tokens)),a=s[0].map((d,c)=>d.map((u,h)=>{let f={content:u.content,variants:{},offset:u.offset};if("includeExplanation"in n&&n.includeExplanation)f.explanation=u.explanation;return s.forEach((m,y)=>{let{content:v,explanation:g,offset:S,...b}=m[c][h];f.variants[r[y].color]=b}),f})),l=o[0].state?new fi(Object.fromEntries(o.map((d)=>[d.theme,d.state?.getInternalStack(d.theme)])),o[0].state.lang):void 0;if(l)Ln(a,l);return a}function zu(...e){let t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){let r=e.map((l)=>l[i]),o=t.map(()=>[]);t.forEach((l,d)=>l.push(o[d]));let s=r.map(()=>0),a=r.map((l)=>l[0]);while(a.every((l)=>l)){let l=Math.min(...a.map((d)=>d.content.length));for(let d=0;d<n;d++){let c=a[d];if(c.content.length===l)o[d].push(c),s[d]+=1,a[d]=r[d][s[d]];else o[d].push({...c,content:c.content.slice(0,l)}),a[d]={...c,content:c.content.slice(l),offset:c.offset+l}}}}return t}var da=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class at{constructor(e,t,n){if(this.normal=t,this.property=e,n)this.space=n}}at.prototype.normal={};at.prototype.property={};at.prototype.space=void 0;function ho(e,t){let n={},i={};for(let r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new at(n,i,t)}function jt(e){return e.toLowerCase()}class ae{constructor(e,t){this.attribute=t,this.property=e}}ae.prototype.attribute="";ae.prototype.booleanish=!1;ae.prototype.boolean=!1;ae.prototype.commaOrSpaceSeparated=!1;ae.prototype.commaSeparated=!1;ae.prototype.defined=!1;ae.prototype.mustUseProperty=!1;ae.prototype.number=!1;ae.prototype.overloadedBoolean=!1;ae.prototype.property="";ae.prototype.spaceSeparated=!1;ae.prototype.space=void 0;var En={};Gs(En,{boolean:()=>P,booleanish:()=>K,commaOrSpaceSeparated:()=>ge,commaSeparated:()=>Ke,number:()=>E,overloadedBoolean:()=>mi,spaceSeparated:()=>V});var Bu=0,P=kt(),K=kt(),mi=kt(),E=kt(),V=kt(),Ke=kt(),ge=kt();function kt(){return 2**++Bu}var fo=Object.keys(En);class qt extends ae{constructor(e,t,n,i){let r=-1;super(e,t);if(ca(this,"space",i),typeof n==="number")while(++r<fo.length){let o=fo[r];ca(this,fo[r],(n&En[o])===En[o])}}}qt.prototype.defined=!0;function ca(e,t,n){if(n)e[t]=n}function Ae(e){let t={},n={};for(let[i,r]of Object.entries(e.properties)){let o=new qt(i,e.transform(e.attributes||{},i),r,e.space);if(e.mustUseProperty&&e.mustUseProperty.includes(i))o.mustUseProperty=!0;t[i]=o,n[jt(i)]=i,n[jt(o.attribute)]=i}return new at(t,n,e.space)}var po=Ae({properties:{ariaActiveDescendant:null,ariaAtomic:K,ariaAutoComplete:null,ariaBusy:K,ariaChecked:K,ariaColCount:E,ariaColIndex:E,ariaColSpan:E,ariaControls:V,ariaCurrent:null,ariaDescribedBy:V,ariaDetails:null,ariaDisabled:K,ariaDropEffect:V,ariaErrorMessage:null,ariaExpanded:K,ariaFlowTo:V,ariaGrabbed:K,ariaHasPopup:null,ariaHidden:K,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:V,ariaLevel:E,ariaLive:null,ariaModal:K,ariaMultiLine:K,ariaMultiSelectable:K,ariaOrientation:null,ariaOwns:V,ariaPlaceholder:null,ariaPosInSet:E,ariaPressed:K,ariaReadOnly:K,ariaRelevant:null,ariaRequired:K,ariaRoleDescription:V,ariaRowCount:E,ariaRowIndex:E,ariaRowSpan:E,ariaSelected:K,ariaSetSize:E,ariaSort:null,ariaValueMax:E,ariaValueMin:E,ariaValueNow:E,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function gi(e,t){return t in e?e[t]:t}function yi(e,t){return gi(e,t.toLowerCase())}var ua=Ae({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ke,acceptCharset:V,accessKey:V,action:null,allow:null,allowFullScreen:P,allowPaymentRequest:P,allowUserMedia:P,alpha:P,alt:null,as:null,async:P,autoCapitalize:null,autoComplete:V,autoFocus:P,autoPlay:P,blocking:V,capture:null,charSet:null,checked:P,cite:null,className:V,closedBy:null,colorSpace:null,cols:E,colSpan:E,command:null,commandFor:null,content:null,contentEditable:K,controls:P,controlsList:V,coords:E|Ke,crossOrigin:null,data:null,dateTime:null,decoding:null,default:P,defer:P,dir:null,dirName:null,disabled:P,download:mi,draggable:K,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:P,formTarget:null,headers:V,height:E,hidden:mi,high:E,href:null,hrefLang:null,htmlFor:V,httpEquiv:V,id:null,imageSizes:null,imageSrcSet:null,inert:P,inputMode:null,integrity:null,is:null,isMap:P,itemId:null,itemProp:V,itemRef:V,itemScope:P,itemType:V,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:P,low:E,manifest:null,max:null,maxLength:E,media:null,method:null,min:null,minLength:E,multiple:P,muted:P,name:null,nonce:null,noModule:P,noValidate:P,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:P,optimum:E,pattern:null,ping:V,placeholder:null,playsInline:P,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:P,referrerPolicy:null,rel:V,required:P,reversed:P,rows:E,rowSpan:E,sandbox:V,scope:null,scoped:P,seamless:P,selected:P,shadowRootClonable:P,shadowRootCustomElementRegistry:P,shadowRootDelegatesFocus:P,shadowRootMode:null,shadowRootSerializable:P,shape:null,size:E,sizes:null,slot:null,span:E,spellCheck:K,src:null,srcDoc:null,srcLang:null,srcSet:null,start:E,step:null,style:null,tabIndex:E,target:null,title:null,translate:null,type:null,typeMustMatch:P,useMap:null,value:K,width:E,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:V,axis:null,background:null,bgColor:null,border:E,borderColor:null,bottomMargin:E,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:P,declare:P,event:null,face:null,frame:null,frameBorder:null,hSpace:E,leftMargin:E,link:null,longDesc:null,lowSrc:null,marginHeight:E,marginWidth:E,noResize:P,noHref:P,noShade:P,noWrap:P,object:null,profile:null,prompt:null,rev:null,rightMargin:E,rules:null,scheme:null,scrolling:K,standby:null,summary:null,text:null,topMargin:E,valueType:null,version:null,vAlign:null,vLink:null,vSpace:E,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:P,disablePictureInPicture:P,disableRemotePlayback:P,exportParts:Ke,part:V,prefix:null,property:null,results:E,security:null,unselectable:null},space:"html",transform:yi});var ha=Ae({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ge,accentHeight:E,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:E,amplitude:E,arabicForm:null,ascent:E,attributeName:null,attributeType:null,azimuth:E,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:E,by:null,calcMode:null,capHeight:E,className:V,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:E,diffuseConstant:E,direction:null,display:null,dur:null,divisor:E,dominantBaseline:null,download:P,dx:null,dy:null,edgeMode:null,editable:null,elevation:E,enableBackground:null,end:null,event:null,exponent:E,externalResourcesRequired:null,fill:null,fillOpacity:E,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ke,g2:Ke,glyphName:Ke,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:E,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:E,horizOriginX:E,horizOriginY:E,id:null,ideographic:E,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:E,k:E,k1:E,k2:E,k3:E,k4:E,kernelMatrix:ge,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:E,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:E,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:E,overlineThickness:E,paintOrder:null,panose1:null,path:null,pathLength:E,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:V,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:E,pointsAtY:E,pointsAtZ:E,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ge,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ge,rev:ge,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ge,requiredFeatures:ge,requiredFonts:ge,requiredFormats:ge,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:E,specularExponent:E,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:E,strikethroughThickness:E,string:null,stroke:null,strokeDashArray:ge,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:E,strokeOpacity:E,strokeWidth:null,style:null,surfaceScale:E,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ge,tabIndex:E,tableValues:null,target:null,targetX:E,targetY:E,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ge,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:E,underlineThickness:E,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:E,values:null,vAlphabetic:E,vMathematical:E,vectorEffect:null,vHanging:E,vIdeographic:E,version:null,vertAdvY:E,vertOriginX:E,vertOriginY:E,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:E,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:gi});var mo=Ae({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var go=Ae({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yi});var yo=Ae({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var $u=/[A-Z]/g,fa=/-[a-z]/g,Vu=/^data[-\w.:]+$/i;function So(e,t){let n=jt(t),i=t,r=ae;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Vu.test(t)){if(t.charAt(4)==="-"){let o=t.slice(5).replace(fa,Wu);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{let o=t.slice(4);if(!fa.test(o)){let s=o.replace($u,Gu);if(s.charAt(0)!=="-")s="-"+s;t="data"+s}}r=qt}return new r(i,t)}function Gu(e){return"-"+e.toLowerCase()}function Wu(e){return e.charAt(1).toUpperCase()}var pa=ho([po,ua,mo,go,yo],"html"),Si=ho([po,ha,mo,go,yo],"svg");var ma={}.hasOwnProperty;function ga(e,t){let n=t||{};function i(r,...o){let{invalid:s,handlers:a}=i;if(r&&ma.call(r,e)){let l=String(r[e]);s=ma.call(a,l)?a[l]:i.unknown}if(s)return s.call(this,r,...o)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}var ju=/["&'<>`]/g,qu=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ku=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Xu=/[|\\{}()[\]^$+*?.]/g,ya=new WeakMap;function Sa(e,t){if(e=e.replace(t.subset?Yu(t.subset):ju,i),t.subset||t.escapeOnly)return e;return e.replace(qu,n).replace(Ku,i);function n(r,o,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function i(r,o,s){return t.format(r.charCodeAt(0),s.charCodeAt(o+1),t)}}function Yu(e){let t=ya.get(e);if(!t)t=Ju(e),ya.set(e,t);return t}function Ju(e){let t=[],n=-1;while(++n<e.length)t.push(e[n].replace(Xu,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}var Zu=/[\dA-Fa-f]/;function va(e,t,n){let i="&#x"+e.toString(16).toUpperCase();return n&&t&&!Zu.test(String.fromCharCode(t))?i:i+";"}var Qu=/\d/;function ba(e,t,n){let i="&#"+String(e);return n&&t&&!Qu.test(String.fromCharCode(t))?i:i+";"}var Ca=["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"];var vi={nbsp:" ",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:"€"};var xa=["cent","copy","divide","gt","lt","not","para","times"];var ka={}.hasOwnProperty,vo={},bi;for(bi in vi)if(ka.call(vi,bi))vo[vi[bi]]=bi;var eh=/[^\dA-Za-z]/;function wa(e,t,n,i){let r=String.fromCharCode(e);if(ka.call(vo,r)){let o=vo[r],s="&"+o;if(n&&Ca.includes(o)&&!xa.includes(o)&&(!i||t&&t!==61&&eh.test(String.fromCharCode(t))))return s;return s+";"}return""}function La(e,t,n){let i=va(e,t,n.omitOptionalSemicolons),r;if(n.useNamedReferences||n.useShortestReferences)r=wa(e,t,n.omitOptionalSemicolons,n.attribute);if((n.useShortestReferences||!r)&&n.useShortestReferences){let o=ba(e,t,n.omitOptionalSemicolons);if(o.length<i.length)i=o}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function Xe(e,t){return Sa(e,Object.assign({format:La},t))}var th=/^>|^->|<!--|-->|--!>|<!-$/g,nh=[">"],ih=["<",">"];function Ea(e,t,n,i){return i.settings.bogusComments?"<?"+Xe(e.value,Object.assign({},i.settings.characterReferences,{subset:nh}))+">":"<!--"+e.value.replace(th,r)+"-->";function r(o){return Xe(o,Object.assign({},i.settings.characterReferences,{subset:ih}))}}function Ta(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function bo(e,t){let n=String(e);if(typeof t!=="string")throw TypeError("Expected character");let i=0,r=n.indexOf(t);while(r!==-1)i++,r=n.indexOf(t,r+t.length);return i}function Aa(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Ra(e){return e.join(" ").trim()}var rh=/[ \t\n\f\r]/g;function wt(e){return typeof e==="object"?e.type==="text"?Ia(e.value):!1:Ia(e)}function Ia(e){return e.replace(rh,"")===""}var Y=Ma(1),Co=Ma(-1),oh=[];function Ma(e){return t;function t(n,i,r){let o=n?n.children:oh,s=(i||0)+e,a=o[s];if(!r)while(a&&wt(a))s+=e,a=o[s];return a}}var sh={}.hasOwnProperty;function Ci(e){return t;function t(n,i,r){return sh.call(e,n.tagName)&&e[n.tagName](n,i,r)}}var Tn=Ci({body:lh,caption:xo,colgroup:xo,dd:hh,dt:uh,head:xo,html:ah,li:ch,optgroup:fh,option:ph,p:dh,rp:Ha,rt:Ha,tbody:gh,td:Pa,tfoot:yh,th:Pa,thead:mh,tr:Sh});function xo(e,t,n){let i=Y(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&wt(i.value.charAt(0)))}function ah(e,t,n){let i=Y(n,t);return!i||i.type!=="comment"}function lh(e,t,n){let i=Y(n,t);return!i||i.type!=="comment"}function dh(e,t,n){let i=Y(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.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 ch(e,t,n){let i=Y(n,t);return!i||i.type==="element"&&i.tagName==="li"}function uh(e,t,n){let i=Y(n,t);return Boolean(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function hh(e,t,n){let i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function Ha(e,t,n){let i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function fh(e,t,n){let i=Y(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function ph(e,t,n){let i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function mh(e,t,n){let i=Y(n,t);return Boolean(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function gh(e,t,n){let i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function yh(e,t,n){return!Y(n,t)}function Sh(e,t,n){let i=Y(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Pa(e,t,n){let i=Y(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}var Na=Ci({body:Ch,colgroup:xh,head:bh,html:vh,tbody:kh});function vh(e){let t=Y(e,-1);return!t||t.type!=="comment"}function bh(e){let t=new Set;for(let i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}let n=e.children[0];return!n||n.type==="element"}function Ch(e){let t=Y(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&wt(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function xh(e,t,n){let i=Co(n,t),r=Y(e,-1,!0);if(n&&i&&i.type==="element"&&i.tagName==="colgroup"&&Tn(i,n.children.indexOf(i),n))return!1;return Boolean(r&&r.type==="element"&&r.tagName==="col")}function kh(e,t,n){let i=Co(n,t),r=Y(e,-1);if(n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&Tn(i,n.children.indexOf(i),n))return!1;return Boolean(r&&r.type==="element"&&r.tagName==="tr")}var xi={name:[[`
|
|
14
|
+
\f\r &/=>`.split(""),`
|
|
15
|
+
\f\r "&'/=>\``.split("")],[`\x00
|
|
16
|
+
\f\r "&'/<=>`.split(""),`\x00
|
|
17
|
+
\f\r "&'/<=>\``.split("")]],unquoted:[[`
|
|
18
|
+
\f\r &>`.split(""),`\x00
|
|
19
|
+
\f\r "&'<=>\``.split("")],[`\x00
|
|
20
|
+
\f\r "&'<=>\``.split(""),`\x00
|
|
21
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\x00&'".split(""),"\x00\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\x00"&'.split(""),"\x00\"&'`".split("")]]};function Da(e,t,n,i){let r=i.schema,o=r.space==="svg"?!1:i.settings.omitOptionalTags,s=r.space==="svg"?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase()),a=[],l;if(r.space==="html"&&e.tagName==="svg")i.schema=Si;let d=wh(i,e.properties),c=i.all(r.space==="html"&&e.tagName==="template"?e.content:e);if(i.schema=r,c)s=!1;if(d||!o||!Na(e,t,n)){if(a.push("<",e.tagName,d?" "+d:""),s&&(r.space==="svg"||i.settings.closeSelfClosing)){if(l=d.charAt(d.length-1),!i.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")a.push(" ");a.push("/")}a.push(">")}if(a.push(c),!s&&(!o||!Tn(e,t,n)))a.push("</"+e.tagName+">");return a.join("")}function wh(e,t){let n=[],i=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){let o=Lh(e,r,t[r]);if(o)n.push(o)}}while(++i<n.length){let o=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;if(i!==n.length-1&&o!=='"'&&o!=="'")n[i]+=" "}return n.join("")}function Lh(e,t,n){let i=So(e.schema,t),r=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,o=e.settings.allowDangerousCharacters?0:1,s=e.quote,a;if(i.overloadedBoolean&&(n===i.attribute||n===""))n=!0;else if((i.boolean||i.overloadedBoolean)&&(typeof n!=="string"||n===i.attribute||n===""))n=Boolean(n);if(n===null||n===void 0||n===!1||typeof n==="number"&&Number.isNaN(n))return"";let l=Xe(i.attribute,Object.assign({},e.settings.characterReferences,{subset:xi.name[r][o]}));if(n===!0)return l;if(n=Array.isArray(n)?(i.commaSeparated?Aa:Ra)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)return l;if(e.settings.preferUnquoted)a=Xe(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:xi.unquoted[r][o]}));if(a!==n){if(e.settings.quoteSmart&&bo(n,s)>bo(n,e.alternative))s=e.alternative;a=s+Xe(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?xi.single:xi.double)[r][o],attribute:!0}))+s}return l+(a?"="+a:a)}var Eh=["<","&"];function ki(e,t,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Xe(e.value,Object.assign({},i.settings.characterReferences,{subset:Eh}))}function Fa(e,t,n,i){return i.settings.allowDangerousHtml?e.value:ki(e,t,n,i)}function _a(e,t,n,i){return i.all(e)}var Oa=ga("type",{invalid:Th,unknown:Ah,handlers:{comment:Ea,doctype:Ta,element:Da,raw:Fa,root:_a,text:ki}});function Th(e){throw Error("Expected node, not `"+e+"`")}function Ah(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Rh={},Ih={},Mh=[];function X(e,t){let n=t||Rh,i=n.quote||'"',r=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:Hh,all:Ph,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||da,characterReferences:n.characterReferences||Ih,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Si:pa,quote:i,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Hh(e,t,n){return Oa(e,t,n,this)}function Ph(e){let t=[],n=e&&e.children||Mh,i=-1;while(++i<n.length)t[i]=this.one(n[i],i,e);return t.join("")}var Ua=/\s+/g;function $a(e,t){if(!t)return e;if(e.properties||={},e.properties.class||=[],typeof e.properties.class==="string")e.properties.class=e.properties.class.split(Ua);if(!Array.isArray(e.properties.class))e.properties.class=[];let n=Array.isArray(t)?t:t.split(Ua);for(let i of n)if(i&&!e.properties.class.includes(i))e.properties.class.push(i);return e}var Nh=/:?lang=["']([^"']+)["']/g,Dh=/(?:```|~~~)([\w-]+)/g,Fh=/\\begin\{([\w-]+)\}/g,_h=/<script\s+(?:type|lang)=["']([^"']+)["']/gi,Oh=/^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;function Uh(e){let t=Vt(e,!0).map(([r])=>r);function n(r){if(r===e.length)return{line:t.length-1,character:t.at(-1).length};let o=r,s=0;for(let a of t){if(o<a.length)break;o-=a.length,s++}return{line:s,character:o}}function i(r,o){let s=0;for(let a=0;a<r;a++)s+=t[a].length;return s+=o,s}return{lines:t,indexToPos:n,posToIndex:i}}function Va(e,t,n){let i=new Set;for(let o of e.matchAll(Nh)){let s=o[1].toLowerCase().trim();if(s)i.add(s)}for(let o of e.matchAll(Dh)){let s=o[1].toLowerCase().trim();if(s)i.add(s)}for(let o of e.matchAll(Fh)){let s=o[1].toLowerCase().trim();if(s)i.add(s)}for(let o of e.matchAll(_h)){let s=o[1].toLowerCase().trim(),a=s.includes("/")?s.split("/").pop():s;if(a)i.add(a)}if(Oh.test(e))i.add("yaml");if(!n)return[...i];let r=n.getBundledLanguages();return[...i].filter((o)=>o&&r[o])}var zh=["color","background-color"];function Bh(e,t){let n=0,i=[];for(let r of t){if(r>n)i.push({...e,content:e.content.slice(n,r),offset:e.offset+n});n=r}if(n<e.content.length)i.push({...e,content:e.content.slice(n),offset:e.offset+n});return i}function $h(e,t){let n=0,i=e.length;while(n<i){let r=n+(i-n>>1);if(e[r]<=t)n=r+1;else i=r}return n}function Vh(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((i,r)=>i-r);if(!n.length)return e;return e.map((i)=>i.flatMap((r)=>{let o=r.offset+r.content.length,s=$h(n,r.offset),a=s;while(a<n.length&&n[a]<o)a++;if(s===a)return r;let l=n.slice(s,a);for(let d=0;d<l.length;d++)l[d]-=r.offset;return Bh(r,l)}))}function Gh(e,t,n,i,r="css-vars"){let o={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map((c)=>wi(e.variants[c])),a=new Set(s.flatMap((c)=>Object.keys(c))),l={},d=(c,u)=>{let h=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return n+t[c]+(u==="color"?"":h)};return s.forEach((c,u)=>{for(let h of a){let f=c[h]||"inherit";if(u===0&&i&&zh.includes(h))if(i==="light-dark()"&&s.length>1){let m=t.findIndex((S)=>S==="light"),y=t.findIndex((S)=>S==="dark");if(m===-1||y===-1)throw new G('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let v=s[m][h]||"inherit",g=s[y][h]||"inherit";if(l[h]=`light-dark(${v}, ${g})`,r==="css-vars")l[d(u,h)]=f}else l[h]=f;else if(r==="css-vars")l[d(u,h)]=f}}),o.htmlStyle=l,o}function wi(e){let t={};if(e.color)t.color=e.color;if(e.bgColor)t["background-color"]=e.bgColor;if(e.fontStyle){if(e.fontStyle&le.Italic)t["font-style"]="italic";if(e.fontStyle&le.Bold)t["font-weight"]="bold";let n=[];if(e.fontStyle&le.Underline)n.push("underline");if(e.fontStyle&le.Strikethrough)n.push("line-through");if(n.length)t["text-decoration"]=n.join(" ")}return t}function wo(e){if(typeof e==="string")return e;return Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Wh(){let e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(s){if(typeof s==="number"){if(s<0||s>n.source.length)throw new G(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...i.indexToPos(s),offset:s}}else{let a=i.lines[s.line];if(a===void 0)throw new G(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${i.lines.length}`);let l=s.character;if(l<0)l=a.length+l;if(l<0||l>a.length)throw new G(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${a.length}`);return{...s,character:l,offset:i.posToIndex(s.line,l)}}},i=Uh(n.source),o=(n.options.decorations||[]).map((s)=>({...s,start:r(s.start),end:r(s.end)}));jh(o),e.set(n.meta,{decorations:o,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;return Vh(n,t(this).decorations.flatMap((i)=>[i.start.offset,i.end.offset]))},code(n){if(!this.options.decorations?.length)return;let i=t(this),r=[...n.children].filter((c)=>c.type==="element"&&c.tagName==="span");if(r.length!==i.converter.lines.length)throw new G(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function o(c,u,h,f){let m=r[c],y="",v=-1,g=-1;if(u===0)v=0;if(h===0)g=0;if(h===Number.POSITIVE_INFINITY)g=m.children.length;if(v===-1||g===-1)for(let b=0;b<m.children.length;b++){if(y+=Ga(m.children[b]),v===-1&&y.length===u)v=b+1;if(g===-1&&y.length===h)g=b+1}if(v===-1)throw new G(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(g===-1)throw new G(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);let S=m.children.slice(v,g);if(!f.alwaysWrap&&S.length===m.children.length)a(m,f,"line");else if(!f.alwaysWrap&&S.length===1&&S[0].type==="element")a(S[0],f,"token");else{let b={type:"element",tagName:"span",properties:{},children:S};a(b,f,"wrapper"),m.children.splice(v,S.length,b)}}function s(c,u){r[c]=a(r[c],u,"line")}function a(c,u,h){let f=u.properties||{},m=u.transform||((y)=>y);if(c.tagName=u.tagName||"span",c.properties={...c.properties,...f,class:c.properties.class},u.properties?.class)$a(c,u.properties.class);return c=m(c,h)||c,c}let l=[],d=i.decorations.sort((c,u)=>u.start.offset-c.start.offset||c.end.offset-u.end.offset);for(let c of d){let{start:u,end:h}=c;if(u.line===h.line)o(u.line,u.character,h.character,c);else if(u.line<h.line){o(u.line,u.character,Number.POSITIVE_INFINITY,c);for(let f=u.line+1;f<h.line;f++)l.unshift(()=>s(f,c));o(h.line,0,h.character,c)}}l.forEach((c)=>c())}}}function jh(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new G(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){let r=e[i],o=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,s=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,l=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(o||s||a||l){if(o&&s)continue;if(a&&l)continue;if(a&&n.start.offset===n.end.offset)continue;if(s&&r.start.offset===r.end.offset)continue;throw new G(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function Ga(e){if(e.type==="text")return e.value;if(e.type==="element")return e.children.map(Ga).join("");return""}var qh=[Wh()];function Li(e){let t=Kh(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...qh]}function Kh(e){let t=[],n=[],i=[];for(let r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}var Lt=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],ko={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Xh(e,t){let n=e.indexOf("\x1B",t);if(n!==-1){if(e[n+1]==="["){let i=e.indexOf("m",n);if(i!==-1)return{sequence:e.substring(n+2,i).split(";"),startPosition:n,position:i+1}}}return{position:e.length}}function za(e){let t=e.shift();if(t==="2"){let n=e.splice(0,3).map((i)=>Number.parseInt(i));if(n.length!==3||n.some((i)=>Number.isNaN(i)))return;return{type:"rgb",rgb:n}}else if(t==="5"){let n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Yh(e){let t=[];while(e.length>0){let n=e.shift();if(!n)continue;let i=Number.parseInt(n);if(Number.isNaN(i))continue;if(i===0)t.push({type:"resetAll"});else if(i<=9){if(ko[i])t.push({type:"setDecoration",value:ko[i]})}else if(i<=29){let r=ko[i-20];if(r){if(t.push({type:"resetDecoration",value:r}),r==="dim")t.push({type:"resetDecoration",value:"bold"})}}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Lt[i-30]}});else if(i===38){let r=za(e);if(r)t.push({type:"setForegroundColor",value:r})}else if(i===39)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Lt[i-40]}});else if(i===48){let r=za(e);if(r)t.push({type:"setBackgroundColor",value:r})}else if(i===49)t.push({type:"resetBackgroundColor"});else if(i===53)t.push({type:"setDecoration",value:"overline"});else if(i===55)t.push({type:"resetDecoration",value:"overline"});else if(i>=90&&i<=97)t.push({type:"setForegroundColor",value:{type:"named",name:Lt[i-90+8]}});else if(i>=100&&i<=107)t.push({type:"setBackgroundColor",value:{type:"named",name:Lt[i-100+8]}})}return t}function Jh(){let e=null,t=null,n=new Set;return{parse(i){let r=[],o=0;do{let s=Xh(i,o),a=s.sequence?i.substring(o,s.startPosition):i.substring(o);if(a.length>0)r.push({value:a,foreground:e,background:t,decorations:new Set(n)});if(s.sequence){let l=Yh(s.sequence);for(let d of l)if(d.type==="resetAll")e=null,t=null,n.clear();else if(d.type==="resetForegroundColor")e=null;else if(d.type==="resetBackgroundColor")t=null;else if(d.type==="resetDecoration")n.delete(d.value);for(let d of l)if(d.type==="setForegroundColor")e=d.value;else if(d.type==="setBackgroundColor")t=d.value;else if(d.type==="setDecoration")n.add(d.value)}o=s.position}while(o<i.length);return r}}}var Zh={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=Zh){function t(a){return e[a]}function n(a){return`#${a.map((l)=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let i;function r(){if(i)return i;i=[];for(let d=0;d<Lt.length;d++)i.push(t(Lt[d]));let a=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let c=0;c<6;c++)for(let u=0;u<6;u++)i.push(n([a[d],a[c],a[u]]));let l=8;for(let d=0;d<24;d++,l+=10)i.push(n([l,l,l]));return i}function o(a){return r()[a]}function s(a){switch(a.type){case"named":return t(a.name);case"rgb":return n(a.rgb);case"table":return o(a.index)}}return{value:s}}var ef=/#([0-9a-f]{3,8})/i,tf=/var\((--[\w-]+-ansi-[\w-]+)\)/,nf={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 rf(e,t,n){let i=xn(e,n),r=Vt(t),o=Qh(Object.fromEntries(Lt.map((a)=>{let l=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,e.colors?.[l]||nf[a]]}))),s=Jh();return r.map((a)=>s.parse(a[0]).map((l)=>{let d,c;if(l.decorations.has("reverse"))d=l.background?o.value(l.background):e.bg,c=l.foreground?o.value(l.foreground):e.fg;else d=l.foreground?o.value(l.foreground):e.fg,c=l.background?o.value(l.background):void 0;if(d=qe(d,i),c=qe(c,i),l.decorations.has("dim"))d=of(d);let u=le.None;if(l.decorations.has("bold"))u|=le.Bold;if(l.decorations.has("italic"))u|=le.Italic;if(l.decorations.has("underline"))u|=le.Underline;if(l.decorations.has("strikethrough"))u|=le.Strikethrough;return{content:l.value,offset:a[1],color:d,bgColor:c,fontStyle:u}}))}function of(e){let t=e.match(ef);if(t){let i=t[1];if(i.length===8){let r=Math.round(Number.parseInt(i.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${i.slice(0,6)}${r}`}else if(i.length===6)return`#${i}80`;else if(i.length===4){let r=i[0],o=i[1],s=i[2],a=i[3];return`#${r}${r}${o}${o}${s}${s}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(i.length===3){let r=i[0],o=i[1],s=i[2];return`#${r}${r}${o}${o}${s}${s}80`}}let n=e.match(tf);if(n)return`var(${n[1]}-dim)`;return e}function Lo(e,t,n={}){let i=e.resolveLangAlias(n.lang||"text"),{theme:r=e.getLoadedThemes()[0]}=n;if(!kn(i)&&!wn(r)&&i==="ansi"){let{theme:o}=e.setTheme(r);return rf(o,t,n)}return co(e,t,n)}function Ei(e,t,n){let i,r,o,s,a,l;if("themes"in n){let{defaultColor:d="light",cssVariablePrefix:c="--shiki-",colorsRendering:u="css-vars"}=n,h=Object.entries(n.themes).filter((g)=>g[1]).map((g)=>({color:g[0],theme:g[1]})).sort((g,S)=>g.color===d?-1:S.color===d?1:0);if(h.length===0)throw new G("`themes` option must not be empty");let f=pi(e,t,n,Lo);if(l=Wt(f),d&&d!=="light-dark()"&&!h.some((g)=>g.color===d))throw new G(`\`themes\` option must contain the defaultColor key \`${d}\``);let m=h.map((g)=>e.getTheme(g.theme)),y=h.map((g)=>g.color);if(o=f.map((g)=>g.map((S)=>Gh(S,y,c,d,u))),l)Ln(o,l);let v=h.map((g)=>xn(g.theme,n));r=Ba(h,m,v,c,d,"fg",u),i=Ba(h,m,v,c,d,"bg",u),s=`shiki-themes ${m.map((g)=>g.name).join(" ")}`,a=d?void 0:[r,i].join(";")}else if("theme"in n){let d=xn(n.theme,n);o=Lo(e,t,n);let c=e.getTheme(n.theme);i=qe(c.bg,d),r=qe(c.fg,d),s=c.name,l=Wt(o)}else throw new G("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:r,bg:i,themeName:s,rootStyle:a,grammarState:l}}function Ba(e,t,n,i,r,o,s){return e.map((a,l)=>{let d=qe(t[l][o],n[l])||"inherit",c=`${i+a.color}${o==="bg"?"-bg":""}:${d}`;if(l===0&&r){if(r==="light-dark()"&&e.length>1){let u=e.findIndex((f)=>f.color==="light"),h=e.findIndex((f)=>f.color==="dark");if(u===-1||h===-1)throw new G('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${qe(t[u][o],n[u])||"inherit"}, ${qe(t[h][o],n[h])||"inherit"});${c}`}return d}if(s==="css-vars")return c;return null}).filter((a)=>!!a).join(";")}var Wa=/^\s+$/,sf=/^(\s*)(.*?)(\s*)$/;function Ti(e,t,n,i={meta:{},options:n,codeToHast:(r,o)=>Ti(e,r,o),codeToTokens:(r,o)=>Ei(e,r,o)}){let r=t;for(let m of Li(n))r=m.preprocess?.call(i,r,n)||r;let{tokens:o,fg:s,bg:a,themeName:l,rootStyle:d,grammarState:c}=Ei(e,r,n),{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;if(u===!0)o=lf(o);else if(u==="never")o=df(o);if(h)o=cf(o);let f={...i,get source(){return r}};for(let m of Li(n))o=m.tokens?.call(f,o)||o;return af(o,{...n,fg:s,bg:a,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},f,c)}function af(e,t,n,i=Wt(e)){let r=Li(t),o=[],s={type:"root",children:[]},{structure:a="classic",tabindex:l="0"}=t,d={class:`shiki ${t.themeName||""}`};if(t.rootStyle!==!1)if(t.rootStyle!=null)d.style=t.rootStyle;else d.style=`background-color:${t.bg};color:${t.fg}`;if(l!==!1&&l!=null)d.tabindex=l.toString();for(let[y,v]of Object.entries(t.meta||{}))if(!y.startsWith("_"))d[y]=v;let c={type:"element",tagName:"pre",properties:d,children:[],data:t.data},u={type:"element",tagName:"code",properties:{},children:o},h=[],f={...n,structure:a,addClassToHast:$a,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return c},get code(){return u},get lines(){return h}};if(e.forEach((y,v)=>{if(v){if(a==="inline")s.children.push({type:"element",tagName:"br",properties:{},children:[]});else if(a==="classic")o.push({type:"text",value:`
|
|
22
|
+
`})}let g={type:"element",tagName:"span",properties:{class:"line"},children:[]},S=0;for(let b of y){let x={type:"element",tagName:"span",properties:{...b.htmlAttrs},children:[{type:"text",value:b.content}]},C=wo(b.htmlStyle||wi(b));if(C)x.properties.style=C;for(let k of r)x=k?.span?.call(f,x,v+1,S,g,b)||x;if(a==="inline")s.children.push(x);else if(a==="classic")g.children.push(x);S+=b.content.length}if(a==="classic"){for(let b of r)g=b?.line?.call(f,g,v+1)||g;h.push(g),o.push(g)}else if(a==="inline")h.push(g)}),a==="classic"){for(let y of r)u=y?.code?.call(f,u)||u;c.children.push(u);for(let y of r)c=y?.pre?.call(f,c)||c;s.children.push(c)}else if(a==="inline"){let y=[],v={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let S of s.children)if(S.type==="element"&&S.tagName==="br")y.push(v),v={type:"element",tagName:"span",properties:{class:"line"},children:[]};else if(S.type==="element"||S.type==="text")v.children.push(S);y.push(v);let g={type:"element",tagName:"code",properties:{},children:y};for(let S of r)g=S?.code?.call(f,g)||g;s.children=[];for(let S=0;S<g.children.length;S++){if(S>0)s.children.push({type:"element",tagName:"br",properties:{},children:[]});let b=g.children[S];if(b.type==="element")s.children.push(...b.children)}}let m=s;for(let y of r)m=y?.root?.call(f,m)||m;if(i)Ln(m,i);return m}function lf(e){return e.map((t)=>{let n=[],i="",r;return t.forEach((o,s)=>{let a=!(o.fontStyle&&(o.fontStyle&le.Underline||o.fontStyle&le.Strikethrough));if(a&&Wa.test(o.content)&&t[s+1]){if(r===void 0)r=o.offset;i+=o.content}else if(i){if(a)n.push({...o,offset:r,content:i+o.content});else n.push({content:i,offset:r},o);r=void 0,i=""}else n.push(o)}),n})}function df(e){return e.map((t)=>t.flatMap((n)=>{if(Wa.test(n.content))return n;let i=n.content.match(sf);if(!i)return n;let[,r,o,s]=i;if(!r&&!s)return n;let a=[{...n,offset:n.offset+r.length,content:o}];if(r)a.unshift({content:r,offset:n.offset});if(s)a.push({content:s,offset:n.offset+r.length+o.length});return a}))}function cf(e){return e.map((t)=>{let n=[];for(let i of t){if(n.length===0){n.push({...i});continue}let r=n.at(-1),o=wo(r.htmlStyle||wi(r)),s=wo(i.htmlStyle||wi(i)),a=r.fontStyle&&(r.fontStyle&le.Underline||r.fontStyle&le.Strikethrough),l=i.fontStyle&&(i.fontStyle&le.Underline||i.fontStyle&le.Strikethrough);if(!a&&!l&&o===s)r.content+=i.content;else n.push({...i})}return n})}var uf=X;function hf(e,t,n){let i={meta:{},options:n,codeToHast:(o,s)=>Ti(e,o,s),codeToTokens:(o,s)=>Ei(e,o,s)},r=uf(Ti(e,t,n,i));for(let o of Li(n))r=o.postprocess?.call(i,r,n)||r;return r}async function ja(e){let t=await lo(e);return{getLastGrammarState:(...n)=>aa(t,...n),codeToTokensBase:(n,i)=>Lo(t,n,i),codeToTokensWithThemes:(n,i)=>pi(t,n,i),codeToTokens:(n,i)=>Ei(t,n,i),codeToHast:(n,i)=>Ti(t,n,i),codeToHtml:(n,i)=>hf(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function ff(e){let t;async function n(i){if(!t)return t=e({...i,themes:i.themes||[],langs:i.langs||[]}),t;else{let r=await t;return await Promise.all([r.loadTheme(...i.themes||[]),r.loadLanguage(...i.langs||[])]),r}}return n}var kb=ff(ja);function qa(e){let{langs:t,themes:n,engine:i}=e;async function r(o){function s(u){if(typeof u==="string"){if(u=o.langAlias?.[u]||u,oo(u))return[];let h=t[u];if(!h)throw new G(`Language \`${u}\` is not included in this bundle. You may want to load it from external source.`);return h}return u}function a(u){if(so(u))return"none";if(typeof u==="string"){let h=n[u];if(!h)throw new G(`Theme \`${u}\` is not included in this bundle. You may want to load it from external source.`);return h}return u}let l=(o.themes??[]).map((u)=>a(u)),d=(o.langs??[]).map((u)=>s(u)),c=await ja({engine:o.engine??i(),...o,themes:l,langs:d});return{...c,loadLanguage(...u){return c.loadLanguage(...u.map(s))},loadTheme(...u){return c.loadTheme(...u.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return r}function pf(e){let t;async function n(i={}){if(!t){t=e({...i,themes:[],langs:[]});let r=await t;return await Promise.all([r.loadTheme(...i.themes||[]),r.loadLanguage(...i.langs||[])]),r}else{let r=await t;return await Promise.all([r.loadTheme(...i.themes||[]),r.loadLanguage(...i.langs||[])]),r}}return n}function Ka(e,t){let n=pf(e);async function i(r,o){let s=await n({langs:[o.lang],themes:"theme"in o?[o.theme]:Object.values(o.themes)}),a=await t?.guessEmbeddedLanguages?.(r,o.lang,s);if(a)await s.loadLanguage(...a);return s}return{getSingletonHighlighter(r){return n(r)},async codeToHtml(r,o){return(await i(r,o)).codeToHtml(r,o)},async codeToHast(r,o){return(await i(r,o)).codeToHast(r,o)},async codeToTokens(r,o){return(await i(r,o)).codeToTokens(r,o)},async codeToTokensBase(r,o){return(await i(r,o)).codeToTokensBase(r,o)},async codeToTokensWithThemes(r,o){return(await i(r,o)).codeToTokensWithThemes(r,o)},async getLastGrammarState(r,o){return(await n({langs:[o.lang],themes:[o.theme]})).getLastGrammarState(r,o)}}}var Ai=qa({langs:$t,themes:Xs,engine:()=>(0,io.createOnigurumaEngine)(import("./wasm-eftreyx0.js"))}),{codeToHtml:mf,codeToHast:gf,codeToTokens:yf,codeToTokensBase:Sf,codeToTokensWithThemes:vf,getSingletonHighlighter:bf,getLastGrammarState:Cf}=Ka(Ai,{guessEmbeddedLanguages:Va});var Xa=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:i,regexConstructor:r}=t;if(!r)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map((o)=>{if(typeof o!=="string")return o;let s=i?.get(o);if(s){if(s instanceof RegExp)return s;if(n)return null;throw s}try{let a=r(o);return i?.set(o,a),a}catch(a){if(i?.set(o,a),n)return null;throw a}})}findNextMatchSync(e,t,n){let i=typeof e==="string"?e:e.content,r=[];function o(s,a,l=0){return{index:s,captureIndices:a.indices.map((d)=>{if(d==null)return{start:4294967295,end:4294967295,length:0};return{start:d[0]+l,end:d[1]+l,length:d[1]-d[0]}})}}for(let s=0;s<this.regexps.length;s++){let a=this.regexps[s];if(!a)continue;try{a.lastIndex=t;let l=a.exec(i);if(!l)continue;if(l.index===t)return o(s,l,0);r.push([s,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(r.length){let s=Math.min(...r.map((a)=>a[1].index));for(let[a,l,d]of r)if(l.index===s)return o(a,l,d)}return null}};function lt(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Ya(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var An=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Q=String.raw;function Ye(e,t){if(e==null)throw Error(t??"Value expected");return e}var nl=Q`\[\^?`,il=`c.? | C(?:-.?)?|${Q`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Q`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Q`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Q`o\{[^\}]*\}?`}|${Q`\d{1,3}`}`,To=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Ri=new RegExp(Q`
|
|
23
|
+
\\ (?:
|
|
24
|
+
${il}
|
|
25
|
+
| [gk]<[^>]*>?
|
|
26
|
+
| [gk]'[^']*'?
|
|
27
|
+
| .
|
|
28
|
+
)
|
|
29
|
+
| \( (?:
|
|
30
|
+
\? (?:
|
|
31
|
+
[:=!>({]
|
|
32
|
+
| <[=!]
|
|
33
|
+
| <[^>]*>
|
|
34
|
+
| '[^']*'
|
|
35
|
+
| ~\|?
|
|
36
|
+
| #(?:[^)\\]|\\.?)*
|
|
37
|
+
| [^:)]*[:)]
|
|
38
|
+
)?
|
|
39
|
+
| \*[^\)]*\)?
|
|
40
|
+
)?
|
|
41
|
+
| (?:${To.source})+
|
|
42
|
+
| ${nl}
|
|
43
|
+
| .
|
|
44
|
+
`.replace(/\s+/g,""),"gsu"),Eo=new RegExp(Q`
|
|
45
|
+
\\ (?:
|
|
46
|
+
${il}
|
|
47
|
+
| .
|
|
48
|
+
)
|
|
49
|
+
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
50
|
+
| ${nl}
|
|
51
|
+
| &&
|
|
52
|
+
| .
|
|
53
|
+
`.replace(/\s+/g,""),"gsu");function rl(e,t={}){let n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw Error("String expected as pattern");let i=zf(n.flags),r=[i.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(u){r.push(u)},replaceCurrentModX(u){r[r.length-1]=u},singleline:n.rules.singleline},s=[],a;for(Ri.lastIndex=0;a=Ri.exec(e);){let u=xf(o,e,a[0],Ri.lastIndex);u.tokens?s.push(...u.tokens):u.token&&s.push(u.token),u.lastIndex!==void 0&&(Ri.lastIndex=u.lastIndex)}let l=[],d=0;s.filter((u)=>u.type==="GroupOpen").forEach((u)=>{u.kind==="capturing"?u.number=++d:u.raw==="("&&l.push(u)}),d||l.forEach((u,h)=>{u.kind="capturing",u.number=h+1});let c=d||l.length;return{tokens:s.map((u)=>u.type==="EscapedNumber"?$f(u,c):u).flat(),flags:i}}function xf(e,t,n,i){let[r,o]=n;if(n==="["||n==="[^"){let s=kf(t,n,i);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(o))return{token:Ja(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Pf(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:sl(n)}}if(o==="K")return{token:al("keep",n)};if(o==="N"||o==="R")return{token:Et("newline",n,{negate:o==="N"})};if(o==="O")return{token:Et("any",n)};if(o==="X")return{token:Et("text_segment",n)};let s=ol(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(r==="("){if(o==="*")return{token:_f(n)};if(n==="(?{")throw Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[i]!==")")throw Error('Unclosed comment group "(?#"');return{lastIndex:i+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Ff(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Kt("group",n)};if(n==="(?>")return{token:Kt("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Kt(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Kt("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw Error(`Unsupported absence function kind "${n}"`);return{token:Kt("absence_repeater",n)}}throw n==="(?("?Error(`Unsupported conditional "${n}"`):Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error('Unmatched ")"');return{token:If(n)}}if(e.getCurrentModX()){if(n==="#"){let s=t.indexOf(`
|
|
54
|
+
`,i);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){let s=/\s+/y;return s.lastIndex=i,{lastIndex:s.exec(t)?s.lastIndex:i}}}if(n===".")return{token:Et("dot",n)};if(n==="^"||n==="$"){let s=e.singleline?{"^":Q`\A`,$:Q`\Z`}[n]:n;return{token:Ja(s,n)}}return n==="|"?{token:Lf(n)}:To.test(n)?{tokens:Vf(n)}:{token:Je(lt(n),n)}}function kf(e,t,n){let i=[Za(t[1]==="^",t)],r=1,o;for(Eo.lastIndex=n;o=Eo.exec(e);){let s=o[0];if(s[0]==="["&&s[1]!==":")r++,i.push(Za(s[1]==="^",s));else if(s==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(Je(93,s));else if(r--,i.push(Ef(s)),!r)break}else{let a=wf(s);Array.isArray(a)?i.push(...a):i.push(a)}}return{tokens:i,lastIndex:Eo.lastIndex||e.length}}function wf(e){if(e[0]==="\\")return ol(e,{inCharClass:!0});if(e[0]==="["){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!An.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Et("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Tf(e):e==="&&"?Af(e):Je(lt(e),e)}function ol(e,{inCharClass:t}){let n=e[1];if(n==="c"||n==="C")return Df(e);if("dDhHsSwW".includes(n))return Of(e);if(e.startsWith(Q`\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 Uf(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let i=e.split(/\\x/).slice(1).map((s)=>parseInt(s,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(i)),o=new TextEncoder;return[...r].map((s)=>{let a=[...o.encode(s)].map((l)=>`\\x${l.toString(16)}`).join("");return Je(lt(s),a)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Je(Bf(e),e);if(Qa.has(n))return Je(Qa.get(n),e);if(/\d/.test(n))return Rf(t,e);if(e==="\\")throw Error(Q`Incomplete escape "\"`);if(n==="M")throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Je(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function Lf(e){return{type:"Alternator",raw:e}}function Ja(e,t){return{type:"Assertion",kind:e,raw:t}}function sl(e){return{type:"Backreference",raw:e}}function Je(e,t){return{type:"Character",value:e,raw:t}}function Ef(e){return{type:"CharacterClassClose",raw:e}}function Tf(e){return{type:"CharacterClassHyphen",raw:e}}function Af(e){return{type:"CharacterClassIntersector",raw:e}}function Za(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Et(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function al(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Ye(n.flags),raw:t}}function Rf(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function If(e){return{type:"GroupClose",raw:e}}function Kt(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Mf(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function Hf(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function Pf(e){return{type:"Subroutine",raw:e}}var Nf=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),Qa=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Df(e){let t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Je(lt(t.toUpperCase())-64,e)}function Ff(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";let r=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),o=tl(n),s=tl(i),a={};if(o&&(a.enable=o),s&&(a.disable=s),e.endsWith(")"))return t.replaceCurrentModX(r),al("flags",e,{flags:a});if(e.endsWith(":"))return t.pushModX(r),t.numOpenGroups++,Kt("group",e,{...(o||s)&&{flags:a}});throw Error(`Unexpected flag modifier "${e}"`)}function _f(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:i,args:r}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(i==="")throw Error(`Named callout tag with empty value not allowed "${e}"`);let o=r?r.split(",").filter((c)=>c!=="").map((c)=>/^[+-]?\d+$/.test(c)?+c:c):[],[s,a,l]=o,d=Nf.has(n)?n.toLowerCase():"custom";switch(d){case"fail":case"mismatch":case"skip":if(o.length>0)throw Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw Error(`Named callout allows only one argument "${o}"`);if(typeof s=="string")throw Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!o.length||o.length>2)throw Error(`Named callout must have one or two arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw Error(`Named callout argument one must be a tag or number "${s}"`);if(o.length===2&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${a}"`);break;case"count":case"total_count":if(o.length>1)throw Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof s=="number"||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(o.length!==3)throw Error(`Named callout must have three arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw Error(`Named callout argument one must be a tag or number "${s}"`);if(typeof a=="number"||!/^(?:[<>!=]=|[<>])$/.test(a))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${a}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${d}"`)}return Mf(d,i??null,r?.split(",")??null,e)}function el(e){let t=null,n,i;if(e[0]==="{"){let{minStr:r,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups;if(+r>1e5||o&&+o>1e5)throw Error("Quantifier value unsupported in Oniguruma");if(n=+r,i=o===void 0?+r:o===""?1/0:+o,n>i&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if(t==="possessive")throw Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,i=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Hf(t,n,i,e)}function Of(e){let t=e[1].toLowerCase();return Et({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Uf(e){let{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Et("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function tl(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 zf(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 i=e[n];if(!"imxDPSWy".includes(i))throw Error(`Invalid flag "${i}"`);if(i==="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"}[i]]=!0}return t}function Bf(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 $f(e,t){let{raw:n,inCharClass:i}=e,r=n.slice(1);if(!i&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=t))return[sl(n)];let o=[],s=r.match(/^[0-7]+|\d/g);for(let a=0;a<s.length;a++){let l=s[a],d;if(a===0&&l!=="8"&&l!=="9"){if(d=parseInt(l,8),d>127)throw Error(Q`Octal encoded byte above 177 unsupported "${n}"`)}else d=lt(l);o.push(Je(d,(a===0?"\\":"")+l))}return o}function Vf(e){let t=[],n=new RegExp(To,"gy"),i;for(;i=n.exec(e);){let r=i[0];if(r[0]==="{"){let o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(o){let{min:s,max:a}=o.groups;if(+s>+a&&r.endsWith("?")){n.lastIndex--,t.push(el(r.slice(0,-1)));continue}}}t.push(el(r))}return t}function Ii(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((i)=>t[i]===n[i])}function ll(e){return Gf.has(e.type)}var Gf=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Hi(e,t={}){let n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=rl(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(h,f)=>{let m=i.tokens[o.nextIndex];switch(o.parent=h,o.nextIndex++,m.type){case"Alternator":return Ze();case"Assertion":return Wf(m);case"Backreference":return jf(m,o);case"Character":return Xt(m.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return qf(m,o,f);case"CharacterClassOpen":return Kf(m,o,f);case"CharacterSet":return Xf(m,o);case"Directive":return tp(m.kind,{flags:m.flags});case"GroupOpen":return Yf(m,o,f);case"NamedCallout":return ip(m.kind,m.tag,m.arguments);case"Quantifier":return Jf(m,o);case"Subroutine":return Zf(m,o);default:throw Error(`Unexpected token type "${m.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:i.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},s=op(np(i.flags)),a=s.body[0];for(;o.nextIndex<i.tokens.length;){let h=r(a,{});h.type==="Alternative"?(s.body.push(h),a=h):a.body.push(h)}let{capturingGroups:l,hasNumberedRef:d,namedGroupsByName:c,subroutines:u}=o;if(d&&c.size&&!n.rules.captureGroup)throw Error("Numbered backref/subroutine not allowed when using named capture");for(let{ref:h}of u)if(typeof h=="number"){if(h>l.length)throw Error("Subroutine uses a group number that's not defined");h&&(l[h-1].isSubroutined=!0)}else if(c.has(h)){if(c.get(h).length>1)throw Error(Q`Subroutine uses a duplicate group name "\g<${h}>"`);c.get(h)[0].isSubroutined=!0}else throw Error(Q`Subroutine uses a group name that's not defined "\g<${h}>"`);return s}function Wf({kind:e}){return Pi(Ye({"^":"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===Q`\B`||e===Q`\Y`})}function jf({raw:e},t){let n=/^\\k[<']/.test(e),i=n?e.slice(3,-1):e.slice(1),r=(o,s=!1)=>{let a=t.capturingGroups.length,l=!1;if(o>a)if(t.skipBackrefValidation)l=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Mi(s?a+1-o:o,{orphan:l})};if(n){let o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(o)return r(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(i))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw Error(`Group name not defined to the left "${e}"`);return Mi(i)}return r(+i)}function qf(e,t,n){let{tokens:i,walk:r}=t,o=t.parent,s=o.body.at(-1),a=i[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&a&&a.type!=="CharacterClassOpen"&&a.type!=="CharacterClassClose"&&a.type!=="CharacterClassIntersector"){let l=r(o,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&l.type==="Character")return o.body.pop(),ep(s,l);throw Error("Invalid character class range")}return Xt(lt("-"))}function Kf({negate:e},t,n){let{tokens:i,walk:r}=t,o=[Rn()],s=i[t.nextIndex],a=ul(s);for(;a.type!=="CharacterClassClose";){if(a.type==="CharacterClassIntersector")o.push(Rn()),t.nextIndex++;else{let d=o.at(-1);d.body.push(r(d,n))}a=ul(i[t.nextIndex],s)}let l=Rn({negate:e});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map((d)=>d.body.length===1?d.body[0]:d)),t.nextIndex++,l}function Xf({kind:e,negate:t,value:n},i){let{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:s}=i;if(e==="property"){let a=Yt(n);if(An.has(a)&&!s?.has(a))e="posix",n=a;else return Tt(n,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:s})}return e==="posix"?rp(n,{negate:t}):Ni(e,{negate:t})}function Yf(e,t,n){let{tokens:i,capturingGroups:r,namedGroupsByName:o,skipLookbehindValidation:s,walk:a}=t,l=sp(e),d=l.type==="AbsenceFunction",c=cl(l),u=c&&l.negate;if(l.type==="CapturingGroup"&&(r.push(l),l.name&&Ya(o,l.name,[]).push(l)),d&&n.isInAbsenceFunction)throw Error("Nested absence function not supported by Oniguruma");let h=hl(i[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")l.body.push(Ze()),t.nextIndex++;else{let f=l.body.at(-1),m=a(f,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||c,isInNegLookbehind:n.isInNegLookbehind||u});if(f.body.push(m),(c||n.isInLookbehind)&&!s){if(u||n.isInNegLookbehind){if(dl(m)||m.type==="CapturingGroup")throw Error("Lookbehind includes a pattern not allowed by Oniguruma")}else if(dl(m)||cl(m)&&m.negate)throw Error("Lookbehind includes a pattern not allowed by Oniguruma")}}h=hl(i[t.nextIndex])}return t.nextIndex++,l}function Jf({kind:e,min:t,max:n},i){let r=i.parent,o=r.body.at(-1);if(!o||!ll(o))throw Error("Quantifier requires a repeatable token");let s=Ro(e,t,n,o);return r.body.pop(),s}function Zf({raw:e},t){let{capturingGroups:n,subroutines:i}=t,r=e.slice(3,-1),o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(o){let a=+o.groups.num,l=n.length;if(t.hasNumberedRef=!0,r={"":a,"+":l+a,"-":l+1-a}[o.groups.sign],r<1)throw Error("Invalid subroutine number")}else r==="0"&&(r=0);let s=Io(r);return i.push(s),s}function Qf(e,t){if(e!=="repeater")throw Error(`Unexpected absence function kind "${e}"`);return{type:"AbsenceFunction",kind:e,body:In(t?.body)}}function Ze(e){return{type:"Alternative",body:fl(e?.body)}}function Pi(e,t){let n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Mi(e,t){let n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Ao(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!ap(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:In(t?.body)}}function Xt(e,t){let n={useLastValid:!1,...t};if(e>1114111){let i=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?Error(`Invalid code point out of range "\\x{${i}}"`):Error(`Invalid code point out of range in JS "\\x{${i}}"`)}return{type:"Character",value:e}}function Rn(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:fl(e?.body)}}function ep(e,t){if(t.value<e.value)throw Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Ni(e,t){let n=!!t?.negate,i={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(i.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(i.variableLength=!0),i}function tp(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Ye(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function np(e){return{type:"Flags",...e}}function we(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:In(e?.body)}}function dt(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:In(e?.body)}}function ip(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function rp(e,t){let n=!!t?.negate;if(!An.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Ro(e,t,n,i){if(t>n)throw Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function op(e,t){return{type:"Regex",body:In(t?.body),flags:e}}function Io(e){return{type:"Subroutine",ref:e}}function Tt(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},i=n.unicodePropertyMap?.get(Yt(e));if(!i){if(n.normalizeUnknownPropertyNames)i=lp(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(Q`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function sp({flags:e,kind:t,name:n,negate:i,number:r}){switch(t){case"absence_repeater":return Qf("repeater");case"atomic":return we({atomic:!0});case"capturing":return Ao(r,{name:n});case"group":return we({flags:e});case"lookahead":case"lookbehind":return dt({behind:t==="lookbehind",negate:i});default:throw Error(`Unexpected group kind "${t}"`)}}function In(e){if(e===void 0)e=[Ze()];else if(!Array.isArray(e)||!e.length||!e.every((t)=>t.type==="Alternative"))throw Error("Invalid body; expected array of one or more Alternative nodes");return e}function fl(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every((t)=>!!t.type))throw Error("Invalid body; expected array of nodes");return e}function dl(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function cl(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function ap(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function lp(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,(t)=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Yt(e){return e.replace(/[- _]+/g,"").toLowerCase()}function ul(e,t){let n=t;return Ye(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function hl(e){return Ye(e,"Unclosed group")}function At(e,t,n=null){function i(o,s){for(let a=0;a<o.length;a++){let l=r(o[a],s,a,o);a=Math.max(-1,a+l)}}function r(o,s=null,a=null,l=null){let d=0,c=!1,u={node:o,parent:s,key:a,container:l,root:e,remove(){Di(l).splice(Math.max(0,Jt(a)+d),1),d--,c=!0},removeAllNextSiblings(){return Di(l).splice(Jt(a)+1)},removeAllPrevSiblings(){let g=Jt(a)+d;return d-=g,Di(l).splice(0,Math.max(0,g))},replaceWith(g,S={}){let b=!!S.traverse;l?l[Math.max(0,Jt(a)+d)]=g:Ye(s,"Can't replace root node")[a]=g,b&&r(g,s,a,l),c=!0},replaceWithMultiple(g,S={}){let b=!!S.traverse;if(Di(l).splice(Math.max(0,Jt(a)+d),1,...g),d+=g.length-1,b){let x=0;for(let C=0;C<g.length;C++)x+=r(g[C],s,Jt(a)+C+x,l)}c=!0},skip(){c=!0}},{type:h}=o,f=t["*"],m=t[h],y=typeof f=="function"?f:f?.enter,v=typeof m=="function"?m:m?.enter;if(y?.(u,n),v?.(u,n),!c)switch(h){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":i(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(o.min,o,"min"),r(o.max,o,"max");break;case"Quantifier":r(o.body,o,"body");break;case"Regex":i(o.body,o),r(o.flags,o,"flags");break;default:throw Error(`Unexpected node type "${h}"`)}return m?.exit?.(u,n),f?.exit?.(u,n),d}return r(e),e}function Di(e){if(!Array.isArray(e))throw Error("Container expected");return e}function Jt(e){if(typeof e!="number")throw Error("Numeric key expected");return e}var pl=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ml(e,t){for(let n=0;n<e.length;n++)if(e[n]>=t)e[n]++}function gl(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}var ye=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Mn(e,t,n,i){let r=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1],s=0,a="";for(let l of e.matchAll(r)){let{0:d,groups:{$skip:c}}=l;if(!c&&(!i||i===ye.DEFAULT===!s)){if(n instanceof Function)a+=n(l,{context:s?ye.CHAR_CLASS:ye.DEFAULT,negated:o[o.length-1]});else a+=n;continue}if(d[0]==="[")s++,o.push(d[1]==="^");else if(d==="]"&&s)s--,o.pop();a+=d}return a}function Mo(e,t,n,i){Mn(e,t,n,i)}function dp(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;let r=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let o=0,s;while(s=r.exec(e)){let{0:a,groups:{$skip:l}}=s;if(!l&&(!i||i===ye.DEFAULT===!o))return s;if(a==="[")o++;else if(a==="]"&&o)o--;if(r.lastIndex==s.index)r.lastIndex++}return null}function Hn(e,t,n){return!!dp(e,t,0,n)}function yl(e,t){let n=/\\?./gsu;n.lastIndex=t;let i=e.length,r=0,o=1,s;while(s=n.exec(e)){let[a]=s;if(a==="[")r++;else if(!r){if(a==="(")o++;else if(a===")"){if(o--,!o){i=s.index;break}}}else if(a==="]")r--}return e.slice(t,i)}var Sl=new RegExp(String.raw`(?<noncapturingStart>${pl})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Po(e,t){let n=t?.hiddenCaptures??[],i=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};let r="(?>",o="(?:(?=(",s=[0],a=[],l=0,d=0,c=NaN,u;do{u=!1;let h=0,f=0,m=!1,y;Sl.lastIndex=Number.isNaN(c)?0:c+o.length;while(y=Sl.exec(e)){let{0:v,index:g,groups:{capturingStart:S,noncapturingStart:b}}=y;if(v==="[")h++;else if(!h){if(v===r&&!m)c=g,m=!0;else if(m&&b)f++;else if(S)if(m)f++;else l++,s.push(l+d);else if(v===")"&&m){if(!f){d++;let x=l+d;if(e=`${e.slice(0,c)}${o}${e.slice(c+r.length,g)}))<$$${x}>)${e.slice(g+1)}`,u=!0,a.push(x),ml(n,x),i.size){let C=new Map;i.forEach((k,w)=>{C.set(w>=x?w+1:w,k.map((T)=>T>=x?T+1:T))}),i=C}break}f--}}else if(v==="]")h--}}while(u);return n.push(...a),e=Mn(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:f,wrappedBackrefNum:m}})=>{if(f){let y=+f;if(y>s.length-1)throw Error(`Backref "${h}" greater than number of captures`);return`\\${s[y]}`}return`\\${m}`},ye.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}var vl=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Ho=new RegExp(String.raw`
|
|
55
|
+
\\(?: \d+
|
|
56
|
+
| c[A-Za-z]
|
|
57
|
+
| [gk]<[^>]+>
|
|
58
|
+
| [pPu]\{[^\}]+\}
|
|
59
|
+
| u[A-Fa-f\d]{4}
|
|
60
|
+
| x[A-Fa-f\d]{2}
|
|
61
|
+
)
|
|
62
|
+
| \((?: \? (?: [:=!>]
|
|
63
|
+
| <(?:[=!]|[^>]+>)
|
|
64
|
+
| [A-Za-z\-]+:
|
|
65
|
+
| \(DEFINE\)
|
|
66
|
+
))?
|
|
67
|
+
| (?<qBase>${vl})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
68
|
+
| \\?.
|
|
69
|
+
`.replace(/\s+/g,""),"gsu");function No(e){if(!new RegExp(`${vl}\\+`).test(e))return{pattern:e};let t=[],n=null,i=null,r="",o=0,s;Ho.lastIndex=0;while(s=Ho.exec(e)){let{0:a,index:l,groups:{qBase:d,qMod:c,invalidQ:u}}=s;if(a==="["){if(!o)i=l;o++}else if(a==="]")if(o)o--;else i=null;else if(!o){if(c==="+"&&r&&!r.startsWith("(")){if(u)throw Error(`Invalid quantifier "${a}"`);let h=-1;if(/^\{\d+\}$/.test(d))e=gl(e,l+d.length,c,"");else{if(r===")"||r==="]"){let f=r===")"?n:i;if(f===null)throw Error(`Invalid unmatched "${r}"`);e=`${e.slice(0,f)}(?>${e.slice(f,l)}${d})${e.slice(l+a.length)}`}else e=`${e.slice(0,l-r.length)}(?>${r}${d})${e.slice(l+a.length)}`;h+=4}Ho.lastIndex+=h}else if(a[0]==="(")t.push(l);else if(a===")")n=t.length?t.pop():null}r=a}return{pattern:e}}var Re=String.raw,cp=Re`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Fo=Re`\(\?R=(?<rDepth>[^\)]+)\)|${cp}`,Fi=Re`\(\?<(?![=!])(?<captureName>[^>]+)>`,wl=Re`${Fi}|(?<unnamed>\()(?!\?)`,Rt=new RegExp(Re`${Fi}|${Fo}|\(\?|\\?.`,"gsu"),Do="Cannot use multiple overlapping recursions";function Ll(e,t){let{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t},r=t?.captureTransfers??new Map;if(!new RegExp(Fo,"su").test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};if(i==="plugin"&&Hn(e,Re`\(\?\(DEFINE\)`,ye.DEFAULT))throw Error("DEFINE groups cannot be used with recursion");let o=[],s=Hn(e,Re`\\[1-9]`,ye.DEFAULT),a=new Map,l=[],d=!1,c=0,u=0,h;Rt.lastIndex=0;while(h=Rt.exec(e)){let{0:f,groups:{captureName:m,rDepth:y,gRNameOrNum:v,gRDepth:g}}=h;if(f==="[")c++;else if(!c){if(y){if(bl(y),d)throw Error(Do);if(s)throw Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let S=e.slice(0,h.index),b=e.slice(Rt.lastIndex);if(Hn(b,Fo,ye.DEFAULT))throw Error(Do);let x=+y-1;e=Cl(S,b,x,!1,n,o,u),r=kl(r,S,x,o.length,0,u);break}else if(v){bl(g);let S=!1;for(let A of l)if(A.name===v||A.num===+v){if(S=!0,A.hasRecursedWithin)throw Error(Do);break}if(!S)throw Error(Re`Recursive \g cannot be used outside the referenced group "${i==="external"?v:Re`\g<${v}&R=${g}>`}"`);let b=a.get(v),x=yl(e,b);if(s&&Hn(x,Re`${Fi}|\((?!\?)`,ye.DEFAULT))throw Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let C=e.slice(b,h.index),k=x.slice(C.length+f.length),w=o.length,T=+g-1,L=Cl(C,k,T,!0,n,o,u);r=kl(r,C,T,o.length-w,w,u);let I=e.slice(0,b),O=e.slice(b+x.length);e=`${I}${L}${O}`,Rt.lastIndex+=L.length-f.length-C.length-k.length,l.forEach((A)=>A.hasRecursedWithin=!0),d=!0}else if(m)u++,a.set(String(u),Rt.lastIndex),a.set(m,Rt.lastIndex),l.push({num:u,name:m});else if(f[0]==="("){let S=f==="(";if(S)u++,a.set(String(u),Rt.lastIndex);l.push(S?{num:u}:{})}else if(f===")")l.pop()}else if(f==="]")c--}return n.push(...o),{pattern:e,captureTransfers:r,hiddenCaptures:n}}function bl(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw Error(t);if(e=+e,e<2||e>100)throw Error(t)}function Cl(e,t,n,i,r,o,s){let a=new Set;if(i)Mo(e+t,Fi,({groups:{captureName:d}})=>{a.add(d)},ye.DEFAULT);let l=[n,i?a:null,r,o,s];return`${e}${xl(`(?:${e}`,"forward",...l)}(?:)${xl(`${t})`,"backward",...l)}${t}`}function xl(e,t,n,i,r,o,s){let l=(c)=>t==="forward"?c+2:n-c+2-1,d="";for(let c=0;c<n;c++){let u=l(c);d+=Mn(e,Re`${wl}|\\k<(?<backref>[^>]+)>`,({0:h,groups:{captureName:f,unnamed:m,backref:y}})=>{if(y&&i&&!i.has(y))return h;let v=`_$${u}`;if(m||f){let g=s+o.length+1;return o.push(g),up(r,g),m?h:`(?<${f}${v}>`}return Re`\k<${y}${v}>`},ye.DEFAULT)}return d}function up(e,t){for(let n=0;n<e.length;n++)if(e[n]>=t)e[n]++}function kl(e,t,n,i,r,o){if(e.size&&i){let s=0;Mo(t,wl,()=>s++,ye.DEFAULT);let a=o-s+r,l=new Map;return e.forEach((d,c)=>{let u=(i-s*n)/n,h=s*n,f=c>a+s?c+i:c,m=[];for(let y of d)if(y<=a)m.push(y);else if(y>a+s+u)m.push(y+i);else if(y<=a+s)for(let v=0;v<=n;v++)m.push(y+s*v);else for(let v=0;v<=n;v++)m.push(y+h+u*v);l.set(f,m)}),l}return e}var{fromCodePoint:ne,raw:D}=String,De={},Oi=globalThis.RegExp;De.flagGroups=(()=>{try{new Oi("(?i:)")}catch{return!1}return!0})();De.unicodeSets=(()=>{try{new Oi("[[]]","v")}catch{return!1}return!0})();De.bugFlagVLiteralHyphenIsRange=De.unicodeSets?(()=>{try{new Oi(D`[\d\-a]`,"v")}catch{return!0}return!1})():!1;De.bugNestedClassIgnoresNegation=De.unicodeSets&&new Oi("[[^a]]","v").test("a");function _i(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Pn(e,t,n){if(!e.has(t))e.set(t,n);return e.get(t)}function Bo(e,t){return El[e]>=El[t]}function hp(e,t){if(e==null)throw Error(t??"Value expected");return e}var El={ES2025:2025,ES2024:2024,ES2018:2018},fp={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Ml(e={}){if({}.toString.call(e)!=="[object Object]")throw Error("Unexpected options");if(e.target!==void 0&&!fp[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}};if(t.target==="auto")t.target=De.flagGroups?"ES2025":De.unicodeSets?"ES2024":"ES2018";return t}var pp="[\t-\r ]",mp=new Set([ne(304),ne(305)]),Qe=D`[\p{L}\p{M}\p{N}\p{Pc}]`;function Hl(e){if(mp.has(e))return[e];let t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),r=Sp.get(n),o=gp.get(n),s=yp.get(n);if([...i].length===1)t.add(i);return s&&t.add(s),r&&t.add(r),t.add(n),o&&t.add(o),[...t]}var $o=new Map(`C Other
|
|
70
|
+
Cc Control cntrl
|
|
71
|
+
Cf Format
|
|
72
|
+
Cn Unassigned
|
|
73
|
+
Co Private_Use
|
|
74
|
+
Cs Surrogate
|
|
75
|
+
L Letter
|
|
76
|
+
LC Cased_Letter
|
|
77
|
+
Ll Lowercase_Letter
|
|
78
|
+
Lm Modifier_Letter
|
|
79
|
+
Lo Other_Letter
|
|
80
|
+
Lt Titlecase_Letter
|
|
81
|
+
Lu Uppercase_Letter
|
|
82
|
+
M Mark Combining_Mark
|
|
83
|
+
Mc Spacing_Mark
|
|
84
|
+
Me Enclosing_Mark
|
|
85
|
+
Mn Nonspacing_Mark
|
|
86
|
+
N Number
|
|
87
|
+
Nd Decimal_Number digit
|
|
88
|
+
Nl Letter_Number
|
|
89
|
+
No Other_Number
|
|
90
|
+
P Punctuation punct
|
|
91
|
+
Pc Connector_Punctuation
|
|
92
|
+
Pd Dash_Punctuation
|
|
93
|
+
Pe Close_Punctuation
|
|
94
|
+
Pf Final_Punctuation
|
|
95
|
+
Pi Initial_Punctuation
|
|
96
|
+
Po Other_Punctuation
|
|
97
|
+
Ps Open_Punctuation
|
|
98
|
+
S Symbol
|
|
99
|
+
Sc Currency_Symbol
|
|
100
|
+
Sk Modifier_Symbol
|
|
101
|
+
Sm Math_Symbol
|
|
102
|
+
So Other_Symbol
|
|
103
|
+
Z Separator
|
|
104
|
+
Zl Line_Separator
|
|
105
|
+
Zp Paragraph_Separator
|
|
106
|
+
Zs Space_Separator
|
|
107
|
+
ASCII
|
|
108
|
+
ASCII_Hex_Digit AHex
|
|
109
|
+
Alphabetic Alpha
|
|
110
|
+
Any
|
|
111
|
+
Assigned
|
|
112
|
+
Bidi_Control Bidi_C
|
|
113
|
+
Bidi_Mirrored Bidi_M
|
|
114
|
+
Case_Ignorable CI
|
|
115
|
+
Cased
|
|
116
|
+
Changes_When_Casefolded CWCF
|
|
117
|
+
Changes_When_Casemapped CWCM
|
|
118
|
+
Changes_When_Lowercased CWL
|
|
119
|
+
Changes_When_NFKC_Casefolded CWKCF
|
|
120
|
+
Changes_When_Titlecased CWT
|
|
121
|
+
Changes_When_Uppercased CWU
|
|
122
|
+
Dash
|
|
123
|
+
Default_Ignorable_Code_Point DI
|
|
124
|
+
Deprecated Dep
|
|
125
|
+
Diacritic Dia
|
|
126
|
+
Emoji
|
|
127
|
+
Emoji_Component EComp
|
|
128
|
+
Emoji_Modifier EMod
|
|
129
|
+
Emoji_Modifier_Base EBase
|
|
130
|
+
Emoji_Presentation EPres
|
|
131
|
+
Extended_Pictographic ExtPict
|
|
132
|
+
Extender Ext
|
|
133
|
+
Grapheme_Base Gr_Base
|
|
134
|
+
Grapheme_Extend Gr_Ext
|
|
135
|
+
Hex_Digit Hex
|
|
136
|
+
IDS_Binary_Operator IDSB
|
|
137
|
+
IDS_Trinary_Operator IDST
|
|
138
|
+
ID_Continue IDC
|
|
139
|
+
ID_Start IDS
|
|
140
|
+
Ideographic Ideo
|
|
141
|
+
Join_Control Join_C
|
|
142
|
+
Logical_Order_Exception LOE
|
|
143
|
+
Lowercase Lower
|
|
144
|
+
Math
|
|
145
|
+
Noncharacter_Code_Point NChar
|
|
146
|
+
Pattern_Syntax Pat_Syn
|
|
147
|
+
Pattern_White_Space Pat_WS
|
|
148
|
+
Quotation_Mark QMark
|
|
149
|
+
Radical
|
|
150
|
+
Regional_Indicator RI
|
|
151
|
+
Sentence_Terminal STerm
|
|
152
|
+
Soft_Dotted SD
|
|
153
|
+
Terminal_Punctuation Term
|
|
154
|
+
Unified_Ideograph UIdeo
|
|
155
|
+
Uppercase Upper
|
|
156
|
+
Variation_Selector VS
|
|
157
|
+
White_Space space
|
|
158
|
+
XID_Continue XIDC
|
|
159
|
+
XID_Start XIDS`.split(/\s/).map((e)=>[Yt(e),e])),gp=new Map([["s",ne(383)],[ne(383),"s"]]),yp=new Map([[ne(223),ne(7838)],[ne(107),ne(8490)],[ne(229),ne(8491)],[ne(969),ne(8486)]]),Sp=new Map([ct(453),ct(456),ct(459),ct(498),..._o(8072,8079),..._o(8088,8095),..._o(8104,8111),ct(8124),ct(8140),ct(8188)]),vp=new Map([["alnum",D`[\p{Alpha}\p{Nd}]`],["alpha",D`\p{Alpha}`],["ascii",D`\p{ASCII}`],["blank",D`[\p{Zs}\t]`],["cntrl",D`\p{Cc}`],["digit",D`\p{Nd}`],["graph",D`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",D`\p{Lower}`],["print",D`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",D`[\p{P}\p{S}]`],["space",D`\p{space}`],["upper",D`\p{Upper}`],["word",D`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",D`\p{AHex}`]]);function bp(e,t){let n=[];for(let i=e;i<=t;i++)n.push(i);return n}function ct(e){let t=ne(e);return[t.toLowerCase(),t]}function _o(e,t){return bp(e,t).map((n)=>ct(n))}var Pl=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Cp(e,t){let n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Nl(e);let i={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Bo(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};At(e,xp,i);let r={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:i.subroutineRefMap};At(e,kp,o);let s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return At(e,wp,s),e._originMap=o.groupOriginByCopy,e._strategy=i.strategy,e}var xp={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:i,kind:r}=e;if(r==="repeater"){let o=we();o.body[0].body.push(dt({negate:!0,body:i}),Tt("Any"));let s=we();s.body[0].body.push(Ro("greedy",0,1/0,o)),n(J(s,t),{traverse:!0})}else throw Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:i}){let r=e.body.filter((o)=>o.kind==="flags");for(let o=n+1;o<t.body.length;o++){let s=t.body[o];Pn(i,s,[]).push(...r)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Fl(t.get(e));if(n){let i=we({flags:n});i.body[0].body=e.body,e.body=[J(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:i,root:r,remove:o,replaceWith:s},a){let{kind:l,negate:d}=e,{asciiWordBoundaries:c,avoidSubclass:u,supportedGNodes:h,wordIsAscii:f}=a;if(l==="text_segment_boundary")throw Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);else if(l==="line_end")s(J(dt({body:[Ze({body:[Pi("string_end")]}),Ze({body:[Xt(10)]})]}),t));else if(l==="line_start")s(J(et(D`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(h.has(e))r.flags.sticky=!0,o();else{let m=i[n-1];if(m&&Ip(m))s(J(dt({negate:!0}),t));else if(u)throw Error(D`Uses "\G" in a way that requires a subclass`);else s(ut(Pi("string_start"),t)),a.strategy="clip_search"}else if(l==="string_end"||l==="string_start");else if(l==="string_end_newline")s(J(et(D`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!f&&!c){let m=`(?:(?<=${Qe})(?!${Qe})|(?<!${Qe})(?=${Qe}))`,y=`(?:(?<=${Qe})(?=${Qe})|(?<!${Qe})(?!${Qe}))`;s(J(et(d?y:m),t))}}else throw Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;if(typeof n==="string"&&!Uo(n))n=Oo(n,t),e.ref=n},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;if(i&&!Uo(i))i=Oo(i,t),e.name=i;if(n.set(e.number,e),i)n.set(i,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){let i=Rn({body:[e]});n(J(i,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:i,minTargetEs2024:r,digitIsAscii:o,spaceIsAscii:s,wordIsAscii:a}){let{kind:l,negate:d,value:c}=e;if(o&&(l==="digit"||c==="digit")){n(ut(Ni("digit",{negate:d}),t));return}if(s&&(l==="space"||c==="space")){n(J(zo(et(pp),d),t));return}if(a&&(l==="word"||c==="word")){n(ut(Ni("word",{negate:d}),t));return}if(l==="any")n(ut(Tt("Any"),t));else if(l==="digit")n(ut(Tt("Nd",{negate:d}),t));else if(l==="dot");else if(l==="text_segment"){if(i==="strict")throw Error(D`Use of "\X" requires non-strict accuracy`);let u="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=D`\p{RI}{2}|${u}(?:\u200D${u})*`;n(J(et(D`(?>\r\n|${r?D`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(ut(Tt("AHex",{negate:d}),t));else if(l==="newline")n(J(et(d?`[^
|
|
160
|
+
]`:`(?>\r
|
|
161
|
+
?|[
|
|
162
|
+
\v\f
\u2028\u2029])`),t));else if(l==="posix")if(!r&&(c==="graph"||c==="print")){if(i==="strict")throw Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let u={graph:"!-~",print:" -~"}[c];if(d)u=`\x00-${ne(u.codePointAt(0)-1)}${ne(u.codePointAt(2)+1)}-\uDBFF\uDFFF`;n(J(et(`[${u}]`),t))}else n(J(zo(et(vp.get(c)),d),t));else if(l==="property"){if(!$o.has(Yt(c)))e.key="sc"}else if(l==="space")n(ut(Tt("space",{negate:d}),t));else if(l==="word")n(J(zo(et(Qe),d),t));else throw Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:r,removeAllPrevSiblings:o,removeAllNextSiblings:s}){let{kind:a,flags:l}=e;if(a==="flags")if(!l.enable&&!l.disable)i();else{let d=we({flags:l});d.body[0].body=s(),r(J(d,t),{traverse:!0})}else if(a==="keep"){let d=n.body[0],u=n.body.length===1&&Ii(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==u||u.body.length>1)throw Error(D`Uses "\K" in a way that's unsupported`);let h=dt({behind:!0});h.body[0].body=o(),r(J(h,t))}else throw Error(`Unexpected directive kind "${a}"`)},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((n)=>delete e[n]),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;if(n==="lookbehind")t.passedLookbehind=!0},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:i}=e;if(i==="fail")n(J(dt({negate:!0}),t));else throw Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){let t=we();t.body[0].body.push(e.body),e.body=J(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],i=!1,r=!1;for(let o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{let s=Ol(o.body);if(s)i=!0,Array.isArray(s)?n.push(...s):n.push(s);else r=!0}if(i&&!r)n.forEach((o)=>t.add(o))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if(t==="strict"&&n&&i)throw Error(D`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;if(typeof n==="string"&&!Uo(n))n=Oo(n,t),e.ref=n}},kp={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:i,ref:r}=e;if(!i)n.set(e,[...t.get(r).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:r,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:a,reffedNodesByReferencer:l}){let d=r.get(e);if(d&&a.has(e.number)){let u=ut(Tl(e.number),t);l.set(u,a.get(e.number)),n(u);return}if(a.set(e.number,e),s.set(e.number,[]),e.name)Pn(s,e.name,[]);let c=s.get(e.name??e.number);for(let u=0;u<c.length;u++){let h=c[u];if(d===h.node||d&&d===h.origin||e===h.origin){c.splice(u,1);break}}if(s.get(e.number).push({node:e,origin:d}),e.name)s.get(e.name).push({node:e,origin:d});if(e.name){let u=Pn(o,e.name,new Map),h=!1;if(d)h=!0;else for(let f of u.values())if(!f.hasDuplicateNameToRemove){h=!0;break}o.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},exit({node:e},{openRefs:t}){if(t.get(e.number)===e)t.delete(e.number)}},Group:{enter({node:e},t){if(t.prevFlags=t.currentFlags,e.flags)t.currentFlags=_i(t.currentFlags,e.flags)},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){let{isRecursive:r,ref:o}=e;if(r){let c=t;while(c=c.parent)if(c.type==="CapturingGroup"&&(c.name===o||c.number===o))break;i.reffedNodesByReferencer.set(e,c);return}let s=i.subroutineRefMap.get(o),a=o===0,l=a?Tl(0):Dl(s,i.groupOriginByCopy,null),d=l;if(!a){let c=Fl(Tp(s,(h)=>h.type==="Group"&&!!h.flags)),u=c?_i(i.globalFlags,c):i.globalFlags;if(!Lp(u,i.currentFlags))d=we({flags:Ap(u)}),d.body[0].body.push(l)}n(J(d,t),{traverse:!a})}},wp={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}let o=i.reffedNodesByReferencer.get(e).filter((s)=>Ep(s,e));if(!o.length)n(J(dt({negate:!0}),t));else if(o.length>1){let s=we({atomic:!0,body:o.reverse().map((a)=>Ze({body:[Mi(a.number)]}))});n(J(s,t))}else e.ref=o[0].number},CapturingGroup({node:e},t){if(e.number=++t.numCapturesToLeft,e.name){if(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 i=0;i<n;i++){let r=Ao();e.body.at(-1).body.push(r)}}},Subroutine({node:e},t){if(!e.isRecursive||e.ref===0)return;e.ref=t.reffedNodesByReferencer.get(e).number}};function Nl(e){At(e,{"*"({node:t,parent:n}){t.parent=n}})}function Lp(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Ep(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;let i=_l(n.parent);for(let r of i){if(r===n)break;if(r===e||Ul(r,e))return!0}}while(n=n.parent);throw Error("Unexpected path")}function Dl(e,t,n,i){let r=Array.isArray(e)?[]:{};for(let[o,s]of Object.entries(e))if(o==="parent")r.parent=Array.isArray(n)?i:n;else if(s&&typeof s==="object")r[o]=Dl(s,t,r,n);else{if(o==="type"&&s==="CapturingGroup")t.set(r,t.get(e)??e);r[o]=s}return r}function Tl(e){let t=Io(e);return t.isRecursive=!0,t}function Tp(e,t){let n=[];while(e=e.parent)if(!t||t(e))n.push(e);return n}function Oo(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Fl(e){let t=["dotAll","ignoreCase"],n={enable:{},disable:{}};if(e.forEach(({flags:i})=>{t.forEach((r)=>{if(i.enable?.[r])delete n.disable[r],n.enable[r]=!0;if(i.disable?.[r])n.disable[r]=!0})}),!Object.keys(n.enable).length)delete n.enable;if(!Object.keys(n.disable).length)delete n.disable;if(n.enable||n.disable)return n;return null}function Ap({dotAll:e,ignoreCase:t}){let n={};if(e||t)n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0);if(!e||!t)n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0);return n}function _l(e){if(!e)throw Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Ol(e){let t=e.find((n)=>n.kind==="search_start"||Mp(n,{negate:!1})||!Rp(n));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 n=[];for(let i of t.body){let r=Ol(i.body);if(!r)return null;Array.isArray(r)?n.push(...r):n.push(r)}return n}return null}function Ul(e,t){let n=_l(e)??[];for(let i of n)if(i===t||Ul(i,t))return!0;return!1}function Rp({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Ip(e){let t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Mp(e,t){let n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Ii(e.body[0],{type:"Assertion",kind:"search_start"})}function Uo(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function et(e,t){let i=Hi(e,{...t,unicodePropertyMap:$o}).body;if(i.length>1||i[0].body.length>1)return we({body:i});return i[0].body[0]}function zo(e,t){return e.negate=t,e}function ut(e,t){return e.parent=t,e}function J(e,t){return Nl(e),e.parent=t,e}function Hp(e,t){let n=Ml(t),i=Bo(n.target,"ES2024"),r=Bo(n.target,"ES2025"),o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw Error("Invalid recursionLimit; use 2-20");let s=null,a=null;if(!r){let f=[e.flags.ignoreCase];At(e,Pp,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(m){f.push(m)},setHasCasedChar(){if(f.at(-1))s=!0;else a=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!a)},d=e,c={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!r&&s&&a),useFlagMods:r,useFlagV:i,verbose:n.verbose};function u(f){return c.lastNode=d,d=f,hp(Np[f.type],`Unexpected node type "${f.type}"`)(f,c,u)}let h={pattern:e.body.map(u).join("|"),flags:u(e.flags),options:{...e.options}};if(!i)delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null;return h._captureTransfers=new Map,h._hiddenCaptures=[],c.captureMap.forEach((f,m)=>{if(f.hidden)h._hiddenCaptures.push(m);if(f.transferTo)Pn(h._captureTransfers,f.transferTo,[]).push(m)}),h}var Pp={"*":{enter({node:e},t){if(Rl(e)){let n=t.getCurrentModI();t.pushModI(e.flags?_i({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){if(Rl(e))t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){if(Vo(ne(e.value)))t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){if(t(),zl(e,{firstOnly:!0}).length)n.setHasCasedChar()},CharacterSet({node:e},t){if(e.kind==="property"&&Pl.has(e.value))t.setHasCasedChar()}},Np={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?D`\B`:D`\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:i,name:r,number:o}=e,s={ignoreCase:t.currentFlags.ignoreCase},a=t.originMap.get(e);if(a){if(s.hidden=!0,o>a.number)s.transferTo=a.number}return t.captureMap.set(o,s),`(${r?`?<${r}>`:""}${i.map(n).join("|")})`},Character({value:e},t){let n=ne(e),i=Zt(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Vo(n)){let r=Hl(n);return t.inCharClass?r.join(""):r.length>1?`[${r.join("")}]`:r[0]}return n},CharacterClass(e,t,n){let{kind:i,negate:r,parent:o}=e,{body:s}=e;if(i==="intersection"&&!t.useFlagV)throw Error("Use of character class intersection requires min target ES2024");if(De.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(Il))s=[Xt(45),...s.filter((d)=>!Il(d))];let a=()=>`[${r?"^":""}${s.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||De.bugNestedClassIgnoresNegation)&&!r){let c=s.filter((u)=>u.type==="CharacterClass"&&u.kind==="union"&&u.negate);if(c.length){let u=we(),h=u.body[0];if(u.parent=o,h.parent=u,s=s.filter((f)=>!c.includes(f)),e.body=s,s.length)e.parent=h,h.body.push(e);else u.body.pop();return c.forEach((f)=>{let m=Ze({body:[f]});f.parent=m,m.parent=u,u.body.push(m)}),n(u)}}t.inCharClass=!0;let d=a();return t.inCharClass=!1,d}let l=s[0];if(i==="union"&&!r&&l&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(De.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&s.length===1&&l.type!=="CharacterClassRange"))return s.map(n).join("");if(!t.useFlagV&&o.type==="CharacterClass")throw Error("Uses nested character class in a way that requires min target ES2024");return a()},CharacterClassRange(e,t){let n=e.min.value,i=e.max.value,r={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=Zt(n,r),s=Zt(i,r),a=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){let l=zl(e);Up(l).forEach((c)=>{a.add(Array.isArray(c)?`${Zt(c[0],r)}-${Zt(c[1],r)}`:Zt(c,r))})}return`${o}-${s}${[...a].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},r){if(e==="dot")return r.currentFlags.dotAll?r.appliedGlobalFlags.dotAll||r.useFlagMods?".":"[^]":D`[^\n]`;if(e==="digit")return t?D`\D`:D`\d`;if(e==="property"){if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&Pl.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?D`\P`:D`\p`}{${i?`${i}=`:""}${n}}`}if(e==="word")return t?D`\W`:D`\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:i},r,o){let s=r.currentFlags;if(n)r.currentFlags=_i(s,n);let a=t.map(o).join("|"),l=!r.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!r.useFlagMods||!n)?a:`(?${zp(e,n,r.useFlagMods)}${a})`;return r.currentFlags=s,l},LookaroundAssertion({body:e,kind:t,negate:n},i,r){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(r).join("|")})`},Quantifier(e,t,n){return n(e.body)+Bp(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error("Unexpected non-recursive subroutine in transformed AST");let i=n.recursionLimit;return t===0?`(?R=${i})`:D`\g<${t}&R=${i}>`}},Dp=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Fp=new Set(["-","\\","]","^","["]),_p=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Al=new Map([[9,D`\t`],[10,D`\n`],[11,D`\v`],[12,D`\f`],[13,D`\r`],[8232,D`\u2028`],[8233,D`\u2029`],[65279,D`\uFEFF`]]),Op=/^\p{Cased}$/u;function Vo(e){return Op.test(e)}function zl(e,t){let n=!!t?.firstOnly,i=e.min.value,r=e.max.value,o=[];if(i<65&&(r===65535||r>=131071)||i===65536&&r>=131071)return o;for(let s=i;s<=r;s++){let a=ne(s);if(!Vo(a))continue;let l=Hl(a).filter((d)=>{let c=d.codePointAt(0);return c<i||c>r});if(l.length){if(o.push(...l),n)break}}return o}function Zt(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(Al.has(e))return Al.get(e);if(e<32||e>126&&e<160||e>262143||t&&$p(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let r=n?i?_p:Fp:Dp,o=ne(e);return(r.has(o)?"\\":"")+o}function Up(e){let t=e.map((r)=>r.codePointAt(0)).sort((r,o)=>r-o),n=[],i=null;for(let r=0;r<t.length;r++)if(t[r+1]===t[r]+1)i??=t[r];else if(i===null)n.push(t[r]);else n.push([i,t[r]]),i=null;return n}function zp(e,t,n){if(e)return">";let i="";if(t&&n){let{enable:r,disable:o}=t;i=(r?.ignoreCase?"i":"")+(r?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${i}:`}function Bp({kind:e,max:t,min:n}){let i;if(!n&&t===1)i="?";else if(!n&&t===1/0)i="*";else if(n===1&&t===1/0)i="+";else if(n===t)i=`{${n}}`;else i=`{${n},${t===1/0?"":t}}`;return i+{greedy:"",lazy:"?",possessive:"+"}[e]}function Rl({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function $p(e){return e>47&&e<58}function Il({type:e,value:t}){return e==="Character"&&t===45}var Vp=class e extends RegExp{#t=new Map;#e=null;#i;#n=null;#r=null;rawOptions={};get source(){return this.#i||"(?:)"}constructor(t,n,i){let r=!!i?.lazyCompile;if(t instanceof RegExp){if(i)throw Error("Cannot provide options when copying a regexp");let o=t;super(o,n);if(this.#i=o.source,o instanceof e)this.#t=o.#t,this.#n=o.#n,this.#r=o.#r,this.rawOptions=o.rawOptions}else{let o={hiddenCaptures:[],strategy:null,transfers:[],...i};super(r?"":t,n);this.#i=t,this.#t=Wp(o.hiddenCaptures,o.transfers),this.#r=o.strategy,this.rawOptions=i??{}}if(!r)this.#e=this}exec(t){if(!this.#e){let{lazyCompile:r,...o}=this.rawOptions;this.#e=new e(this.#i,this.flags,o)}let n=this.global||this.sticky,i=this.lastIndex;if(this.#r==="clip_search"&&n&&i){this.lastIndex=0;let r=this.#o(t.slice(i));if(r)Gp(r,i,t,this.hasIndices),this.lastIndex+=i;return r}return this.#o(t)}#o(t){this.#e.lastIndex=this.lastIndex;let n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;let i=[...n];n.length=1;let r;if(this.hasIndices)r=[...n.indices],n.indices.length=1;let o=[0];for(let s=1;s<i.length;s++){let{hidden:a,transferTo:l}=this.#t.get(s)??{};if(a)o.push(null);else if(o.push(n.length),n.push(i[s]),this.hasIndices)n.indices.push(r[s]);if(l&&i[s]!==void 0){let d=o[l];if(!d)throw Error(`Invalid capture transfer to "${d}"`);if(n[d]=i[s],this.hasIndices)n.indices[d]=r[s];if(n.groups){if(!this.#n)this.#n=jp(this.source);let c=this.#n.get(l);if(c){if(n.groups[c]=i[s],this.hasIndices)n.indices.groups[c]=r[s]}}}}return n}};function Gp(e,t,n,i){if(e.index+=t,e.input=n,i){let r=e.indices;for(let s=0;s<r.length;s++){let a=r[s];if(a)r[s]=[a[0]+t,a[1]+t]}let o=r.groups;if(o)Object.keys(o).forEach((s)=>{let a=o[s];if(a)o[s]=[a[0]+t,a[1]+t]})}}function Wp(e,t){let n=new Map;for(let i of e)n.set(i,{hidden:!0});for(let[i,r]of t)for(let o of r)Pn(n,o,{}).transferTo=i;return n}function jp(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,i=0,r=0,o;while(o=t.exec(e)){let{0:s,groups:{capture:a,name:l}}=o;if(s==="[")i++;else if(!i){if(a){if(r++,l)n.set(r,l)}}else if(s==="]")i--}return n}function Bl(e,t){let n=qp(e,t);if(n.options)return new Vp(n.pattern,n.flags,n.options);return new RegExp(n.pattern,n.flags)}function qp(e,t){let n=Ml(t),i=Hi(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:$o}),r=Cp(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=Hp(r,n),s=Ll(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),a=No(s.pattern),l=Po(a.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),d={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error("Lazy compilation requires subclass")}else{let c=l.hiddenCaptures.sort((m,y)=>m-y),u=Array.from(l.captureTransfers),h=r._strategy,f=d.pattern.length>=n.lazyCompileLength;if(c.length||u.length||h||f)d.options={...c.length&&{hiddenCaptures:c},...u.length&&{transfers:u},...h&&{strategy:h},...f&&{lazyCompile:f}}}return d}function Go(e,t){return Bl(e,{global:!0,hasIndices:!0,lazyCompileLength:3000,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Ui(e={}){let t={target:"auto",cache:new Map,...e};return t.regexConstructor||=(n)=>Go(n,{target:t.target}),{createScanner(n){return new Xa(n,t)},createString(n){return{content:n}}}}async function $l(e){if(oi())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=ri.get(e);if(t!=null)return t;try{let n=zs.get(e);if(n==null&&Object.prototype.hasOwnProperty.call($t,e))n=$t[e];if(n==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let i=n().then(({default:r})=>{let o={name:e,data:r};if(!je.has(e))je.set(e,o);return o});return ri.set(e,i),await i}finally{ri.delete(e)}}function Vl(e){return je.get(e)??$l(e)}function zi(e){return e!==null&&typeof e==="object"&&"default"in e?e.default:e}var Gl=class extends Error{constructor(e){super(`Theme "${e}" is already registered`);this.name="DuplicateThemeError"}},Wl=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`);this.name="UnregisteredThemeError"}},jl=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`);this.name="UnresolvedThemeError"}};function Wo(){let e=new Map,t=new Map,n=new Map,i=0;function r(g,S){if(e.has(g))throw new Gl(g);e.set(g,S)}function o(g,S){if(e.has(g))return!1;return e.set(g,S),!0}function s(g){return e.has(g)}function a(g){let S=t.get(g);if(S!==void 0)return Promise.resolve(S);let b=n.get(g);if(b!==void 0)return b;let x=e.get(g);if(x===void 0)return Promise.reject(new Wl(g));let C=i,k=x().then((w)=>{let T=zi(w);if(C===i)t.set(g,T);if(n.get(g)===k)n.delete(g);return T}).catch((w)=>{if(n.get(g)===k)n.delete(g);throw w});return n.set(g,k),k}function l(g){return Promise.all(g.map((S)=>a(S)))}function d(g,S){t.set(g,S)}function c(g){for(let[S,b]of g)d(S,b)}function u(g){return t.get(g)}function h(g){let S=[];for(let b of g){let x=t.get(b);if(x===void 0)throw new jl(b);S.push(x)}return S}function f(g){return t.has(g)}function m(g){for(let S of g)if(!t.has(S))return!1;return!0}function y(g){let S=t.get(g);if(S!==void 0)return S;return a(g)}function v(){i++,t.clear(),n.clear()}return{clearResolvedThemes:v,getResolvedOrResolveTheme:y,getResolvedTheme:u,getResolvedThemes:h,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:m,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:a,resolveThemes:l,seedResolvedTheme:d,seedResolvedThemes:c}}var de=Wo();var Qt=new Set;function jo(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n==="string"){if(i=de.getResolvedTheme(n),i==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else if(i=n,n=n.name,de.getResolvedTheme(n)==null)de.seedResolvedTheme(n,i);if(Qt.has(n))continue;Qt.add(n),t.loadThemeSync(i)}}function ht(e){let t=[],n=new Set;for(let u of Kp(e.themes)){let h=ql(u)?u.getThemes():[u];for(let f of h){if(n.has(f.name))throw Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}let i=Object.freeze([...t]),r=Object.freeze(i.filter((u)=>u.colorScheme==="light")),o=Object.freeze(i.filter((u)=>u.colorScheme==="dark")),s=new Map(i.map((u)=>[u.name,u])),a=Object.freeze(i.map((u)=>u.name)),l=Object.freeze(r.map((u)=>u.name)),d=Object.freeze(o.map((u)=>u.name));function c(u){if(u==null)return i;let{colorScheme:h,collection:f}=u;if(f==null){if(h==="light")return r;if(h==="dark")return o;return i}return i.filter((m)=>{if(m.collection!==f)return!1;return h==null||m.colorScheme===h})}return{getTheme(u){return s.get(u)},getThemes(u){return c(u)},getThemeNames(u){if(u?.collection==null){if(u?.colorScheme==="light")return l;if(u?.colorScheme==="dark")return d;return a}return c(u).map((h)=>h.name)},hasTheme(u){return s.has(u)},orderBy(u){return ht({themes:i.map((h,f)=>({descriptor:h,index:f})).sort((h,f)=>{let m=u(h.descriptor,f.descriptor);if(m!==0)return m;return h.index-f.index}).map((h)=>h.descriptor)})},pick(u){let h=[],f=new Set;for(let m of u){if(f.has(m))throw Error(`Theme collection pick already includes theme "${m}"`);f.add(m);let y=s.get(m);if(y==null)throw Error(`Theme collection does not contain theme "${m}"`);h.push(y)}return ht({themes:h})},registerInto(u){for(let h of i)u.registerThemeIfAbsent(h.name,h.load)}}}function Kp(e){if(Xp(e))return[e];return e}function Xp(e){return ql(e)||Yp(e)}function Yp(e){return typeof e.name==="string"&&typeof e.load==="function"}function ql(e){return typeof e.getThemes==="function"}function Nn({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:Jp(t)}}function Jp(e){return async()=>Gt(zi(await e()))}var Zp="pierre",Qp=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],Kl=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],em=[...Kl,...Qp],tm=new Set(Kl);function nm(e){if(tm.has(e))return"light";return"dark"}var im={"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"},rm={"pierre-dark":()=>import("./pierre-dark-2sng8cw6.js"),"pierre-dark-soft":()=>import("./pierre-dark-soft-xpc8stwc.js"),"pierre-dark-vibrant":()=>import("./pierre-dark-vibrant-dtc0vftx.js"),"pierre-dark-protanopia-deuteranopia":()=>import("./pierre-dark-protanopia-deuteranopia-615mrd5v.js"),"pierre-dark-tritanopia":()=>import("./pierre-dark-tritanopia-nw71c9hw.js"),"pierre-light":()=>import("./pierre-light-mtkcs9xq.js"),"pierre-light-soft":()=>import("./pierre-light-soft-f0vxkd08.js"),"pierre-light-vibrant":()=>import("./pierre-light-vibrant-y1syd51f.js"),"pierre-light-protanopia-deuteranopia":()=>import("./pierre-light-protanopia-deuteranopia-d84wh0sh.js"),"pierre-light-tritanopia":()=>import("./pierre-light-tritanopia-prpe8fpj.js")};function om(e){return Nn({name:e,collection:Zp,colorScheme:nm(e),displayName:im[e],load:rm[e]})}var Bi=ht({themes:em.map((e)=>om(e))});var sm="shiki",Yl=["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"],am=["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"],lm=new Set(Yl);function dm(e){if(lm.has(e))return"light";return"dark"}var cm={andromeeda:()=>import("./andromeeda-zy6mvqwb.js"),"aurora-x":()=>import("./aurora-x-gp6v3669.js"),"ayu-dark":()=>import("./ayu-dark-hbtcbdtr.js"),"ayu-light":()=>import("./ayu-light-m7rwwssv.js"),"ayu-mirage":()=>import("./ayu-mirage-5z71k1jj.js"),"catppuccin-frappe":()=>import("./catppuccin-frappe-05b7n5ms.js"),"catppuccin-latte":()=>import("./catppuccin-latte-c7x59n84.js"),"catppuccin-macchiato":()=>import("./catppuccin-macchiato-xq6zfjrk.js"),"catppuccin-mocha":()=>import("./catppuccin-mocha-xreqmgt9.js"),"dark-plus":()=>import("./dark-plus-zvzcxs8s.js"),dracula:()=>import("./dracula-6abcnchd.js"),"dracula-soft":()=>import("./dracula-soft-zyfsdrw6.js"),"everforest-dark":()=>import("./everforest-dark-g7rhmq33.js"),"everforest-light":()=>import("./everforest-light-spn7qghr.js"),"github-dark":()=>import("./github-dark-r3j6b7er.js"),"github-dark-default":()=>import("./github-dark-default-q5m3jmep.js"),"github-dark-dimmed":()=>import("./github-dark-dimmed-0v34f529.js"),"github-dark-high-contrast":()=>import("./github-dark-high-contrast-62grsqa6.js"),"github-light":()=>import("./github-light-z1qp6zt5.js"),"github-light-default":()=>import("./github-light-default-xgca5we2.js"),"github-light-high-contrast":()=>import("./github-light-high-contrast-0ee3g9rt.js"),"gruvbox-dark-hard":()=>import("./gruvbox-dark-hard-0zvxnx0e.js"),"gruvbox-dark-medium":()=>import("./gruvbox-dark-medium-qvjwy81n.js"),"gruvbox-dark-soft":()=>import("./gruvbox-dark-soft-mhtpt38s.js"),"gruvbox-light-hard":()=>import("./gruvbox-light-hard-nrwjbbts.js"),"gruvbox-light-medium":()=>import("./gruvbox-light-medium-qbwkw432.js"),"gruvbox-light-soft":()=>import("./gruvbox-light-soft-rmkm778k.js"),horizon:()=>import("./horizon-fm23m9qj.js"),"horizon-bright":()=>import("./horizon-bright-9s4tt51x.js"),houston:()=>import("./houston-fx2psmvq.js"),"kanagawa-dragon":()=>import("./kanagawa-dragon-fbqq2bhk.js"),"kanagawa-lotus":()=>import("./kanagawa-lotus-zgxv1mgm.js"),"kanagawa-wave":()=>import("./kanagawa-wave-wedn0ksa.js"),laserwave:()=>import("./laserwave-2fz4nxs5.js"),"light-plus":()=>import("./light-plus-5tghbj4b.js"),"material-theme":()=>import("./material-theme-p7k291d1.js"),"material-theme-darker":()=>import("./material-theme-darker-fnv6smqw.js"),"material-theme-lighter":()=>import("./material-theme-lighter-35th362e.js"),"material-theme-ocean":()=>import("./material-theme-ocean-4dq3ahw3.js"),"material-theme-palenight":()=>import("./material-theme-palenight-yhd4pmvh.js"),"min-dark":()=>import("./min-dark-rtx0tqrz.js"),"min-light":()=>import("./min-light-5m66fg5h.js"),monokai:()=>import("./monokai-79awbcqn.js"),"night-owl":()=>import("./night-owl-y5p2e2yz.js"),"night-owl-light":()=>import("./night-owl-light-05jd94v7.js"),nord:()=>import("./nord-akta5pm4.js"),"one-dark-pro":()=>import("./one-dark-pro-pbp84hvh.js"),"one-light":()=>import("./one-light-jpadzfmm.js"),plastic:()=>import("./plastic-5dg6r26t.js"),poimandres:()=>import("./poimandres-p8seewrs.js"),red:()=>import("./red-tkj5bw1z.js"),"rose-pine":()=>import("./rose-pine-vgbee1jh.js"),"rose-pine-dawn":()=>import("./rose-pine-dawn-apmj5y1p.js"),"rose-pine-moon":()=>import("./rose-pine-moon-mgx7zgjy.js"),"slack-dark":()=>import("./slack-dark-ntnagayj.js"),"slack-ochin":()=>import("./slack-ochin-kge218j8.js"),"snazzy-light":()=>import("./snazzy-light-57mzezsa.js"),"solarized-dark":()=>import("./solarized-dark-0r80rpr7.js"),"solarized-light":()=>import("./solarized-light-1e0p6z46.js"),"synthwave-84":()=>import("./synthwave-84-007ndkbp.js"),"tokyo-night":()=>import("./tokyo-night-rvkd4sna.js"),vesper:()=>import("./vesper-005phtef.js"),"vitesse-black":()=>import("./vitesse-black-sxfaa2kz.js"),"vitesse-dark":()=>import("./vitesse-dark-fhxvesec.js"),"vitesse-light":()=>import("./vitesse-light-cygqrsgb.js")};function Xl(e){return Nn({name:e,collection:sm,colorScheme:dm(e),load:cm[e]})}var $i=ht({themes:Object.freeze([...Yl.map((e)=>Xl(e)),...am.map((e)=>Xl(e))])});var LC=ht({themes:[Bi,$i]});function Jl(e){if(oi())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(de.hasRegisteredTheme(e))return;let t=$i.getTheme(e);if(t!=null){de.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function Zl(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Ql(e){Jl(e);let t=await de.resolveTheme(e);return Zl(e,t),t}function ed(e){return de.getResolvedTheme(e)??Ql(e)}var ze;async function en({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){ze??=Ai({themes:[],langs:["text"],engine:n==="shiki-wasm"?ci(import("./wasm-eftreyx0.js")):Ui()});let i=td(ze)?await ze:ze;ze=i;let r=[];for(let s of t){if(s==="text"||s==="ansi")continue;let a=Vl(s);if("then"in a)r.push(a);else Xr(a,i)}let o=[];for(let s of e){let a=ed(s);if("then"in a)o.push(a);else jo(a,ze)}if(r.length>0||o.length>0)await Promise.all([Promise.all(r).then((s)=>{Xr(s,i)}),Promise.all(o).then((s)=>{jo(s,i)})]);return i}function Dn(){if(ze!=null&&!("then"in ze))return ze}function td(e=ze){return e!=null&&"then"in e}async function um(e){await en(e)}for(let e of Bi.getThemes())de.registerThemeIfAbsent(e.name,e.load);function nd(e,t){if(e==null||t==null)return e===t;if(e.header!==t.header||e.footer!==t.footer)return!1;return hm(e.items,t.items)}function hm(e,t){if(e==null||t==null)return e===t;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(i==null||r==null||i.id!==r.id||i.type!==r.type||i.element!==r.element||i.instance!==r.instance||i.version!==r.version)return!1}return!0}function Be(e,t,n){if(e===t||e==null||t==null)return e===t;let i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(let s of r){if(o.delete(s),i.has(s))continue;if(!(s in t)||e[s]!==t[s])return!1}for(let s of Array.from(o))if(!i.has(s))return!1;return!0}function Ie(e,t){if(e==null||t==null||typeof e==="string"||typeof t==="string")return e===t;return e.dark===t.dark&&e.light===t.light}function tn(e,t){let n=e?.theme??z,i=t?.theme??z,r=id(e),o=id(t);return Ie(n,i)&&Be(e,t,["theme","parseDiffOptions"])&&Be(r,o)}function id(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function nn(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function sd(e,t,n){let i=document.createElement("div");if(i.style.display="flow-root",e==="header")i.setAttribute(rd,""),t.before(i);else i.setAttribute(od,""),t.after(i);return n?.observe(i),i}function ad({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){let s=n+o*2,a=i?n+r*2:s;if(t=Math.max(t,a),s>=t||i){let c=Math.max(e-r,0),u=Math.min(e+a,t);return{top:c,bottom:Math.max(u,c)}}let l=e+n/2-s/2,d=l+s;if(l<0)l=0;if(d>t)d=t;return l=Math.floor(Math.max(l,0)),{top:l,bottom:Math.ceil(Math.max(Math.min(d,t),l))}}class tt{diff(e,t,n={}){let i;if(typeof n==="function")i=n,n={};else if("callback"in n)i=n.callback;let r=this.castInput(e,n),o=this.castInput(t,n),s=this.removeEmpty(this.tokenize(r,n)),a=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(s,a,n,i)}diffWithOptionsObj(e,t,n,i){var r;let o=(g)=>{if(g=this.postProcess(g,n),i){setTimeout(function(){i(g)},0);return}else return g},s=t.length,a=e.length,l=1,d=s+a;if(n.maxEditLength!=null)d=Math.min(d,n.maxEditLength);let c=(r=n.timeout)!==null&&r!==void 0?r:1/0,u=Date.now()+c,h=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(h[0],t,e,0,n);if(h[0].oldPos+1>=a&&f+1>=s)return o(this.buildValues(h[0].lastComponent,t,e));let m=-1/0,y=1/0,v=()=>{for(let g=Math.max(m,-l);g<=Math.min(y,l);g+=2){let S,b=h[g-1],x=h[g+1];if(b)h[g-1]=void 0;let C=!1;if(x){let w=x.oldPos-g;C=x&&0<=w&&w<s}let k=b&&b.oldPos+1<a;if(!C&&!k){h[g]=void 0;continue}if(!k||C&&b.oldPos<x.oldPos)S=this.addToPath(x,!0,!1,0,n);else S=this.addToPath(b,!1,!0,1,n);if(f=this.extractCommon(S,t,e,g,n),S.oldPos+1>=a&&f+1>=s)return o(this.buildValues(S.lastComponent,t,e))||!0;else{if(h[g]=S,S.oldPos+1>=a)y=Math.min(y,g-1);if(f+1>=s)m=Math.max(m,g+1)}}l++};if(i)(function g(){setTimeout(function(){if(l>d||Date.now()>u)return i(void 0);if(!v())g()},0)})();else while(l<=d&&Date.now()<=u){let g=v();if(g)return g}}addToPath(e,t,n,i,r){let o=e.lastComponent;if(o&&!r.oneChangePerToken&&o.added===t&&o.removed===n)return{oldPos:e.oldPos+i,lastComponent:{count:o.count+1,added:t,removed:n,previousComponent:o.previousComponent}};else return{oldPos:e.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:o}}}extractCommon(e,t,n,i,r){let o=t.length,s=n.length,a=e.oldPos,l=a-i,d=0;while(l+1<o&&a+1<s&&this.equals(n[a+1],t[l+1],r))if(l++,a++,d++,r.oneChangePerToken)e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1};if(d&&!r.oneChangePerToken)e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1};return e.oldPos=a,l}equals(e,t,n){if(n.comparator)return n.comparator(e,t);else return e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)if(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 i=[],r;while(e)i.push(e),r=e.previousComponent,delete e.previousComponent,e=r;i.reverse();let o=i.length,s=0,a=0,l=0;for(;s<o;s++){let d=i[s];if(!d.removed){if(!d.added&&this.useLongestToken){let c=t.slice(a,a+d.count);c=c.map(function(u,h){let f=n[l+h];return f.length>u.length?f:u}),d.value=this.join(c)}else d.value=this.join(t.slice(a,a+d.count));if(a+=d.count,!d.added)l+=d.count}else d.value=this.join(n.slice(l,l+d.count)),l+=d.count}return i}}class ld extends tt{}var dd=new ld;function qo(e,t,n){return dd.diff(e,t,n)}function Ko(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 Xo(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 Vi(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 Gi(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 rn(e,t){return Vi(e,t,"")}function Fn(e,t){return Gi(e,t,"")}function Yo(e,t){return t.slice(0,fm(e,t))}function fm(e,t){let n=0;if(e.length>t.length)n=e.length-t.length;let i=t.length;if(e.length<t.length)i=e.length;let r=Array(i),o=0;r[0]=0;for(let s=1;s<i;s++){if(t[s]==t[o])r[s]=r[o];else r[s]=o;while(o>0&&t[s]!=t[o])o=r[o];if(t[s]==t[o])o++}o=0;for(let s=n;s<e.length;s++){while(o>0&&e[s]!=t[o])o=r[o];if(e[s]==t[o])o++}return o}function Jo(e,t){let n=[];for(let i of Array.from(t.segment(e))){let r=i.segment;if(n.length&&/\s/.test(n[n.length-1])&&/\s/.test(r))n[n.length-1]+=r;else n.push(r)}return n}function Wi(e,t){if(t)return on(e,t)[1];let n;for(n=e.length-1;n>=0;n--)if(!e[n].match(/\s/))break;return e.substring(n+1)}function It(e,t){if(t)return on(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:""}function on(e,t){if(!t)return[It(e),Wi(e)];if(t.resolvedOptions().granularity!="word")throw Error('The segmenter passed must have a granularity of "word"');let n=Jo(e,t),i=n[0],r=n[n.length-1],o=/\s/.test(i)?i:"",s=/\s/.test(r)?r:"";return[o,s]}var ji="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}",pm=new RegExp(`[${ji}]+|\\s+|[^${ji}]`,"ug");class ud extends tt{equals(e,t,n){if(n.ignoreCase)e=e.toLowerCase(),t=t.toLowerCase();return e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let o=t.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw Error('The segmenter passed must have a granularity of "word"');n=Jo(e,o)}else n=e.match(pm)||[];let i=[],r=null;return n.forEach((o)=>{if(/\s/.test(o))if(r==null)i.push(o);else i.push(i.pop()+o);else if(r!=null&&/\s/.test(r))if(i[i.length-1]==r)i.push(i.pop()+o);else i.push(r+o);else i.push(o);r=o}),i}join(e){return e.map((t,n)=>{if(n==0)return t;else return t.replace(/^\s+/,"")}).join("")}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,i=null,r=null;if(e.forEach((o)=>{if(o.added)i=o;else if(o.removed)r=o;else{if(i||r)cd(n,r,i,o,t.intlSegmenter);n=o,i=null,r=null}}),i||r)cd(n,r,i,null,t.intlSegmenter);return e}}var mm=new ud;function cd(e,t,n,i,r){if(t&&n){let[o,s]=on(t.value,r),[a,l]=on(n.value,r);if(e){let d=Ko(o,a);e.value=Gi(e.value,a,d),t.value=rn(t.value,d),n.value=rn(n.value,d)}if(i){let d=Xo(s,l);i.value=Vi(i.value,l,d),t.value=Fn(t.value,d),n.value=Fn(n.value,d)}}else if(n){if(e){let o=It(n.value,r);n.value=n.value.substring(o.length)}if(i){let o=It(i.value,r);i.value=i.value.substring(o.length)}}else if(e&&i){let o=It(i.value,r),[s,a]=on(t.value,r),l=Ko(o,s);t.value=rn(t.value,l);let d=Xo(rn(o,l),a);t.value=Fn(t.value,d),i.value=Vi(i.value,o,d),e.value=Gi(e.value,o,o.slice(0,o.length-d.length))}else if(i){let o=It(i.value,r),s=Wi(t.value,r),a=Yo(s,o);t.value=Fn(t.value,a)}else if(e){let o=Wi(e.value,r),s=It(t.value,r),a=Yo(o,s);t.value=rn(t.value,a)}}class hd extends tt{tokenize(e){let t=new RegExp(`(\\r?\\n)|[${ji}]+|[^\\S\\n\\r]+|[^${ji}]`,"ug");return e.match(t)||[]}}var fd=new hd;function Zo(e,t,n){return fd.diff(e,t,n)}class pd extends tt{constructor(){super(...arguments);this.tokenize=ym}equals(e,t,n){if(n.ignoreWhitespace){if(!n.newlineIsToken||!e.includes(`
|
|
163
|
+
`))e=e.trim();if(!n.newlineIsToken||!t.includes(`
|
|
164
|
+
`))t=t.trim()}else if(n.ignoreNewlineAtEof&&!n.newlineIsToken){if(e.endsWith(`
|
|
165
|
+
`))e=e.slice(0,-1);if(t.endsWith(`
|
|
166
|
+
`))t=t.slice(0,-1)}return super.equals(e,t,n)}}var gm=new pd;function Qo(e,t,n){return gm.diff(e,t,n)}function ym(e,t){if(t.stripTrailingCr)e=e.replace(/\r\n/g,`
|
|
167
|
+
`);let n=[],i=e.split(/(\n|\r\n)/);if(!i[i.length-1])i.pop();for(let r=0;r<i.length;r++){let o=i[r];if(r%2&&!t.newlineIsToken)n[n.length-1]+=o;else n.push(o)}return n}function Sm(e){for(let t=0;t<e.length;t++)if(e[t]<" "||e[t]>"~"||e[t]==='"'||e[t]==="\\")return!0;return!1}function ft(e){if(!Sm(e))return e;let t='"',n=new TextEncoder().encode(e),i=0;while(i<n.length){let r=n[i];if(r===7)t+="\\a";else if(r===8)t+="\\b";else if(r===9)t+="\\t";else if(r===10)t+="\\n";else if(r===11)t+="\\v";else if(r===12)t+="\\f";else if(r===13)t+="\\r";else if(r===34)t+="\\\"";else if(r===92)t+="\\\\";else if(r>=32&&r<=126)t+=String.fromCharCode(r);else t+="\\"+r.toString(8).padStart(3,"0");i++}return t+='"',t}var es={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function ts(e,t,n,i,r,o,s){let a;if(!s)a={};else if(typeof s==="function")a={callback:s};else a=s;if(typeof a.context>"u")a.context=4;let l=a.context;if(a.newlineIsToken)throw Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(!a.callback)return d(Qo(n,i,a));else{let{callback:c}=a;Qo(n,i,Object.assign(Object.assign({},a),{callback:(u)=>{let h=d(u);c(h)}}))}function d(c){if(!c)return;c.push({value:"",lines:[]});function u(S){return S.map(function(b){return" "+b})}let h=[],f=0,m=0,y=[],v=1,g=1;for(let S=0;S<c.length;S++){let b=c[S],x=b.lines||vm(b.value);if(b.lines=x,b.added||b.removed){if(!f){let C=c[S-1];if(f=v,m=g,C)y=l>0?u(C.lines.slice(-l)):[],f-=y.length,m-=y.length}for(let C of x)y.push((b.added?"+":"-")+C);if(b.added)g+=x.length;else v+=x.length}else{if(f)if(x.length<=l*2&&S<c.length-2)for(let C of u(x))y.push(C);else{let C=Math.min(x.length,l);for(let w of u(x.slice(0,C)))y.push(w);let k={oldStart:f,oldLines:v-f+C,newStart:m,newLines:g-m+C,lines:y};h.push(k),f=0,m=0,y=[]}v+=x.length,g+=x.length}}for(let S of h)for(let b=0;b<S.lines.length;b++)if(S.lines[b].endsWith(`
|
|
168
|
+
`))S.lines[b]=S.lines[b].slice(0,-1);else S.lines.splice(b+1,0,"\"),b++;return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:o,hunks:h}}}function qi(e,t){var n,i,r,o,s,a;if(!t)t=es;if(Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every((c)=>c.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((c)=>qi(c,t)).join(`
|
|
169
|
+
`)}let l=[];if(e.isGit){if(t=es,!e.oldFileName)throw Error("oldFileName must be specified for Git patches");if(!e.newFileName)throw Error("newFileName must be specified for Git patches");let{oldFileName:c,newFileName:u}=e;if(e.isCreate&&c==="/dev/null")c=u.replace(/^b\//,"a/");else if(e.isDelete&&u==="/dev/null")u=c.replace(/^a\//,"b/");if(l.push("diff --git "+ft(c)+" "+ft(u)),e.isDelete)l.push("deleted file mode "+((n=e.oldMode)!==null&&n!==void 0?n:"100644"));if(e.isCreate)l.push("new file mode "+((i=e.newMode)!==null&&i!==void 0?i:"100644"));if(e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate)l.push("old mode "+e.oldMode),l.push("new mode "+e.newMode);if(e.isRename)l.push("rename from "+ft(((r=e.oldFileName)!==null&&r!==void 0?r:"").replace(/^a\//,""))),l.push("rename to "+ft(((o=e.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,"")));if(e.isCopy)l.push("copy from "+ft(((s=e.oldFileName)!==null&&s!==void 0?s:"").replace(/^a\//,""))),l.push("copy to "+ft(((a=e.newFileName)!==null&&a!==void 0?a:"").replace(/^b\//,"")))}else{if(t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0)l.push("Index: "+e.oldFileName);if(t.includeUnderline)l.push("===================================================================")}let d=e.hunks.length>0;if(t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||d))l.push("--- "+ft(e.oldFileName)+(e.oldHeader?"\t"+e.oldHeader:"")),l.push("+++ "+ft(e.newFileName)+(e.newHeader?"\t"+e.newHeader:""));for(let c=0;c<e.hunks.length;c++){let u=e.hunks[c],h=u.oldLines===0?u.oldStart-1:u.oldStart,f=u.newLines===0?u.newStart-1:u.newStart;l.push("@@ -"+h+","+u.oldLines+" +"+f+","+u.newLines+" @@");for(let m of u.lines)l.push(m)}return l.join(`
|
|
170
|
+
`)+`
|
|
171
|
+
`}function ns(e,t,n,i,r,o,s){if(typeof s==="function")s={callback:s};if(!(s===null||s===void 0?void 0:s.callback)){let a=ts(e,t,n,i,r,o,s);if(!a)return;return qi(a,s===null||s===void 0?void 0:s.headerOptions)}else{let{callback:a}=s;ts(e,t,n,i,r,o,Object.assign(Object.assign({},s),{callback:(l)=>{if(!l)a(void 0);else a(qi(l,s.headerOptions))}}))}}function vm(e){let t=e.endsWith(`
|
|
172
|
+
`),n=e.split(`
|
|
173
|
+
`).map((i)=>i+`
|
|
174
|
+
`);if(t)n.pop();else n.push(n.pop().slice(0,-1));return n}var bm="/dev/null";function Fe(e,t,n,i=!1){if(e===null&&t===null)throw Error("parseDiffFromFile: You must pass oldFile, newFile, or both");let r=e??md(),o=t??md(),s=Kr(ns(r.name,o.name,r.contents,o.contents,r.header,o.header,n),{cacheKey:(()=>{let l=e?.cacheKey??e?.name,d=t?.cacheKey??t?.name;if(l!=null&&d!=null)return l+":"+d;return l??d})(),oldFile:r,newFile:o,throwOnError:i});if(s==null)throw Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");if(e===null)s.type="new",s.prevName=void 0;else if(t===null)s.type="deleted",s.prevName=void 0;let a=t?.lang??(t===null?e?.lang:void 0);if(a!=null)s.lang=a;return s}function md(){return{name:bm,contents:""}}function sn(e){return{...Ki,...e}}function Le(e,t){let n=Cm(e,t);return t?n:e.diffHeaderHeight+n}function Cm(e,t){return e.paddingTop??(t?e.spacing:0)}function Mt(e){return e.paddingBottom??e.spacing}function gd(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}function an(e){return[se(e.additionStart,e.additionCount)+1,ee(e.additionStart,e.additionCount)+1]}function Se({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}){let o=Math.max(t,0);if(o===0||e)return{fromStart:0,fromEnd:0,rangeSize:o,collapsedLines:o,renderAll:!1};if(n===!0||o<=r)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};let s=n?.get(i),a=Math.min(Math.max(s?.fromStart??0,0),o),l=Math.min(Math.max(s?.fromEnd??0,0),o),d=a+l,c=d>=o;return{fromStart:c?o:a,fromEnd:c?0:l,rangeSize:o,collapsedLines:Math.max(o-d,0),renderAll:c}}function yd(e){let t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;let n=e.additionLines.length-ee(t.additionStart,t.additionCount),i=e.deletionLines.length-ee(t.deletionStart,t.deletionCount);if(n<=0&&i<=0)return!1;return n!==i}function is({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 i=e.additionLines.length-ee(n.additionStart,n.additionCount),r=e.deletionLines.length-ee(n.deletionStart,n.deletionCount);if(i<=0&&r<=0)return 0;if(i!==r)throw Error(`${t}: trailing context mismatch (additions=${i}, deletions=${r}) for ${e.name}`);return Math.min(i,r)}function ve({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:r}){if(t!==e.hunks.length-1)return;let o=is({fileDiff:e,errorPrefix:r});if(o<=0)return;if(n===!0||o<=i)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};let s=n?.get(e.hunks.length),a=Math.min(Math.max(s?.fromStart??0,0),o);return{fromStart:a,fromEnd:0,rangeSize:o,collapsedLines:o-a,renderAll:a>=o}}function Xi({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:i}){if(n===!0||e.isPartial)return!0;for(let[a,l]of e.hunks.entries()){let[d,c]=an(l);if(t<d){let u=Se({isPartial:e.isPartial,rangeSize:l.collapsedBefore,expandedHunks:n,hunkIndex:a,collapsedContextThreshold:i}),h=d-u.rangeSize;return u.renderAll||t<h+u.fromStart||t>=d-u.fromEnd}if(t<c)return!0}let r=ve({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:"isAdditionLineRenderable"});if(r==null||r.renderAll)return!0;let o=e.hunks[e.hunks.length-1],[,s]=an(o);return t<s+r.fromStart||t>=s+r.rangeSize}function Sd({fileDiff:e,lineNumber:t,direction:n,expandedHunks:i,collapsedContextThreshold:r}){if(i===!0||e.isPartial)return t;let o=[],s=1;for(let[l,d]of e.hunks.entries()){let[c,u]=an(d),h=Se({isPartial:e.isPartial,rangeSize:d.collapsedBefore,expandedHunks:i,hunkIndex:l,collapsedContextThreshold:r}),f=c-h.rangeSize;if(h.renderAll)o.push([f,c]);else{if(h.fromStart>0)o.push([f,f+h.fromStart]);if(h.fromEnd>0)o.push([c-h.fromEnd,c])}o.push([c,u]),s=u}let a=ve({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:i,collapsedContextThreshold:r,errorPrefix:"getNearestRenderableAdditionLine"});if(a!=null){let l=s;if(s=l+a.rangeSize,a.renderAll)o.push([l,s]);else if(a.fromStart>0)o.push([l,l+a.fromStart])}if(t>=s)return t;if(n==="down"){for(let[l,d]of o)if(d>t)return Math.max(l,t);return}for(let l=o.length-1;l>=0;l--){let[d,c]=o[l];if(d<=t)return Math.min(c-1,t)}}function vd({type:e,metrics:t}){return t.hunkSeparatorHeight??gd(e)}function bd({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function xm({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 km(e){return e!=="simple"&&e!=="metadata"}function Ht({type:e,metrics:t,hunkIndex:n,hunkSpecs:i}){if(!xm({type:e,hunkIndex:n,hunkSpecs:i}))return;let r=vd({type:e,metrics:t}),o=bd({type:e,metrics:t}),s=n>0?o:0,a=o;return{height:r,gapBefore:s,gapAfter:a,totalHeight:s+r+a}}function nt({type:e,metrics:t}){if(!km(e))return;let n=vd({type:e,metrics:t}),i=bd({type:e,metrics:t});return{height:n,gapBefore:i,gapAfter:0,totalHeight:i+n}}function $e(e,t){let n=Fe({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:n.hunks,splitLineCount:n.splitLineCount,unifiedLineCount:n.unifiedLineCount,additionLines:n.additionLines,deletionLines:n.deletionLines,type:n.type}}function wm(e,t){let n=Math.max(e,1),i=Array.from({length:n},(r,o)=>`${" ".repeat(o+1)}
|
|
175
|
+
`).join("");if(i===t)i=Array.from({length:n},(r,o)=>`\x00${" ".repeat(o)}
|
|
176
|
+
`).join("");return i}function Lm(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function Yi(e,t){return t.length>0&&t.length<e.deletionLines.length&&Lm(t)}function _n(e,t,n){let i=e.deletionLines.join(""),r=wm(t.length,i),o=Fe({name:e.prevName??e.name,contents:i},{name:e.name,contents:r,lang:e.lang},n);return{hunks:o.hunks,splitLineCount:o.splitLineCount,unifiedLineCount:o.unifiedLineCount,additionLines:t,deletionLines:o.deletionLines,type:o.type}}function On(e,t){return _n(e,[""],t)}function Ji(e,t){if(e.additionLines.length===0)return On(e,t);if(Yi(e,e.additionLines))return _n(e,e.additionLines,t);let n=e.additionLines,i=$e(e,t);return rs(i,n),i}function Em(e){return e.length>1&&e.at(-1)===""}function rs(e,t){if(!Em(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let i=e.additionLines.length,r=e.hunks.at(-1);if(r==null)return;if(ee(r.additionStart,r.additionCount)!==i)return;for(let o of r.hunkContent)if(o.type==="change"&&o.additions<o.deletions&&o.additionLineIndex+o.additions===i){e.additionLines=t,o.additions+=n,r.additionCount+=n,r.additionLines+=n,Qi(e);return}}function Cd(e,t,n){if(e.isPartial)return it(e,$e(e,n));if(e.deletionLines.length!==e.additionLines.length)return it(e,$e(e,n));let i=Array.from(t);if(i.length===0)return it(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let o of i){let s=e.additionLines[o],a=e.deletionLines[o];if(s==null||a==null)return it(e,$e(e,n));if(ke(s)===ke(a))return it(e,$e(e,n))}let r=Tm(e,i);if(r.size===0)return it(e,$e(e,n));for(let o of r)if(!Rm(e,o,n))return it(e,$e(e,n));if(Qi(e),yd(e))return it(e,$e(e,n));return it(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function it(e,t){return Object.assign(e,t),t}function Tm(e,t){let n=new Set;for(let i of t){let r=Am(e,i);if(r==null)return new Set;n.add(r)}return n}function Am(e,t){for(let[n,i]of e.hunks.entries()){let r=i.additionLineIndex+i.additionCount;if(t>=i.additionLineIndex&&t<r)return n}}function Rm(e,t,n){let i=e.hunks[t];if(i==null)return!1;let r=e.deletionLines.slice(i.deletionLineIndex,i.deletionLineIndex+i.deletionCount),o=e.additionLines.slice(i.additionLineIndex,i.additionLineIndex+i.additionCount),s=Fe({name:e.prevName??e.name,contents:r.join("")},{name:e.name,contents:o.join(""),lang:e.lang},{...n,context:0}),a=s.hunks[0];if(a==null||s.hunks.length!==1)return!1;return Im(i,a),os(e,t),!0}function os(e,t){let n=e.hunks[t];if(n==null)return;if(t!==e.hunks.length-1){n.noEOFCRAdditions=!1,n.noEOFCRDeletions=!1;return}let i=e.additionLines.at(-1),r=e.deletionLines.at(-1);n.noEOFCRAdditions=i!=null&&i!==""&&!i.endsWith(`
|
|
177
|
+
`),n.noEOFCRDeletions=r!=null&&r!==""&&!r.endsWith(`
|
|
178
|
+
`)}function Im(e,t){let{additionLineIndex:n,deletionLineIndex:i}=e;if(e.hunkContent=t.hunkContent.map((r)=>ss(r,n,i)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart=e.additionStart+t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0)e.deletionLineIndex=i+t.deletionLineIndex,e.deletionStart=e.deletionStart+t.deletionLineIndex;e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,Zi(e)}function ss(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function Zi(e){let t=0,n=0;for(let i of e.hunkContent)if(i.type==="context")t+=i.lines,n+=i.lines;else t+=Math.max(i.additions,i.deletions),n+=i.additions+i.deletions;e.splitLineCount=t,e.unifiedLineCount=n}function Qi(e){let t=0,n=0,i=0;for(let r of e.hunks)r.collapsedBefore=Math.max(se(r.additionStart,r.additionCount)-i,0),r.splitLineStart=t+r.collapsedBefore,r.unifiedLineStart=n+r.collapsedBefore,Zi(r),t+=r.collapsedBefore+r.splitLineCount,n+=r.collapsedBefore+r.unifiedLineCount,i=ee(r.additionStart,r.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],o=Math.max(e.additionLines.length-ee(r.additionStart,r.additionCount),0);t+=o,n+=o}e.splitLineCount=t,e.unifiedLineCount=n}var xd=new WeakMap;function Mm(e){if(e.length>1&&e[e.length-1]==="")return e.slice(0,-1);return e}function Hm(e,t){let n=Math.min(e.length,t.length),i=0;while(i<n&&e[i]===t[i])i++;let r=e.length,o=t.length;while(r>i&&o>i&&e[r-1]===t[o-1])r--,o--;if(i===r&&i===o)return;return{start:i,deletionEnd:r,additionEnd:o}}function tr(e,t){let{hunks:n,additionLines:i}=e,r=Mm(i),o=r===i?e:{...e,additionLines:r},s=_m(n,Fm(o,t),e.deletionLines.length),a=zm(o,s);if(e.additionLines=r,e.hunks=a,e.editSessionDirty=!0,Gm(e),rs(e,i),!$m(n,e.hunks))return;return{regions:s.map((l)=>l.previousSpan)}}function Ed(e,t,n,i){let r=Array.from(new Set(t)).filter((l)=>l>=0&&l<e.additionLines.length).sort((l,d)=>l-d);if(r.length===0)return;let{hunks:o}=e,s,a=0;for(let l of r){while(a<o.length){let u=o[a];if(l<nr(u)+u.additionCount)break;a++}let d=o[a],c=d==null?void 0:nr(d);if(c==null||l<c||s!=null&&s!==a)return tr(e,n);s=a}if(s==null)return;if(Pm(e,r,s,i,n)){e.editSessionDirty=!0;return}return tr(e,n)}function Pm(e,t,n,i,r){if(i==null||r?.ignoreWhitespace===!0||r?.stripTrailingCr===!0)return!1;let o=Nm(e),s=e.hunks[n];if(s.hunkContent.some(Dm))return!1;for(let a of t){let l=i.get(a),d=e.additionLines[a];if(l==null||d==null||o.has(l)||o.has(d))return!1;let c=!1;for(let u of s.hunkContent)if(u.type==="change"&&u.additions===u.deletions&&a>=u.additionLineIndex&&a<u.additionLineIndex+u.additions){c=!0;break}if(!c)return!1}return!0}function Nm(e){let t=xd.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return xd.set(e,{lines:e.deletionLines,set:n}),n}function Dm(e){return e?.type==="change"&&(e.additions===0||e.deletions===0)}function Td(e,t){let n=new Map,{regions:i}=t;for(let r=0;r<=i.length;r++){let o=i[r-1],s=i[r],a=r===0?e.get(0):o==null?void 0:e.get(o.lastIndex+1),l=s==null?void 0:e.get(s.firstIndex),d=a?.fromStart??0,c=l?.fromEnd??0;if(d>0||c>0)n.set(r,{fromStart:d,fromEnd:c})}return n}function Ad(e,t,n){let i=[];if(e.isPartial)return i;for(let[o,s]of e.hunks.entries()){let a=Se({isPartial:e.isPartial,rangeSize:s.collapsedBefore,expandedHunks:t,hunkIndex:o,collapsedContextThreshold:n});if(a.rangeSize<=n)continue;let l=Pt(s),d=l-a.rangeSize;if(a.fromStart>0)i.push([d,d+a.fromStart]);if(a.fromEnd>0)i.push([l-a.fromEnd,l])}let r=ve({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"captureExpansionAnchors"});if(r!=null&&r.fromStart>0&&r.rangeSize>n){let o=e.hunks[e.hunks.length-1],s=Pt(o)+o.deletionCount;i.push([s,s+r.fromStart])}return i}function Rd(e,t){let n=new Map;if(t.length===0)return n;let i=(o,s,a)=>{if(a<=s)return;let l=0,d=0;for(let[c,u]of t){if(u<=s||c>=a)continue;if(c<=s)l=Math.max(l,Math.min(u,a)-s);if(u>=a)d=Math.max(d,a-Math.max(c,s))}if(l>0||d>0)n.set(o,{fromStart:l,fromEnd:d})};for(let[o,s]of e.hunks.entries()){let a=Pt(s);i(o,a-Math.max(s.collapsedBefore,0),a)}let r=e.hunks[e.hunks.length-1];if(r!=null&&!e.isPartial&&e.deletionLines.length>0)i(e.hunks.length,Pt(r)+r.deletionCount,e.deletionLines.length);return n}function Un(e,t){if(e.editSessionDirty!==!0)return!1;return e.editSessionDirty=void 0,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join("")===""?$e(e,t):Ji(e,t)),!0}function Fm(e,t){if(Hm(e.deletionLines,e.additionLines)==null)return[];let n=Fe({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t),i=[],r=0,o=0;for(let s of n.hunks){let a=s.additionCount>0?s.additionLineIndex-r:s.deletionLineIndex-o;r+=a,o+=a;for(let l of s.hunkContent){if(l.type==="context"){r+=l.lines,o+=l.lines;continue}let d=ss(l,0,0);if(d.additions===0)d.additionLineIndex=r;if(d.deletions===0)d.deletionLineIndex=o;i.push(d),r+=d.additions,o+=d.deletions}}return i}function _m(e,t,n){let i=e.map((s,a)=>{let l=Pt(s);return{deletionStart:l,deletionEnd:l+s.deletionCount,blocks:[],previousSpan:{firstIndex:a,lastIndex:a}}}),r=[],o=0;for(let s of t){let a=s.deletionLineIndex,l=a+s.deletions;while(o<i.length&&i[o].deletionEnd<a)r.push(i[o]),o++;let d=r.length>0&&Om(a,l,r[r.length-1])?r.pop():void 0;while(o<i.length&&i[o].deletionStart<=l)d=Um(d,i[o]),o++;if(d==null){let c=a,u=l;if((s.deletions===0||s.additions===0)&&n>s.deletions){let h=r[r.length-1]?.deletionEnd??0,f=i[o]?.deletionStart??n;if(a>h)c--;else if(l<f)u++}d={deletionStart:c,deletionEnd:u,blocks:[],previousSpan:void 0}}d.deletionStart=Math.min(d.deletionStart,a),d.deletionEnd=Math.max(d.deletionEnd,l),d.blocks.push(s),r.push(d)}while(o<i.length)r.push(i[o]),o++;return r}function Om(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function Um(e,t){if(e==null)return t;if(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null)e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex);return e}function zm(e,t){let n=[],i=0,r=0;for(let o of t){let s=o.deletionStart-i;if(s<0)throw Error("buildRegionHunks: overlapping old-side regions");i+=s,r+=s;let a=r,l=[];for(let c of o.blocks){let u=c.deletionLineIndex-i,h=c.additionLineIndex-r;if(u<0||u!==h)throw Error("buildRegionHunks: canonical block context mismatch");kd(l,u,r,i),i+=u,r+=h,l.push({...c}),i+=c.deletions,r+=c.additions}let d=o.deletionEnd-i;if(d<0)throw Error("buildRegionHunks: block exceeds its old-side region");kd(l,d,r,i),i+=d,r+=d,n.push(Bm(e,{additionStart:a,additionEnd:r,deletionStart:o.deletionStart,deletionEnd:o.deletionEnd},l))}if(e.deletionLines.length-i!==e.additionLines.length-r)throw Error("buildRegionHunks: trailing context mismatch");return n}function Bm(e,t,n){let i=t.additionEnd-t.additionStart,r=t.deletionEnd-t.deletionStart,o=0,s=0;for(let l of n)if(l.type==="change")o+=l.additions,s+=l.deletions;let a={collapsedBefore:0,additionStart:er(t.additionStart,i),additionCount:i,additionLines:o,additionLineIndex:Ld(t.additionStart,i),deletionStart:er(t.deletionStart,r),deletionCount:r,deletionLines:s,deletionLineIndex:Ld(t.deletionStart,r),hunkContent:n,hunkSpecs:`@@ -${er(t.deletionStart,r)},${r} +${er(t.additionStart,i)},${i} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return Zi(a),a}function kd(e,t,n,i){if(t>0)e.push({type:"context",lines:t,additionLineIndex:n,deletionLineIndex:i})}function $m(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let i=e[n],r=t[n];if(Pt(i)!==Pt(r)||i.deletionCount!==r.deletionCount||nr(i)!==nr(r)||i.additionCount!==r.additionCount||i.splitLineCount!==r.splitLineCount||!Vm(i,r))return!0}return!1}function Vm(e,t){let n=wd(e),i=wd(t);while(!0){let r=n.next(),o=i.next();if(r.done===!0||o.done===!0)return r.done===o.done;if(r.value[0]!==o.value[0]||r.value[1]!==o.value[1])return!1}}function*wd(e){for(let t of e.hunkContent){if(t.type==="context"){for(let i=0;i<t.lines;i++)yield[t.deletionLineIndex+i,t.additionLineIndex+i];continue}let n=Math.max(t.deletions,t.additions);for(let i=0;i<n;i++)yield[i<t.deletions?t.deletionLineIndex+i:void 0,i<t.additions?t.additionLineIndex+i:void 0]}}function nr(e){return se(e.additionStart,e.additionCount)}function Pt(e){return se(e.deletionStart,e.deletionCount)}function er(e,t){return t===0?e:e+1}function Ld(e,t){return t===0?e-1:e}function Gm(e){Qi(e);for(let t=0;t<e.hunks.length;t++)os(e,t)}function pt(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return typeof t==="string"&&t.toLowerCase()==="style"}function Id(){if(typeof window>"u"||typeof window.matchMedia!=="function")return!1;return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function _e(e){let t=window.devicePixelRatio??1;return Math.round(e*t)/t}function fe(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}var ir="-1,-1";function zn(e){return e?.some((t)=>t.lineNumber===0)??!1}function Bn(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function mt(e){return e.startingLine===0&&e.totalLines>0}function Md(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function be(e){return{type:"text",value:e}}function H({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function Nt({name:e,width:t=16,height:n=16,properties:i}){return H({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[H({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function Hd(e){let t=e.children[0];while(t!=null){if(t.type==="element"&&t.tagName==="code")return t;if("children"in t)t=t.children[0];else t=null}}function gt(e){return H({tagName:"div",properties:{"data-gutter":""},children:e})}function rr(e,t,n,i={}){return H({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[H({tagName:"span",properties:{"data-line-number-content":""},children:[be(`${t}`)]})]:void 0})}function pe(e,t,n){return H({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 Pd(){return H({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[Nt({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}var ar=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;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(),yt(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;if(this.pre!==e)this.cleanUp(),this.pre=e;if(n)this.ensureGutterUtilityNode(t);else if(this.gutterUtilityContainer!=null){if(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.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){let n=!(e===this.selectedRange||nn(e??void 0,this.selectedRange??void 0)),i=t?.lineNumberOnly??!1,r=t?.activeLineSide!==this.selectedRangeHighlightSide||i!==this.selectedRangeLineNumberOnly;if(!this.isSelectionDirty()&&!n&&!r)return;if(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=i,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1)this.notifySelectionCommitted(e)}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let i=e!==this.editorActiveLine,r=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;if(!this.isSelectionDirty()&&!i&&!r)return;this.editorActiveLine=e,this.editorActiveLineSide=n,this.editorLineNumberOnly=t,this.renderSelection()}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:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;if(t==null&&n==null&&i==null&&o==null&&r==null)return;if(this.options.onGutterUtilityClick!=null&&$n(e.composedPath()))return;rt(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:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;if(t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null)return;rt(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e})};handlePointerLeave=(e)=>{let{__debugPointerEvents:t}=this.options;if(rt(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){rt(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}if(this.hoveredToken!=null)this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken();if(this.hoveredLine!=null)this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine();this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,i=t.composedPath();rt(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});let r=this.resolvePointerTarget(i);rt(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);let{onLineClick:o,onLineNumberClick:s,onLineEnter:a,onLineLeave:l,onTokenClick:d,onTokenEnter:c,onTokenLeave:u,onHunkExpand:h,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{let m=as(r)&&this.hoveredLine?.lineElement===r.lineElement;if(!(sr(r)&&this.hoveredToken?.tokenElement===r.tokenElement)){if(this.hoveredToken!=null)u?.(this.hoveredToken,t),this.clearHoveredToken();if(sr(r))this.setHoveredToken(this.toTokenEventBaseProps(r)),c?.(this.hoveredToken,t)}if(!m){if(this.hoveredLine!=null)l?.({...this.hoveredLine,event:t}),this.clearHoveredLine();if(as(r))this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),a?.({...this.hoveredLine,event:t});else this.placeUtility()}break}case"click":{if(r==null)break;if(qm(r)&&f!=null){f(r);break}if(jm(r)&&h!=null){h(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!as(r))break;if(sr(r)&&d!=null)d(this.toTokenEventBaseProps(r),t);let m=this.toEventBaseProps(r);if(s!=null&&r.numberColumn)s({...m,event:t});else if(o!=null)o({...m,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:a,onTokenEnter:l,onTokenLeave:d,onHunkExpand:c,onMergeConflictActionClick:u,enableGutterUtility:h=!1,enableLineSelection:f=!1,onGutterUtilityClick:m}=this.options,y=m!=null,v=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||a!=null||l!=null||d!=null||c!=null||u!=null||h||f||y;if(v&&!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,rt(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{let b=[];if(t==="both"||t==="click"){if(i!=null)b.push("onLineClick");if(r!=null)b.push("onLineNumberClick");if(c!=null)b.push("expandable hunk separators");if(u!=null)b.push("merge conflict actions")}return b})()),rt(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),rt(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event");else if(!v&&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 g=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",S=this.pointerSession.mode==="gutterSelecting";if(!f&&g||!y&&S)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,i=e!=null,r=t!=null||n;if(i&&!this.interactiveLinesAttr)this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0;else if(!i&&this.interactiveLinesAttr)this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1;if(r&&!this.interactiveLineNumbersAttr)this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0;else if(!r&&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();if($n(t)&&this.options.onGutterUtilityClick!=null)this.startGutterSelectionFromPointerDown(e);else{if(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:i}=this;if(i==null)return;let{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){let a=this.getIndexesFromSelection(this.selectedRange,i.getAttribute("data-diff-type")==="split");if(a==null)return;let l=a.start<=a.end?s>=a.start:s<=a.end;this.selectionAnchor={lineNumber:l?this.selectedRange.start:this.selectedRange.end,side:l?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){let a={lineNumber:r,side:o};this.selectionAnchor=a,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:a,pending:a},this.attachDocumentPointerListeners();return}if(this.options.controlledSelection===!0)this.proposedSelectedRange=null;else this.selectedRange=null;this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),i=n?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),r=n?.top??i;if(i==null||r==null)return;e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:r,current:i},this.selectionAnchor={lineNumber:r.lineNumber,side:r.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners()}handleDocumentPointerMove=(e)=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.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(Md(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{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{let{pointerSession:n}=this;if(e.pointerId!==n.pointerId)return;e.preventDefault();let i=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(i!=null)n.current=i,this.updateSelection(i.lineNumber,i.side);let r=this.buildSelectedLineRange(n.anchor,n.current);t?.({...r}),this.selectionAnchor=void 0,this.notifySelectionEnd(r),this.notifySelectionCommitted(r),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.getCurrentSelectionRange()),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.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=(e)=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession){if(e.pointerId!==this.pointerSession.pointerId)return}this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){if(this.hoveredLine==null)return;this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0}setHoveredLine(e){let{lineHoverHighlight:t="disabled"}=this.options;if(this.hoveredLine!=null)this.clearHoveredLine();if(this.hoveredLine=e,t!=="disabled"){if(t==="both"||t==="line")this.hoveredLine.lineElement.setAttribute("data-hovered","");if(t==="both"||t==="number")this.hoveredLine.numberElement.setAttribute("data-hovered","")}}clearHoveredToken(){if(this.hoveredToken==null)return;this.hoveredToken=void 0}setHoveredToken(e){if(this.hoveredToken!=null)this.clearHoveredToken();this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null)this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","");if(e){if(this.gutterUtilityButton!=null)this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0;if(this.gutterUtilitySlot==null)this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot";if(this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer)this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot)}else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let t=document.createElement("div");t.innerHTML=X(Pd());let n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}if(this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer)this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);if(Vn(t)&&t.numberColumn)this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(this.placeUtilityFromSelection())return;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);if(t==null)this.hideUtility();else this.showUtilityOnLine(this.toEventBaseProps(t));return!0}showUtilityOnLine(e){if(this.gutterUtilityContainer==null)return;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},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(i==null||r==null)return;return i>r?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;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]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let r of i){if(!(r instanceof HTMLElement))continue;let o=this.resolvePointerTarget(or(r));if(!Vn(o))continue;if(this.mode==="diff"&&e.side!=null&&o.side!==e.side)continue;return o}}attachDocumentPointerListeners(){if(this.hasDocumentPointerListeners)return;document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0}detachDocumentPointerListeners(){if(!this.hasDocumentPointerListeners)return;document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){if(this.pointerSession.mode==="pendingSingleLineUnselect")this.pointerSession={mode:"idle"}}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(!Vn(n))return;if(t&&!n.numberColumn)return;if(n.splitLineIndex==null)return;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?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(!Vn(t))return;return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{let i=this.pathFromCoordinates(e,n);if(i!==void 0)return i??void 0;return this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n===void 0)return;if(n===null)return null;return this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(t&&$n(e))return;for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}pathFromElement(e,t){let n=or(e);if(t&&$n(n))return;let i=Xm(e);if(i!=null)return or(i);return this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){let t=Jm(Ym(e));if(t==null)return;let n=this.targetForSelectionPoint(t);return n!=null?or(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=Dd(t)?t:Dd(document)?document:void 0;if(n==null)return;return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let i=this.getCurrentSelectionRange(),r;if(e==null)r=null;else{let o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}if(nn(i??void 0,r??void 0))return;if(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0)this.proposedSelectedRange=r;else this.selectedRange=r,ln(this.renderSelection);if(this.placeUtility(),n)this.notifySelectionChangeDelta()}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,n){if(e.range==null)return;let i=this.getIndexesFromSelection(e.range,t);if(i==null)throw console.error({rowRange:i,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return i}getLineRenderColumns(e,t,n,i){if(this.pre==null||t==null&&i==null)return[];let{children:r}=this.pre;if(r.length>2)throw console.error(r),Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");let o=[];for(let s of r){let a=s.hasAttribute("data-deletions")?"deletions":s.hasAttribute("data-additions")?"additions":void 0,l=e!=null&&t!=null&&(e.highlightSide==null||a==null||e.highlightSide===a),d=n!=null&&i!=null&&(n.highlightSide==null||a==null||n.highlightSide===a);if(!l&&!d)continue;let[c,u]=s.children;if(!(c instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error("InteractionManager.renderSelection: missing gutter or content element");if(u.children.length!==c.children.length)throw Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");o.push({content:u,gutter:c,renderEditorActiveLine:d,renderSelectedLines:l})}return o}renderSelection=()=>{yt(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,i=!Fd(this.renderedSelectedLinesState,n),r=!Fd(this.renderedEditorActiveLineState,t);if(!i&&!r)return;if(i)this.renderedSelectedLinesState=void 0;if(r)this.renderedEditorActiveLineState=void 0;let o=this.pre.getAttribute("data-diff-type")==="split",s=!i?void 0:this.resolveLineRenderRange(n,o,"selected-lines"),a=!r?void 0:this.resolveLineRenderRange(t,o,"editor-active-line"),l=this.getLineRenderColumns(i?n:void 0,s,r?t:void 0,a),d=n.range==null||l.some((y)=>y.renderSelectedLines),c=t.range==null||l.some((y)=>y.renderEditorActiveLine);if(i)for(let y of this.pre.querySelectorAll("[data-selected-line]"))y.removeAttribute("data-selected-line");if(r)for(let y of this.pre.querySelectorAll("[data-editor-active-line]"))y.removeAttribute("data-editor-active-line");let u=s==null?void 0:Math.min(s.start,s.end),h=s==null?void 0:Math.max(s.start,s.end),f=u===h,m=a?.start;for(let y of l){let{content:v,gutter:g,renderEditorActiveLine:S,renderSelectedLines:b}=y,x=Math.max(b?h??-1/0:-1/0,S?m??-1/0:-1/0),C=v.children.length;for(let k=0;k<C;k++){let w=v.children[k],T=g.children[k];if(!(w instanceof HTMLElement)||!(T instanceof HTMLElement))continue;let L=this.parseLineIndex(w,o);if((L??0)>x)break;if(L==null)continue;if(b&&u!=null&&h!=null&&L>=u&&L<=h){let I=f?"single":L===u?"first":L===h?"last":"";if(T.setAttribute("data-selected-line",I),!n.lineNumberOnly){if(w.setAttribute("data-selected-line",I),T.nextSibling instanceof HTMLElement&&w.nextSibling instanceof HTMLElement&&(w.nextSibling.hasAttribute("data-line-annotation")||w.nextSibling.hasAttribute("data-merge-conflict-actions"))){if(f)I="last",w.setAttribute("data-selected-line","first");else if(L===u)I="";else if(L===h)w.setAttribute("data-selected-line","");w.nextSibling.setAttribute("data-selected-line",I),T.nextSibling.setAttribute("data-selected-line",I)}}}if(S&&L===m){if(T.setAttribute("data-editor-active-line",""),!t.lineNumberOnly)w.setAttribute("data-editor-active-line","")}}}if(i&&d)this.renderedSelectedLinesState=n;if(r&&c)this.renderedEditorActiveLineState=t};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){if(this.mode==="file")return{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement};return{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:i,tokenElement:r,tokenText:o}){if(this.mode==="file")return{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:r,tokenText:o};return{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...n!=null?{side:n}:{},...n!==i&&i!=null?{endSide:i}:{}}}resolvePointerTarget(e){let t=!1,n,i,r,o,s,a,l,d,c,u;for(let f of e){if(!(f instanceof HTMLElement))continue;if(u==null&&f.hasAttribute("data-merge-conflict-action")){let g=f.getAttribute("data-merge-conflict-action")??void 0,S=f.getAttribute("data-merge-conflict-conflict-index")??void 0,b=S!=null?Number.parseInt(S,10):NaN;if(Km(g)&&Number.isFinite(b))u={kind:"merge-conflict-action",resolution:g,conflictIndex:b}}if(a==null&&f.hasAttribute("data-char")){a=f;let g=f.getAttribute("data-char");if(g!=null){let S=Number.parseInt(g,10);if(!Number.isNaN(S)){let b=f.textContent??"",x=S+b.length;if(b.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)l={tokenElement:a,lineCharStart:S,lineCharEnd:x,tokenText:b};continue}}}let m=s==null?f.getAttribute("data-column-number")??void 0:void 0;if(m!=null){s=f,c=Number.parseInt(m,10),t=!0,n=Od(f),o=f.getAttribute("data-line-index")??void 0;continue}let y=r==null?f.getAttribute("data-line")??void 0:void 0;if(y!=null){r=f,c=Number.parseInt(y,10),n=Od(f),o=f.getAttribute("data-line-index")??void 0;continue}if(d==null&&(f.hasAttribute("data-expand-button")||f.hasAttribute("data-unmodified-lines"))){d={hunkIndex:void 0,direction:(()=>{if(f.hasAttribute("data-expand-up"))return"up";if(f.hasAttribute("data-expand-down"))return"down";return"both"})(),all:f.hasAttribute("data-expand-all-button")};continue}let v=d!=null?f.getAttribute("data-expand-index")??void 0:void 0;if(d!=null&&v!=null){let g=Number.parseInt(v,10);if(!Number.isNaN(g))d.hunkIndex=g;continue}if(i==null&&f.hasAttribute("data-code")){i=f;break}}if(u!=null)return u;if(d?.hunkIndex!=null)return{type:"line-info",hunkIndex:d.hunkIndex,direction:d.direction,all:d.all};if(r??=o!=null?Nd(i,`[data-line][data-line-index="${o}"]`):void 0,s??=o!=null?Nd(i,`[data-column-number][data-line-index="${o}"]`):void 0,i==null||r==null||s==null||n==null||c==null||Number.isNaN(c))return;let h=this.parseLineIndex(r,this.isSplitDiff());if(l!=null){if(this.mode==="file")return{kind:"token",lineType:n,lineElement:r,lineNumber:c,numberColumn:t,numberElement:s,side:void 0,splitLineIndex:h,...l};return{kind:"token",lineType:n,lineElement:r,lineNumber:c,numberColumn:t,numberElement:s,side:_d(n,i),splitLineIndex:h,...l}}if(this.mode==="file")return{kind:"line",lineType:n,lineElement:r,lineNumber:c,numberColumn:t,numberElement:s,side:void 0,splitLineIndex:h};return{kind:"line",lineType:n,lineElement:r,lineNumber:c,numberColumn:t,numberElement:s,side:_d(n,i),splitLineIndex:h}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){let n=(e.getAttribute("data-line-index")??"").split(",").map((i)=>Number.parseInt(i,10)).filter((i)=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function dn({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:a,onTokenClick:l,onTokenEnter:d,onTokenLeave:c,renderGutterUtility:u,__debugPointerEvents:h,enableLineSelection:f,controlledSelection:m,onLineSelected:y,onLineSelectionStart:v,onLineSelectionChange:g,onLineSelectionEnd:S},b,x,C){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Wm({enableGutterUtility:t,renderGutterUtility:u,onGutterUtilityClick:i}),usesCustomGutterUtility:u!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:b,onMergeConflictActionClick:C,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:a,onTokenClick:l,onTokenEnter:d,onTokenLeave:c,__debugPointerEvents:h,enableLineSelection:f,controlledSelection:m,onLineSelected:y,onLineSelectionStart:v,onLineSelectionChange:g,onLineSelectionEnd:S,getLineIndex:x}}function Wm({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 Vn(e){return e!=null&&"kind"in e&&e.kind==="line"}function sr(e){return e!=null&&"kind"in e&&e.kind==="token"}function as(e){return Vn(e)||sr(e)}function jm(e){return"type"in e&&e.type==="line-info"}function qm(e){return"kind"in e&&e.kind==="merge-conflict-action"}function Km(e){return e==="current"||e==="incoming"||e==="both"}function Nd(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function or(e){let t=[],n=e;while(n!=null)t.push(n),n=n.parentNode;return t}function Xm(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 i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function Ym(e){let t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){let n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function Jm(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;return{lineNumber:n,side:t[1]}}function Dd(e){return e!=null&&typeof e.elementFromPoint==="function"}function Zm(e,t){return e===t||nn(e??void 0,t??void 0)}function Fd(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&Zm(e?.range??null,t.range)}function _d(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function Od(e){let t=e.getAttribute("data-line-type");if(t==null)return;switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function rt(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 lr=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 i of t){let r=e.managersByElement.get(i.target);if(r==null)continue;let o=n.get(r);if(o==null)n.set(r,[i]);else o.push(i)}for(let[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,{disableAnnotations:n,columnVariables:i="apply"}){let r=new Set,o=i==="apply",s=0,a=new Map(this.observedNodes);this.observedNodes.clear();for(let l of t.children){if(s===2)break;let d=(()=>{if(l instanceof HTMLElement&&l.tagName==="CODE")return l})();if(d==null)continue;s++;let c=a.get(d);if(c!=null&&c.type!=="code")throw Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let u=d.firstElementChild;if(!(u instanceof HTMLElement))u=null;if(c!=null){if(this.observedNodes.set(d,c),a.delete(d),c.numberElement!==u){if(c.numberElement!=null)this.unobserve(c.numberElement),a.delete(c.numberElement);if(u!=null)this.observe(u),a.delete(u),this.observedNodes.set(u,c);c.numberElement=u,c.numberWidth=0}else if(c.numberElement!=null)a.delete(c.numberElement),this.observedNodes.set(c.numberElement,c);else c.numberWidth=0;tg(c,o)}else if(c={type:"code",codeElement:d,numberElement:u,codeWidth:"auto",numberWidth:0,applyColumnVariables:o},this.observedNodes.set(d,c),this.observe(d),u!=null)this.observedNodes.set(u,c),this.observe(u)}if(s>1&&!n){let l=t.querySelectorAll('[data-line-annotation*=","]'),d=new Map;for(let c of l){if(!(c instanceof HTMLElement))continue;let u=c.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(u)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:u,element:c});continue}let h=d.get(u);if(h==null)h=[],d.set(u,h);h.push(c)}for(let[c,u]of d){if(u.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",c,u);continue}let[h,f]=u,m=h.firstElementChild,y=f.firstElementChild;if(!(h instanceof HTMLElement)||!(f instanceof HTMLElement)||!(m instanceof HTMLElement)||!(y instanceof HTMLElement))continue;let v=a.get(m);if(v!=null){this.observedNodes.set(m,v),this.observedNodes.set(y,v),a.delete(m),a.delete(y);continue}let g=m.getBoundingClientRect().height,S=y.getBoundingClientRect().height;v={type:"annotations",column1:{container:h,child:m,childHeight:g},column2:{container:f,child:y,childHeight:S},currentHeight:"auto"},r.add({child1:m,child2:y,item:v,newHeight:Math.max(g,S)})}for(let c of r)this.applyNewHeight(c.item,c.newHeight),this.observedNodes.set(c.child1,c.item),this.observedNodes.set(c.child2,c.item),this.observe(c.child1),this.observe(c.child2);r.clear()}for(let[l,d]of a)if(this.unobserve(l),d.type==="code")ng(d);else ig(d);a.clear()}cleanUp(){for(let t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,i=n.get(t);if(i===this)return;else if(i!=null&&i!==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:i}=e,r=n.get(t);if(r==null)return;else if(r!==this)throw Error("ResizeManager.unobserve: element is owned by another ResizeManager");if(n.delete(t),i?.unobserve(t),i!=null&&n.size===0)i.disconnect(),e.resizeObserver=void 0}handleResizeEntries(t){let n=new Map,i=new Set;for(let r of t){let{target:o,borderBoxSize:s,contentBoxSize:a}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}let l=this.observedNodes.get(o);if(l==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(l.type==="annotations"){let d=(()=>{if(o===l.column1.child)return l.column1;if(o===l.column2.child)return l.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:l,target:o});continue}d.childHeight=s[0].blockSize,i.add(l)}else if(l.type==="code"){let d=n.get(l)??{},c=a[0].inlineSize;if(o===l.codeElement)d.codeInlineSize=c;else if(o===l.numberElement)d.numberInlineSize=c;n.set(l,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(let n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=(t)=>{for(let[n,i]of t){let r=i.codeInlineSize!=null?Qm(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?eg(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,a=o!==n.numberWidth;if(!s&&!a)continue;if(n.codeWidth=r,n.numberWidth=o,n.applyColumnVariables)Ud(n,{codeWidthChanged:s,numberWidthChanged:a})}};applyNewHeight(t,n){if(n!==t.currentHeight)t.currentHeight=Math.max(n,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`)}};function Qm(e){let t=Math.max(Math.floor(e),0);return t===0?"auto":t}function eg(e){return Math.max(Math.ceil(e),0)}function tg(e,t){if(e.applyColumnVariables===t)return;if(e.applyColumnVariables=t,t)Ud(e,{codeWidthChanged:!0,numberWidthChanged:!0});else zd(e)}function Ud(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:i,codeWidth:r,numberWidth:o}=e;if(t)i.style.setProperty("--diffs-column-width",`${typeof r==="number"?`${r}px`:"auto"}`);if(n)i.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`);if(t||n&&r!=="auto"){let s=typeof r==="number"?Math.max(r-o,0):0;i.style.setProperty("--diffs-column-content-width",`${s>0?`${s}px`:"auto"}`)}}function zd(e){e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width")}function ng(e){if(e.codeElement.isConnected)zd(e)}function ig(e){if(e.column1.container.isConnected)e.column1.container.style.removeProperty("--diffs-annotation-min-height");if(e.column2.container.isConnected)e.column2.container.style.removeProperty("--diffs-annotation-min-height")}function St(e,t){if(e==null||t==null)return e===t;return e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function Gn(e){return(e.lang??oe(e.name))==="text"}function cn(e){for(let t of Array.isArray(e)?e:[e]){if(t==="text"||t==="ansi")continue;if(!Bt.has(t))return!1}return!0}function un(e=z){let t=[];if(typeof e==="string")t.push(e);else t.push(e.dark),t.push(e.light);return t}function Dt(e){for(let t of un(e))if(!Qt.has(t))return!1;return!0}function Bd(e){return de.hasResolvedThemes(e)}function dr(e,t){if(e.endsWith(`\r
|
|
179
|
+
`))return t+`\r
|
|
180
|
+
`;if(e.endsWith("\r"))return t+"\r";if(e.endsWith(`
|
|
181
|
+
`))return t+`
|
|
182
|
+
`;return t}function Ft(e,t){return Ie(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function Wn(e){return H({tagName:"div",children:[H({tagName:"div",children:e.annotations?.map((t)=>H({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function cr(e,t){return H({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function $d(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 ur({fileOrDiff:e,mode:t,stickyHeader:n}){let i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return H({tagName:"div",children:[t==="custom"?H({tagName:"slot",properties:{name:mn}}):rg({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[og(i)]],properties:r})}function rg({name:e,prevName:t,iconType:n}){let i=[H({tagName:"slot",properties:{name:hn}}),Nt({name:$d(n),properties:{"data-change-icon":n}})];if(t!=null)i.push(H({tagName:"div",children:[H({tagName:"bdi",children:[be(t)]})],properties:{"data-prev-name":""}})),i.push(Nt({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}));return i.push(H({tagName:"div",children:[H({tagName:"bdi",children:[be(e)]})],properties:{"data-title":""}})),i.push(H({tagName:"slot",properties:{name:fn}})),H({tagName:"div",children:i,properties:{"data-header-content":""}})}function og(e){let t=[];if(e!=null){let n=0,i=0;for(let r of e.hunks)n+=r.additionLines,i+=r.deletionLines;if(i>0||n===0)t.push(H({tagName:"span",children:[be(`-${i}`)],properties:{"data-deletions-count":""}}));if(n>0||i===0)t.push(H({tagName:"span",children:[be(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push(H({tagName:"slot",properties:{name:pn}})),H({tagName:"div",children:t,properties:{"data-metadata":""}})}function hr(e){return H({tagName:"pre",properties:sg(e)})}function sg({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,split:r,totalLines:o,type:s,customProperties:a}){return{...a,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":i,"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:${`${o}`.length}ch;`}}function fr(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:un(t),preferredHighlighter:n}}function Vd(e,t,n){let i=typeof n.lineInfo==="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}if(e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0)e.children.push(be(`
|
|
183
|
+
`));return e}var pr=Symbol("no-token"),ls=Symbol("multiple-tokens");function ds(e){let t=ag(e);if(t!=null)return t;let n=pr,i=[],r=[],o,s=()=>{if(r.length===0||o==null){r=[],o=void 0;return}if(r.length===1){let l=r[0];if(l?.type==="element"){lg(l,o);for(let d of l.children)mr(d)}else mr(l);i.push(l),r=[],o=void 0;return}for(let l of r)mr(l);i.push(H({tagName:"span",properties:{"data-char":o},children:r})),r=[],o=void 0},a=(l)=>{if(l===pr)return;if(l===ls){n=ls;return}if(n===pr){n=l;return}if(n!==l)n=ls};for(let l of e.children){let d=l.type==="element"?ds(l):pr;if(a(d),typeof d!=="number"){s(),i.push(l);continue}if(o!=null&&o!==d)s();o??=d,r.push(l)}return s(),e.children=i,n}function ag(e){let t=e.properties["data-char"];if(typeof t==="number")return t}function mr(e){if(e.type!=="element")return;e.properties["data-char"]=void 0;for(let t of e.children)mr(t)}function lg(e,t){e.properties["data-char"]=t}var Sw=Symbol("highlighted-lines");function Gd(e={}){let{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=(a)=>a}=e,r=new Map;function o(a){return Object.entries(a).map(([l,d])=>`${l}:${d}`).join(";")}function s(a){let l=typeof a==="string"?a:o(a),d=t+dg(l)+n;if(d=i(d),!r.has(d))r.set(d,typeof a==="string"?a:{...a});return d}return{name:"@shikijs/transformers:style-to-class",pre(a){if(!a.properties.style)return;let l=s(a.properties.style);delete a.properties.style,this.addClassToHast(a,l)},tokens(a){for(let l of a)for(let d of l){if(!d.htmlStyle)continue;let c=s(d.htmlStyle);if(d.htmlStyle={},d.htmlAttrs||={},!d.htmlAttrs.class)d.htmlAttrs.class=c;else d.htmlAttrs.class+=` ${c}`}},getClassRegistry(){return r},getCSS(){let a="";for(let[l,d]of r.entries())a+=`.${l}{${typeof d==="string"?d:o(d)}}`;return a},clearRegistry(){r.clear()}}}function dg(e,t=0){let n=3735928559^t,i=1103547991^t;for(let r=0,o;r<e.length;r++)o=e.charCodeAt(r),n=Math.imul(n^o,2654435761),i=Math.imul(i^o,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function gr(e=!1,t=!1){let n={lineInfo:[]},i=[{line(r){return delete r.properties.class,r},pre(r){let o=Hd(r),s=[];if(o!=null){let a=1;for(let l of o.children){if(l.type!=="element")continue;if(e)ds(l);s.push(Vd(l,a,n)),a++}o.children=s}return r},...e?{tokens(r){for(let o of r){let s=0;for(let a of o){let l=a;l.__lineChar??=s,s+=a.content.length}}},preprocess(r,o){o.mergeWhitespaces="never"},span(r,o,s,a,l){if(l?.offset!=null&&l.content!=null){let d=l.__lineChar;if(d!=null)r.properties["data-char"]=d;return r}return r}}:null}];if(t)i.push(cg,Wd);if(e)i.push({line:(r)=>{if(r.type==="element"&&r.children.length===0)r.children.push({type:"element",tagName:"br",properties:{},children:[]});return r}});return{state:n,transformers:i,toClass:Wd}}var Wd=Gd({classPrefix:"hl-"}),cg={name:"token-style-normalizer",tokens(e){for(let t of e)for(let n of t){if(n.htmlStyle!=null)continue;let i={};if(n.color!=null)i.color=n.color;if(n.bgColor!=null)i["background-color"]=n.bgColor;if(n.fontStyle!=null&&n.fontStyle!==0){if((n.fontStyle&1)!==0)i["font-style"]="italic";if((n.fontStyle&2)!==0)i["font-weight"]="bold";if((n.fontStyle&4)!==0)i["text-decoration"]="underline"}if(Object.keys(i).length>0)n.htmlStyle=i}}};function ce(e){return`--${e==="token"?"diffs-token":"diffs"}-`}function Sr({theme:e=z,highlighter:t,prefix:n}){let i="";if(typeof e==="string"){let r=t.getTheme(e),o=yr(r);i+=`color:${o.fg};`,i+=`background-color:${o.bg};`,i+=`${ce("global")}fg:${o.fg};`,i+=`${ce("global")}bg:${o.bg};`,i+=cs(r,n)}else{let r=t.getTheme(e.dark),o=yr(r);i+=`${ce("global")}dark:${o.fg};`,i+=`${ce("global")}dark-bg:${o.bg};`,i+=cs(r,"dark"),r=t.getTheme(e.light),o=yr(r),i+=`${ce("global")}light:${o.fg};`,i+=`${ce("global")}light-bg:${o.bg};`,i+=cs(r,"light")}return i}function cs(e,t){t=t!=null?`${t}-`:"";let n="",i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];if(i!=null)n+=`${ce("global")}${t}addition-color:${i};`;let r=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];if(r!=null)n+=`${ce("global")}${t}deletion-color:${r};`;let o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];if(o!=null)n+=`${ce("global")}${t}modified-color:${o};`;return n}function jn(e){let t=e.children[0];while(t!=null){if(t.type==="element"&&t.tagName==="code")return t.children;if("children"in t)t=t.children[0];else t=null}throw console.error(e),Error("getLineNodes: Unable to find children")}var ug={forcePlainText:!1};function jd(e,t,{theme:n=z,tokenizeMaxLineLength:i,useTokenTransformer:r},{forcePlainText:o,startingLine:s,totalLines:a,lines:l}=ug){if(o)s??=0,a??=1/0;else s=0,a=1/0;let d=s>0||a<1/0,{state:c,transformers:u}=gr(r),h=o?"text":e.lang??oe(e.name),f=typeof n==="string"?t.getTheme(n).type:void 0,m=Sr({theme:n,highlighter:t});c.lineInfo=(S)=>({type:"context",lineIndex:S-1+s,lineNumber:S+s});let y=(()=>{if(typeof n==="string")return{lang:h,theme:n,transformers:u,defaultColor:!1,cssVariablePrefix:ce("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0};return{lang:h,themes:n,transformers:u,defaultColor:!1,cssVariablePrefix:ce("token"),tokenizeMaxLineLength:i,tokenizeTimeLimit:0}})(),v=jn(t.codeToHast(d?hg(l??gn(e.contents),s,a):e.contents,y)),g=d?Array(s):v;if(d)g.push(...v);return{code:g,themeStyles:m,baseThemeType:f}}function hg(e,t,n){if(e.length===0)return"";let i=Math.min(t+n,e.length);return e.slice(t,i).join("")}function vr(e,t){return t.cacheKey==null?e.file===t&&e.sourceContents===t.contents:e.cacheKey===t.cacheKey}var fg=-1,qd=class{options;onRenderUpdate;workerManager;__id=`file-renderer:${++fg}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;pendingStructuralRows;textDocumentCache=new WeakMap;editSessionActive=!1;constructor(e={theme:z},t,n){if(this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0)this.highlighter=Dt(e.theme??z)?Dn():void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(let t of e){let n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}beginEditSession(){this.editSessionActive=!0}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0,this.endEditSession(),this.textDocumentCache=new WeakMap}syncEditedContentsToFile(){let{renderCache:e,lineCache:t}=this;if(e?.isDirty!==!0||t==null||!vr(t,e.file))return;e.file.contents=t.lines.join("")}hasUnkeyedFileContentsChanged(e){let{lineCache:t}=this;return e.cacheKey==null&&t!=null&&t.file===e&&t.sourceContents!==e.contents}invalidateChangedUnkeyedFile(e){if(!this.hasUnkeyedFileContentsChanged(e))return;this.workerManager?.cleanUpTasks(this),this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap}clearRenderCache(){this.syncEditedContentsToFile(),this.pendingStructuralRows=void 0;let e=this.renderCache;if(this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.file.cacheKey!=null)this.workerManager?.evictFileFromCache(e.file.cacheKey)}hydrate(e){let{options:t}=this.getRenderOptions(e),n=us(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength()),i=this.workerManager?.getFileResultCache(e);if(i!=null&&!Ft(t,i.options))i=void 0;if(this.renderCache??={file:e,options:t,highlighted:!n&&!Gn(e),result:n?void 0:i?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){if(this.renderCache.result==null&&!n)this.workerManager.highlightFileAST(this,e)}else if(this.highlighter==null)this.computedLang=e.lang??oe(e.name),this.initializeHighlighter()}getLocalHighlightTheme(){return this.workerManager?.getFileRenderOptions().theme??this.options.theme??z}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getFileRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let r=this.workerManager.getFileRenderOptions();if(this.editSessionActive&&r.useTokenTransformer!==!0)return{...r,useTokenTransformer:!0};return r}let{tokenizeMaxLineLength:i=1000}=this.options;return{theme:this.getLocalHighlightTheme(),useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:i}})(),{renderCache:n}=this;if(n?.result==null)return{options:t,forceHighlight:!0};if(!fe(e,n.file)||!Ft(t,n.options))return{options:t,forceHighlight:!0};return{options:t,forceHighlight:!1}}getOrCreateLineCache(e){this.invalidateChangedUnkeyedFile(e);let{lineCache:t}=this;if(t==null||!vr(t,e))t={cacheKey:e.cacheKey,file:e,sourceContents:e.contents,lines:gn(e.contents)};return this.lineCache=t,t.lines}getLineCount(e){let t=this.getOrCreateLineCache(e);return this.textDocumentCache.get(e)?.lineCount??t.length}updateRenderCache(e,t,n=!1){if(this.pendingStructuralRows=void 0,this.renderCache==null)return;let{file:i,result:r}=this.renderCache;if(r==null)return;let o=n?new Map:void 0;this.pendingStructuralRows=o;let s=this.lineCache!=null&&vr(this.lineCache,i)?this.lineCache:void 0;for(let[a,l]of e){if(o===void 0&&s!=null&&a<s.lines.length){let c=l.map((u)=>u[2]).join("");s.lines[a]=dr(s.lines[a]??"",c)}let d={type:"element",tagName:"div",properties:{"data-line":a+1,"data-line-type":"context","data-line-index":a},children:l.map(([c,u,h])=>{if(c===0&&u===""){if(h==="")return{type:"element",tagName:"br",properties:{},children:[]};return{type:"text",value:h}}return{type:"element",tagName:"span",properties:{"data-char":c,style:`color:${u};`},children:[{type:"text",value:h}]}})};if(o!==void 0)o.set(a,d);else r.code[a]=d}r.baseThemeType=t,this.renderCache.isDirty=!0}applyDocumentChange(e){let t=this.pendingStructuralRows;if(this.pendingStructuralRows=void 0,this.renderCache==null)return;let{file:n,result:i}=this.renderCache;if(i==null)return;let r=this.lineCache!=null&&vr(this.lineCache,n)?this.lineCache.lines:gn(n.contents),o=gn(e.getText());if(r.length!==o.length){let s=Math.min(r.length,o.length),a=0;while(a<s&&r[a]===o[a])a++;let l=0;while(l<s-a&&r[r.length-1-l]===o[o.length-1-l])l++;let d=i.code;i.code=Array(o.length);for(let c=0;c<a;c++)i.code[c]=d[c];for(let c=0;c<l;c++)i.code[o.length-1-c]=d[r.length-1-c];if(t!==void 0){for(let[c,u]of t)if(c<o.length)i.code[c]=u}for(let c=a;c<o.length-l;c++)i.code[c]??={type:"element",tagName:"div",properties:{"data-line":c+1,"data-line-type":"context","data-line-index":c},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:e.getLineText(c)}]}]};for(let c=0;c<i.code.length;c++){let u=i.code[c];if(u?.type==="element")u.properties["data-line"]=c+1,u.properties["data-line-index"]=c}this.renderCache.isDirty=!0}this.lineCache={cacheKey:n.cacheKey,file:n,sourceContents:n.contents,lines:o},this.textDocumentCache.set(n,e)}renderFile(e=this.renderCache?.file,t=yn){if(e==null)return;if(this.invalidateChangedUnkeyedFile(e),this.renderCache?.isDirty===!0&&!fe(e,this.renderCache.file))this.clearRenderCache(),this.lineCache=void 0,this.textDocumentCache=new WeakMap;let{options:n,forceHighlight:i}=this.getRenderOptions(e);if(this.renderCache?.isDirty===!0&&!Ft(n,this.renderCache.options))this.clearRenderCache();let r=this.getMatchingWorkerResultCache(e,n);if(r!=null&&!this.hasHighlightedRenderCache(e,n))this.renderCache={file:e,highlighted:!0,renderRange:void 0,...r},i=!1;this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};let o=this.getOrCreateLineCache(e),s=e.contents.length>0,a=!s||Gn(e)||us(o.length,this.getTokenizeMaxLength()),l=!fe(e,this.renderCache.file),d=!St(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){if(a||this.renderCache.result==null||!this.renderCache.highlighted&&(l||d)){if(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,this.renderCache.result==null||l||d||i)this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,o);this.renderCache.renderRange=t}if(!a&&s&&(!this.renderCache.highlighted||i))this.workerManager.highlightFileAST(this,e)}else{this.computedLang=e.lang??oe(e.name);let c=this.highlighter!=null&&Dt(n.theme),u=this.highlighter!=null&&cn(this.computedLang),h=!a&&u;if(this.highlighter!=null&&c&&(i||a||!this.renderCache.highlighted&&h||this.renderCache.result==null)){let{result:f,options:m}=this.renderFileWithHighlighter(e,this.highlighter,a||!u);this.renderCache={file:e,options:m,highlighted:h,result:f,renderRange:void 0}}if(!c||!a&&!u)this.asyncHighlight(e).then(({result:f,options:m})=>{if(this.renderCache!=null)this.renderCache.highlighted=!1;this.applyHighlightResult(e,f,m,!a)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=yn){let{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){let t=us(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??oe(e.name);let n=this.highlighter!=null&&Bd(un(this.getLocalHighlightTheme())),i=t||this.highlighter!=null&&cn(this.computedLang);if(this.highlighter==null||!n||!i)this.highlighter=await this.initializeHighlighter();return this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){let{options:i}=this.getRenderOptions(e);return{result:jd(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){let o=this.getLineCount(e),{disableFileHeader:s=!1}=this.options,a=[],l=gt(),d=Math.min(t.startingLine+t.totalLines,o),c=0,u=mt(t)?Bn(this.lineAnnotations):void 0;if(u!=null)l.children.push(pe("context","annotation",1)),a.push(Wn({type:"annotation",hunkIndex:-1,lineIndex:-1,annotations:u.map((h)=>Ee(h))})),c++;for(let h=t.startingLine;h<d;h++){let f=h+1,m=n[h];if(m==null)throw console.error("FileRenderer.processFileResult: Line doesnt exist",{name:e.name,lineIndex:h,lineNumber:f}),Error("FileRenderer.processFileResult: Line doesnt exist");l.children.push(rr("context",f,`${h}`)),a.push(m),c++;let y=this.lineAnnotations[f];if(y!=null)l.children.push(pe("context","annotation",1)),a.push(Wn({type:"annotation",hunkIndex:0,lineIndex:f,annotations:y.map((v)=>Ee(v))})),c++}return l.properties.style=`grid-row: span ${c}`,{gutterAST:l.children??[],contentAST:a,preAST:this.createPreElement(o),headerAST:!s?this.renderHeader(e):void 0,totalLines:o,rowCount:c,themeStyles:i,baseThemeType:r,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){let{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return ur({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return X(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push(H({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){let t=gt();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,cr(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){if(!t)return X(e);return X(H({tagName:"code",children:e,properties:{"data-code":""}}))}async initializeHighlighter(){return this.highlighter=await en(fr(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}onHighlightSuccess(e,t,n,i=!0){if(this.editSessionActive)return;this.applyHighlightResult(e,t,n,i)}applyHighlightResult(e,t,n,i=!0){if(this.renderCache==null)return;let r=!fe(e,this.renderCache.file)||!this.renderCache.highlighted||!Ft(n,this.renderCache.options);if(this.renderCache={file:e,options:n,highlighted:i,result:t,renderRange:void 0},r)this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getFileResultCache(e);if(n==null||!Ft(t,n.options))return;return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&fe(e,n.file)&&Ft(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}createPreElement(e){let{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return hr({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function us(e,t){return e>t}var br=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
184
|
+
<symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
|
|
185
|
+
<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"/>
|
|
186
|
+
</symbol>
|
|
187
|
+
<symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
|
|
188
|
+
<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"/>
|
|
189
|
+
</symbol>
|
|
190
|
+
<symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
|
|
191
|
+
<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"/>
|
|
192
|
+
</symbol>
|
|
193
|
+
<symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
|
|
194
|
+
<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"/>
|
|
195
|
+
</symbol>
|
|
196
|
+
<symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
|
|
197
|
+
<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"/>
|
|
198
|
+
</symbol>
|
|
199
|
+
<symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
|
|
200
|
+
<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"/>
|
|
201
|
+
</symbol>
|
|
202
|
+
<symbol id="diffs-icon-expand" viewBox="0 0 16 16">
|
|
203
|
+
<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"/>
|
|
204
|
+
</symbol>
|
|
205
|
+
<symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
|
|
206
|
+
<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"/>
|
|
207
|
+
</symbol>
|
|
208
|
+
<symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
|
|
209
|
+
<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"/>
|
|
210
|
+
</symbol>
|
|
211
|
+
<symbol id="diffs-icon-plus" viewBox="0 0 16 16">
|
|
212
|
+
<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"/>
|
|
213
|
+
</symbol>
|
|
214
|
+
<symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
|
|
215
|
+
<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"/>
|
|
216
|
+
</symbol>
|
|
217
|
+
<symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
|
|
218
|
+
<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"/>
|
|
219
|
+
</symbol>
|
|
220
|
+
<symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
|
|
221
|
+
<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"/>
|
|
222
|
+
</symbol>
|
|
223
|
+
<symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
|
|
224
|
+
<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"/>
|
|
225
|
+
</symbol>
|
|
226
|
+
<symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
|
|
227
|
+
<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"/>
|
|
228
|
+
</symbol>
|
|
229
|
+
<symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
|
|
230
|
+
<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"/>
|
|
231
|
+
</symbol>
|
|
232
|
+
<symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
|
|
233
|
+
<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"/>
|
|
234
|
+
</symbol>
|
|
235
|
+
</svg>`;function Kd(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function Cr(e,t){if(e==null||t==null)return e===t;return pg(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 Xd={};function pg(e=Xd,t=Xd){if(e===t)return!0;let n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function xr(e){let t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function kr(){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 wr(){let e=document.createElement("style");return e.setAttribute(Yd,""),e}var Lr;function vt(e){if(Lr!=null)return Lr;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(Jd,"true");let i=document.createElement("div");return i.style.position="relative",i.style.width="200%",i.style.height="200%",n.appendChild(i),e.appendChild(n),Lr=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Lr}function hs(e){return`${Er}: ${e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`};`}var fs=`@layer base {
|
|
236
|
+
:host {
|
|
237
|
+
--diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
|
|
238
|
+
"Courier New", monospace;
|
|
239
|
+
--diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
|
|
240
|
+
"Noto Sans", "Liberation Sans", Arial, sans-serif;
|
|
241
|
+
--diffs-mixer: light-dark(#000, #fff);
|
|
242
|
+
--diffs-gap-fallback: 8px;
|
|
243
|
+
--diffs-scrollbar-gutter-fallback: 6px;
|
|
244
|
+
--diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
|
|
245
|
+
--diffs-added-light: #0dbe4e;
|
|
246
|
+
--diffs-added-dark: #5ecc71;
|
|
247
|
+
--diffs-modified-light: #009fff;
|
|
248
|
+
--diffs-modified-dark: #69b1ff;
|
|
249
|
+
--diffs-deleted-light: #ff2e3f;
|
|
250
|
+
--diffs-deleted-dark: #ff6762;
|
|
251
|
+
--diffs-warning-light: #d5a910;
|
|
252
|
+
--diffs-warning-dark: #ffd452;
|
|
253
|
+
color-scheme: light dark;
|
|
254
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
255
|
+
font-size: var(--diffs-font-size, 13px);
|
|
256
|
+
line-height: var(--diffs-line-height, 20px);
|
|
257
|
+
font-feature-settings: var(--diffs-font-features);
|
|
258
|
+
--diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
|
|
259
|
+
--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))));
|
|
260
|
+
--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))));
|
|
261
|
+
--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))));
|
|
262
|
+
--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))));
|
|
263
|
+
--diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
|
|
264
|
+
--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))));
|
|
265
|
+
--diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
|
|
266
|
+
--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)))));
|
|
267
|
+
--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)))));
|
|
268
|
+
--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)))));
|
|
269
|
+
--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))));
|
|
270
|
+
--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)));
|
|
271
|
+
--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))));
|
|
272
|
+
--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)));
|
|
273
|
+
--diffs-selection-base: var(--diffs-modified-base);
|
|
274
|
+
--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)));
|
|
275
|
+
background-color: var(--diffs-bg);
|
|
276
|
+
color: var(--diffs-fg);
|
|
277
|
+
display: block;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
pre, code, [data-error-wrapper] {
|
|
281
|
+
isolation: isolate;
|
|
282
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
283
|
+
outline: none;
|
|
284
|
+
margin: 0;
|
|
285
|
+
padding: 0;
|
|
286
|
+
display: block;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
pre, code {
|
|
290
|
+
background-color: var(--diffs-bg);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
code {
|
|
294
|
+
contain: content;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
input, button {
|
|
298
|
+
font-family: inherit;
|
|
299
|
+
font-size: inherit;
|
|
300
|
+
line-height: inherit;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
*, :before, :after {
|
|
304
|
+
box-sizing: border-box;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
[data-icon-sprite] {
|
|
308
|
+
display: none;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
[data-diffs-header], [data-separator] {
|
|
312
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
[data-diffs-header][data-sticky] {
|
|
316
|
+
z-index: 1;
|
|
317
|
+
background-color: var(--diffs-bg);
|
|
318
|
+
position: sticky;
|
|
319
|
+
top: 0;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
[data-file-info] {
|
|
323
|
+
color: var(--fg);
|
|
324
|
+
background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
|
|
325
|
+
border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
|
|
326
|
+
padding: 10px;
|
|
327
|
+
font-weight: 700;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
[data-diff], [data-file] {
|
|
331
|
+
--diffs-grid-number-column-width: minmax(min-content, max-content);
|
|
332
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
|
|
333
|
+
|
|
334
|
+
&[data-dehydrated] {
|
|
335
|
+
--diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
&:hover [data-code]::-webkit-scrollbar-thumb {
|
|
339
|
+
background-color: var(--diffs-bg-context);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
@supports (-webkit-touch-callout: none) {
|
|
344
|
+
:host {
|
|
345
|
+
--diffs-scrollbar-gutter-fallback: 0px;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
[data-line] span {
|
|
350
|
+
color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
|
|
351
|
+
background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
|
|
352
|
+
font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
|
|
353
|
+
font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
|
|
354
|
+
text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
[data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
|
|
358
|
+
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
359
|
+
--diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
|
|
360
|
+
--diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
|
|
361
|
+
--diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
|
|
362
|
+
--diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
|
|
363
|
+
--diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
|
|
364
|
+
--diffs-line-bg: var(--diffs-computed-hovered-line-bg);
|
|
365
|
+
color: var(--diffs-fg);
|
|
366
|
+
background-color: var(--diffs-line-bg, var(--diffs-bg));
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
[data-line], [data-no-newline] {
|
|
370
|
+
&[data-decoration-bg] {
|
|
371
|
+
--mix-deco-light: 92%;
|
|
372
|
+
--mix-deco-dark: 85%;
|
|
373
|
+
|
|
374
|
+
&[data-decoration-bg-depth="2"] {
|
|
375
|
+
--mix-deco-light: 88%;
|
|
376
|
+
--mix-deco-dark: 80%;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
&[data-decoration-bg-depth="3"] {
|
|
380
|
+
--mix-deco-light: 85%;
|
|
381
|
+
--mix-deco-dark: 78%;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
--diffs-hover-mix-target: var(--diffs-decoration-bg);
|
|
385
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
386
|
+
var(--diffs-bg) var(--mix-deco-light),
|
|
387
|
+
var(--diffs-decoration-bg)), color-mix(in lab,
|
|
388
|
+
var(--diffs-bg) var(--mix-deco-dark),
|
|
389
|
+
var(--diffs-decoration-bg)));
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
[data-line-annotation], [data-gutter-buffer="annotation"] {
|
|
394
|
+
--diffs-annotation-bg: var(--diffs-bg-context);
|
|
395
|
+
--diffs-computed-decoration-bg: var(--diffs-annotation-bg);
|
|
396
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
[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"] {
|
|
400
|
+
--diffs-computed-decoration-bg: var(--diffs-bg-context);
|
|
401
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
[data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
|
|
405
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
406
|
+
var(--diffs-bg) 78%,
|
|
407
|
+
var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
|
|
408
|
+
var(--diffs-bg) 68%,
|
|
409
|
+
var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
|
|
410
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
[data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
|
|
414
|
+
--diffs-computed-decoration-bg: light-dark(color-mix(in lab,
|
|
415
|
+
var(--diffs-bg) 78%,
|
|
416
|
+
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
|
|
417
|
+
var(--diffs-bg) 68%,
|
|
418
|
+
var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
|
|
419
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
[data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
|
|
423
|
+
--diffs-computed-decoration-bg: var(--diffs-bg);
|
|
424
|
+
--diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
:where([data-background]) {
|
|
428
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
429
|
+
--mix-light: 91%;
|
|
430
|
+
--mix-dark: 85%;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
& [data-line], & [data-no-newline] {
|
|
434
|
+
--mix-light: 88%;
|
|
435
|
+
--mix-dark: 80%;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
& [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
|
|
439
|
+
--diffs-diff-line-mix-target: var(--diffs-bg);
|
|
440
|
+
|
|
441
|
+
&[data-line-type="change-deletion"] {
|
|
442
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
|
|
443
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
444
|
+
|
|
445
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
446
|
+
color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
|
|
447
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
451
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
452
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
453
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
454
|
+
var(--diffs-diff-line-mix-target)));
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
&[data-line-type="change-addition"] {
|
|
458
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
|
|
459
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
460
|
+
|
|
461
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
462
|
+
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
463
|
+
--diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
467
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
468
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
469
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
470
|
+
var(--diffs-diff-line-mix-target)));
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
&[data-merge-conflict="current"] {
|
|
474
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
|
|
475
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
476
|
+
|
|
477
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
478
|
+
color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
|
|
479
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
483
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
484
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
485
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
486
|
+
var(--diffs-diff-line-mix-target)));
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
&[data-merge-conflict="incoming"] {
|
|
490
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
|
|
491
|
+
--diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
|
|
492
|
+
|
|
493
|
+
&:where([data-gutter-buffer], [data-column-number]) {
|
|
494
|
+
color: var(--diffs-modified-base);
|
|
495
|
+
--diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
--diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
|
|
499
|
+
var(--diffs-computed-decoration-bg) var(--mix-light),
|
|
500
|
+
var(--diffs-diff-line-mix-target)), color-mix(in lab,
|
|
501
|
+
var(--diffs-computed-decoration-bg) var(--mix-dark),
|
|
502
|
+
var(--diffs-diff-line-mix-target)));
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
[data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
|
|
508
|
+
--diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
|
|
509
|
+
--diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
|
|
510
|
+
|
|
511
|
+
&:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
|
|
512
|
+
--mix-selection-light: 82%;
|
|
513
|
+
--mix-selection-dark: 75%;
|
|
514
|
+
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
&:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
|
|
518
|
+
--mix-selection-light: 75%;
|
|
519
|
+
--mix-selection-dark: 60%;
|
|
520
|
+
--diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
|
|
521
|
+
--diffs-hover-mix-target: var(--diffs-selection-mix-target);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
&:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
|
|
525
|
+
--diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
|
|
526
|
+
var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
|
|
527
|
+
var(--mix-selection-light),
|
|
528
|
+
var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
&:where([data-editor-overlay]), &[data-selected-line] {
|
|
532
|
+
--diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
|
|
533
|
+
var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
|
|
534
|
+
var(--diffs-selection-mix-target)), color-mix(in lab,
|
|
535
|
+
var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
|
|
536
|
+
var(--diffs-selection-mix-target)));
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
[data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
|
|
541
|
+
--diffs-computed-editor-active-line-bg: color-mix(in lab,
|
|
542
|
+
var(--diffs-computed-selected-line-bg)
|
|
543
|
+
var(--diffs-editor-active-line-source-mix, 100%),
|
|
544
|
+
var(--diffs-selection-emphasis-mix-target));
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
@media (pointer: fine) {
|
|
548
|
+
[data-line][data-hovered], [data-gutter-buffer][data-hovered], [data-column-number][data-hovered], [data-line-annotation][data-hovered], [data-no-newline][data-hovered], [data-merge-conflict][data-hovered], [data-merge-conflict-actions][data-hovered], [data-editor-overlay][data-hovered] {
|
|
549
|
+
--diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
|
|
550
|
+
var(--diffs-computed-editor-active-line-bg) 97%,
|
|
551
|
+
var(--diffs-hover-mix-target)), color-mix(in lab,
|
|
552
|
+
var(--diffs-computed-editor-active-line-bg) 91%,
|
|
553
|
+
var(--diffs-hover-mix-target)));
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
[data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
|
|
558
|
+
color: var(--diffs-selection-number-fg);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
[data-no-newline] {
|
|
562
|
+
user-select: none;
|
|
563
|
+
|
|
564
|
+
& span {
|
|
565
|
+
opacity: .6;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
[data-diff-type="split"][data-overflow="scroll"] {
|
|
570
|
+
grid-template-columns: 1fr 1fr;
|
|
571
|
+
display: grid;
|
|
572
|
+
|
|
573
|
+
& [data-additions] {
|
|
574
|
+
border-left: 1px solid var(--diffs-bg);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
& [data-deletions] {
|
|
578
|
+
border-right: 1px solid var(--diffs-bg);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
[data-code] {
|
|
583
|
+
grid-auto-flow: dense;
|
|
584
|
+
grid-template-columns: var(--diffs-code-grid);
|
|
585
|
+
overflow: var(--diffs-overflow-override, scroll) clip;
|
|
586
|
+
overscroll-behavior-x: none;
|
|
587
|
+
tab-size: var(--diffs-tab-size, 2);
|
|
588
|
+
padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
589
|
+
padding-bottom: max(0px,
|
|
590
|
+
calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
|
|
591
|
+
var(--diffs-scrollbar-gutter)));
|
|
592
|
+
scrollbar-gutter: stable;
|
|
593
|
+
align-self: flex-start;
|
|
594
|
+
display: grid;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
[data-diffs-scrollbar-measure] {
|
|
598
|
+
opacity: 0;
|
|
599
|
+
pointer-events: none;
|
|
600
|
+
scrollbar-gutter: auto;
|
|
601
|
+
grid-template-columns: none;
|
|
602
|
+
width: 100px;
|
|
603
|
+
height: 100px;
|
|
604
|
+
padding: 0;
|
|
605
|
+
position: absolute;
|
|
606
|
+
top: -200px;
|
|
607
|
+
left: -200px;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
[data-container-size] {
|
|
611
|
+
container-type: inline-size;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
[data-code]::-webkit-scrollbar {
|
|
615
|
+
width: 0;
|
|
616
|
+
height: var(--diffs-scrollbar-gutter);
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
[data-code]::-webkit-scrollbar-track {
|
|
620
|
+
background: none;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
[data-code]::-webkit-scrollbar-thumb {
|
|
624
|
+
background-color: #0000;
|
|
625
|
+
background-clip: content-box;
|
|
626
|
+
border: 1px solid #0000;
|
|
627
|
+
border-radius: 3px;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
[data-code]::-webkit-scrollbar-corner {
|
|
631
|
+
background-color: #0000;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
@supports ((-moz-appearance: none)) {
|
|
635
|
+
[data-code] {
|
|
636
|
+
scrollbar-width: thin;
|
|
637
|
+
scrollbar-color: var(--diffs-bg-context) transparent;
|
|
638
|
+
padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
[data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
|
|
643
|
+
& [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
644
|
+
padding-top: 0;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
[data-gutter] {
|
|
649
|
+
grid-template-rows: subgrid;
|
|
650
|
+
grid-template-columns: subgrid;
|
|
651
|
+
z-index: 3;
|
|
652
|
+
background-color: var(--diffs-bg);
|
|
653
|
+
grid-column: 1;
|
|
654
|
+
display: grid;
|
|
655
|
+
position: relative;
|
|
656
|
+
|
|
657
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
658
|
+
border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
[data-content] {
|
|
663
|
+
grid-template-rows: subgrid;
|
|
664
|
+
grid-template-columns: subgrid;
|
|
665
|
+
background-color: var(--diffs-bg);
|
|
666
|
+
grid-column: 2;
|
|
667
|
+
min-width: 0;
|
|
668
|
+
display: grid;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
[data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
|
|
672
|
+
grid-auto-flow: dense;
|
|
673
|
+
grid-template-columns: repeat(2, var(--diffs-code-grid));
|
|
674
|
+
padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
675
|
+
display: grid;
|
|
676
|
+
|
|
677
|
+
& [data-code] {
|
|
678
|
+
display: contents;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
& [data-deletions] {
|
|
682
|
+
& [data-gutter] {
|
|
683
|
+
grid-column: 1;
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
& [data-content] {
|
|
687
|
+
border-right: 1px solid var(--diffs-bg);
|
|
688
|
+
grid-column: 2;
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
& [data-additions] {
|
|
693
|
+
& [data-gutter] {
|
|
694
|
+
border-left: 1px solid var(--diffs-bg);
|
|
695
|
+
grid-column: 3;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
& [data-content] {
|
|
699
|
+
grid-column: 4;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
|
|
705
|
+
overflow: clip;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
[data-overflow="scroll"] [data-gutter] {
|
|
709
|
+
position: sticky;
|
|
710
|
+
left: 0;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
[data-interactive-lines] [data-line] {
|
|
714
|
+
cursor: pointer;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
[data-interactive-line-numbers] [data-column-number] {
|
|
718
|
+
cursor: pointer;
|
|
719
|
+
touch-action: none;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
[data-content-buffer], [data-gutter-buffer] {
|
|
723
|
+
user-select: none;
|
|
724
|
+
min-height: 1lh;
|
|
725
|
+
position: relative;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
[data-gutter-buffer] {
|
|
729
|
+
padding-left: 2ch;
|
|
730
|
+
padding-right: 1ch;
|
|
731
|
+
|
|
732
|
+
&:before {
|
|
733
|
+
content: "";
|
|
734
|
+
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
735
|
+
display: block;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
[data-gutter-buffer="annotation"] {
|
|
740
|
+
--diffs-annotation-bg: var(--diffs-bg-context-gutter);
|
|
741
|
+
min-height: 0;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
[data-gutter-buffer="buffer"] {
|
|
745
|
+
--diffs-line-bg: var(--diffs-bg-context-gutter);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
[data-content-buffer] {
|
|
749
|
+
background-position: 5px 0;
|
|
750
|
+
background-size: 8px 8px;
|
|
751
|
+
background-origin: border-box;
|
|
752
|
+
background-image: repeating-linear-gradient(-45deg,
|
|
753
|
+
transparent,
|
|
754
|
+
transparent calc(3px * 1.414),
|
|
755
|
+
var(--diffs-bg-buffer) calc(3px * 1.414),
|
|
756
|
+
var(--diffs-bg-buffer) calc(4px * 1.414));
|
|
757
|
+
grid-column: 1;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
[data-separator] {
|
|
761
|
+
box-sizing: content-box;
|
|
762
|
+
background-color: var(--diffs-bg);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
[data-separator="simple"] {
|
|
766
|
+
min-height: 4px;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
|
|
770
|
+
background-color: var(--diffs-bg-separator);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
[data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
774
|
+
height: 32px;
|
|
775
|
+
position: relative;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
[data-separator-wrapper] {
|
|
779
|
+
user-select: none;
|
|
780
|
+
fill: currentColor;
|
|
781
|
+
background-color: var(--diffs-bg);
|
|
782
|
+
align-items: center;
|
|
783
|
+
height: 100%;
|
|
784
|
+
display: flex;
|
|
785
|
+
position: absolute;
|
|
786
|
+
inset-inline: 0;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
[data-content] [data-separator-wrapper] {
|
|
790
|
+
display: none;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
[data-separator="metadata"] [data-separator-wrapper] {
|
|
794
|
+
background-color: var(--diffs-bg-separator);
|
|
795
|
+
height: 100%;
|
|
796
|
+
color: var(--diffs-fg-number);
|
|
797
|
+
white-space: nowrap;
|
|
798
|
+
text-overflow: ellipsis;
|
|
799
|
+
min-width: min-content;
|
|
800
|
+
padding-inline: 1ch;
|
|
801
|
+
inset-inline: 100% auto;
|
|
802
|
+
overflow: hidden;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
[data-separator="line-info"] {
|
|
806
|
+
margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
|
|
807
|
+
|
|
808
|
+
& [data-separator-wrapper] {
|
|
809
|
+
min-width: 16px;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
[data-separator="line-info-basic"], [data-separator="metadata"] {
|
|
814
|
+
margin-block: 0;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
[data-separator="line-info"][data-separator-first] {
|
|
818
|
+
margin-top: 0;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
[data-separator="line-info"][data-separator-last] {
|
|
822
|
+
margin-bottom: 0;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
[data-expand-index] [data-separator-wrapper] {
|
|
826
|
+
grid-template-columns: 32px auto;
|
|
827
|
+
display: grid;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
[data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
|
|
831
|
+
grid-template-columns: 32px 32px auto;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
[data-expand-button], [data-separator-content] {
|
|
835
|
+
background-color: var(--diffs-bg-separator);
|
|
836
|
+
flex: none;
|
|
837
|
+
align-items: center;
|
|
838
|
+
display: flex;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
[data-expand-index] [data-separator-content]:hover {
|
|
842
|
+
cursor: pointer;
|
|
843
|
+
text-decoration: underline;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
[data-expand-button] {
|
|
847
|
+
cursor: pointer;
|
|
848
|
+
min-width: 32px;
|
|
849
|
+
color: var(--diffs-fg-number);
|
|
850
|
+
border-right: 2px solid var(--diffs-bg);
|
|
851
|
+
flex-shrink: 0;
|
|
852
|
+
justify-content: center;
|
|
853
|
+
align-self: stretch;
|
|
854
|
+
|
|
855
|
+
&:hover {
|
|
856
|
+
color: var(--diffs-fg);
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
&[data-expand-all-button] {
|
|
860
|
+
display: none;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
[data-expand-down] [data-icon] {
|
|
865
|
+
transform: scaleY(-1);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
[data-separator-content] {
|
|
869
|
+
height: 100%;
|
|
870
|
+
color: var(--diffs-fg-number);
|
|
871
|
+
flex: auto;
|
|
872
|
+
justify-content: flex-start;
|
|
873
|
+
padding: 0 1ch;
|
|
874
|
+
overflow: hidden;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
878
|
+
& [data-separator-content] {
|
|
879
|
+
user-select: none;
|
|
880
|
+
height: 100%;
|
|
881
|
+
overflow: clip;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
[data-unmodified-lines] {
|
|
886
|
+
text-overflow: ellipsis;
|
|
887
|
+
white-space: nowrap;
|
|
888
|
+
flex: 0 auto;
|
|
889
|
+
min-width: 0;
|
|
890
|
+
display: block;
|
|
891
|
+
overflow: hidden;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
@supports (width: 1cqi) {
|
|
895
|
+
[data-unified] {
|
|
896
|
+
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
897
|
+
padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
898
|
+
width: 100cqi;
|
|
899
|
+
|
|
900
|
+
& [data-separator-content] {
|
|
901
|
+
border-radius: 6px;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
& [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
|
|
906
|
+
border-top-left-radius: unset;
|
|
907
|
+
border-bottom-left-radius: unset;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
[data-gutter] {
|
|
912
|
+
& [data-separator="line-info"] [data-separator-wrapper] {
|
|
913
|
+
padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
& [data-separator="line-info"] [data-separator-content] {
|
|
917
|
+
border-top-left-radius: 6px;
|
|
918
|
+
border-bottom-left-radius: 6px;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
& [data-separator="line-info"][data-expand-index] [data-separator-content] {
|
|
922
|
+
border-top-left-radius: unset;
|
|
923
|
+
border-bottom-left-radius: unset;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
[data-additions] {
|
|
928
|
+
& [data-content] [data-separator="line-info"] {
|
|
929
|
+
background-color: var(--diffs-bg);
|
|
930
|
+
|
|
931
|
+
& [data-separator-wrapper] {
|
|
932
|
+
display: none;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
& [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
937
|
+
background-color: var(--diffs-bg-separator);
|
|
938
|
+
border-top-right-radius: 6px;
|
|
939
|
+
border-bottom-right-radius: 6px;
|
|
940
|
+
height: 100%;
|
|
941
|
+
display: block;
|
|
942
|
+
|
|
943
|
+
& [data-separator-content], & [data-expand-button] {
|
|
944
|
+
display: none;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
[data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
|
|
950
|
+
width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
[data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
|
|
954
|
+
background-color: var(--diffs-bg-separator);
|
|
955
|
+
height: 100%;
|
|
956
|
+
margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
957
|
+
border-top-right-radius: 6px;
|
|
958
|
+
border-bottom-right-radius: 6px;
|
|
959
|
+
display: block;
|
|
960
|
+
|
|
961
|
+
& [data-separator-content], & [data-expand-button] {
|
|
962
|
+
display: none;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
967
|
+
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
968
|
+
border-top-left-radius: 6px;
|
|
969
|
+
border-bottom-left-radius: 6px;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
@media (pointer: fine) {
|
|
974
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
975
|
+
&[data-separator-multi-button] {
|
|
976
|
+
& [data-expand-up] {
|
|
977
|
+
border-top-left-radius: 6px;
|
|
978
|
+
border-bottom-left-radius: unset;
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
& [data-expand-down] {
|
|
982
|
+
border-bottom-left-radius: 6px;
|
|
983
|
+
border-top-left-radius: unset;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
@media (pointer: coarse) {
|
|
991
|
+
[data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
|
|
992
|
+
grid-template-columns: 34px 34px auto;
|
|
993
|
+
|
|
994
|
+
& [data-separator-content] {
|
|
995
|
+
grid-column: unset;
|
|
996
|
+
grid-row: unset;
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
@supports (width: 1cqi) {
|
|
1001
|
+
[data-separator="line-info"] [data-separator-wrapper] {
|
|
1002
|
+
& [data-expand-both], & [data-expand-down], & [data-expand-up] {
|
|
1003
|
+
border-top-left-radius: 6px;
|
|
1004
|
+
border-bottom-left-radius: 6px;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
&[data-separator-multi-button] {
|
|
1008
|
+
& [data-expand-up] {
|
|
1009
|
+
border-top-left-radius: 6px;
|
|
1010
|
+
border-bottom-left-radius: 6px;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
& [data-expand-down] {
|
|
1014
|
+
border-bottom-left-radius: unset;
|
|
1015
|
+
border-top-left-radius: unset;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
@media (pointer: fine) {
|
|
1023
|
+
[data-separator-wrapper][data-separator-multi-button] {
|
|
1024
|
+
grid-template-rows: 50% 50%;
|
|
1025
|
+
display: grid;
|
|
1026
|
+
|
|
1027
|
+
& [data-separator-content] {
|
|
1028
|
+
grid-area: 1 / 2 / -1;
|
|
1029
|
+
min-width: min-content;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
& [data-expand-button] {
|
|
1033
|
+
grid-column: 1;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
[data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
|
|
1038
|
+
grid-template-columns: 34px auto;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
[data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
|
|
1042
|
+
grid-template-columns: 100% auto;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
[data-separator="line-info"], [data-separator="line-info-basic"] {
|
|
1046
|
+
& [data-separator-multi-button] {
|
|
1047
|
+
& [data-expand-up] {
|
|
1048
|
+
border-bottom: 1px solid var(--diffs-bg);
|
|
1049
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
& [data-expand-down] {
|
|
1053
|
+
border-top: 1px solid var(--diffs-bg);
|
|
1054
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
[data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
|
|
1061
|
+
display: none;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
[data-line-annotation] {
|
|
1065
|
+
min-height: var(--diffs-annotation-min-height, 0);
|
|
1066
|
+
z-index: 2;
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
[data-merge-conflict-actions] {
|
|
1070
|
+
z-index: 2;
|
|
1071
|
+
}
|
|
1072
|
+
|
|
1073
|
+
[data-separator="custom"] {
|
|
1074
|
+
grid-template-columns: subgrid;
|
|
1075
|
+
display: grid;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
[data-line], [data-column-number], [data-no-newline] {
|
|
1079
|
+
padding-inline: 1ch;
|
|
1080
|
+
position: relative;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
[data-indicators="classic"] [data-line] {
|
|
1084
|
+
padding-inline-start: 2ch;
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
[data-indicators="classic"] {
|
|
1088
|
+
& [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
|
|
1089
|
+
&[data-no-newline], &[data-line] {
|
|
1090
|
+
&:before {
|
|
1091
|
+
user-select: none;
|
|
1092
|
+
width: 1ch;
|
|
1093
|
+
height: 1lh;
|
|
1094
|
+
display: inline-block;
|
|
1095
|
+
position: absolute;
|
|
1096
|
+
top: 0;
|
|
1097
|
+
left: 0;
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
& [data-line-type="change-addition"] {
|
|
1103
|
+
&[data-line], &[data-no-newline] {
|
|
1104
|
+
&:before {
|
|
1105
|
+
content: "+";
|
|
1106
|
+
color: var(--diffs-addition-base);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
& [data-line-type="change-deletion"] {
|
|
1112
|
+
&[data-line], &[data-no-newline] {
|
|
1113
|
+
&:before {
|
|
1114
|
+
content: "-";
|
|
1115
|
+
color: var(--diffs-deletion-base);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
[data-indicators="bars"] {
|
|
1122
|
+
& [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
|
|
1123
|
+
&[data-column-number] {
|
|
1124
|
+
&:before {
|
|
1125
|
+
content: "";
|
|
1126
|
+
user-select: none;
|
|
1127
|
+
contain: strict;
|
|
1128
|
+
width: 4px;
|
|
1129
|
+
height: 100%;
|
|
1130
|
+
display: block;
|
|
1131
|
+
position: absolute;
|
|
1132
|
+
top: 0;
|
|
1133
|
+
left: 0;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
& [data-line-type="change-deletion"] {
|
|
1139
|
+
&[data-column-number] {
|
|
1140
|
+
&:before {
|
|
1141
|
+
background-image: linear-gradient(0deg,
|
|
1142
|
+
var(--diffs-bg-deletion) 50%,
|
|
1143
|
+
var(--diffs-deletion-base) 50%);
|
|
1144
|
+
background-repeat: repeat;
|
|
1145
|
+
background-size: 2px 2px;
|
|
1146
|
+
background-size: calc(1lh / round(1lh / 2px))
|
|
1147
|
+
calc(1lh / round(1lh / 2px));
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
& [data-line-type="change-addition"] {
|
|
1153
|
+
&[data-column-number] {
|
|
1154
|
+
&:before {
|
|
1155
|
+
background-color: var(--diffs-addition-base);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
[data-overflow="wrap"] {
|
|
1162
|
+
& [data-line] {
|
|
1163
|
+
white-space: pre-wrap;
|
|
1164
|
+
word-break: break-word;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
& [data-annotation-content] {
|
|
1168
|
+
word-break: break-word;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
[data-overflow="scroll"] [data-line] {
|
|
1173
|
+
white-space: pre;
|
|
1174
|
+
min-height: 1lh;
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
[data-column-number] {
|
|
1178
|
+
box-sizing: content-box;
|
|
1179
|
+
text-align: right;
|
|
1180
|
+
user-select: none;
|
|
1181
|
+
color: var(--diffs-fg-number);
|
|
1182
|
+
padding-left: 2ch;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
[data-line-number-content] {
|
|
1186
|
+
min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
|
|
1187
|
+
z-index: 1;
|
|
1188
|
+
display: inline-block;
|
|
1189
|
+
position: relative;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
[data-disable-line-numbers] {
|
|
1193
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
1194
|
+
min-width: 4px;
|
|
1195
|
+
padding: 0;
|
|
1196
|
+
|
|
1197
|
+
&:before {
|
|
1198
|
+
min-width: 0;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
& [data-line-number-content] {
|
|
1203
|
+
display: none;
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
& [data-gutter-utility-slot] {
|
|
1207
|
+
right: unset;
|
|
1208
|
+
justify-content: flex-start;
|
|
1209
|
+
left: 0;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
&[data-indicators="bars"] [data-gutter-utility-slot] {
|
|
1213
|
+
left: 6px;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
[data-file][data-disable-line-numbers] {
|
|
1218
|
+
& [data-gutter-buffer], & [data-column-number] {
|
|
1219
|
+
border-right: 0;
|
|
1220
|
+
min-width: 0;
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
[data-diff-span] {
|
|
1225
|
+
box-decoration-break: clone;
|
|
1226
|
+
border-radius: 3px;
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
[data-line-type="change-addition"] [data-diff-span] {
|
|
1230
|
+
background-color: var(--diffs-bg-addition-emphasis);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
[data-line-type="change-deletion"] [data-diff-span] {
|
|
1234
|
+
background-color: var(--diffs-bg-deletion-emphasis);
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
|
|
1238
|
+
color: var(--diffs-fg);
|
|
1239
|
+
padding-left: 1ch;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
[data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
|
|
1243
|
+
align-items: center;
|
|
1244
|
+
display: flex;
|
|
1245
|
+
|
|
1246
|
+
&:after {
|
|
1247
|
+
color: var(--diffs-fg-conflict-marker);
|
|
1248
|
+
font-size: .75rem;
|
|
1249
|
+
font-style: normal;
|
|
1250
|
+
line-height: 1.25rem;
|
|
1251
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1252
|
+
padding-left: 1ch;
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
[data-merge-conflict="marker-start"]:after {
|
|
1257
|
+
content: "(Current Change)";
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
[data-merge-conflict="marker-end"]:after {
|
|
1261
|
+
content: "(Incoming Change)";
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
[data-merge-conflict-actions-content] {
|
|
1265
|
+
min-height: 1.75rem;
|
|
1266
|
+
font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
|
|
1267
|
+
color: var(--diffs-fg);
|
|
1268
|
+
align-items: center;
|
|
1269
|
+
gap: .25rem;
|
|
1270
|
+
padding-inline: .5rem;
|
|
1271
|
+
font-size: .75rem;
|
|
1272
|
+
line-height: 1.2;
|
|
1273
|
+
display: flex;
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1276
|
+
[data-merge-conflict-action] {
|
|
1277
|
+
appearance: none;
|
|
1278
|
+
color: var(--diffs-fg-number);
|
|
1279
|
+
font: inherit;
|
|
1280
|
+
cursor: pointer;
|
|
1281
|
+
background: none;
|
|
1282
|
+
border: 0;
|
|
1283
|
+
padding: 0;
|
|
1284
|
+
font-style: normal;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
[data-merge-conflict-action]:hover {
|
|
1288
|
+
color: var(--diffs-fg);
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
[data-merge-conflict-action="current"]:hover {
|
|
1292
|
+
color: var(--diffs-addition-base);
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
[data-merge-conflict-action="incoming"]:hover {
|
|
1296
|
+
color: var(--diffs-modified-base);
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
[data-merge-conflict-action-separator] {
|
|
1300
|
+
color: var(--diffs-fg-number);
|
|
1301
|
+
opacity: .6;
|
|
1302
|
+
user-select: none;
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1305
|
+
[data-diffs-header="default"] {
|
|
1306
|
+
background-color: var(--diffs-bg);
|
|
1307
|
+
justify-content: space-between;
|
|
1308
|
+
align-items: center;
|
|
1309
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1310
|
+
min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
|
|
1311
|
+
z-index: 2;
|
|
1312
|
+
flex-direction: row;
|
|
1313
|
+
padding-inline: 16px;
|
|
1314
|
+
display: flex;
|
|
1315
|
+
position: relative;
|
|
1316
|
+
top: 0;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
[data-header-content] {
|
|
1320
|
+
align-items: center;
|
|
1321
|
+
gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1322
|
+
white-space: nowrap;
|
|
1323
|
+
flex-direction: row;
|
|
1324
|
+
min-width: 0;
|
|
1325
|
+
display: flex;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1328
|
+
[data-header-content] [data-prev-name], [data-header-content] [data-title] {
|
|
1329
|
+
text-overflow: ellipsis;
|
|
1330
|
+
white-space: nowrap;
|
|
1331
|
+
direction: rtl;
|
|
1332
|
+
min-width: 0;
|
|
1333
|
+
overflow: hidden;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
[data-prev-name] {
|
|
1337
|
+
opacity: .7;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
[data-rename-icon] {
|
|
1341
|
+
fill: currentColor;
|
|
1342
|
+
flex-grow: 0;
|
|
1343
|
+
flex-shrink: 0;
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
[data-diffs-header="default"] [data-metadata] {
|
|
1347
|
+
white-space: nowrap;
|
|
1348
|
+
align-items: center;
|
|
1349
|
+
gap: 1ch;
|
|
1350
|
+
display: flex;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
[data-diffs-header="default"] [data-additions-count] {
|
|
1354
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1355
|
+
color: var(--diffs-addition-base);
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
[data-diffs-header="default"] [data-deletions-count] {
|
|
1359
|
+
font-family: var(--diffs-font-family, var(--diffs-font-fallback));
|
|
1360
|
+
color: var(--diffs-deletion-base);
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
[data-change-icon] {
|
|
1364
|
+
fill: currentColor;
|
|
1365
|
+
flex-shrink: 0;
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
[data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
|
|
1369
|
+
color: var(--diffs-modified-base);
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
[data-change-icon="new"] {
|
|
1373
|
+
color: var(--diffs-addition-base);
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
[data-change-icon="deleted"] {
|
|
1377
|
+
color: var(--diffs-deletion-base);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
[data-change-icon="file"] {
|
|
1381
|
+
opacity: .6;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
[data-annotation-content] {
|
|
1385
|
+
z-index: 2;
|
|
1386
|
+
isolation: isolate;
|
|
1387
|
+
white-space: normal;
|
|
1388
|
+
align-self: flex-start;
|
|
1389
|
+
min-width: 0;
|
|
1390
|
+
display: flow-root;
|
|
1391
|
+
position: relative;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
[data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
|
|
1395
|
+
width: var(--diffs-column-content-width, auto);
|
|
1396
|
+
left: var(--diffs-column-number-width, 0);
|
|
1397
|
+
position: sticky;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
[data-annotation-slot] {
|
|
1401
|
+
text-wrap-mode: wrap;
|
|
1402
|
+
word-break: normal;
|
|
1403
|
+
white-space-collapse: collapse;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
[data-gutter-utility-slot] {
|
|
1407
|
+
touch-action: none;
|
|
1408
|
+
justify-content: flex-end;
|
|
1409
|
+
display: flex;
|
|
1410
|
+
position: absolute;
|
|
1411
|
+
top: 0;
|
|
1412
|
+
bottom: 0;
|
|
1413
|
+
right: 0;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
[data-utility-button] {
|
|
1417
|
+
appearance: none;
|
|
1418
|
+
cursor: pointer;
|
|
1419
|
+
width: 1lh;
|
|
1420
|
+
height: 1lh;
|
|
1421
|
+
font-size: var(--diffs-font-size, 13px);
|
|
1422
|
+
line-height: var(--diffs-line-height, 20px);
|
|
1423
|
+
background-color: var(--diffs-modified-base);
|
|
1424
|
+
color: var(--diffs-bg);
|
|
1425
|
+
fill: currentColor;
|
|
1426
|
+
z-index: 4;
|
|
1427
|
+
touch-action: none;
|
|
1428
|
+
border: none;
|
|
1429
|
+
border-radius: 4px;
|
|
1430
|
+
justify-content: center;
|
|
1431
|
+
align-items: center;
|
|
1432
|
+
margin-right: calc(-1lh + 1ch);
|
|
1433
|
+
padding: 0;
|
|
1434
|
+
display: flex;
|
|
1435
|
+
position: relative;
|
|
1436
|
+
|
|
1437
|
+
&:before {
|
|
1438
|
+
content: "";
|
|
1439
|
+
display: block;
|
|
1440
|
+
position: absolute;
|
|
1441
|
+
inset: 0 0 0 -4px;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
[data-decoration-bar-stack] {
|
|
1446
|
+
pointer-events: none;
|
|
1447
|
+
isolation: isolate;
|
|
1448
|
+
z-index: 1;
|
|
1449
|
+
background-color: var(--diffs-decoration-bar-color, transparent);
|
|
1450
|
+
box-sizing: content-box;
|
|
1451
|
+
border-left: 2px solid var(--diffs-bg);
|
|
1452
|
+
border-right: 2px solid var(--diffs-bg);
|
|
1453
|
+
width: 6px;
|
|
1454
|
+
position: absolute;
|
|
1455
|
+
top: 0;
|
|
1456
|
+
bottom: 0;
|
|
1457
|
+
right: -2px;
|
|
1458
|
+
|
|
1459
|
+
[data-decoration-bar-depth="1"] & {
|
|
1460
|
+
background-color: color-mix(in lab,
|
|
1461
|
+
var(--diffs-bg) 20%,
|
|
1462
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
[data-decoration-bar-depth="2"] & {
|
|
1466
|
+
background-color: color-mix(in lab,
|
|
1467
|
+
var(--diffs-bg) 45%,
|
|
1468
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
[data-decoration-bar-depth="3"] & {
|
|
1472
|
+
background-color: color-mix(in lab,
|
|
1473
|
+
var(--diffs-bg) 65%,
|
|
1474
|
+
var(--diffs-decoration-bar-color, transparent));
|
|
1475
|
+
}
|
|
1476
|
+
|
|
1477
|
+
[data-decoration-bar-start] & {
|
|
1478
|
+
border-top-left-radius: 5px;
|
|
1479
|
+
border-top-right-radius: 5px;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
[data-decoration-bar-end] & {
|
|
1483
|
+
z-index: 3;
|
|
1484
|
+
border-bottom-right-radius: 5px;
|
|
1485
|
+
border-bottom-left-radius: 5px;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
[data-placeholder] {
|
|
1490
|
+
contain: strict;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
[data-error-wrapper] {
|
|
1494
|
+
padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
|
|
1495
|
+
var(--diffs-gap-inline, var(--diffs-gap-fallback));
|
|
1496
|
+
scrollbar-width: none;
|
|
1497
|
+
max-height: 400px;
|
|
1498
|
+
overflow: auto;
|
|
1499
|
+
|
|
1500
|
+
& [data-error-message] {
|
|
1501
|
+
color: var(--diffs-deletion-base);
|
|
1502
|
+
font-size: 18px;
|
|
1503
|
+
font-weight: bold;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
& [data-error-stack] {
|
|
1507
|
+
color: var(--diffs-fg-number);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
@layer theme, rendered, unsafe;
|
|
1513
|
+
`;var Zd="@layer base, theme, rendered, unsafe;",mg=new RegExp(`${gg(Er)}\\s*:\\s*[^;]+;`);function Tr(e){return`${Zd}
|
|
1514
|
+
@layer unsafe {
|
|
1515
|
+
${e}
|
|
1516
|
+
}`}function Ar(e,t="system",n){return`${Zd}
|
|
1517
|
+
@layer rendered {
|
|
1518
|
+
:host {${t==="system"?"":`
|
|
1519
|
+
color-scheme: ${t};`}
|
|
1520
|
+
${hs(n)}
|
|
1521
|
+
${e}
|
|
1522
|
+
}
|
|
1523
|
+
}`}function Rr(e,t){let n=hs(t);return e.replace(mg,n)}function gg(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ir(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function ps(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Ir(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Sn({code:e,pre:t,columnType:n,rowSpan:i,containerSize:r=!1}={}){if(e==null){if(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null)e.setAttribute(`data-${n}`,"");t?.appendChild(e)}if(i!=null)e.style.setProperty("grid-row",`span ${i}`);else e.style.removeProperty("grid-row");if(r)e.setAttribute("data-container-size","");else e.removeAttribute("data-container-size");return e}function qn(e,t){let n=e?.offsetHeight??0;if(e==null||n===0){t();return}e.style.minHeight=`${n}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=""}}function Mr({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}if(t??=yg(),t.textContent=n,t.parentNode!==e)e.appendChild(t);return t}function yg(){let e=document.createElement("style");return e.setAttribute(Qd,""),e}function Hr(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:"open"});if(n.innerHTML==="")n.innerHTML=t}function Pr(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:r,overflow:o,split:s,totalLines:a,customProperties:l}){if(l!=null)for(let d in l){let c=l[d];if(c!=null)e.setAttribute(d,`${c}`)}if(t==="diff")e.setAttribute("data-diff",""),e.removeAttribute("data-file");else e.setAttribute("data-file",""),e.removeAttribute("data-diff");switch(n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators");break}if(r)e.setAttribute("data-disable-line-numbers","");else e.removeAttribute("data-disable-line-numbers");if(i)e.removeAttribute("data-background");else e.setAttribute("data-background","");if(t==="diff")e.setAttribute("data-diff-type",s?"split":"single");else e.removeAttribute("data-diff-type");return e.setAttribute("data-overflow",o),e.style.setProperty("--diffs-min-number-column-width-default",`${`${a}`.length}ch`),e}if(typeof HTMLElement<"u"&&customElements.get("diffs-container")==null){let e;class t extends HTMLElement{constructor(){super();if(this.shadowRoot!=null)return;let n=this.attachShadow({mode:"open"});if(e==null)e=new CSSStyleSheet,e.replaceSync(fs);n.adoptedStyleSheets=[e]}connectedCallback(){vt(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(Nr,t)}var Sg=[""],vg=-1,ms=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file:${++vg}`;type="file";fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerFilenameSuffix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;editor;constructor(e={theme:z},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.fileRenderer=new qd(e,this.handleHighlightRender,this.workerManager),this.resizeManager=new lr,this.interactionManager=new ar("file",dn(e)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){if(!this.enabled||this.file==null)return;this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}__getCurrentFile(){return this.file}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(e){if(e==null)return;this.options=e,this.cachedHeaderHTML=void 0,this.syncInteractionOptions()}syncInteractionOptions(){this.interactionManager.setOptions(dn(this.options))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){if((this.options.themeType??"system")===e)return;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;if(this.appliedThemeCSS.themeType===t)return!1;return this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Ie(this.appliedThemeCSS.theme,this.options.theme??z)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}setSelectedLines(e,t){this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??"additions"})}getCodeScrollLeft(){return this.code?.scrollLeft??0}setCodeScrollLeft(e){if(this.code!=null)this.code.scrollLeft=e}__getEffectiveCodeOptions(){return{...this.options,...this.fileRenderer.getEffectiveCodeOptions()}}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{overflow:e="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:e==="wrap",columnVariables:this.shouldApplyColumnVariables(e)?"apply":"measure"}),this.managersDirty=!1}shouldApplyColumnVariables(e){return e==="scroll"&&this.lineAnnotations.length>0}cleanUp(e=!1){if(this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,!this.isContainerManaged)this.fileContainer?.remove();if(this.fileContainer=void 0,this.mounted=!1,!e)this.lineAnnotations=[];if(this.clearAuxiliaryNodes(),this.pre=void 0,this.code=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,!e)this.cachedHeaderHTML=void 0;if(this.errorWrapper?.remove(),this.errorWrapper=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.placeHolder?.remove(),this.placeHolder=void 0,e)this.fileRenderer.recycle();else this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0;this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){let{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,file:r,lineAnnotations:o}=e;if(!this.enabled)throw Error("File.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw Error("File.hydrate: hydrate can only be called before the instance has rendered or hydrated");if(this.hydrateElements(t,n),bg(this.pre,r,this.options.collapsed)||Cg(this.headerElement,r,this.options.disableFileHeader))this.render({...e,preventEmit:!0});else this.hydrationSetup({file:r,lineAnnotations:o});if(!i)this.emitPostRender()}hydrateElements(e,t){if(this.fileContainer!==e)this.emitPostRender(!0);Hr(e,t);for(let n of Array.from(e.shadowRoot?.children??[])){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(!(n instanceof HTMLElement))continue;if(n instanceof HTMLPreElement){this.pre=n,this.appliedPreAttributes=void 0;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}if("diffsHeader"in n.dataset){this.headerElement=n,this.lastRenderedHeaderHTML=void 0;continue}}if(this.pre!=null)this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated");this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({file:e,lineAnnotations:t}){if(this.lineAnnotations=t??this.lineAnnotations,this.file=e,this.fileRenderer.setOptions(ps(this.options)),this.syncInteractionOptions(),this.pre==null)return;this.fileRenderer.hydrate(e),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers()}getOrCreateLineCache(e=this.file){return e!=null?this.fileRenderer.getOrCreateLineCache(e):Sg}updateBuffers(e){if(this.pre!=null)this.applyBuffers(this.pre,e)}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.file,i=this.lineAnnotations,r=this.renderRange;if(e!=null&&t!=null&&n!=null)this.fileRenderer.initializeHighlighter().then((o)=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.file!==n)return;e.__syncRenderView(o,t,n,i,r)})}attachEditor(e){this.editor?.cleanUp(),this.editor=e,this.fileRenderer.beginEditSession();let t=this.file==null?void 0:e.__prepareFile?.(this.file);if(t!==void 0&&t!==this.file)this.renderPreparedFile({file:t,forceRender:!0,preventEmit:!0,renderRange:this.renderRange});else if(this.fileRenderer.editorRenderReady())this.syncRenderViewToEditor();else this.rerender();return()=>{this.editor=void 0,this.fileRenderer.endEditSession()}}applyDocumentChange(e,t){if(this.fileRenderer.applyDocumentChange(e),t!=null&&t!==this.lineAnnotations&&this.file!=null)this.setLineAnnotations(t),this.fileRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations()}updateRenderCache(e,t,n){this.fileRenderer.updateRenderCache(e,t,n?.lineCountChangeInFlight)}render(e){if(!this.enabled)throw Error("File.render: attempting to call render after cleaned up");let t=this.editor?.__prepareFile?.(e.file)??e.file;return this.renderPreparedFile(t===e.file?e:{...e,file:t})}renderPreparedFile({file:e,fileContainer:t,forceRender:n=!1,preventEmit:i=!1,containerWrapper:r,deferManagers:o=!1,lineAnnotations:s,renderRange:a}){this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:l=!1,themeType:d="system"}=this.options,c=l?void 0:a,u=this.renderRange,h=this.hasThemeChanged(),f=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1,m=!fe(this.file,e)||this.fileRenderer.hasUnkeyedFileContentsChanged(e);if(!l&&!n&&St(c,this.renderRange)&&!m&&!f&&!h)return this.applyCachedThemeState(d);if(this.renderRange=c,m)this.cachedHeaderHTML=void 0;if(this.file=e,this.fileRenderer.setOptions(ps(this.options)),this.syncInteractionOptions(),s!=null)this.setLineAnnotations(s);this.fileRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:y=!1,disableFileHeader:v=!1}=this.options;if(v){if(this.headerElement!=null)this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0;this.clearHeaderSlots()}if(t=this.getOrCreateFileContainerNode(t,r),this.applyCachedThemeState(d),l){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let g=this.fileRenderer.renderFile(e,Dr);if(g!=null)this.applyThemeState(t,g.themeStyles,d,g.baseThemeType);if(g?.headerAST!=null)this.applyHeaderToDOM(g.headerAST,t);this.injectUnsafeCSS()}catch(g){if(y)throw g;if(console.error(g),g instanceof Error)this.applyErrorToDOM(g,t)}if(!i)this.emitPostRender();return!0}try{let g=this.getOrCreatePreNode(t);if(!this.canPartiallyRender(n,f,m||h)||!this.applyPartialRender(u,c)){let S=this.fileRenderer.renderFile(e,c);if(S==null){if(this.workerManager?.isInitialized()===!1)this.workerManager.initialize().then(()=>this.rerender());return!1}if(this.applyThemeState(t,S.themeStyles,d,S.baseThemeType),S.headerAST!=null)this.applyHeaderToDOM(S.headerAST,t);this.applyFullRender(S,g)}if(this.applyBuffers(g,c),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,!o)this.flushManagers();if(this.editor!=null)this.syncRenderViewToEditor()}catch(g){if(y)throw g;if(console.error(g),g instanceof Error)this.applyErrorToDOM(g,t)}if(!i)this.emitPostRender();return!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted)return;if(this.mounted=!1,t==null)return;n?.(t,this,"unmount");return}if(t==null)return;let i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(e,t,n){if(e||t||n)return!1;return!0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){let t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}async primeHighlightCache(e=this.file){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Gn(e))return;let n=this.options.tokenizeMaxLength??1e5;if(this.fileRenderer.getOrCreateLineCache(e).length>n)return;await t.primeFileHighlightCache(e).catch((i)=>{console.error(i)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.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.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=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}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:n}of this.annotationCache.values())n.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,i]of this.lineAnnotations.entries()){let r=`${n}-${Ee(i)}`,o=this.annotationCache.get(r);if(o==null||!Kd(i,o.annotation)){o?.element.remove();let s=t(i);if(s==null)continue;o={element:xr(Ee(i)),annotation:i},o.element.appendChild(s),this.fileContainer.appendChild(o.element),this.annotationCache.set(r,o)}e.delete(r)}for(let[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.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;else if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=kr();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t==null)return;if(e==null||e===""){if(this.unsafeCSSStyle!=null)this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0;this.appliedUnsafeCSS=void 0;return}if(this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e)return;if(this.unsafeCSSStyle??=wr(),this.unsafeCSSStyle.parentNode!==t)t.appendChild(this.unsafeCSSStyle);this.unsafeCSSStyle.textContent=Tr(e),this.appliedUnsafeCSS=e}applyThemeState(e,t,n,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n,s=this.options.theme??z,a=typeof s==="string"?s:{...s},l=vt(r);if(this.themeCSSStyle?.parentNode===r&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===l){this.appliedThemeCSS.theme=a;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===r){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:a,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:l};return}this.themeCSSStyle=Mr({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:Ar(t,o,l)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:a,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:l}:void 0}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;if(e==null||this.themeCSSStyle==null)return;this.themeCSSStyle.textContent=Rr(this.themeCSSStyle.textContent??"",vt(e))}shouldGuardRebuildScroll(){return this.editor!=null&&Fr()}applyFullRender(e,t){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(t,e);let n=this.code=Sn({code:this.code}),i=this.fileRenderer.renderCodeAST(e);this.editor?.__captureFocusForDOMReplacement();let r=()=>{if(n.childElementCount>=2)for(let o=0;o<2;o++){let s=n.children[o],a=i[o];s.innerHTML=X(a.children),s.style.cssText=a.properties.style}else n.innerHTML=X(i);if(!t.contains(n))t.replaceChildren(n)};if(this.shouldGuardRebuildScroll())qn(t,r);else r();this.lastRowCount=e.rowCount}applyPartialRender(e,t){if(e==null||t==null)return!1;let{file:n,code:i}=this,r=i!=null?this.getColumns(i):void 0;if(n==null||i==null||r==null)return!1;let o=e.startingLine,s=t.startingLine,a=e.totalLines===1/0?Number.POSITIVE_INFINITY:o+e.totalLines,l=t.totalLines===1/0?Number.POSITIVE_INFINITY:s+t.totalLines,d=Math.max(o,s),c=Math.min(a,l);if(c<=d)return!1;if(!this.trimDOMToOverlap(r.gutter,d,c)||!this.trimDOMToOverlap(r.content,d,c))throw Error("File.applyPartialRender: failed to trim to overlap");let{length:u}=r.content.children,h=(v,g)=>{if(g<=0)return;return this.fileRenderer.renderFile(n,{startingLine:v,totalLines:g,bufferBefore:0,bufferAfter:0})},f=s<d?h(s,d-s):void 0;if(f===void 0&&s<d)return!1;let m=l===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:Math.max(0,l-c),y=l>c?h(c,m):void 0;if(y===void 0&&l>c)return!1;if(this.cleanupErrorWrapper(),f!=null)r.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.gutterAST)),r.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(f.contentAST)),u+=f.rowCount;if(y!=null)r.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(y.gutterAST)),r.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(y.contentAST)),u+=y.rowCount;if(this.lastRowCount!==u)r.gutter.style.setProperty("grid-row",`span ${u}`),r.content.style.setProperty("grid-row",`span ${u}`),this.lastRowCount=u;return!0}getColumns(e){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;return{gutter:t,content:n}}trimDOMToOverlap(e,t,n){let i=this.getDOMBoundaryIndices(e,[t,n]),r=i.get(t)??e.children.length,o=i.get(n)??e.children.length;if(r>o)return!1;for(let s=e.children.length-1;s>=o;s-=1)e.children[s]?.remove();for(let s=r-1;s>=0;s-=1)e.children[s]?.remove();return!0}getDOMBoundaryIndices(e,t){let n=[...new Set(t)].sort((a,l)=>a-l),i=new Map;if(n.length===0)return i;let r=0,o=n[r],{children:s}=e;if(o===0)i.set(0,0),r+=1,o=n[r];for(let a=0;a<s.length;a+=1){let l=s[a];if(!(l instanceof HTMLElement))continue;let d=this.getLineIndexFromDOMNode(l);if(d==null)continue;while(o!=null&&d>=o)i.set(o,a),r+=1,o=n[r];if(r>=n.length)break}for(let a of n)if(!i.has(a))i.set(a,s.length);return i}getLineIndexFromDOMNode(e){let t=e.dataset.lineIndex;if(t==null)return;let n=Number(t);return Number.isNaN(n)?void 0:n}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){if(this.bufferBefore!=null)this.bufferBefore.remove(),this.bufferBefore=void 0;if(this.bufferAfter!=null)this.bufferAfter.remove(),this.bufferAfter=void 0;return}if(t.bufferBefore>0){if(this.bufferBefore==null)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")}else if(this.bufferBefore!=null)this.bufferBefore.remove(),this.bufferBefore=void 0;if(t.bufferAfter>0){if(this.bufferAfter==null)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")}else if(this.bufferAfter!=null)this.bufferAfter.remove(),this.bufferAfter=void 0}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(e,t){let{file:n}=this;if(n==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let i=this.cachedHeaderHTML??X(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){let l=document.createElement("div");l.innerHTML=i;let d=l.firstElementChild;if(!(d instanceof HTMLElement))return;if(this.headerElement!=null)t.shadowRoot?.replaceChild(d,this.headerElement);else t.shadowRoot?.prepend(d);this.headerElement=d,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged)return;let{renderHeaderPrefix:r,renderHeaderFilenameSuffix:o,renderCustomHeader:s,renderHeaderMetadata:a}=this.options;if(s!=null){let l=s(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,mn,l),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0}else{let l=r?.(n)??void 0,d=o?.(n)??void 0,c=a?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,hn,l),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,fn,d),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,pn,c),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}let r=t??this.createHeaderSlotElement(n);if(t==null)e.appendChild(r);return this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,t){if(e.replaceChildren(),t instanceof Element)e.appendChild(t);else e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement("div");return t.slot=e,t}getOrCreateFileContainerNode(e,t){let{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),r=n!==i;if(n!=null&&r)this.editor?.__captureFocusForDOMReplacement();if(r)this.emitPostRender(!0);if(this.fileContainer=i,n!=null&&r)this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0;if(t!=null&&this.fileContainer.parentNode!==t)t.appendChild(this.fileContainer);if(r)this.adoptReusableShellElements(this.fileContainer);return this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t==null)return;for(let n of t.children)if(n instanceof SVGElement)this.spriteSVG??=n;else if(pt(n)&&n.hasAttribute("data-theme-css"))this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0;else if(pt(n)&&n.hasAttribute("data-unsafe-css"))this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){let n=document.createElement("div");n.innerHTML=br;let i=n.firstChild;if(i instanceof SVGElement)this.spriteSVG=i}if(this.spriteSVG!=null&&this.spriteSVG.parentNode!==t)t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.pre==null)this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,t.appendChild(this.pre);else if(this.pre.parentNode!==t)this.editor?.__captureFocusForDOMReplacement(),e.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0;return this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(e){this.code=void 0;for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;if(t.hasAttribute("data-code")){this.code=t;return}}}applyPreNodeAttributes(e,{totalLines:t}){let{overflow:n="scroll",disableLineNumbers:i=!1}=this.options,r={type:"file",split:!1,overflow:n,disableLineNumbers:i,diffIndicators:"none",disableBackground:!0,totalLines:t};if(Cr(r,this.appliedPreAttributes))return;Pr(e,r),this.appliedPreAttributes=r}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 i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);let r=document.createElement("pre");r.dataset.errorStack="",r.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(r)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function bg(e,t,n=!1){return!n&&e==null&&t!=null}function Cg(e,t,n=!1){return e==null&&t!=null&&!n}var xg=5000,kg=-1;function wg(e,t){return(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.unsafeCSS!==t.unsafeCSS}var ec=class extends ms{virtualizer;metrics;__id=`virtualized-file:${++kg}`;top;height=0;cache={heights:new Map,checkpoints:[],fileAnnotationHeight:0};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=Ki,i,r=!1){super(e,i,r);this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){let n=sn(e);if(!t&&Be(this.metrics,n))return;this.metrics=n,this.resetLayoutCache()}setLineAnnotations(e){if(this.syncLineAnnotations(e))this.resetLayoutCache()}syncLineAnnotations(e){if(e==null||e===this.lineAnnotations)return!1;if(e.length===0&&this.lineAnnotations.length===0)return!1;return super.setLineAnnotations(e),!0}hasLineAnnotations(){return this.lineAnnotations.some((e)=>e.lineNumber>0)}getLineHeight(e,t=!1){let n=this.cache.heights.get(e);if(n!=null)return n;let i=t?2:1;return this.metrics.lineHeight*i}setOptions(e){if(this.isAdvancedMode())throw Error("VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;let{options:t}=this,n=!tn(t,e),i=wg(t,e);if(super.setOptions(e),i)this.resetLayoutCache(!0);if(n)this.forceRenderOverride=!0;if(n)this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache(e=!1,t=!0){if(this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heights.size>0)this.cache.heights.clear();if(this.cache.checkpoints.length>0)this.cache.checkpoints.length=0;if(this.renderRange!=null&&t)this.renderRange=void 0;if(e&&this.isSimpleMode())this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null){if(this.height!==0)e=!0;return this.height=0,e}let{overflow:t="scroll"}=this.options;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;if(this.code==null)return e;let n=this.code.children[1];if(!(n instanceof HTMLElement))return e;let i=zn(this.lineAnnotations);if(this.renderRange!=null&&i&&mt(this.renderRange)){let r=Lg(n)??0;if(r!==this.cache.fileAnnotationHeight)this.cache.fileAnnotationHeight=r,e=!0}else if(!i&&this.cache.fileAnnotationHeight!==0)this.cache.fileAnnotationHeight=0,e=!0;for(let r of n.children){if(!(r instanceof HTMLElement))continue;let o=r.dataset.lineIndex;if(o==null)continue;let s=Number(o),a=r.getBoundingClientRect().height,l=!1;if(r.nextElementSibling instanceof HTMLElement&&(("lineAnnotation"in r.nextElementSibling.dataset)||("noNewline"in r.nextElementSibling.dataset))){if("noNewline"in r.nextElementSibling.dataset)l=!0;a+=r.nextElementSibling.getBoundingClientRect().height}let d=this.getLineHeight(s,l);if(a===d)continue;if(e=!0,a===this.metrics.lineHeight*(l?2:1))this.cache.heights.delete(s);else this.cache.heights.set(s,a)}if(e||this.isResizeDebuggingEnabled())this.computeApproximateSize(!0);return e}onRender=(e)=>{if(this.fileContainer==null||this.file==null)return!1;if(e)this.top=this.getVirtualizedTop();return this.render({file:this.file})};prepareCodeViewItem(e,t,n,i){let r=this.syncLineAnnotations(i),o=!fe(this.file,e)||this.fileRenderer.hasUnkeyedFileContentsChanged(e),s=n?.resetFileLayoutCache===!0||o||r;if(n?.metrics!=null)this.metrics=n.metrics,s=!0;let{collapsed:a=!1}=this.options;if(this.currentCollapsed!==a)this.currentCollapsed=a,s=!0;if(s)this.resetLayoutCache();if(this.file!==e)this.layoutDirty=!0;return this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null||e<1)return;let{disableFileHeader:t=!1,collapsed:n=!1}=this.options,i=this.fileRenderer.getLineCount(this.file)-1,r=Le(this.metrics,t);if(n||i<0)return{top:r,height:0};let o=Math.min(Math.max(e-1,0),i),{overflow:s="scroll"}=this.options,{lineHeight:a}=this.metrics;if(r+=this.cache.fileAnnotationHeight,s==="scroll"&&!this.hasLineAnnotations())return{top:r+o*a,height:a};let l=this.getLayoutCheckpointBeforeLineIndex(o);r=l?.top??r;for(let d=l?.lineIndex??0;d<o;d++)r+=this.getLineHeight(d,!1);return{top:r,height:this.getLineHeight(o,!1)}}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){if(this.file==null||this.renderRange==null)return;let{disableFileHeader:t=!1,collapsed:n=!1,overflow:i="scroll"}=this.options;if(n||this.renderRange.totalLines<=0)return;let r=this.fileRenderer.getLineCount(this.file)-1;if(r<0)return;let o=Le(this.metrics,t),s=Math.min(this.renderRange.startingLine,r),a=Math.min(s+this.renderRange.totalLines-1,r);if(a<s)return;let{fileAnnotationHeight:l}=this.cache;if(i==="scroll"&&!this.hasLineAnnotations()){let{lineHeight:c}=this.metrics,u=o+(s===0?l:this.renderRange.bufferBefore),h=s+Math.max(Math.ceil((e-u)/c),0);if(h>a)return;return{lineNumber:h+1,top:o+l+h*c}}let d=o+(s===0?l:this.renderRange.bufferBefore);for(let c=s;c<=a;c++){if(d>=e)return{lineNumber:c+1,top:d};d+=this.getLineHeight(c)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let t=e!=null?this.computeRenderRangeFromWindow(this.file,this.top,e):this.renderRange;if(t==null)return;let{bufferBefore:n,bufferAfter:i,totalLines:r}=t,o=0;if(r===0){let s=e??this.virtualizer.getWindowSpecs();if(this.top<s.top)o=i}return{topOffset:this.top+n+o,height:this.height-(n+i)}}cleanUp(e=!1){if(this.fileContainer!=null&&this.isSimpleMode())this.getSimpleVirtualizer()?.disconnect(this.fileContainer);if(!e)this.resetLayoutCache();this.isSetup=!1,super.cleanUp(e)}computeApproximateSize(e=!1,t=this.file){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let i=this.height===0;if(this.height=0,this.cache.checkpoints=[],t==null){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:o=!1,overflow:s="scroll"}=this.options,{lineHeight:a}=this.metrics,l=this.fileRenderer.getLineCount(t),d=Le(this.metrics,r),c=Mt(this.metrics);if(this.height+=d,o){this.layoutDirty=!1;return}if(this.height+=this.cache.fileAnnotationHeight,s==="scroll"&&!this.hasLineAnnotations())this.height+=l*a;else for(let u=0;u<l;u++)this.addLayoutCheckpoint(u,this.height),this.height+=this.getLineHeight(u,!1);if(l>0)this.height+=c;if(this.fileContainer!=null&&n&&!i){let u=this.fileContainer.getBoundingClientRect();if(u.height!==this.height)console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:t.name,elementHeight:u.height,computedHeight:this.height});else console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}setVisibility(e){if(this.isAdvancedMode()||this.fileContainer==null)return;if(this.renderRange=void 0,e&&!this.isVisible)this.top=this.getVirtualizedTop(),this.isVisible=!0;else if(!e&&this.isVisible)this.isVisible=!1,this.rerender()}rerender(){if(!this.enabled||this.file==null)return;this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1)}applyDocumentChange(e,t,n=!1){let{renderRange:i}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(this.isSimpleMode(),!1),!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&i!==void 0&&this.file!==void 0){let r=this.virtualizer.getWindowSpecs(),o=this.computeRenderRangeFromWindow(this.file,this.top??0,r);if(o.bufferAfter!==i.bufferAfter)this.updateBuffers(o)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}renderPreparedFile({fileContainer:e,file:t,forceRender:n=!1,lineAnnotations:i,...r}){let o=this.file==null||!fe(this.file,t)||this.fileRenderer.hasUnkeyedFileContentsChanged(t),{forceRenderOverride:s,isSetup:a}=this;this.forceRenderOverride=void 0;let l=this.syncLineAnnotations(i);if(l)this.resetLayoutCache();if(e=this.getOrCreateFileContainerNode(e),t==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(!a){this.computeApproximateSize(!1,t);let f=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(f==null)throw Error("VirtualizedFile.render: simple virtualizer is not available");f.connect(e,this),this.isVisible=f.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}else if(this.top??=this.getVirtualizedTop(),o&&this.isSimpleMode())this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache(!1),this.computeApproximateSize(!1,t);if(!this.isVisible&&this.isSimpleMode()&&(!o||!a)){if(this.file=t,o)this.cachedHeaderHTML=void 0;return this.renderPlaceholder(this.height)}let d=this.virtualizer.getWindowSpecs(),c=this.top??0,u=this.computeRenderRangeFromWindow(t,c,d),h=super.renderPreparedFile({file:t,fileContainer:e,renderRange:u,lineAnnotations:i,forceRender:(s??n)||l||o,...r});if(this.isSimpleMode()&&h)this.getSimpleVirtualizer()?.requestHeightReconcile(this);return h}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}addLayoutCheckpoint(e,t){if(e%xg!==0)return;this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;while(t<=n){let r=t+n>>1,o=this.cache.checkpoints[r];if(o==null)throw Error("VirtualizedFile: invalid checkpoint index");if(o.lineIndex<=e)i=o,t=r+1;else n=r-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,r=-1;while(n<=i){let o=n+i>>1,s=this.cache.checkpoints[o];if(s==null)throw Error("VirtualizedFile: invalid checkpoint index");if(s.top<=e)r=o,n=o+1;else i=o-1}if(t==null)return r>=0?this.cache.checkpoints[r]:void 0;for(let o=r;o>=0;o--){let s=this.cache.checkpoints[o];if(s==null)throw Error("VirtualizedFile: invalid checkpoint index");if(s.lineIndex%t===0)return s}}getVirtualizedTop(){if(this.virtualizer.type==="advanced")return this.virtualizer.getLocalTopForInstance(this);return this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type==="advanced"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){let{disableFileHeader:r=!1,overflow:o="scroll"}=this.options,{hunkLineCount:s,lineHeight:a}=this.metrics,l=this.fileRenderer.getLineCount(e),d=this.height,c=Le(this.metrics,r),u=l>0?Mt(this.metrics):0,{fileAnnotationHeight:h}=this.cache,f=c+h,m=Math.max(0,d-c-h-u),y=zn(this.lineAnnotations),v=t+c,g=h>0&&y&&v<i&&v+h>n;if(t<n-d||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-c-u};if(l<=s)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};let S=Math.ceil(Math.max(i-n,0)/a),b=Math.ceil(S/s)*s+s,x=b/s,C=(n+i)/2;if(o==="scroll"&&!this.hasLineAnnotations()){let he=t+f,Me=he+m;if(!g&&!(he<i&&Me>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-c-u};let Ue=Math.floor(g&&C<t+f?0:(C-(t+f))/a),Ce=Math.floor(Ue/s)-Math.floor(x/2),He=Math.ceil(l/s),Ve=Math.max(0,Math.min(Ce,He))*s,Ut=Ce<0?b+Ce*s:b,Ge=Ve===0?0:h+Ve*a,Pe=Math.min(Ut,l-Ve);return{startingLine:Ve,totalLines:Ut,bufferBefore:Ge,bufferAfter:Math.max(0,(l-Ve-Pe)*a)}}let k=x,w=[],T=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-b*a*2),s),L=t+(T?.top??f),I=T?.lineIndex??0,O,A,R,_=T?.lineIndex??0;for(let he=_;he<l;he++){let Me=I%s===0,Ue=Math.floor(I/s);if(Me){if(w[Ue]=L-(t+f),R!=null){if(R<=0)break;R--}}let Ce=this.getLineHeight(he,!1);if(L>n-Ce&&L<i)O??=Ue;if(L+Ce>C)A??=Ue;if(R==null&&L>=i&&Me)R=k;I++,L+=Ce}if(O==null)if(g)O=0,A=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:d-c-u};A??=O;let F=Math.round(A-x/2),M=Math.max(0,Math.ceil(l/s)-x),N=Math.max(0,Math.min(F,M)),B=N*s,ie=F<0?b+F*s:b,U=w[N]??0,W=B===0?0:h+U,j=N+ie/s,ue=j<w.length?m-w[j]:m-(L-t-f);return{startingLine:B,totalLines:ie,bufferBefore:W,bufferAfter:Math.max(0,ue)}}};function Lg(e){let t;for(let n of e.children){if(!(n instanceof HTMLElement))continue;if(n.dataset.lineAnnotation!==ir)continue;t=Math.max(t??0,n.getBoundingClientRect().height)}return t}function bt(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}async function Kn(e,t=300){let n;try{await Promise.race([e(),new Promise((i)=>{n=setTimeout(i,t)})])}finally{if(n!=null)clearTimeout(n)}}function tc({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:i,expandUnchanged:r,expandedHunks:o,collapsedContextThreshold:s,canHydratePartialDiff:a}){let l=Le(t,n),d=l,c=r?!0:o,u=e.hunks.length-1;for(let h=0;h<e.hunks.length;h++){let f=e.hunks[h];if(f==null)throw Error("computeEstimatedDiffHeights: invalid hunk index");let m=Se({isPartial:e.isPartial,rangeSize:f.collapsedBefore,expandedHunks:c,hunkIndex:h,collapsedContextThreshold:s}),y=(m.fromStart+m.fromEnd)*t.lineHeight;if(l+=y,d+=y,m.collapsedLines>0){let S=Ht({type:i,metrics:t,hunkIndex:h,hunkSpecs:f.hunkSpecs})?.totalHeight??0;l+=S,d+=S}l+=f.splitLineCount*t.lineHeight,d+=f.unifiedLineCount*t.lineHeight;let v=Eg(f);l+=v.split*t.lineHeight,d+=v.unified*t.lineHeight;let g=h===u?ve({fileDiff:e,hunkIndex:h,expandedHunks:c,collapsedContextThreshold:s,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(g!=null){let S=(g.fromStart+g.fromEnd)*t.lineHeight;if(l+=S,d+=S,g.collapsedLines>0){let b=nt({type:i,metrics:t})?.totalHeight??0;l+=b,d+=b}}else if(h===u&&e.isPartial&&a){let S=nt({type:i,metrics:t})?.totalHeight??0;l+=S,d+=S}}if(e.hunks.length>0){let h=Mt(t);l+=h,d+=h}return{splitHeight:l,unifiedHeight:d}}function Eg(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 n=t.lines>0?1:0;return{split:n,unified:n}}return Tg(e,t)}function Tg(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),i=t.deletions>0&&e.noEOFCRDeletions,r=t.additions>0&&e.noEOFCRAdditions;return{split:i||r?1:0,unified:n}}function Xn({oldFile:e,newFile:t},n){if(e===void 0&&t===void 0)return;if(e===void 0||t===void 0)throw Error(`${n}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw Error(`${n}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}if(t===null)return{oldFile:e,newFile:t};return{oldFile:e,newFile:t}}function nc(e){return{...e,hunks:e.hunks.map((t)=>({...t,hunkContent:t.hunkContent.map((n)=>({...n}))})),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function _r(e){return e!==""?e.split(ic):[]}function Yn(e,t,n){let i=e==="clone"?nc(t):t;if(!i.isPartial)throw Error("hydratePartialDiff: fileDiff must be partial");switch(i.type){case"change":case"rename-changed":return Ag(i,Ig(i,n),rc(i,n));case"rename-pure":{let r=rc(i,n);Mg(i,n);let o=_r(r.contents);return i.isPartial=!1,i.deletionLines=o,i.additionLines=o,oc(i,null,r),i}}throw Error(`hydratePartialDiff: ${i.type} diffs cannot be hydrated from loaded files`)}function Ag(e,t,n){let i=_r(t.contents),r=_r(n.contents),{hunks:o,splitLineCount:s,unifiedLineCount:a}=Rg(e.hunks,r.length);return e.hunks=o,e.splitLineCount=s,e.unifiedLineCount=a,e.isPartial=!1,e.deletionLines=i,e.additionLines=r,oc(e,t,n),e}function Rg(e,t){let n=0,i=0,r=0,o=[];for(let s of e){let a=Math.max(s.additionStart-1,0),l=Math.max(s.deletionStart-1,0),d=a,c=l,u=0,h=0,f=0,m=0,y=[];for(let g of s.hunkContent){if(g.type==="context"){y.push({...g,additionLineIndex:d,deletionLineIndex:c}),d+=g.lines,c+=g.lines,f+=g.lines,m+=g.lines;continue}y.push({...g,additionLineIndex:d,deletionLineIndex:c}),d+=g.additions,c+=g.deletions,u+=g.additions,h+=g.deletions,f+=Math.max(g.additions,g.deletions),m+=g.additions+g.deletions}let v=Math.max(se(s.additionStart,s.additionCount)-r,0);o.push({...s,collapsedBefore:v,additionLineIndex:a,deletionLineIndex:l,additionLines:u,deletionLines:h,hunkContent:y,splitLineStart:n+v,unifiedLineStart:i+v,splitLineCount:f,unifiedLineCount:m}),n+=v+f,i+=v+m,r=ee(s.additionStart,s.additionCount)}if(o.length>0){let s=o[o.length-1],a=ee(s.additionStart,s.additionCount),l=Math.max(t-a,0);n+=l,i+=l}return{hunks:o,splitLineCount:n,unifiedLineCount:i}}function Ig(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function rc(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function Mg(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function Hg(e,t,n){if(e.cacheKey!=null)return`${e.cacheKey}:hydrated`;return Pg(t,n)}function oc(e,t,n){let i=Hg(e,t,n);if(i==null){delete e.cacheKey;return}e.cacheKey=i}function Pg(e,t){if(e!=null&&t!=null)return e.cacheKey!=null&&t.cacheKey!=null?`${e.cacheKey}:${t.cacheKey}`:void 0;return e?.cacheKey??t?.cacheKey}function Oe({diff:e,diffStyle:t,startingLine:n=0,totalLines:i=1/0,expandedHunks:r,collapsedContextThreshold:o=1,callback:s}){let a=Ng({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:o}),l={viewportStart:n,viewportEnd:n+i,isWindowedHighlight:n>0||i<1/0,splitCount:a.splitCount,unifiedCount:a.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!l.isWindowedHighlight)return!1;let d=l.unifiedCount>=n+i,c=l.splitCount>=n+i;if(t==="unified")return d;else if(t==="split")return c;else return d&&c},shouldSkip(d,c){if(!l.isWindowedHighlight)return!1;let u=d>0&&l.unifiedCount+d<=n,h=c>0&&l.splitCount+c<=n;if(t==="unified")return u;else if(t==="split")return h;else return u&&h},incrementCounts(d,c){if(t==="unified"||t==="both")l.unifiedCount+=d;if(t==="split"||t==="both")l.splitCount+=c},isInWindow(d,c){if(!l.isWindowedHighlight)return!0;let u=l.isInUnifiedWindow(d),h=l.isInSplitWindow(c);if(t==="unified")return u;else if(t==="split")return h;else return u||h},isInUnifiedWindow(d){return!l.isWindowedHighlight||l.unifiedCount>=n-d&&l.unifiedCount<n+i},isInSplitWindow(d){return!l.isWindowedHighlight||l.splitCount>=n-d&&l.splitCount<n+i},emit(d,c=!1){if(!c)if(t==="unified")l.incrementCounts(1,0);else if(t==="split")l.incrementCounts(0,1);else l.incrementCounts(1,1);return s(d)??!1}};e:for(let d=a.hunkIndex;d<e.hunks.length;d++){let S=function(A,R){if(v==null||v.collapsedLines<=0||v.fromStart+v.fromEnd>0)return 0;if(t==="unified")return A===c.unifiedLineStart+c.unifiedLineCount-1?v.collapsedLines:0;return R===c.splitLineStart+c.splitLineCount-1?v.collapsedLines:0},x=function(){if(b)return 0;return b=!0,y.collapsedLines},c=e.hunks[d];if(c==null)throw Error("iterateOverDiff: invalid hunk index");if(l.shouldBreak())break;let u=se(c.deletionStart,c.deletionCount),h=se(c.additionStart,c.additionCount),f=!e.isPartial&&c.deletionCount===0?u:c.deletionLineIndex,m=!e.isPartial&&c.additionCount===0?h:c.additionLineIndex,y=Se({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:r,hunkIndex:d,collapsedContextThreshold:o}),v=d===l.finalHunkIndex?ve({fileDiff:e,hunkIndex:d,expandedHunks:r,collapsedContextThreshold:o,errorPrefix:"iterateOverDiff"}):void 0,g=y.fromStart+y.fromEnd,b=y.collapsedLines===0;if(!l.shouldSkip(g,g)){let A=c.unifiedLineStart-y.rangeSize,R=c.splitLineStart-y.rangeSize,_=f-y.rangeSize,F=m-y.rangeSize,M=u+1-y.rangeSize,N=h+1-y.rangeSize;if(Or(l,y.fromStart,t,(B)=>l.emit({hunkIndex:d,hunk:c,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:M+B,lineIndex:_+B,noEOFCR:!1,unifiedLineIndex:A+B,splitLineIndex:R+B},additionLine:{unifiedLineIndex:A+B,splitLineIndex:R+B,lineIndex:F+B,lineNumber:N+B,noEOFCR:!1}})))break e;if(A=c.unifiedLineStart-y.fromEnd,R=c.splitLineStart-y.fromEnd,_=f-y.fromEnd,F=m-y.fromEnd,M=u+1-y.fromEnd,N=h+1-y.fromEnd,Or(l,y.fromEnd,t,(B)=>l.emit({hunkIndex:d,hunk:c,collapsedBefore:x(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:M+B,lineIndex:_+B,noEOFCR:!1,unifiedLineIndex:A+B,splitLineIndex:R+B},additionLine:{unifiedLineIndex:A+B,splitLineIndex:R+B,lineIndex:F+B,lineNumber:N+B,noEOFCR:!1}}),()=>{x()}))break e}else l.incrementCounts(g,g),x();let{unifiedLineStart:C,splitLineStart:k}=c,w=f,T=m,L=u+1,I=h+1,O=c.hunkContent.at(-1);for(let A of c.hunkContent){if(l.shouldBreak())break e;let R=A===O;if(A.type==="context"){if(!l.shouldSkip(A.lines,A.lines)){if(Or(l,A.lines,t,(_)=>{let F=R&&_===A.lines-1,M=C+_,N=k+_;return l.emit({hunkIndex:d,hunk:c,collapsedBefore:x(),collapsedAfter:S(M,N),type:"context",deletionLine:{lineNumber:L+_,lineIndex:w+_,noEOFCR:F&&c.noEOFCRDeletions,unifiedLineIndex:M,splitLineIndex:N},additionLine:{unifiedLineIndex:M,splitLineIndex:N,lineIndex:T+_,lineNumber:I+_,noEOFCR:F&&c.noEOFCRAdditions}})},()=>{x()}))break e}else l.incrementCounts(A.lines,A.lines),x();C+=A.lines,k+=A.lines,w+=A.lines,T+=A.lines,L+=A.lines,I+=A.lines}else{let _=Math.max(A.deletions,A.additions),F=A.deletions+A.additions;if(!l.shouldSkip(F,_)){let M=_g(l,A,t);if((M[0]?.[0]??0)>0)x();for(let[N,B]of M)for(let ie=N;ie<B;ie++){let U=S(C+ie,t==="unified"?k+(ie<A.deletions?ie:ie-A.deletions):k+ie);if(l.emit(Og({hunkIndex:d,hunk:c,collapsedBefore:x(),collapsedAfter:U,diffStyle:t,index:ie,unifiedLineIndex:C,splitLineIndex:k,additionLineIndex:T,deletionLineIndex:w,additionLineNumber:I,deletionLineNumber:L,content:A,isLastContent:R,unifiedCount:F,splitCount:_}),!0))break e}}x(),l.incrementCounts(F,_),C+=F,k+=_,w+=A.deletions,T+=A.additions,L+=A.deletions,I+=A.additions}}if(v!=null){let{collapsedLines:A,fromStart:R,fromEnd:_}=v,F=R+_;if(Or(l,F,t,(M)=>{let N=M===F-1;return l.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:N?A:0,type:"context-expanded",deletionLine:{lineNumber:L+M,lineIndex:w+M,noEOFCR:!1,unifiedLineIndex:C+M,splitLineIndex:k+M},additionLine:{unifiedLineIndex:C+M,splitLineIndex:k+M,lineIndex:T+M,lineNumber:I+M,noEOFCR:!1}})},void 0,()=>l.shouldBreak()))break e}}}function Ng({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:r}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};let o=Dg({diff:e,expandedHunks:i,collapsedContextThreshold:r}),s=0,a=e.hunks.length-1,l=e.hunks.length;while(s<=a){let c=s+a>>1,u=o[c+1];if(u==null)throw Error("iterateOverDiff: invalid hunk prefix index");if((t==="unified"?u.unifiedCount:u.splitCount)>n)l=c,a=c-1;else s=c+1}if(l>=e.hunks.length){let c=o[e.hunks.length];if(c==null)throw Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:c.splitCount,unifiedCount:c.unifiedCount}}let d=o[l];if(d==null)throw Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:l,splitCount:d.splitCount,unifiedCount:d.unifiedCount}}function Dg({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let i=0,r=0,o=e.hunks.length-1,s=[{splitCount:0,unifiedCount:0}];for(let a=0;a<e.hunks.length;a++){let l=e.hunks[a];if(l==null)throw Error("iterateOverDiff: invalid hunk summary index");let d=Se({isPartial:e.isPartial,rangeSize:l.collapsedBefore,expandedHunks:t,hunkIndex:a,collapsedContextThreshold:n}),c=d.fromStart+d.fromEnd;i+=c+l.splitLineCount,r+=c+l.unifiedLineCount;let u=a===o?ve({fileDiff:e,hunkIndex:a,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"iterateOverDiff"}):void 0;if(u!=null){let h=u.fromStart+u.fromEnd;i+=h,r+=h}s.push({splitCount:i,unifiedCount:r})}return s}function Fg(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let i=[];function r(a){let l=Math.max(0,e.viewportStart-a),d=Math.min(t,e.viewportEnd-a);if(d>l)i.push([l,d])}if(n!=="split")r(e.unifiedCount);if(n!=="unified")r(e.splitCount);if(i.length===0)return[0,0];let o=i[0][0],s=i[0][1];for(let a=1;a<i.length;a++){let l=i[a];o=Math.min(o,l[0]),s=Math.max(s,l[1])}return[o,s]}function Or(e,t,n,i,r,o){let[s,a]=Fg(e,t,n);if(s>0)e.incrementCounts(s,s),r?.();let l=s;while(l<t){if(o?.()===!0)return!0;if(l>=a){e.incrementCounts(t-l,t-l);break}if(e.isInWindow(0,0)){if(i(l)===!0)return!0}else e.incrementCounts(1,1);l++}return!1}function _g(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let i=n!=="split",r=n!=="unified",o=n==="unified"?"unified":"split",s=[];function a(u,h){if(u+h<=e.viewportStart||u>=e.viewportEnd)return;let f=Math.max(0,e.viewportStart-u),m=Math.min(h,e.viewportEnd-u);return m>f?[f,m]:void 0}function l(u,h){if(o==="split")return u;return h==="additions"?[u[0]+t.deletions,u[1]+t.deletions]:u}function d(u,h){if(u==null)return;let[f,m]=l(u,h);if(m>f)s.push([f,m])}if(i)d(a(e.unifiedCount,t.deletions),"deletions"),d(a(e.unifiedCount+t.deletions,t.additions),"additions");if(r)d(a(e.splitCount,t.deletions),"deletions"),d(a(e.splitCount,t.additions),"additions");if(s.length===0)return s;s.sort((u,h)=>u[0]-h[0]);let c=[s[0]];for(let[u,h]of s.slice(1)){let f=c[c.length-1];if(u<=f[1])f[1]=Math.max(f[1],h);else c.push([u,h])}return c}function Og({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,diffStyle:r,index:o,unifiedLineIndex:s,splitLineIndex:a,additionLineIndex:l,deletionLineIndex:d,additionLineNumber:c,deletionLineNumber:u,content:h,isLastContent:f,unifiedCount:m,splitCount:y}){let v=o<h.deletions?s+o:void 0,g=r==="unified"?o>=h.deletions?s+o:void 0:o<h.additions?s+h.deletions+o:void 0,S=r==="unified"?a+(o<h.deletions?o:o-h.deletions):a+o,b=o<h.deletions?d+o:void 0,x=o<h.deletions?u+o:void 0,C=r==="unified"?o>=h.deletions?l+(o-h.deletions):void 0:o<h.additions?l+o:void 0,k=r==="unified"?o>=h.deletions?c+(o-h.deletions):void 0:o<h.additions?c+o:void 0,w=r==="unified"?f&&o===h.deletions-1&&t.noEOFCRDeletions:f&&o===y-1&&t.noEOFCRDeletions,T=r==="unified"?f&&o===m-1&&t.noEOFCRAdditions:f&&o===y-1&&t.noEOFCRAdditions,L=b!=null&&x!=null&&v!=null?{lineNumber:x,lineIndex:b,noEOFCR:w,unifiedLineIndex:v,splitLineIndex:S}:void 0,I=C!=null&&k!=null&&g!=null?{unifiedLineIndex:g,splitLineIndex:S,lineIndex:C,lineNumber:k,noEOFCR:T}:void 0;if(L==null&&I!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:void 0,additionLine:I};else if(L!=null&&I==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:L,additionLine:void 0};if(L==null||I==null)throw Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:L,additionLine:I}}var sc=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){if(!this.enabled)return;this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1}setup(e,t,n){if(t==null||n==null)for(let i of e.children??[]){if(!(i instanceof HTMLElement))continue;if("deletions"in i.dataset)t=i;else if("additions"in i.dataset)n=i}if(n==null||t==null){this.cleanUp();return}if(this.codeDeletions!==t)this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0});if(this.codeAdditions!==n)this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0});this.enabled=!0}handleDeletionsScroll=()=>{if(this.isAdditionsScrolling)return;this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft})};handleAdditionsScroll=()=>{if(this.isDeletionsScrolling)return;this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft})}};function Jn(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function vn(e){let t=e.lang??oe(e.name),n=e.lang??(e.prevName!=null?oe(e.prevName):"text");return t==="text"&&n==="text"}function _t(e,t){return Ie(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Zn(e){return H({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Qn(e){return H({tagName:"div",children:[H({tagName:"span",children:[be("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function gs(e){return H({tagName:"div",children:[Nt({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 Ot({type:e,content:t,expandIndex:n,chunked:i=!1,slotName:r,isFirstHunk:o,isLastHunk:s}){let a=0,l=[];if(e==="metadata"&&t!=null)l.push(H({tagName:"div",children:[be(t)],properties:{"data-separator-wrapper":""}}));if((e==="line-info"||e==="line-info-basic")&&t!=null){let d=[];if(n!=null)if(!i)d.push(gs(!o&&!s?"both":o?"down":"up")),a++;else{if(!o)d.push(gs("up")),a++;if(!s)d.push(gs("down")),a++}if(d.push(H({tagName:"div",children:[H({tagName:"span",children:[be(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),i&&n!=null)d.push(H({tagName:"div",children:[be("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}}));l.push(H({tagName:"div",children:d,properties:{"data-separator-wrapper":"","data-separator-multi-button":a>1?"":void 0}}))}if(e==="custom"&&r!=null)l.push(H({tagName:"slot",properties:{name:r}}));return H({tagName:"div",children:l,properties:{"data-separator":l.length===0?"simple":e,"data-expand-index":n,"data-separator-first":o?"":void 0,"data-separator-last":s?"":void 0}})}function ac(e,t){return`hunk-separator-${e}-${t}`}function lc(e){let t=e.at(-1);if(t==null)return 0;return Math.max(ee(t.additionStart,t.additionCount),ee(t.deletionStart,t.deletionCount))}function ys({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 ei({item:e,arr:t,enableJoin:n,isNeutral:i=!1,isLastItem:r=!1}){let o=t[t.length-1];if(o==null||r||!n){t.push([i?0:1,e.value]);return}let s=o[0]===0;if(i===s||i&&e.value.length===1&&!s){o[1]+=e.value;return}t.push([i?0:1,e.value])}var Ug={forcePlainText:!1};function dc(e,t,n,{forcePlainText:i,startingLine:r,totalLines:o,expandedHunks:s,collapsedContextThreshold:a=1}=Ug){if(i)r??=0,o??=1/0;else r=0,o=1/0;let l=r>0||o<1/0,d=typeof n.theme==="string"?t.getTheme(n.theme).type:void 0,c=Sr({theme:n.theme,highlighter:t}),u=i&&!l&&(e.unifiedLineCount>1000||e.splitLineCount>1000)?"none":n.lineDiffType,h={deletionLines:[],additionLines:[]},{maxLineDiffLength:f}=n,m=!i&&!e.isPartial,y=i?s:void 0,v=new Map;function g(b){let x=m?0:b,C=v.get(x)??Bg();return v.set(x,C),C}function S(b,x,C,k){if(l){let w=C.at(-1);if(w==null||w.targetIndex+w.count!==x)w={targetIndex:x,originalOffset:k.length,count:0},C.push(w);w.count++}k.push(b)}Oe({diff:e,diffStyle:"both",startingLine:r,totalLines:o,expandedHunks:l?y:!0,collapsedContextThreshold:a,callback:({hunkIndex:b,additionLine:x,deletionLine:C,type:k})=>{let w=g(b),T=x!=null?x.splitLineIndex:C.splitLineIndex;if(k==="change"&&x!=null&&C!=null)zg({additionLine:e.additionLines[x.lineIndex],deletionLine:e.deletionLines[C.lineIndex],deletionLineIndex:w.deletionContent.length,additionLineIndex:w.additionContent.length,deletionDecorations:w.deletionDecorations,additionDecorations:w.additionDecorations,lineDiffType:u,maxLineDiffLength:f});if(C!=null)S(e.deletionLines[C.lineIndex],C.lineIndex,w.deletionSegments,w.deletionContent),w.deletionInfo.push({type:k==="change"?"change-deletion":k,lineNumber:C.lineNumber,altLineNumber:k==="change"?void 0:x.lineNumber??void 0,lineIndex:`${C.unifiedLineIndex},${T}`});if(x!=null)S(e.additionLines[x.lineIndex],x.lineIndex,w.additionSegments,w.additionContent),w.additionInfo.push({type:k==="change"?"change-addition":k,lineNumber:x.lineNumber,altLineNumber:k==="change"?void 0:C.lineNumber??void 0,lineIndex:`${x.unifiedLineIndex},${T}`})}});for(let b of v.values()){if(b.deletionContent.length===0&&b.additionContent.length===0)continue;let x={name:e.prevName??e.name,contents:b.deletionContent.value},C={name:e.name,contents:b.additionContent.value},{deletionLines:k,additionLines:w}=$g({deletionFile:x,deletionInfo:b.deletionInfo,deletionDecorations:b.deletionDecorations,additionFile:C,additionInfo:b.additionInfo,additionDecorations:b.additionDecorations,highlighter:t,options:n,languageOverride:i?"text":e.lang});if(m){h.deletionLines=k,h.additionLines=w;continue}if(b.deletionSegments.length>0)for(let T of b.deletionSegments)for(let L=0;L<T.count;L++)h.deletionLines[T.targetIndex+L]=k[T.originalOffset+L];else h.deletionLines.push(...k);if(b.additionSegments.length>0)for(let T of b.additionSegments)for(let L=0;L<T.count;L++)h.additionLines[T.targetIndex+L]=w[T.originalOffset+L];else h.additionLines.push(...w)}return{code:h,themeStyles:c,baseThemeType:d}}function zg({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:i,deletionDecorations:r,additionDecorations:o,lineDiffType:s,maxLineDiffLength:a}){if(e==null||t==null||s==="none")return;if(e=ke(e),t=ke(t),e.length>a||t.length>a)return;let l=s==="char"?qo(e,t):Zo(e,t),d=[],c=[],u=s==="word-alt",h=l.at(-1);for(let m of l){let y=m===h;if(!m.added&&!m.removed)ei({item:m,arr:d,enableJoin:u,isNeutral:!0,isLastItem:y}),ei({item:m,arr:c,enableJoin:u,isNeutral:!0,isLastItem:y});else if(m.removed)ei({item:m,arr:d,enableJoin:u,isLastItem:y});else ei({item:m,arr:c,enableJoin:u,isLastItem:y})}let f=0;for(let m of d){if(m[0]===1)r.push(ys({line:n,spanStart:f,spanLength:m[1].length}));f+=m[1].length}f=0;for(let m of c){if(m[0]===1)o.push(ys({line:i,spanStart:f,spanLength:m[1].length}));f+=m[1].length}}function Bg(){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 $g({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:i,highlighter:r,deletionDecorations:o,additionDecorations:s,languageOverride:a,options:{theme:l=z,...d}}){let c=a??oe(e.name),u=a??oe(t.name),{state:h,transformers:f}=gr(d.useTokenTransformer),m=(()=>typeof l==="string"?{...d,lang:"text",theme:l,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:ce("token"),tokenizeTimeLimit:0}:{...d,lang:"text",themes:l,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:ce("token"),tokenizeTimeLimit:0})();return{deletionLines:(()=>{if(e.contents==="")return[];return m.lang=c,h.lineInfo=n,m.decorations=o,jn(r.codeToHast(ke(e.contents),m))})(),additionLines:(()=>{if(t.contents==="")return[];return m.lang=u,m.decorations=s,h.lineInfo=i,jn(r.codeToHast(ke(t.contents),m))})()}}var Vg=-1,gc=class{options;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++Vg}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;editSessionActive=!1;constructor(e={theme:z},t,n){if(this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0)this.highlighter=Dt(e.theme??z)?Dn():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),this.endEditSession()}beginEditSession(){this.editSessionActive=!0;let e=this.diffCache;if(e!=null&&!e.isPartial&&e.additionLines.length===0)Object.assign(e,On(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache()}endEditSession(){this.editSessionActive=!1}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{renderCache:e}=this;if(e==null||vn(e.diff)||Br(e.diff,this.getTokenizeMaxLength()))return Promise.resolve();let{diff:t}=e,{workerManager:n}=this;if(!this.editSessionActive&&n?.isWorkingPool()===!0&&t.cacheKey!=null)return n.evictDiffFromCache(t.cacheKey),n.primeDiffHighlightCache(t).then(()=>{this.applyRefreshedResult(t,n.getDiffResultCache(t))}).catch((i)=>this.onHighlightError(i));return this.asyncHighlight(t).then((i)=>this.applyRefreshedResult(t,i)).catch((i)=>this.onHighlightError(i))}applyRefreshedResult(e,t){if(t==null||this.renderCache==null||this.renderCache.diff!==e||this.editSessionActive)return;let{options:n}=this.getRenderOptions(e);if(!_t(n,t.options))return;this.renderCache={diff:e,options:t.options,highlighted:!0,result:t.result,renderRange:void 0},this.onRenderUpdate?.()}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){let e=this.renderCache;if(this.renderCache=void 0,e!=null&&e.isDirty===!0&&e.diff.cacheKey!=null)this.workerManager?.evictDiffFromCache(e.diff.cacheKey)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};if(t==="up"||t==="both")i.fromStart+=n;if(t==="down"||t==="both")i.fromEnd+=n;if(this.renderCache?.highlighted!==!0)this.clearRenderCache();this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??mc}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),i=n[t.lineNumber]??[];n[t.lineNumber]=i,i.push(t)}}updateRenderCache(e,t,n=!1){if(this.renderCache==null)return!1;let{result:i,diff:r}=this.renderCache;if(i==null)return!1;if(r.isPartial)throw Error("Could not update render cache for partial diff");let o=i.code.additionLines,s=[],a=new Map;for(let[d,c]of e){let u=o[d]?.properties??{},h=c.map((v)=>v[2]).join(""),f=d<r.additionLines.length,m=f?r.additionLines[d]??"":"",y=ke(m);if(f){if(r.additionLines[d]=dr(m,h),y!==h)s.push(d),a.set(d,m)}o[d]={type:"element",tagName:"div",properties:{"data-line":u["data-line"]??d+1,"data-line-index":u["data-line-index"]??d,"data-line-type":u["data-line-type"]??"context"},children:c.map(([v,g,S])=>{if(v===0&&g===""){if(S==="")return{type:"element",tagName:"br",properties:{},children:[]};return{type:"text",value:S}}return{type:"element",tagName:"span",properties:{"data-char":v,style:`color:${g};`},children:[{type:"text",value:S}]}})}}let l=!1;if(s.length>0)if(this.editSessionActive&&!r.isPartial){if(!n)if(r.additionLines.length<=1&&r.additionLines.join("")==="")Object.assign(r,On(r,this.options.parseDiffOptions)),this.markEditSessionPass(r),l=!0;else if(Yi(r,r.additionLines))Object.assign(r,_n(r,r.additionLines,this.options.parseDiffOptions)),this.markEditSessionPass(r),l=!0;else{let d=Ed(r,s,this.options.parseDiffOptions,a);this.applyExpansionRemap(d),l=d!=null}}else Object.assign(r,Cd(r,s,this.options.parseDiffOptions));return i.baseThemeType=t,this.renderCache.isDirty=!0,l}applyExpansionRemap(e){if(e!=null)this.expandedHunks=Td(this.expandedHunks,e)}applyDocumentChange(e){if(this.renderCache==null)return;let{diff:t,result:n}=this.renderCache;if(n==null)return;if(t.isPartial)throw Error("Could not apply document change for partial diff");let{additionLines:i}=t;if(t.additionLines=qg(e,i),n.code.additionLines=jg(i,t.additionLines,n.code.additionLines,e),t.additionLines.length<=1&&t.additionLines.join("")==="")Object.assign(t,On(t,this.options.parseDiffOptions)),n.code.additionLines[0]=vs(0,e.getLineText(0)),this.markEditSessionPass(t);else if(this.editSessionActive)this.applySessionDocumentChange(t);else Object.assign(t,Ji(t,this.options.parseDiffOptions));this.renderCache.isDirty=!0}applySessionDocumentChange(e){let{parseDiffOptions:t}=this.options,n=e.additionLines;if(Yi(e,n)){Object.assign(e,_n(e,n,t)),this.markEditSessionPass(e);return}this.applyExpansionRemap(tr(e,t))}markEditSessionPass(e){if(!this.editSessionActive)return;e.editSessionDirty=!0}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){let n=t==="change"?e==="deletions"?"change-deletion":"change-addition":t;return{gutterLineType:n,contentProperties:{"data-line-type":n}}}createAnnotationElement=(e)=>Wn(e);getOptionsWithDefaults(){let{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:i=!1,disableLineNumbers:r=!1,disableVirtualizationBuffers:o=!1,collapsed:s=!1,expandUnchanged:a=!1,collapsedContextThreshold:l=1,expansionLineCount:d=100,hunkSeparators:c="line-info",lineDiffType:u="word-alt",maxLineDiffLength:h=1000,overflow:f="scroll",stickyHeader:m=!1,theme:y=z,headerRenderMode:v="default",tokenizeMaxLineLength:g=1000,tokenizeMaxLength:S=pc,useTokenTransformer:b=!1,useCSSClasses:x=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:i,disableLineNumbers:r,disableVirtualizationBuffers:o,collapsed:s,expandUnchanged:a,collapsedContextThreshold:l,expansionLineCount:d,hunkSeparators:c,lineDiffType:u,maxLineDiffLength:h,overflow:f,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??y,headerRenderMode:v,tokenizeMaxLineLength:g,tokenizeMaxLength:S,useTokenTransformer:b,useCSSClasses:x}}async initializeHighlighter(){return this.highlighter=await en(fr(this.computedLang,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;let{options:t}=this.getRenderOptions(e),n=Br(e,this.getTokenizeMaxLength()),i=this.workerManager?.getDiffResultCache(e);if(i!=null&&!_t(t,i.options))i=void 0;if(this.renderCache??={diff:e,highlighted:!n&&!vn(e),options:t,result:n?void 0:i?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){if(this.renderCache.result==null&&!n)this.workerManager.highlightDiffAST(this,this.diff)}else if(this.highlighter==null)this.computedLang=e.lang??oe(e.name),this.initializeHighlighter()}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??z}getEffectiveCodeOptions(){let e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){let t=(()=>{if(this.workerManager?.isWorkingPool()===!0){let a=this.workerManager.getDiffRenderOptions();if(this.editSessionActive&&a.useTokenTransformer!==!0)return{...a,useTokenTransformer:!0};return a}let{theme:i,tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}=this.getOptionsWithDefaults();return{theme:i,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}})();this.getOptionsWithDefaults();let{renderCache:n}=this;if(n?.result==null)return{options:t,forceHighlight:!0};if(!bt(e,n.diff)||!_t(t,n.options))return{options:t,forceHighlight:!0};return{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=yn){if(e==null)return;let{expandUnchanged:n,collapsedContextThreshold:i}=this.getOptionsWithDefaults(),{options:r,forceHighlight:o}=this.getRenderOptions(e),s=this.getMatchingWorkerResultCache(e,r);if(s!=null&&!this.hasHighlightedRenderCache(e,r))this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...s},o=!1;this.renderCache??={diff:e,highlighted:!1,options:r,result:void 0,renderRange:void 0};let a=e.additionLines.length>0||e.deletionLines.length>0,l=!a||vn(e)||Br(e,this.getTokenizeMaxLength()),d=!bt(e,this.renderCache.diff),c=!St(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let u=this.renderCache.result==null&&this.renderCache.highlighted&&!l&&!d&&Jn(t);if(u)this.renderCache.highlightPending=!0;if(!u&&(l||this.renderCache.result==null||!this.renderCache.highlighted&&(d||c))){if(this.renderCache.diff=e,this.renderCache.options=r,this.renderCache.highlighted=!1,this.renderCache.result==null||d||c||o)this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,Jn(t)?!0:n?!0:this.expandedHunks,i);this.renderCache.renderRange=t}if(!l&&a&&(!this.renderCache.highlighted||o))this.workerManager.highlightDiffAST(this,e)}else{this.computedLang=e.lang??oe(e.name);let u=this.highlighter!=null&&Dt(r.theme),h=this.highlighter!=null&&cn(this.computedLang),f=!l&&h;if(this.highlighter!=null&&u&&(o||l||!this.renderCache.highlighted&&f||this.renderCache.result==null)){let{result:m,options:y}=this.renderDiffWithHighlighter(e,this.highlighter,l||!h);this.renderCache={diff:e,options:y,highlighted:f,result:m,renderRange:void 0}}if(!u||!l&&!h)this.asyncHighlight(e).then(({result:m,options:y})=>{if(this.renderCache!=null)this.renderCache.highlighted=!1;this.applyHighlightResult(e,m,y,!l)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=yn){let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:s}=this.getOptionsWithDefaults();return hr({type:"diff",diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:s,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=Br(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??oe(e.name);let n=this.highlighter!=null&&Dt(this.getLocalHighlightTheme()),i=t||this.highlighter!=null&&cn(this.computedLang);if(this.highlighter==null||!n||!i)this.highlighter=await this.initializeHighlighter();return this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:r}=this.getOptionsWithDefaults(),o=dc(e,t,i,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:r});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===""&&o.code.additionLines[0]==null){let s;if(Oe({diff:e,diffStyle:"both",expandedHunks:n?!0:void 0,collapsedContextThreshold:r,callback:({additionLine:a})=>{if(a?.lineIndex!==0)return;return s=a,!0}}),s==null)throw Error("DiffHunksRenderer: missing empty addition line");o.code.additionLines[0]=vs(0,"",s.unifiedLineIndex,s.splitLineIndex)}return{result:o,options:i}}onHighlightSuccess(e,t,n,i=!0){if(this.editSessionActive)return;this.applyHighlightResult(e,t,n,i)}applyHighlightResult(e,t,n,i=!0){if(this.renderCache==null)return;let r=this.renderCache.highlightPending===!0||!this.renderCache.highlighted||!_t(this.renderCache.options,n)||!bt(this.renderCache.diff,e);if(this.renderCache={diff:e,options:n,highlighted:i,result:t,renderRange:void 0},r)this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(n==null||!_t(t,n.options))return;return n}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&bt(e,n.diff)&&_t(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){let{diffStyle:o,disableFileHeader:s,expandUnchanged:a,expansionLineCount:l,collapsedContextThreshold:d,hunkSeparators:c}=this.getOptionsWithDefaults(),u=this.renderCache?.isDirty??!1;this.diff=e;let h=o==="unified",f=Yg(e,this.options.loadDiffFiles!=null),m=!e.isPartial||f,y=[],v=[],g=[],S=[],{additionLines:b,deletionLines:x}=n,C={rowCount:0,hunkSeparators:c,additionsContentAST:y,deletionsContentAST:v,unifiedContentAST:g,unifiedGutterAST:gt(),deletionsGutterAST:gt(),additionsGutterAST:gt(),expansionLineCount:l,hunkData:S,incrementRowCount(M=1){C.rowCount+=M},pushToGutter(M,N){switch(M){case"unified":C.unifiedGutterAST.children.push(N);break;case"deletions":C.deletionsGutterAST.children.push(N);break;case"additions":C.additionsGutterAST.children.push(N);break}}},k=is({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),w={size:0,side:void 0,increment(){this.size+=1},flush(){if(o==="unified")return;if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}if(this.side==="additions")C.pushToGutter("additions",pe(void 0,"buffer",this.size)),y?.push(Zn(this.size));else C.pushToGutter("deletions",pe(void 0,"buffer",this.size)),v?.push(Zn(this.size));this.size=0,this.side=void 0}},T=(M,N,B,ie,U)=>{C.pushToGutter(M,rr(N,B,ie,U))};function L(M){if(w.flush(),o==="unified")Ss("unified",M,C);else Ss("deletions",M,C),Ss("additions",M,C)}if(this.pushFileLevelAnnotations(e,o,t,C),Oe({diff:e,diffStyle:o,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:a?!0:this.expandedHunks,collapsedContextThreshold:d,callback:({hunkIndex:M,hunk:N,collapsedBefore:B,collapsedAfter:ie,additionLine:U,deletionLine:W,type:j})=>{let ue=W!=null?W.splitLineIndex:U.splitLineIndex,he=U!=null?U.unifiedLineIndex:W.unifiedLineIndex;if(o==="split"&&j!=="change")w.flush();if(B>0)L({hunkIndex:M,collapsedLines:B,rangeSize:Math.max(N?.collapsedBefore??0,0),hunkSpecs:N?.hunkSpecs,isFirstHunk:M===0,isLastHunk:!1,isExpandable:m});let Me=o==="unified"?he:ue,Ue={type:j,hunkIndex:M,lineIndex:Me,unifiedLineIndex:he,splitLineIndex:ue,deletionLine:W,additionLine:U};if(o==="unified"){let q=this.getUnifiedInjectedRowsForLine?.(Ue);if(q?.before!=null)uc(q.before,C);let me=W!=null?x[W.lineIndex]:void 0,xe=U!=null?b[U.lineIndex]:void 0;if(me==null&&xe==null)throw console.error("DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong",{file:e.name}),Error("DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong");let xt=j==="change"?U!=null?"change-addition":"change-deletion":j,Ne=this.getUnifiedLineDecoration({type:j,lineType:xt,additionLineIndex:U?.lineIndex,deletionLineIndex:W?.lineIndex});if(T("unified",Ne.gutterLineType,U!=null?U.lineNumber:W.lineNumber,`${he},${ue}`,Ne.gutterProperties),xe!=null)xe=zr(xe,Ne.contentProperties,u&&U!=null?{"data-line":U.lineNumber,"data-line-index":`${he},${ue}`}:void 0);else if(me!=null)me=zr(me,Ne.contentProperties,u&&W!=null?{"data-line":W.lineNumber,"data-line-index":`${he},${ue}`}:void 0);if(Ur({diffStyle:"unified",type:j,deletionLine:me,additionLine:xe,unifiedSpan:this.getAnnotations("unified",W?.lineNumber,U?.lineNumber,M,Me),createAnnotationElement:(We)=>this.createAnnotationElement(We),context:C}),q?.after!=null)uc(q.after,C)}else{let q=this.getSplitInjectedRowsForLine?.(Ue);if(q?.before!=null)hc(q.before,C,w);let me=W!=null?x[W.lineIndex]:void 0,xe=U!=null?b[U.lineIndex]:void 0,xt=this.getSplitLineDecoration({side:"deletions",type:j,lineIndex:W?.lineIndex}),Ne=this.getSplitLineDecoration({side:"additions",type:j,lineIndex:U?.lineIndex});if(me==null&&xe==null)throw console.error("DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong",{file:e.name}),Error("DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong");let We=(()=>{if(j==="change"){if(xe==null)return"additions";else if(me==null)return"deletions"}})();if(We!=null){if(w.side!=null&&w.side!==We)w.flush();w.side=We,w.increment()}else if(j==="change")w.flush();let st=this.getAnnotations("split",W?.lineNumber,U?.lineNumber,M,Me);if(st!=null&&w.size>0)w.flush();if(W!=null){let Te=zr(me,xt.contentProperties,u?{"data-line":W.lineNumber,"data-line-index":`${W.unifiedLineIndex},${ue}`}:void 0);if(T("deletions",xt.gutterLineType,W.lineNumber,`${W.unifiedLineIndex},${ue}`,xt.gutterProperties),Te!=null)me=Te}if(U!=null){let Te=zr(xe,Ne.contentProperties,u?{"data-line":U.lineNumber,"data-line-index":`${U.unifiedLineIndex},${ue}`}:void 0);if(T("additions",Ne.gutterLineType,U.lineNumber,`${U.unifiedLineIndex},${ue}`,Ne.gutterProperties),Te!=null)xe=Te}if(Ur({diffStyle:"split",type:j,additionLine:xe,deletionLine:me,...st,createAnnotationElement:(Te)=>this.createAnnotationElement(Te),context:C}),q?.after!=null)hc(q.after,C,w)}let Ce=o==="split"&&N!=null&&ue===N.splitLineStart+N.splitLineCount-1,He=M===e.hunks.length-1&&N!=null&&(o==="split"?ue===N.splitLineStart+N.splitLineCount-1:he===N.unifiedLineStart+N.unifiedLineCount-1),Ve=Ce?N.noEOFCRDeletions:!1,Ut=Ce?N.noEOFCRAdditions:!1,Ge=(W?.noEOFCR??!1)||Ve,Pe=(U?.noEOFCR??!1)||Ut;if(Pe||Ge){if(o==="split")w.flush();if(Ge){let q=j==="context"||j==="context-expanded"?j:"change-deletion";if(o==="unified")C.unifiedContentAST.push(Qn(q)),C.pushToGutter("unified",pe(q,"metadata",1));else if(C.deletionsContentAST.push(Qn(q)),C.pushToGutter("deletions",pe(q,"metadata",1)),!Pe)C.pushToGutter("additions",pe(void 0,"buffer",1)),C.additionsContentAST.push(Zn(1))}if(Pe){let q=j==="context"||j==="context-expanded"?j:"change-addition";if(o==="unified")C.unifiedContentAST.push(Qn(q)),C.pushToGutter("unified",pe(q,"metadata",1));else if(C.additionsContentAST.push(Qn(q)),C.pushToGutter("additions",pe(q,"metadata",1)),!Ge)C.pushToGutter("deletions",pe(void 0,"buffer",1)),C.deletionsContentAST.push(Zn(1))}C.incrementRowCount(1)}if(c!=="simple"&&c!=="metadata"&&(ie>0||He&&f))L({hunkIndex:j==="context-expanded"?M:M+1,collapsedLines:He&&f?"unknown":ie,rangeSize:k,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m});C.incrementRowCount(1)}}),o==="split")w.flush();let I=Math.max(lc(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),O=t.bufferBefore>0||t.bufferAfter>0,A=!h&&e.type!=="deleted",R=!h&&e.type!=="new",_=C.rowCount>0||O;y=A&&_?y:void 0,v=R&&_?v:void 0,g=h&&_?g:void 0;let F=this.createPreElement(v!=null&&y!=null,I);return{unifiedGutterAST:h&&_?C.unifiedGutterAST.children:void 0,unifiedContentAST:g,deletionsGutterAST:R&&_?C.deletionsGutterAST.children:void 0,deletionsContentAST:v,additionsGutterAST:A&&_?C.additionsGutterAST.children:void 0,additionsContentAST:y,hunkData:S,preNode:F,themeStyles:i,baseThemeType:r,headerElement:!s?this.renderHeader(this.diff):void 0,totalLines:I,rowCount:C.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){let n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,i=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||i==null)return;let r=gt(n);return r.properties.style=`grid-row: span ${t.rowCount}`,[r,cr(i,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators==="line-info",i=this.renderCodeAST("unified",e);if(i!=null)return t.push(H({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};let r=this.renderCodeAST("deletions",e);if(r!=null)t.push(H({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));let o=this.renderCodeAST("additions",e);if(o!=null)t.push(H({tagName:"code",children:o,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}}));return{...e.preNode,children:t}}renderFullHTML(e,t=[]){return X(this.renderFullAST(e,t))}renderPartialHTML(e,t){if(t==null)return X(e);return X(H({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,n,i){if(!mt(n))return;let r=e.type!=="new"?cc(Bn(this.deletionAnnotations)):[],o=e.type!=="deleted"?cc(Bn(this.additionAnnotations)):[];if(r.length===0&&o.length===0)return;let s=-1,a=-1,{createAnnotationElement:l}=this;if(t==="unified"){Ur({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:s,lineIndex:a,annotations:r.concat(o)},createAnnotationElement:l,context:i});return}Ur({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:s,lineIndex:a,annotations:r},additionSpan:{type:"annotation",hunkIndex:s,lineIndex:a,annotations:o},createAnnotationElement:l,context:i})}getAnnotations(e,t,n,i,r){let o={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(t!=null)for(let a of this.deletionAnnotations[t]??[])o.annotations.push(Ee(a));let s={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(n!=null)for(let a of this.additionAnnotations[n]??[])(e==="unified"?o:s).annotations.push(Ee(a));if(e==="unified"){if(o.annotations.length>0)return o;return}if(s.annotations.length===0&&o.annotations.length===0)return;return{deletionSpan:o,additionSpan:s}}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return ur({fileOrDiff:e,mode:t,stickyHeader:n})}};function cc(e){return e?.map((t)=>Ee(t))??[]}var Gg=new Intl.PluralRules("en-US");function Wg(e){return`${e} unmodified line${Gg.select(e)==="one"?"":"s"}`}function uc(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function hc(e,t,n){for(let{deletion:i,addition:r}of e){if(i==null&&r==null)continue;let o=i!=null&&r!=null?void 0:i==null?"deletions":"additions";if(o==null||n.side!==o)n.flush();if(i!=null)t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter);if(r!=null)t.additionsContentAST.push(r.content),t.pushToGutter("additions",r.gutter);if(o!=null)n.side=o,n.increment();t.incrementRowCount(1)}}function Ur({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:r,deletionSpan:o,additionSpan:s,createAnnotationElement:a,context:l}){let d=!1;if(e==="unified"){if(i!=null)l.unifiedContentAST.push(i);else if(n!=null)l.unifiedContentAST.push(n);if(r!=null){let c=t==="change"?n!=null?"change-deletion":"change-addition":t;l.unifiedContentAST.push(a(r)),l.pushToGutter("unified",pe(c,"annotation",1)),d=!0}}else if(e==="split"){if(n!=null)l.deletionsContentAST.push(n);if(i!=null)l.additionsContentAST.push(i);if(o!=null){let c=t==="change"?n!=null?"change-deletion":"context":t;l.deletionsContentAST.push(a(o)),l.pushToGutter("deletions",pe(c,"annotation",1)),d=!0}if(s!=null){let c=t==="change"?i!=null?"change-addition":"context":t;l.additionsContentAST.push(a(s)),l.pushToGutter("additions",pe(c,"annotation",1)),d=!0}}if(d)l.incrementRowCount(1)}function Ss(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:r,isFirstHunk:o,isLastHunk:s,isExpandable:a},l){if(typeof n==="number"&&n<=0)return;let d=e==="unified"?l.unifiedContentAST:e==="deletions"?l.deletionsContentAST:l.additionsContentAST;if(l.hunkSeparators==="metadata"){if(r!=null){if(l.pushToGutter(e,Ot({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),d.push(Ot({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),e!=="additions")l.incrementRowCount(1)}return}if(l.hunkSeparators==="simple"){if(t>0){if(l.pushToGutter(e,Ot({type:"simple",isFirstHunk:o,isLastHunk:!1})),d.push(Ot({type:"simple",isFirstHunk:o,isLastHunk:!1})),e!=="additions")l.incrementRowCount(1)}return}let c=ac(e,t),u=i>l.expansionLineCount,h=a?t:void 0,f=typeof n==="number"?Wg(n):"More unchanged context may be available";if(l.pushToGutter(e,Ot({type:l.hunkSeparators,content:f,expandIndex:h,chunked:u,slotName:c,isFirstHunk:o,isLastHunk:s})),d.push(Ot({type:l.hunkSeparators,content:f,expandIndex:h,chunked:u,slotName:c,isFirstHunk:o,isLastHunk:s})),e!=="additions")l.incrementRowCount(1);l.hunkData.push({slotName:c,hunkIndex:t,lines:typeof n==="number"?n:0,lineCountKnown:typeof n==="number",type:e,expandable:a?{up:!o,down:!s,chunked:u}:void 0})}function zr(e,t,n){if(e==null||e.type!=="element"||t==null&&n==null)return e;return{...e,properties:{...e.properties,...t,...n}}}function fc(e){return e.length>0&&e[e.length-1]===""?e.length-1:e.length}function jg(e,t,n,i){let r=fc(e),o=fc(t),s=Math.min(r,o),a=0;while(a<s&&e[a]===t[a])a++;let l=0;while(l<s-a&&e[r-1-l]===t[o-1-l])l++;let d=Array(t.length);for(let c=0;c<a;c++)d[c]=n[c];for(let c=0;c<l;c++)d[o-1-c]=n[r-1-c];if(r<e.length&&o<t.length)d[t.length-1]=n[e.length-1];for(let c=e.length;c<t.length;c++)d[c]??=n[c];for(let c=a;c<t.length;c++)d[c]??=vs(c,i.getLineText(c));return d}function vs(e,t,n=e,i=e){return{type:"element",tagName:"div",properties:{"data-line":e+1,"data-line-index":`${n},${i}`,"data-line-type":"context"},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:t}]}]}}function qg(e,t){let n=[],i=Xg(t);for(let r=0;r<e.lineCount;r++){let o=e.getLineText(r,!0);n.push(r<e.lineCount-1&&!Kg(o)?o+i:o)}return n}function Kg(e){return e.endsWith(`
|
|
1524
|
+
`)||e.endsWith("\r")}function Xg(e){for(let t of e){if(t.endsWith(`\r
|
|
1525
|
+
`))return`\r
|
|
1526
|
+
`;if(t.endsWith(`
|
|
1527
|
+
`))return`
|
|
1528
|
+
`;if(t.endsWith("\r"))return"\r"}return`
|
|
1529
|
+
`}function Br(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Yg(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function yc(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function Sc(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function vc(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:Ir(e),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,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Jg(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}var Zg=-1,Cc=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Zg}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;pendingFiles;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:z},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new lr,this.scrollSyncManager=new sc,this.interactionManager=new ar("diff",dn(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 vc(e)}createHunksRenderer(e){return new gc(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>{let n=this.fileDiffCache;if(n==null)return;let i=n.hunks.at(-1),r,o;e:for(let s of n.hunks){let a=t==="deletions"?s.deletionStart:s.additionStart,l=t==="deletions"?s.deletionCount:s.additionCount,d=se(a,l)+1,c=s.splitLineStart,u=s.unifiedLineStart;if(e<d){let h=d-e;r=Math.max(u-h,0),o=Math.max(c-h,0);break e}if(e>=d+l){if(s===i){let h=e-(d+l);r=u+s.unifiedLineCount+h,o=c+s.splitLineCount+h;break e}continue}for(let h of s.hunkContent)if(h.type==="context")if(e<d+h.lines){let f=e-d;o=c+f,r=u+f;break e}else d+=h.lines,c+=h.lines,u+=h.lines;else{let f=t==="deletions"?h.deletions:h.additions;if(e<d+f){let m=e-d;r=u+(t==="additions"?h.deletions:0)+m,o=c+m;break e}else d+=f,c+=Math.max(h.deletions,h.additions),u+=h.deletions+h.additions}break e}if(r==null||o==null)return;return[r,o]};setOptions(e){if(e==null)return;this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions()}syncInteractionOptions(){this.interactionManager.setOptions(dn(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){if((this.options.themeType??"system")===e)return;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;if(this.appliedThemeCSS.themeType===t)return!1;return this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Ie(this.appliedThemeCSS.theme,this.options.theme??z)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){if(e||t||n||typeof this.options.hunkSeparators==="function")return!1;return!0}setSelectedLines(e,t){if(this.lineStateRefreshPending)this.deferredSelectedLines=[e,t];else this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){if(this.lineStateRefreshPending)this.deferredEditorActiveLine=[e,t];else this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??"additions"})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;if(this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null)this.setEditorActiveLine(...e);if(t!=null)this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}let{diffStyle:e="split",overflow:t="scroll"}=this.options;if(this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t==="wrap",columnVariables:this.shouldApplyColumnVariables(t)?"apply":"measure"}),t==="scroll"&&e==="split")this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions);else this.scrollSyncManager.cleanUp();this.managersDirty=!1}shouldApplyColumnVariables(e){if(typeof this.options.hunkSeparators==="function")return!0;return e==="scroll"&&(this.lineAnnotations.length>0||this.pre?.hasAttribute("data-has-merge-conflict")===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){if(this.codeUnified!=null)this.codeUnified.scrollLeft=e;if(this.codeAdditions!=null)this.codeAdditions.scrollLeft=e;if(this.codeDeletions!=null)this.codeDeletions.scrollLeft=e}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){if(yt(this.handleEditSessionRender),this.emitPostRender(!0),this.editor?.cleanUp(e),this.editor=void 0,this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.pendingFiles=void 0,!this.isContainerManaged)this.fileContainer?.remove();if(this.fileContainer=void 0,this.mounted=!1,!e)this.lineAnnotations=[];if(this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,!e)this.cachedHeaderHTML=void 0;if(this.errorWrapper?.remove(),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();else this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0;if(this.refreshViewTimeout!=null)clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:n=!1,lineAnnotations:i,fileDiff:r,...o}){if(!this.enabled)throw Error("FileDiff.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw Error("FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated");let s=Xn(o,"FileDiff.hydrate"),a=s?.oldFile,l=s?.newFile;if(this.hydrateElements(e,t),ty(this.pre,Qg({fileDiff:r,oldFile:a,newFile:l}),this.options.collapsed)||ny(this.headerElement,ey({fileDiff:r,oldFile:a,newFile:l}),this.options.disableFileHeader))this.render({...o,fileContainer:e,lineAnnotations:i,fileDiff:r,preventEmit:!0});else this.hydrationSetup({fileDiff:r,lineAnnotations:i,...s});if(!n)this.emitPostRender()}hydrateElements(e,t){if(this.fileContainer!==e)this.emitPostRender(!0);Hr(e,t);for(let n of e.shadowRoot?.children??[]){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(!(n instanceof HTMLElement))continue;if(n instanceof HTMLPreElement){this.pre=n;for(let i of n.children){if(!(i instanceof HTMLElement)||i.tagName.toLowerCase()!=="code")continue;if("deletions"in i.dataset)this.codeDeletions=i;if("additions"in i.dataset)this.codeAdditions=i;if("unified"in i.dataset)this.codeUnified=i}continue}if("diffsHeader"in n.dataset){this.headerElement=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-theme-css")){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.textContent;continue}}if(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:i}){if(this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?Fe(t,n,this.options.parseDiffOptions):void 0),this.pre==null)return;this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers()}rerender(){if(!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null)return;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.loadFilesIfNecessary(),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;if(e==null||t==null||!Jg(e)||this.pendingFiles?.fileDiff===e)return;this.pendingFiles={fileDiff:e,promise:this.loadFilesForDiff(e,t)}}async loadFilesForDiff(e,t){try{let n=await t(e);if(!this.enabled||this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(n){if(this.options.disableErrorHandling===!0)throw n;console.error(n)}finally{if(this.pendingFiles?.fileDiff===e)this.pendingFiles=void 0}}async handleFilesLoaded(e,t){if(this.fileDiff!==e||!e.isPartial)return;if(Yn("merge",e,t),this.setHydratedState(t),await Kn(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e)return;this.rerender()}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:n=!1,preventEmit:i=!1,lineAnnotations:r,fileContainer:o,containerWrapper:s,renderRange:a,...l}){let d=Xn(l,"FileDiff.render"),c=d?.oldFile,u=d?.newFile;if(!this.enabled)throw Error("FileDiff.render: attempting to call render after cleaned up");if(e!=null&&e.cacheKey===void 0)e.cacheKey=e.prevName!=null?e.prevName+":"+e.name:e.name;this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:h=!1,themeType:f="system",expandUnchanged:m=!1}=this.options,y=h?void 0:a,v=this.hasThemeChanged(),g=d!=null,S=g&&(!bc(c,this.deletionFile)||!bc(u,this.additionFile)),b=e!=null&&e!==this.fileDiff,x=r!=null&&(r.length>0||this.lineAnnotations.length>0)?r!==this.lineAnnotations:!1;if(!h&&St(y,this.renderRange)&&!n&&!x&&!v&&(e!=null&&e===this.fileDiff||e==null&&!S))return this.applyCachedThemeState(f);let C;if(e==null&&g&&(S||this.fileDiff==null))C=Fe(d.oldFile,d.newFile,this.options.parseDiffOptions);let{renderRange:k}=this;if(this.renderRange=y,g)this.deletionFile=c,this.additionFile=u;else if(e!=null)this.deletionFile=void 0,this.additionFile=void 0;if(e!=null)this.fileDiff=e;else if(C!=null)b=!0,this.fileDiff=C;if(b)this.cachedHeaderHTML=void 0;if(r!=null)this.setLineAnnotations(r);if(this.fileDiff==null)return!1;if(this.fileDiff.editSessionDirty===!0&&this.shouldSelfHealEditSession())Un(this.fileDiff,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult();if(m)this.loadFilesIfNecessary();this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);let{disableErrorHandling:w=!1,disableFileHeader:T=!1}=this.options;if(T){if(this.headerElement!=null)this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0;this.clearHeaderSlots()}if(o=this.getOrCreateFileContainer(o,s),this.applyCachedThemeState(f),h){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let L=this.hunksRenderer.renderDiff(this.fileDiff,Dr);if(L!=null)this.applyThemeState(o,L.themeStyles,f,L.baseThemeType);if(L?.headerElement!=null)this.applyHeaderToDOM(L.headerElement,o);this.renderSeparators([]),this.injectUnsafeCSS()}catch(L){if(w)throw L;if(console.error(L),L instanceof Error)this.applyErrorToDOM(L,o)}if(!i)this.emitPostRender();return!0}try{let L=this.getOrCreatePreNode(o);if(!(this.canPartiallyRender(n,x,S||b||v)&&this.applyPartialRender({previousRenderRange:k,renderRange:y}))){let I=this.hunksRenderer.renderDiff(this.fileDiff,y);if(I==null){if(this.workerManager?.isInitialized()===!1)this.workerManager.initialize().then(()=>this.rerender());return!1}if(this.applyThemeState(o,I.themeStyles,f,I.baseThemeType),I.headerElement!=null)this.applyHeaderToDOM(I.headerElement,o);if(I.additionsContentAST!=null||I.deletionsContentAST!=null||I.unifiedContentAST!=null)this.applyHunksToDOM(L,I);else if(this.pre!=null)this.pre.remove(),this.pre=void 0;this.renderSeparators(I.hunkData)}if(this.applyBuffers(L,y),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,!t)this.flushManagers();if(this.editor!=null)this.syncRenderViewToEditor()}catch(L){if(w)throw L;if(console.error(L),L instanceof Error)this.applyErrorToDOM(L,o)}if(!i)this.emitPostRender();return!0}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted)return;if(this.mounted=!1,t==null)return;this.options.onPostRender?.(t,this,"unmount");return}if(t==null)return;let i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}get fileDiffCache(){return this.hunksRenderer.diffCache??this.fileDiff}syncRenderViewToEditor(){let e=this.editor,t=this.fileContainer,n=this.fileDiffCache,i=this.lineAnnotations,r=this.computeEditorRenderRange(this.renderRange);if(e!=null&&t!=null&&n!=null&&!n.isPartial)this.hunksRenderer.initializeHighlighter().then((o)=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.fileDiffCache!==n)return;e.__syncRenderView(o,t,n,i,r)})}computeEditorRenderRange(e){let t=this.fileDiffCache;if(e==null||t==null||Jn(e))return e;let{diffStyle:n="split",expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options,o,s;if(Oe({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({additionLine:a})=>{if(a!=null)o??=a.lineNumber,s=a.lineNumber}}),o==null||s==null)return{...e,startingLine:0,totalLines:0};return{...e,startingLine:o-1,totalLines:s-o+1}}attachEditor(e){if(this.type!=="file-diff")throw Error(`FileDiff.attachEditor: cannot attach an editor to a "${this.type}" diff`);if(this.editor?.cleanUp(),this.editor=e,this.hunksRenderer.beginEditSession(),this.fileDiff?.isPartial===!0)this.loadFilesIfNecessary();if(this.hunksRenderer.editorRenderReady())this.syncRenderViewToEditor();else this.rerender();return(t)=>{if(this.editor=void 0,t!==!0)this.finishEditSession()}}finishEditSession(){this.hunksRenderer.endEditSession(),this.completeEditSession()}completeEditSession(){let e=this.fileDiffCache;if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=Ad(e,this.hunksRenderer.getExpandedHunksMap(),t);return Un(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(Rd(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){this.hunksRenderer.applyDocumentChange(e);let n=this.hunksRenderer.diffCache;if(n!=null){let i=this.fileDiff?.cacheKey;if(i!=null&&n.cacheKey==null)n.cacheKey=i;this.fileDiff=n}if(t!==void 0&&t!==this.lineAnnotations)this.setLineAnnotations(t),this.hunksRenderer.setLineAnnotations(this.lineAnnotations),this.renderAnnotations();this.rerender(),this.interactionManager.setSelectionDirty()}updateRenderCache(e,t,n={}){let{shouldRefreshDiffsView:i,lineCountChangeInFlight:r}=n;if(this.hunksRenderer.updateRenderCache(e,t,r)){if(this.refreshViewTimeout!=null)clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0;this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}if(i===!0){if(this.refreshViewTimeout!=null)clearTimeout(this.refreshViewTimeout);this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{if(this.refreshViewTimeout=void 0,this.options.diffStyle==="split")this.refreshSplitDiffView();else this.refreshUnifiedDiffView();this.flushDeferredLineState()},150)}}isLineRenderable(e){let t=this.fileDiffCache;if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options;return Xi({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}getNearestRenderableLine(e,t){let n=this.fileDiffCache;if(n==null)return e;let{expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options;return Sd({fileDiff:n,lineNumber:e,direction:t,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}revealLine(e){let t=this.fileDiffCache,{expandUnchanged:n=!1,collapsedContextThreshold:i=1,expansionLineCount:r=100}=this.options;if(t==null||t.isPartial||n)return!1;let o=this.hunksRenderer.getExpandedHunksMap();for(let[d,c]of t.hunks.entries()){let[u,h]=an(c);if(e<u){let f=Se({isPartial:t.isPartial,rangeSize:c.collapsedBefore,expandedHunks:o,hunkIndex:d,collapsedContextThreshold:i}),m=u-f.rangeSize;if(f.renderAll||e<m+f.fromStart||e>=u-f.fromEnd)return!1;let y=e-(m+f.fromStart)+1,v=u-f.fromEnd-e;if(y<=v)this.expandHunk(d,"up",y+r);else this.expandHunk(d,"down",v+r);return!0}if(e<h)return!1}let s=ve({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:o,collapsedContextThreshold:i,errorPrefix:"FileDiff.revealLine"});if(s==null||s.renderAll)return!1;let a=t.hunks[t.hunks.length-1],[,l]=an(a);if(e<l+s.fromStart||e>=l+s.rangeSize)return!1;return this.expandHunk(t.hunks.length,"up",e-(l+s.fromStart)+1+r),!0}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){ln(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};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 t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${e}px`),!0}async primeHighlightCache(e=this.fileDiff){let{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||vn(e))return;let n=this.options.tokenizeMaxLength??1e5;if(Math.max(e.additionLines.length,e.deletionLines.length)>n)return;await t.primeDiffHighlightCache(e).catch((i)=>{console.error(i)})}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.headerFilenameSuffix?.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.headerFilenameSuffix=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:i}of this.separatorCache.values())i.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let i of e){let r=i.slotName,o=this.separatorCache.get(r);if(o==null||!Sc(i,o.hunkData)){o?.element.remove();let s=document.createElement("div");s.style.display="contents",s.slot=i.slotName;let a=t(i,this);if(a!=null)s.appendChild(a);this.fileContainer.appendChild(s),o={element:s,hunkData:i},this.separatorCache.set(r,o)}n.delete(r)}for(let[i,{element:r}]of n.entries())this.separatorCache.delete(i),r.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:n}of this.annotationCache.values())n.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,i]of this.lineAnnotations.entries()){let r=`${n}-${Ee(i)}`,o=this.annotationCache.get(r);if(o==null||!yc(i,o.annotation)){o?.element.remove();let s=t(i);if(s==null)continue;o={element:xr(Ee(i)),annotation:i},o.element.appendChild(s),this.fileContainer.appendChild(o.element),this.annotationCache.set(r,o)}e.delete(r)}for(let[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.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;else if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=kr();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,i=e??n??document.createElement("diffs-container"),r=n!==i;if(n!=null&&r)this.editor?.__captureFocusForDOMReplacement();if(r)this.emitPostRender(!0);if(this.fileContainer=i,n!=null&&r)this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0;if(t!=null&&this.fileContainer.parentNode!==t)t.appendChild(this.fileContainer);if(r)this.adoptReusableShellElements(this.fileContainer);return this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t==null)return;for(let n of t.children)if(n instanceof SVGElement)this.spriteSVG??=n;else if(pt(n)&&n.hasAttribute("data-theme-css"))this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0;else if(pt(n)&&n.hasAttribute("data-unsafe-css"))this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){let n=document.createElement("div");n.innerHTML=br;let i=n.firstChild;if(i instanceof SVGElement)this.spriteSVG=i}if(this.spriteSVG!=null&&this.spriteSVG.parentNode!==t)t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:"open"});if(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);else if(this.pre.parentNode!==t)this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0;return 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)){if(!(t instanceof HTMLElement))continue;if(t.hasAttribute("data-unified"))this.codeUnified=t;else if(t.hasAttribute("data-deletions"))this.codeDeletions=t;else if(t.hasAttribute("data-additions"))this.codeAdditions=t}}applyHeaderToDOM(e,t){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{fileDiff:n}=this,i=this.cachedHeaderHTML??X(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){let u=document.createElement("div");u.innerHTML=i;let h=u.firstElementChild;if(!(h instanceof HTMLElement))return;if(this.headerElement!=null)t.shadowRoot?.replaceChild(h,this.headerElement);else t.shadowRoot?.prepend(h);this.headerElement=h,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged||n==null)return;let{renderCustomHeader:r,renderHeaderPrefix:o,renderHeaderFilenameSuffix:s,renderHeaderMetadata:a}=this.options;if(r!=null){let u=r(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,mn,u),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let l=o?.(n)??void 0,d=s?.(n)??void 0,c=a?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,hn,l),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,fn,d),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,pn,c),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}let r=t??this.createHeaderSlotElement(n);if(t==null)e.appendChild(r);return this.replaceHeaderSlotContent(r,i),r}replaceHeaderSlotContent(e,t){if(e.replaceChildren(),t instanceof Element)e.appendChild(t);else 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)return;if(e==null||e===""){if(this.unsafeCSSStyle!=null)this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0;this.appliedUnsafeCSS=void 0;return}if(this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e)return;if(this.unsafeCSSStyle??=wr(),this.unsafeCSSStyle.parentNode!==t)t.appendChild(this.unsafeCSSStyle);this.unsafeCSSStyle.textContent=Tr(e),this.appliedUnsafeCSS=e}applyThemeState(e,t,n,i){let r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n,s=this.options.theme??z,a=typeof s==="string"?s:{...s},l=vt(r);if(this.themeCSSStyle?.parentNode===r&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===l){this.appliedThemeCSS.theme=a;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===r){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:a,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:l};return}this.themeCSSStyle=Mr({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:Ar(t,o,l)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:a,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:l}:void 0}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;if(e==null||this.themeCSSStyle==null)return;this.themeCSSStyle.textContent=Rr(this.themeCSSStyle.textContent??"",vt(e))}shouldGuardRebuildScroll(){return this.editor!=null&&Fr()}applyHunksToDOM(e,t){if(this.shouldGuardRebuildScroll())qn(e,()=>this.replaceCodeColumns(e,t));else this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let i=this.getColumnPair(e);if(i==null)return!1;let r=Ct(t[0]),o=Ct(t[1]);if(r==null||o==null)return!1;if(i.gutter.innerHTML=X(r),i.content.innerHTML=X(o),n!==this.lastRowCount)i.gutter.style.setProperty("grid-row",`span ${n}`),i.content.style.setProperty("grid-row",`span ${n}`);return!0}replaceCodeColumns(e,t){let{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r=n==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1,s=[],a=this.hunksRenderer.renderCodeAST("unified",t),l=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);if(this.editor?.__captureFocusForDOMReplacement(),a!=null){if(o=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=Sn({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),!this.applyCodeColumnsInPlace(this.codeUnified,a,t.rowCount))this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(a);s.push(this.codeUnified)}else if(l!=null||d!=null){if(l!=null){if(o=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Sn({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),!this.applyCodeColumnsInPlace(this.codeDeletions,l,t.rowCount))this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(l);s.push(this.codeDeletions)}else this.codeDeletions?.remove(),this.codeDeletions=void 0;if(d!=null){if(o=o||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Sn({code:this.codeAdditions,columnType:"additions",rowSpan:r,containerSize:i}),!this.applyCodeColumnsInPlace(this.codeAdditions,d,t.rowCount))this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d);s.push(this.codeAdditions)}else this.codeAdditions?.remove(),this.codeAdditions=void 0}else this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0;if(s.length===0)e.textContent="";else if(o)e.replaceChildren(...s);this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:i,codeAdditions:r,codeDeletions:o,options:{diffStyle:s="split"}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;let a=this.getCodeColumns(s,i,o,r);if(a==null)return!1;let l=e.startingLine,d=t.startingLine,c=l+e.totalLines,u=d+t.totalLines,h=Math.max(l,d),f=Math.min(c,u);if(f<=h)return!1;let m=Math.max(0,h-l),y=Math.max(0,c-f),v=this.trimColumns({columns:a,trimStart:m,trimEnd:y,previousStart:l,overlapStart:h,overlapEnd:f,diffStyle:s});if(v<0)throw Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount<v)throw Error("FileDiff.applyPartialRender: trimmed beyond DOM row count");let g=this.lastRowCount-v,S=(k,w)=>{if(w<=0||this.fileDiff==null)return;return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:k,totalLines:w,bufferBefore:0,bufferAfter:0})},b=S(d,Math.max(h-d,0));if(b==null&&d<h)return!1;let x=S(f,Math.max(u-f,0));if(x==null&&u>f)return!1;let C=(k,w)=>{if(k==null)return;if(s==="unified"&&!Array.isArray(a))this.insertPartialHTML(s,a,k,w);else if(s==="split"&&Array.isArray(a))this.insertPartialHTML(s,a,k,w);else throw Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");g+=k.rowCount};if(this.cleanupErrorWrapper(),C(b,"afterbegin"),C(x,"beforeend"),this.lastRowCount!==g)this.applyRowSpan(s,a,g),this.lastRowCount=g;return!0}insertPartialHTML(e,t,n,i){if(e==="unified"&&!Array.isArray(t)){let r=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,r,i)}else if(e==="split"&&Array.isArray(t)){let r=this.hunksRenderer.renderCodeAST("deletions",n),o=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],r,i),this.renderPartialColumn(t[1],o,i)}else throw Error("FileDiff.insertPartialHTML: Invalid argument composition")}refreshSplitDiffView(){if(this.options.diffStyle!=="split")return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns("split",this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(t))return;let n=(i,r)=>{if(r==null)return;let o=this.hunksRenderer.renderCodeAST(i,e),s=Ct(o?.[0]),a=Ct(o?.[1]);for(let[l,d]of[[r.gutter,s],[r.content,a]])if(d!=null&&l.childElementCount===d.length)for(let c=0;c<d.length;c++){let u=l.children[c],h=d[c].properties["data-line-type"];if(h!=null&&u.dataset.lineType!==h)u.dataset.lineType=h}};n("deletions",t[0]),n("additions",t[1])}refreshUnifiedDiffView(){if(this.options.diffStyle!=="unified")return;let e=this.hunksRenderer.renderDiff(this.fileDiff,this.renderRange);if(e==null)return;let t=this.getCodeColumns("unified",this.codeUnified,this.codeDeletions,this.codeAdditions);if(t==null||Array.isArray(t))return;let n=this.hunksRenderer.renderCodeAST("unified",e),i=Ct(n?.[0]),r=Ct(n?.[1]),o=()=>{for(let[s,a]of[[t.gutter,i],[t.content,r]])if(a!=null)s.innerHTML=X(a);if(e.rowCount!==this.lastRowCount)this.applyRowSpan("unified",t,e.rowCount),this.lastRowCount=e.rowCount};if(this.shouldGuardRebuildScroll())qn(this.pre,o);else o();this.renderSeparators(e.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let i=Ct(t[0]),r=Ct(t[1]);if(i==null||r==null)throw Error("FileDiff.insertPartialHTML: Unexpected AST structure");let o=r.at(0);if(n==="beforeend"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]==="number")this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],i,r,!0);let s=r.at(-1);if(n==="afterbegin"&&s?.type==="element"&&typeof s.properties["data-buffer-size"]==="number")this.mergeBuffersIfNecessary(s.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],i,r,!1);e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,t,n,i,r,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let s=this.getBufferSize(t.dataset);if(s==null)return;if(o)i.shift(),r.shift();else i.pop(),r.pop();this.updateBufferSize(t,s+e),this.updateBufferSize(n,s+e)}applyRowSpan(e,t,n){let i=(r)=>{if(r==null)return;r.gutter.style.setProperty("grid-row",`span ${n}`),r.content.style.setProperty("grid-row",`span ${n}`)};if(e==="unified"&&!Array.isArray(t))i(t);else if(e==="split"&&Array.isArray(t))i(t[0]),i(t[1]);else throw Error("dun fuuuuked up")}trimColumnRows(e,t,n){let i=0,r=0,o=0,s=!1,a=n>=0;if(e==null)return 0;let l=Array.from(e.content.children),d=Array.from(e.gutter.children);if(l.length!==d.length)throw Error("FileDiff.trimColumnRows: columns do not match");while(o<l.length){if(t<=0&&!a&&!s)break;let c=d[o],u=l[o];if(o++,!(c instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:c,contentElement:u}),Error("FileDiff.trimColumnRows: invalid row elements");if(s){if(s=!1,c.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in u.dataset||c.dataset.gutterBuffer==="metadata"&&"noNewline"in u.dataset){c.remove(),u.remove(),r++;continue}}if("lineIndex"in c.dataset&&"lineIndex"in u.dataset){if(t>0||a&&i>=n){if(c.remove(),u.remove(),t>0){if(t--,t===0)s=!0}r++}i++;continue}if("separator"in c.dataset&&"separator"in u.dataset){if(t>0||a&&i>=n)c.remove(),u.remove(),r++;continue}if(c.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in u.dataset){if(t>0||a&&i>=n)c.remove(),u.remove(),r++;continue}if(c.dataset.gutterBuffer==="metadata"&&"noNewline"in u.dataset){if(t>0||a&&i>=n)c.remove(),u.remove(),r++;continue}if(c.dataset.gutterBuffer==="buffer"&&"contentBuffer"in u.dataset){let h=this.getBufferSize(u.dataset);if(h==null)throw Error("FileDiff.trimColumnRows: invalid element");if(t>0){let f=Math.min(t,h),m=h-f;if(m>0)this.updateBufferSize(c,m),this.updateBufferSize(u,m),r+=f;else c.remove(),u.remove(),r+=h;if(t-=f,t===0&&m===0)s=!0}else if(a){let f=i,m=i+h-1;if(n<=f)c.remove(),u.remove(),r+=h;else if(n<=m){let y=m-n+1,v=h-y;this.updateBufferSize(c,v),this.updateBufferSize(u,v),r+=y}}i+=h;continue}throw console.error({gutterElement:c,contentElement:u}),Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:r,trimEnd:o,trimStart:s}){let a=Math.max(0,i-r),l=n-r;if(l<0)throw Error("FileDiff.trimColumns: overlap ends before previous");let d=s>0,c=o>0;if(!d&&!c)return 0;let u=d?a:0,h=c?l:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,u,h);else if(t==="split"&&Array.isArray(e)){let f=this.trimColumnRows(e[0],u,h),m=this.trimColumnRows(e[1],u,h);if(e[0]!=null&&e[1]!=null&&f!==m)throw Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?f:m}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)`)}getColumnPair(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;return{gutter:t,content:n}}getCodeColumns(e,t,n,i){if(e==="unified")return this.getColumnPair(t);else{let r=this.getColumnPair(n),o=this.getColumnPair(i);return r!=null||o!=null?[r,o]:void 0}}updateBuffers(e){if(this.pre!=null)this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){if(this.bufferBefore!=null)this.bufferBefore.remove(),this.bufferBefore=void 0;if(this.bufferAfter!=null)this.bufferAfter.remove(),this.bufferAfter=void 0;return}if(t.bufferBefore>0){if(this.bufferBefore==null)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")}else if(this.bufferBefore!=null)this.bufferBefore.remove(),this.bufferBefore=void 0;if(t.bufferAfter>0){if(this.bufferAfter==null)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")}else if(this.bufferAfter!=null)this.bufferAfter.remove(),this.bufferAfter=void 0}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:i},r){let{diffIndicators:o="bars",disableBackground:s=!1,disableLineNumbers:a=!1,overflow:l="scroll",diffStyle:d="split"}=this.options,c={type:"diff",diffIndicators:o,disableBackground:s,disableLineNumbers:a,overflow:l,split:d==="unified"?!1:t!=null&&n!=null,totalLines:i,customProperties:r};if(Cr(c,this.appliedPreAttributes))return;Pr(e,c),this.appliedPreAttributes=c}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 i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);let r=document.createElement("pre");r.dataset.errorStack="",r.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(r)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function bc(e,t){if(e==null||t==null)return e==null&&t==null;return fe(e,t)}function Qg({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function ey({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function ty(e,t,n=!1){return!n&&e==null&&t}function ny(e,t,n=!1){return e==null&&t&&!n}function Ct(e){if(e==null||e.type!=="element")return;return e.children??[]}var Cs=3000,iy=-1,Lc=class extends Cc{__id=`little-virtualized-file-diff:${++iy}`;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;currentExpandUnchanged;pendingHydratedDiff;pendingExpansions;constructor(e,t,n,i,r=!1){super(e,i,r);this.virtualizer=t,this.metrics=sn(n)}setMetrics(e,t=!1){let n=sn(e);if(!t&&Be(this.metrics,n))return;this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0})}setLineAnnotations(e){if(this.syncLineAnnotations(e))this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){if(e==null||e===this.lineAnnotations||e.length===0&&this.lineAnnotations.length===0)return!1;return super.setLineAnnotations(e),!0}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;if(e===t)return!1;return this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0}hasFileAnnotations(e=this.fileDiff){if(e==null||!zn(this.lineAnnotations))return!1;return this.lineAnnotations.some((t)=>{if(t.lineNumber!==0)return!1;if(e.type==="new")return t.side==="additions";if(e.type==="deleted")return t.side==="deletions";return!0})}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=!tn(t,e),i=n&&dy(t,e);if(super.setOptions(e),i)this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:cy(t,e)});if(n)this.forceRenderOverride=!0;if(n&&this.isSimpleMode())this.virtualizer.instanceChanged(this,i)}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,resetRenderRange:n=!0}={}){if(this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0)this.cache.heightDeltas.clear();if(this.cache.measuredHeightDeltaTotal!==0)this.cache.measuredHeightDeltaTotal=0;if(this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode())this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){if(this.layoutDirty=!0,this.cache.checkpoints.length>0)this.cache.checkpoints.length=0;if(this.cache.totalLines!==0)this.cache.totalLines=0;if(e)this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;if(this.renderRange!=null&&t)this.renderRange=void 0}reconcileHeights(){let e=!1,{overflow:t="scroll"}=this.options;if(this.fileContainer==null||this.fileDiff==null){if(this.height!==0)e=!0;return this.height=0,e}if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),i=n==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],r=this.hasFileAnnotations(this.fileDiff);if(this.renderRange!=null&&r&&mt(this.renderRange)){let o=ry(i)??0;if(this.setFileAnnotationHeight(o))e=!0}else if(!r&&this.setFileAnnotationHeight(0))e=!0;for(let o of i){if(o==null)continue;let s=o.children[1];if(!(s instanceof HTMLElement))continue;for(let a of s.children){if(!(a instanceof HTMLElement))continue;let l=a.dataset.lineIndex;if(l==null)continue;let d=hy(l,n),c=a.getBoundingClientRect().height,u=!1;if(a.nextElementSibling instanceof HTMLElement&&(("lineAnnotation"in a.nextElementSibling.dataset)||("noNewline"in a.nextElementSibling.dataset))){if("noNewline"in a.nextElementSibling.dataset)u=!0;c+=a.nextElementSibling.getBoundingClientRect().height}let h=this.getEstimatedLineHeight(u),f=this.cache.heightDeltas.get(d)??0,m=c-h;if(m===f)continue;if(e=!0,this.cache.measuredHeightDeltaTotal+=m-f,m===0)this.cache.heightDeltas.delete(d);else this.cache.heightDeltas.set(d,m)}}if(e||this.isResizeDebuggingEnabled())this.computeApproximateSize(!0);return e}onRender=(e)=>{if(this.fileContainer==null)return!1;if(e)this.top=this.getVirtualizedTop();return this.render()};flushManagers(){if(super.flushManagers(),this.lineStateRefreshPending)this.flushDeferredLineState()}prepareCodeViewItem(e,t,n,i){let r=!bt(this.fileDiff,e),o=this.syncLineAnnotations(i),s=n?.resetDiffLayoutCache===!0||r||o,a=r||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;if(n?.metrics!=null)this.metrics=sn(n.metrics),s=!0,a=!0;let{collapsed:l=!1,expandUnchanged:d=!1}=this.options;if(this.currentCollapsed!==l)this.currentCollapsed=l,s=!0;if(this.currentExpandUnchanged!==d)this.currentExpandUnchanged=d,s=!0,a=!0;if(s)this.resetLayoutCache({includeEstimatedHeights:a});return 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:i=!1,expandUnchanged:r=!1,collapsed:o=!1,collapsedContextThreshold:s=1}=this.options,a=this.getDiffStyle(),l=this.getHunkSeparatorType(),d=a==="split"?n[1]:n[0];this.approximateLayoutCheckpoints();let c=Le(this.metrics,i),u=this.getLayoutCheckpointBeforeLineIndex(d),h=u?.top??c+this.cache.fileAnnotationHeight;if(o)return{top:c,height:0};let f;return Oe({diff:this.fileDiff,diffStyle:a,startingLine:u?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:m,hunk:y,collapsedBefore:v,collapsedAfter:g,deletionLine:S,additionLine:b})=>{let x=a==="split"?b?.splitLineIndex??S?.splitLineIndex:b?.unifiedLineIndex??S?.unifiedLineIndex;if(x==null)throw Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(v>0){let k=Ht({type:l,metrics:this.metrics,hunkIndex:m,hunkSpecs:y?.hunkSpecs});if(k!=null){if(h+=k.gapBefore,d>=x-v&&d<x)return f={top:h,height:k.height},!0;h+=k.height+k.gapAfter}}let C=this.getLineHeight(x,(b?.noEOFCR??!1)||(S?.noEOFCR??!1));if(x===d)return f={top:h,height:C},!0;if(h+=C,g>0){let k=nt({type:l,metrics:this.metrics});if(k!=null){if(d>x&&d<=x+g)return f={top:h+k.gapBefore,height:k.height},!0;h+=k.totalHeight}}return!1}}),f}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){if(this.fileDiff==null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:i=!1,collapsedContextThreshold:r=1}=this.options;if(i)return;let o=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();let a=this.getLayoutCheckpointBeforeTop(e),l=a?.top??Le(this.metrics,t)+this.cache.fileAnnotationHeight,d;return Oe({diff:this.fileDiff,diffStyle:o,startingLine:a?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({hunkIndex:c,hunk:u,collapsedBefore:h,collapsedAfter:f,deletionLine:m,additionLine:y})=>{let v=o==="split"?y?.splitLineIndex??m?.splitLineIndex:y?.unifiedLineIndex??m?.unifiedLineIndex;if(v==null)throw Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(h>0){let S=Ht({type:s,metrics:this.metrics,hunkIndex:c,hunkSpecs:u?.hunkSpecs});if(S!=null)l+=S.totalHeight}if(l>=e){if(m!=null)d={lineNumber:m.lineNumber,side:"deletions",top:l};else if(y!=null)d={lineNumber:y.lineNumber,side:"additions",top:l};if(d!=null)return!0}let g=this.getLineHeight(v,(y?.noEOFCR??!1)||(m?.noEOFCR??!1));if(l+=g,f>0){let S=nt({type:s,metrics:this.metrics});if(S!=null)l+=S.totalHeight}return!1}}),d}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.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(t==null)return;let{bufferBefore:n,bufferAfter:i,totalLines:r}=t,o=0;if(r===0){let s=e??this.virtualizer.getWindowSpecs();if(this.top<s.top)o=i}return{topOffset:this.top+n+o,height:this.height-(n+i)}}cleanUp(e=!1){if(this.fileContainer!=null&&this.isSimpleMode())this.getSimpleVirtualizer()?.disconnect(this.fileContainer);if(!e)this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0;this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{if(this.fileDiff==null)return;if(this.isAdvancedMode())this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n});else this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize();this.loadFilesIfNecessary(),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)};async handleFilesLoaded(e,t){if(this.fileDiff!==e||!e.isPartial)return;if(this.isAdvancedMode()){let n=Yn("clone",e,t);if(await Kn(()=>this.primeHighlightCache(n)),!this.enabled||this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(Yn("merge",e,t),this.setHydratedState(t),await Kn(()=>this.primeHighlightCache(e)),!this.enabled||this.fileDiff!==e)return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}consumeCodeViewLayoutChanges(e){let t=!1,n,{pendingExpansions:i,pendingHydratedDiff:r}=this;if(i!=null){this.pendingExpansions=void 0;for(let o of i)this.hunksRenderer.expandHunk(o.hunkIndex,o.direction,o.expansionLineCountOverride),t=!0}if(r!=null){if(this.pendingHydratedDiff=void 0,r.expectedDiff===e)this.setHydratedState(r.files),n=r.nextDiff}if(n!=null)this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0});else if(t)this.forceRenderOverride=!0,this.invalidateDerivedLayoutCache(!0);return n}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;let{pendingExpansions:t}=this,n=this.fileDiffCache;if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:i=100,collapsedContextThreshold:r=1}=this.options,o=new Map(this.hunksRenderer.getExpandedHunksMap());for(let s of t){let a={...o.get(s.hunkIndex)??{fromStart:0,fromEnd:0}},l=s.expansionLineCountOverride??i;if(s.direction==="up"||s.direction==="both")a.fromStart+=l;if(s.direction==="down"||s.direction==="both")a.fromEnd+=l;o.set(s.hunkIndex,a)}return Xi({fileDiff:n,lineNumber:e,expandedHunks:o,collapsedContextThreshold:r})}invalidateEditSessionLayout(){if(this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),!this.isSimpleMode())this.computeApproximateSize(!0);this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){if(this.invalidateEditSessionLayout(),!this.enabled||this.fileDiff==null)return;this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){if(this.isAdvancedMode()||this.fileContainer==null)return;if(this.renderRange=void 0,e&&!this.isVisible)this.top=this.getVirtualizedTop(),this.isVisible=!0;else if(!e&&this.isVisible)this.isVisible=!1,this.rerender()}rerender(){if(!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null)return;this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1)}applyDocumentChange(e,t,n=!1){let{renderRange:i}=this;if(this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&i!==void 0&&this.fileDiff!==void 0){let r=this.virtualizer.getWindowSpecs(),o=this.computeRenderRangeFromWindow(this.fileDiff,this.top??0,r);if(o.bufferAfter!==i.bufferAfter)this.updateBuffers(o)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.fileDiff){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let i=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:o=!1}=this.options,s=Le(this.metrics,r);if(this.height+=s,o){this.layoutDirty=!1;return}if(this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!i)this.validateComputedHeight(t);this.layoutDirty=!1}getActiveEstimatedHeight(e=this.fileDiff){this.ensureEstimatedDiffHeights(e);let t=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return t}ensureEstimatedDiffHeights(e=this.fileDiff){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options,{splitHeight:r,unifiedHeight:o}=tc({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,canHydratePartialDiff:bs(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=o}validateComputedHeight(e=this.fileDiff){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();if(t.height!==this.height)console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:e.name,elementHeight:t.height,computedHeight:this.height});else console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:i,...r}={}){let o=Xn(r,"VirtualizedFileDiff.render"),s=o!=null,a=o?.oldFile,l=o?.newFile,d=s&&(!wc(a,this.deletionFile)||!wc(l,this.additionFile)),c=t??this.fileDiff;if(t==null&&s&&(d||this.fileDiff==null))c=Fe(o.oldFile,o.newFile,this.options.parseDiffOptions);let{forceRenderOverride:u,isSetup:h}=this;this.forceRenderOverride=void 0;let f=this.syncLineAnnotations(i);if(f)this.resetLayoutCache({includeEstimatedHeights:!1});let m=t!=null&&t!==this.fileDiff,y=c!=null&&!bt(this.fileDiff,c),v=m||d;if(y)this.resetLayoutCache({includeEstimatedHeights:!0});if(e=this.getOrCreateFileContainer(e),c==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(!h){this.computeApproximateSize(!1,c);let C=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(C==null)throw Error("VirtualizedFileDiff.render: simple virtualizer is not available");C.connect(e,this),this.isVisible=C.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}else if(this.top??=this.getVirtualizedTop(),y)this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,c);if(!this.isVisible&&this.isSimpleMode()&&(!v||!h)){if(this.fileDiff=c,o!=null)this.deletionFile=a,this.additionFile=l;if(y)this.cachedHeaderHTML=void 0;return this.renderPlaceholder(this.height)}let g=this.virtualizer.getWindowSpecs(),S=this.top??0,b=this.computeRenderRangeFromWindow(c,S,g),x=super.render({fileDiff:c,fileContainer:e,renderRange:b,lineAnnotations:i,forceRender:(u??n)||f||y,...o,...r});if(this.isSimpleMode()&&x)this.getSimpleVirtualizer()?.requestHeightReconcile(this);return x}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}getVirtualizedTop(){if(this.virtualizer.type==="advanced")return this.virtualizer.getLocalTopForInstance(this);return this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type==="advanced"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return uy(this.options.hunkSeparators)}approximateLayoutCheckpoints(e=this.fileDiff){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e==null||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:i=1}=this.options,r=e.hunks.length-1,o=bs(e,this.options.loadDiffFiles!=null),s=this.getDiffStyle(),a=this.getHunkSeparatorType(),l=n?!0:this.hunksRenderer.getExpandedHunksMap(),d=oy(this.cache.heightDeltas),c=Le(this.metrics,t)+this.cache.fileAnnotationHeight,u=0,h=({rowCount:f,startLineIndex:m,preSeparatorHeight:y=0,postSeparatorHeight:v=0,metadataOffsets:g=[]})=>{if(f<=0)return;let S=u,b=u+f,x=sy(S);while(x<b){let C=x-S,k=c+(C>0?y:0)+C*this.metrics.lineHeight+ay(g,C)*this.metrics.lineHeight+xc(d,m,m+C);this.cache.checkpoints.push({renderedLineIndex:x,lineIndex:m+C,top:k}),x+=Cs}c+=y+f*this.metrics.lineHeight+g.length*this.metrics.lineHeight+xc(d,m,m+f)+v,u=b};for(let f=0;f<e.hunks.length;f++){let m=e.hunks[f];if(m==null)throw Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");let y=Se({isPartial:e.isPartial,rangeSize:m.collapsedBefore,expandedHunks:l,hunkIndex:f,collapsedContextThreshold:i}),v=y.collapsedLines>0?Ht({type:a,metrics:this.metrics,hunkIndex:f,hunkSpecs:m.hunkSpecs})?.totalHeight??0:0;h({rowCount:y.fromStart,startLineIndex:(s==="split"?m.splitLineStart:m.unifiedLineStart)-y.rangeSize});let g=v;if(h({rowCount:y.fromEnd,startLineIndex:(s==="split"?m.splitLineStart:m.unifiedLineStart)-y.fromEnd,preSeparatorHeight:g}),y.fromEnd>0)g=0;let S=f===r?ve({fileDiff:e,hunkIndex:f,expandedHunks:l,collapsedContextThreshold:i,errorPrefix:"VirtualizedFileDiff"}):void 0,b=S!=null&&S.collapsedLines>0?nt({type:a,metrics:this.metrics})?.totalHeight??0:f===r&&o?nt({type:a,metrics:this.metrics})?.totalHeight??0:0,x=S!=null?S.fromStart+S.fromEnd:0,C=s==="split"?m.splitLineCount:m.unifiedLineCount,k=s==="split"?m.splitLineStart:m.unifiedLineStart;if(h({rowCount:C,startLineIndex:k,preSeparatorHeight:g,postSeparatorHeight:x===0?b:0,metadataOffsets:ly({diffStyle:s,hunk:m,rowCount:C})}),S!=null&&x>0)h({rowCount:x,startLineIndex:k+C,postSeparatorHeight:b})}this.cache.totalLines=u}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;while(t<=n){let r=t+n>>1,o=this.cache.checkpoints[r];if(o==null)throw Error("VirtualizedFileDiff: invalid checkpoint index");if(o.lineIndex<=e)i=o,t=r+1;else n=r-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,r=-1;while(n<=i){let o=n+i>>1,s=this.cache.checkpoints[o];if(s==null)throw Error("VirtualizedFileDiff: invalid checkpoint index");if(s.top<=e)r=o,n=o+1;else i=o-1}if(t==null)return r>=0?this.cache.checkpoints[r]:void 0;for(let o=r;o>=0;o--){let s=this.cache.checkpoints[o];if(s==null)throw Error("VirtualizedFileDiff: invalid checkpoint index");if(s.renderedLineIndex%t===0)return s}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let a of e.hunks)n+=t==="split"?a.splitLineCount:a.unifiedLineCount;return n}let{expandUnchanged:i=!1,collapsedContextThreshold:r=1}=this.options,o=i?!0:this.hunksRenderer.getExpandedHunksMap();for(let[a,l]of e.hunks.entries()){let d=t==="split"?l.splitLineCount:l.unifiedLineCount;n+=d;let c=Math.max(l.collapsedBefore,0),{fromStart:u,fromEnd:h,renderAll:f}=Se({isPartial:e.isPartial,rangeSize:c,expandedHunks:o,hunkIndex:a,collapsedContextThreshold:r});if(c>0)n+=f?c:u+h}let s=ve({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:o,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"});if(s!=null)n+=s.fromStart+s.fromEnd;return n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),i=t==="split"?e.splitLineCount:e.unifiedLineCount;return Math.max(n,i,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){let{disableFileHeader:r=!1,expandUnchanged:o=!1,collapsedContextThreshold:s=1}=this.options,{hunkLineCount:a,lineHeight:l}=this.metrics,d=this.getDiffStyle(),c=this.getHunkSeparatorType(),u=bs(e,this.options.loadDiffFiles!=null),h=this.height,f=this.getLayoutLineCount(e,d),m=Le(this.metrics,r),y=e.hunks.length>0?Mt(this.metrics):0,{fileAnnotationHeight:v}=this.cache,g=m+v,S=Math.max(0,h-m-v-y),b=this.hasFileAnnotations(e),x=t+m,C=v>0&&b&&x<i&&x+v>n;if(t<n-h||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-m-y};if(f<=a||e.hunks.length===0)return{startingLine:0,totalLines:a,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),f=this.getLayoutLineCount(e,d);let k=Math.ceil(Math.max(i-n,0)/l),w=Math.ceil(k/a)*a+a,T=w/a,L=T,I=[],O=(n+i)/2,A=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-w*l*2),a),R=t+(A?.top??g),_=A?.renderedLineIndex??0,F,M,N;if(Oe({diff:e,diffStyle:d,startingLine:A?.renderedLineIndex??0,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:Ce,hunk:He,collapsedBefore:Ve,collapsedAfter:Ut,deletionLine:Ge,additionLine:Pe})=>{let q=Pe!=null?Pe.splitLineIndex:Ge.splitLineIndex,me=Pe!=null?Pe.unifiedLineIndex:Ge.unifiedLineIndex,xe=(Pe?.noEOFCR??!1)||(Ge?.noEOFCR??!1),xt=Ce===e.hunks.length-1&&He!=null&&(d==="split"?q===He.splitLineStart+He.splitLineCount-1:me===He.unifiedLineStart+He.unifiedLineCount-1),Ne=(Ve>0?Ht({type:c,metrics:this.metrics,hunkIndex:Ce,hunkSpecs:He?.hunkSpecs}):void 0)?.totalHeight??0;R+=Ne;let We=_%a===0,st=Math.floor(_/a);if(We){if(I[st]=R-(t+g+Ne),N!=null){if(N<=0)return!0;N--}}let Te=this.getLineHeight(d==="split"?q:me,xe);if(R>n-Te&&R<i)F??=st;if(M==null&&R+Te>O)M=st;if(N==null&&R>=i&&We)N=L;if(_++,R+=Te,Ut>0||xt&&u){let ni=nt({type:c,metrics:this.metrics});if(ni!=null){if(R<i&&R+ni.totalHeight>n)F??=st;if(M==null&&R+ni.totalHeight>O)M=st;R+=ni.totalHeight}}return!1}}),F==null)if(C)F=0,M=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:h-m-y};M??=F;let B=Math.round(M-T/2),ie=Math.max(0,Math.ceil(f/a)-T),U=Math.max(0,Math.min(B,ie)),W=U*a,j=B<0?w+B*a:w,ue=I[U]??0,he=W===0?0:v+ue,Me=U+j/a,Ue=Me<I.length?S-I[Me]:S-(R-t-g);return{startingLine:W,totalLines:j,bufferBefore:he,bufferAfter:Math.max(0,Ue)}}};function ry(e){let t;for(let n of e){if(n==null)continue;let i=n.children[1];if(!(i instanceof HTMLElement))continue;for(let r of i.children){if(!(r instanceof HTMLElement))continue;if(r.dataset.lineAnnotation!==ir)continue;t=Math.max(t??0,r.getBoundingClientRect().height)}}return t}function oy(e){let t=Array.from(e).sort((o,s)=>o[0]-s[0]),n=[],i=[0],r=0;for(let[o,s]of t)n.push(o),r+=s,i.push(r);return{lineIndexes:n,prefixTotals:i}}function xc({lineIndexes:e,prefixTotals:t},n,i){if(n>=i||e.length===0)return 0;let r=kc(e,n);return(t[kc(e,i)]??0)-(t[r]??0)}function kc(e,t){let n=0,i=e.length;while(n<i){let r=n+i>>1,o=e[r];if(o==null)throw Error("VirtualizedFileDiff: invalid prefix index");if(o<t)n=r+1;else i=r}return n}function sy(e){return Math.ceil(e/Cs)*Cs}function ay(e,t){let n=0;for(let i of e)if(i<t)n++;return n}function ly({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let i=t.hunkContent.at(-1);if(i==null)return[];if(i.type==="context")return[n-1];let r=Math.max(i.deletions,i.additions),o=i.deletions+i.additions;if(e==="split")return r>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let s=[],a=n-o;if(i.deletions>0&&t.noEOFCRDeletions)s.push(a+i.deletions-1);if(i.additions>0&&t.noEOFCRAdditions)s.push(n-1);return s}function dy(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")||Boolean(e.loadDiffFiles)!==Boolean(t.loadDiffFiles)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function cy(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||Boolean(e.loadDiffFiles)!==Boolean(t.loadDiffFiles)||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function bs(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function uy(e){return typeof e==="function"?"custom":e??"line-info"}function wc(e,t){if(e==null||t==null)return e==null&&t==null;return fe(e,t)}function hy(e,t){let[n,i]=e.split(",").map(Number);return t==="split"?i:n}var Uc=["theme","disableLineNumbers","overflow","themeType","disableFileHeader","disableVirtualizationBuffers","preferredHighlighter","useCSSClasses","useTokenTransformer","tokenizeMaxLineLength","tokenizeMaxLength","unsafeCSS","diffStyle","diffIndicators","disableBackground","expandUnchanged","loadDiffFiles","collapsedContextThreshold","lineDiffType","maxLineDiffLength","expansionLineCount","lineHoverHighlight","enableTokenInteractionsOnWhitespace","enableGutterUtility","__debugPointerEvents","enableLineSelection","controlledSelection","disableErrorHandling"],zc=["theme","disableLineNumbers","overflow","themeType","disableFileHeader","disableVirtualizationBuffers","preferredHighlighter","useCSSClasses","useTokenTransformer","tokenizeMaxLineLength","tokenizeMaxLength","unsafeCSS","lineHoverHighlight","enableTokenInteractionsOnWhitespace","enableGutterUtility","__debugPointerEvents","enableLineSelection","controlledSelection","disableErrorHandling"],Ec=["renderCustomHeader","renderHeaderPrefix","renderHeaderFilenameSuffix","renderHeaderMetadata","renderAnnotation","renderGutterUtility","onPostRender","onGutterUtilityClick","onLineClick","onLineNumberClick","onLineEnter","onLineLeave","onTokenClick","onTokenEnter","onTokenLeave"],Tc=["onLineSelected","onLineSelectionStart","onLineSelectionChange","onLineSelectionEnd"],Bc=Symbol("CodeView.itemOptionsState");function Ac(e,t){Object.defineProperty(e,Bc,{configurable:!1,enumerable:!1,value:t})}function ti(e){return e[Bc]}function ot(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get(){return n(this)}})}var fy=120,Rc=1,Ic="--diffs-overflow-override",xs=12000000,$c=1e6,Vc=2000000,py=xs-Vc,Mc=xs-$c;function my(e){if(e==null)throw Error("CodeView: createEditor is required for items with edit: true")}var gy=(()=>{let{navigator:e}=globalThis,t=e.userAgent,n=/iP(?:hone|ad|od)/.test(t),i=e.platform==="MacIntel"&&e.maxTouchPoints>1;return(n||i)&&/AppleWebKit/.test(t)&&/Safari/.test(t)&&!/(CriOS|FxiOS|EdgiOS|OPiOS)/.test(t)})(),yy=class e{static __STOP=!1;static __lastScrollPosition=0;type="advanced";config={overscrollSize:200,intersectionObserverMargin:0,resizeDebugging:!1};items=[];idToItem=new Map;selectedLines=null;itemEditors=new Map;attachedEditors=new Set;instanceToItem=new Map;layoutDirtyIndex;pendingLayoutReset;renderOptionsRevision=0;slotCoordinator;slotSnapshot;scrollListeners=new Set;scrollHeight=0;containerHeight=-1;scrollTop=0;scrollPageOffset=0;scrollDirty=!0;scrollInteractionFixTimer;pointerEventsDisabled=!1;codeOverflowFix=!1;height=0;heightDirty=!0;windowSpecs={top:0,bottom:0};renderState={scrollTop:-1,firstIndex:-1,lastIndex:-1,stickyHeight:0,stickyTop:-1,stickyBottom:-1};itemMetricsCache=bn;fileOptionsPrototype;diffOptionsPrototype;pendingScrollTarget;pendingLayoutAnchor;shouldFixContainerFocus=!1;scrollAnimation;root;resizeObserver;container=document.createElement("div");stickyContainer=document.createElement("div");stickyOffset=document.createElement("div");header={element:void 0,render:void 0,height:0};footer={element:void 0,render:void 0,height:0};elementPool=[];elementPoolVersion=0;elementPoolTracker=new WeakMap;pendingElementPool=[];options;workerManager;isReadySubscription;isContainerManaged;constructor(t={theme:z},n,i=!1){this.options=t,this.computeMetricsCache(t.itemMetrics),this.fileOptionsPrototype=this.createFileOptionsPrototype(),this.diffOptionsPrototype=this.createDiffOptionsPrototype(),this.workerManager=n,this.isContainerManaged=i,this.stickyOffset.style.contain="layout size",this.stickyContainer.style.position="sticky",this.stickyContainer.style.width="100%",this.stickyContainer.style.contain="layout style inline-size",this.stickyContainer.style.isolation="isolate",this.stickyContainer.style.display="flex",this.stickyContainer.style.flexDirection="column"}getLayout(){return this.options.layout??_c}getItemTopOffset(){return this.getLayout().paddingTop+this.header.height}computeMetricsCache(t){return this.itemMetricsCache={hunkLineCount:t?.hunkLineCount??bn.hunkLineCount,lineHeight:t?.lineHeight??bn.lineHeight,diffHeaderHeight:t?.diffHeaderHeight??bn.diffHeaderHeight,hunkSeparatorHeight:t?.hunkSeparatorHeight,spacing:t?.spacing??bn.spacing,paddingTop:t?.paddingTop,paddingBottom:t?.paddingBottom},this.itemMetricsCache}getSmoothScrollSettings(){return this.options.smoothScrollSettings??Oc}shouldDisablePointerEvents(){return this.options.pointerEventsOnScroll!==!0}shouldValidateItemHeights(){return Fc&&this.options.__devOnlyValidateItemHeights===!0}validateRenderedItemHeight(t){if(!this.shouldValidateItemHeights()||t.element==null)return;let n=t.instance.getAdvancedStickySpecs();if(n==null)return;let i=n.height,r=t.element.getBoundingClientRect().height;if(i===r)return;console.error("CodeView: reconciled item height does not match DOM height",{id:t.item.id,type:t.type,index:t.index,version:t.version,expectedHeight:i,actualHeight:r,delta:r-i,stickyTopOffset:n.topOffset,virtualizedHeight:t.instance.getVirtualizedHeight(),top:t.top,scrollTop:this.getScrollTop(),windowSpecs:{...this.windowSpecs},element:t.element,instance:t.instance})}validateStickyContainerHeight(){if(!this.shouldValidateItemHeights())return;let{firstIndex:t,lastIndex:n,stickyHeight:i,stickyTop:r,stickyBottom:o}=this.renderState;if(t===-1||n===-1)return;let s=this.stickyContainer.getBoundingClientRect().height;if(Math.abs(s-i)<Rc)return;console.error("CodeView: sticky container height does not match computed layout",{computedStickyHeight:i,actualStickyHeight:s,delta:s-i,stickyTop:r,stickyBottom:o,firstIndex:t,lastIndex:n,firstStickySpecs:this.items[t]?.instance.getAdvancedStickySpecs(),lastStickySpecs:this.items[n]?.instance.getAdvancedStickySpecs(),scrollTop:this.getScrollTop(),scrollPageOffset:this.scrollPageOffset,windowSpecs:{...this.windowSpecs},stickyContainer:this.stickyContainer})}clearScrollInteractionTimer(){if(this.scrollInteractionFixTimer!=null)clearTimeout(this.scrollInteractionFixTimer),this.scrollInteractionFixTimer=void 0}suspendScrollInteractions(){if(this.clearScrollInteractionTimer(),this.shouldDisablePointerEvents()&&!this.pointerEventsDisabled)this.stickyContainer.style.pointerEvents="none",this.pointerEventsDisabled=!0;if(gy&&!this.codeOverflowFix)this.stickyContainer.style.setProperty(Ic,"hidden"),this.codeOverflowFix=!0;this.scrollInteractionFixTimer=setTimeout(this.restoreScrollInteractions,fy)}restoreScrollInteractions=()=>{if(this.clearScrollInteractionTimer(),this.pointerEventsDisabled)this.stickyContainer.style.removeProperty("pointer-events"),this.pointerEventsDisabled=!1;if(this.codeOverflowFix)this.stickyContainer.style.setProperty(Ic,"auto"),this.codeOverflowFix=!1};syncLayout(){let{gap:t,paddingBottom:n,paddingTop:i}=this.getLayout();this.stickyContainer.style.gap=`${t}px`,this.container?.style.setProperty("margin-top",`${i}px`),this.container?.style.setProperty("margin-bottom",`${n}px`)}reconcileHeaderFooterHosts(){let t=this.reconcileHost("header"),n=this.reconcileHost("footer");return t||n}reconcileHost(t){let{root:n,container:i}=this;if(n==null||i==null)return!1;let r=t==="header"?this.header:this.footer,o=t==="header"?this.options.renderCodeViewHeader:this.options.renderCodeViewFooter;if(o==null){if(r.element==null)return!1;return this.resizeObserver?.unobserve(r.element),r.element.remove(),r.element=void 0,r.render=void 0,this.setHostHeight(r,0),!1}if(r.element!=null&&o===r.render)return!1;let s=r.element??sd(t,i,this.resizeObserver);r.element=s;let a=o();if(a!=null)s.replaceChildren(a);else if(!this.isContainerManaged&&s.children.length>0)s.textContent="";return r.render=o,!0}setHostHeight(t,n){if(t.height===n)return;t.height=n,this.scrollDirty=!0}measureMountedHosts(){if(this.header.element!=null)this.setHostHeight(this.header,this.header.element.getBoundingClientRect().height);if(this.footer.element!=null)this.setHostHeight(this.footer,this.footer.element.getBoundingClientRect().height)}setup(t){if(this.root!=null)throw Error("CodeView.setup: already setup");if(this.workerManager?.subscribeToThemeChanges(this),this.root=t,this.root.style.overflowAnchor="none",!this.root.hasAttribute("tabindex"))this.root.tabIndex=-1;this.container??=document.createElement("div"),this.container.style.contain="layout style",this.syncLayout(),this.container.appendChild(this.stickyOffset),this.container.appendChild(this.stickyContainer),this.root.appendChild(this.container),this.scrollDirty=!0,this.heightDirty=!0,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.stickyContainer),this.root.addEventListener("scroll",this.handleScroll,{passive:!0}),this.root.addEventListener("wheel",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("touchstart",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("pointerdown",this.clearPendingScroll,{passive:!0}),this.root.addEventListener("keydown",this.clearPendingScroll,{passive:!0}),this.resizeObserver.observe(this.root),this.render(!0),window.__INSTANCE=this,window.__TOGGLE=()=>{if(e.__STOP)e.__STOP=!1,this.scrollTo({type:"position",position:e.__lastScrollPosition,behavior:"instant"});else e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0}}reset(){yt(this.computeRenderRangeAndEmit),this.clearReadySubscription(),this.restoreScrollInteractions(),this.cleanAllRenderedItems();for(let t of this.itemEditors.values())t.editor.cleanUp();if(this.itemEditors.clear(),this.attachedEditors.clear(),this.selectedLines=null,this.items.length=0,this.idToItem.clear(),this.instanceToItem.clear(),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,this.stickyContainer.textContent="",this.stickyOffset.style.height="",this.container?.style.removeProperty("height"),this.containerHeight=-1,this.windowSpecs={top:0,bottom:0},this.pendingLayoutAnchor=void 0,this.shouldFixContainerFocus=!1,this.height=0,this.scrollTop=0,this.scrollPageOffset=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.resetRenderState(),!this.isContainerManaged)this.flushSlotCoordinator()}cleanUp(){this.reset(),this.clearElementPool(),this.restoreScrollInteractions(),this.workerManager?.unsubscribeToThemeChanges(this),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.root?.removeEventListener("scroll",this.handleScroll),this.root?.removeEventListener("wheel",this.clearPendingScroll),this.root?.removeEventListener("touchstart",this.clearPendingScroll),this.root?.removeEventListener("pointerdown",this.clearPendingScroll),this.root?.removeEventListener("keydown",this.clearPendingScroll),this.root?.style.removeProperty("overflow-anchor"),this.container?.remove(),this.stickyOffset.remove(),this.stickyContainer.remove(),this.stickyContainer.textContent="",this.header.element?.remove(),this.header.element=void 0,this.header.render=void 0,this.header.height=0,this.footer.element?.remove(),this.footer.element=void 0,this.footer.render=void 0,this.footer.height=0,this.root=void 0,this.container=void 0}cleanAllRenderedItems(){if(this.renderState.firstIndex===-1)return;for(let t=this.renderState.firstIndex;t<=this.renderState.lastIndex;t++){let n=this.items[t];if(n==null)throw Error(`CodeView.cleanAllRenderedItems: Item does not exist at index: ${t}`);this.releaseRenderedItem(n)}}primeScrollTarget(t){if(t.type==="position")return;let n=this.idToItem.get(t.id);if(n==null)return;n.instance.primeHighlightCache()}getElementPoolLimit(){let t=this.getHeight()+this.config.overscrollSize*2,{diffHeaderHeight:n}=this.itemMetricsCache;return Math.max(8,Math.ceil(t/Math.max(n,10))+1)*(this.isContainerManaged?2:1)}acquireElement(){this.promotePendingPooledElements();let t=this.elementPool.pop();while(t!=null&&!this.isElementPoolGenerationCurrent(t))t=this.elementPool.pop();return t??=document.createElement(Nr),this.markElementPoolGenerationCurrent(t),t}releaseRenderedItem(t){let{element:n}=t;if(n!=null&&this.renderedItemOwnsFocus(n))this.shouldFixContainerFocus=!0;if(t.instance.cleanUp(!0),this.attachedEditors.delete(t.item.id),t.element=void 0,n==null)return;n.remove(),this.cleanElement(n),this.queueElementForPool(n)}renderedItemOwnsFocus(t){let{activeElement:n}=document;return n===t||t.contains(n)||t.shadowRoot?.activeElement!=null}fixContainerFocus(){if(this.shouldFixContainerFocus)this.shouldFixContainerFocus=!1,this.root?.focus({preventScroll:!0})}cleanElement(t){let{shadowRoot:n}=t;if(n!=null){for(let i of Array.from(n.children))if(!xy(i))i.remove()}if(!this.isContainerManaged)t.replaceChildren()}queueElementForPool(t){let n=this.getElementPoolLimit();if(!this.isElementPoolGenerationCurrent(t)||this.getElementPoolSize()>=n)return;if(this.isElementClean(t))this.elementPool.push(t);else this.pendingElementPool.push(t)}promotePendingPooledElements(){if(this.pendingElementPool.length===0)return;let{pendingElementPool:t}=this;this.pendingElementPool=[];let n=this.getElementPoolLimit();for(let i of t)if(this.isElementPoolGenerationCurrent(i)&&this.isElementClean(i)&&this.elementPool.length<n)this.elementPool.push(i);else if(this.isElementPoolGenerationCurrent(i)&&this.getElementPoolSize()<n)this.pendingElementPool.push(i)}isElementClean(t){return t.childNodes.length===0}getElementPoolSize(){return this.elementPool.length+this.pendingElementPool.length}clearElementPool(){this.elementPool.length=0,this.pendingElementPool.length=0}invalidateElementPool(){this.elementPoolVersion++,this.clearElementPool()}markElementPoolGenerationCurrent(t){this.elementPoolTracker.set(t,this.elementPoolVersion)}isElementPoolGenerationCurrent(t){return this.elementPoolTracker.get(t)===this.elementPoolVersion}resolveEffectiveScrollBehavior(t,n){if(Id())return"instant";if(t.behavior!=="smooth-auto")return t.behavior??"instant";return Math.abs(n-this.getScrollTop())<=this.getHeight()*10?"smooth":"instant"}scrollTo(t){if(this.root==null)return;let n=this.normalizeScrollTarget(t);if(n==null)return;let i=this.resolveScrollTargetTop(n);if(i==null)return;if(this.primeScrollTarget(n),this.resolveEffectiveScrollBehavior(n,i)==="smooth")this.scrollAnimation??={position:this.getScrollTop(),velocity:0,lastTimestamp:performance.now()};else this.scrollAnimation=void 0;this.suspendScrollInteractions(),this.pendingLayoutAnchor=void 0,this.pendingScrollTarget=n,this.render()}setSelectedLines(t,n){this.applySelectedLines(t,n)}getSelectedLines(){return this.selectedLines}clearSelectedLines(t){this.applySelectedLines(null,t)}getItem(t){return this.idToItem.get(t)?.item}getEditor(t){return this.itemEditors.get(t)?.editor}updateItem(t){let n=this.idToItem.get(t.id);if(n==null)return console.error(`CodeView.updateItem: unknown item id "${t.id}"`),!1;if(!this.syncItemRecord(n,t))return!1;return this.markItemLayoutDirty(n),this.scrollDirty=!0,this.render(),this.syncItemEditors(),this.syncSelection(),!0}updateItemId(t,n){if(t===n)return!0;let i=this.idToItem.get(t);if(i==null)return console.error(`CodeView.updateItemId: unknown item id "${t}"`),!1;if(this.idToItem.has(n))return console.error(`CodeView.updateItemId: duplicate item id "${n}"`),!1;if(this.idToItem.delete(t),i.item.id=n,this.idToItem.set(n,i),this.updateItemOptionsId(i.instance.options,n),this.selectedLines?.id===t)this.selectedLines={...this.selectedLines,id:n},this.options.onSelectedLinesChange?.(this.selectedLines);let r=this.itemEditors.get(t);if(r!=null){if(r.state.id=n,this.itemEditors.delete(t),this.itemEditors.set(n,r),this.attachedEditors.delete(t))this.attachedEditors.add(n)}return this.renamePendingScrollTarget(t,n),this.renamePendingLayoutAnchor(t,n),this.render(),!0}addItem(t){this.addItems([t])}addItems(t){this.appendItemsInternal(t),this.syncItemEditors(),this.syncSelection()}removeItem(t){let n=this.idToItem.get(t);if(n==null)return console.error(`CodeView.removeItem: unknown item id "${t}"`),!1;let i=[];for(let r of this.items)if(r!==n)i.push(r.item);return this.setItems(i),!0}setItems(t){let n;if(this.items.length===0)this.appendItemsInternal(t);else if(!this.tryAppendItems(t))n=this.reconcileItems(t);this.syncItemEditors(n),this.syncSelection()}appendItemsInternal(t,n=!0){if(t.length===0)return;let i=this.getLayout(),r=this.items.length===0?0:this.scrollHeight+i.gap,o=r;for(let s=0;s<t.length;s++){let a=t[s];if(a==null)throw Error("CodeView.appendItemsInternal: missing input item");if(this.idToItem.has(a.id))throw Error(`CodeView.addItem: duplicate id "${a.id}"`);let l=this.createItem(a,this.items.length,r);this.items.push(l),this.idToItem.set(l.item.id,l),this.instanceToItem.set(l.instance,l),l.height=Sy(l),r+=l.height+i.gap}if(this.scrollHeight=r-i.gap,this.scrollDirty=!0,n)if(this.canSkipRenderForAppend(o))this.syncContainerHeight();else this.render()}canSkipRenderForAppend(t){return this.container!=null&&this.renderState.firstIndex!==-1&&this.pendingScrollTarget==null&&this.scrollAnimation==null&&this.layoutDirtyIndex==null&&t>this.windowSpecs.bottom}onThemeChange(){this.invalidateElementPool()}setOptions(t){if(t==null)return;this.capturePendingLayoutAnchor();let{options:n}=this,i=this.getLayout(),{itemMetricsCache:r}=this;if(vy(n,t))this.invalidateElementPool();this.options=t;let o=this.computeMetricsCache(t.itemMetrics),s=!Be(r,o),a=!Be(i,this.getLayout());if(a)this.syncLayout();let l=s||by(n,t);if(l){let c=this.pendingLayoutReset;this.pendingLayoutReset={metrics:s?o:c?.metrics,resetFileLayoutCache:!0,resetDiffLayoutCache:!0,includeEstimatedDiffHeights:c?.includeEstimatedDiffHeights===!0||s||Cy(n,t)}}if(a||l)this.markLayoutDirtyFromIndex(0),this.scrollDirty=!0;if(!tn(n,t))this.renderOptionsRevision++;this.syncItemEditors();let d=n.renderCodeViewHeader!==t.renderCodeViewHeader||n.renderCodeViewFooter!==t.renderCodeViewFooter;if(!this.isContainerManaged&&(this.items.length>0||d))this.render()}capturePendingLayoutAnchor(t=this.idToItem){if(this.root==null||this.items.length===0||this.pendingScrollTarget!=null)return;this.pendingLayoutAnchor=this.getScrollAnchor(this.getScrollTop(),t)}render(t=!1){if(e.__STOP)return;if(t)yt(this.computeRenderRangeAndEmit),this.computeRenderRangeAndEmit();else ln(this.computeRenderRangeAndEmit)}isReady(){let{workerManager:t}=this;if(t==null||t.isInitialized()||t.getStats().workersFailed)return this.clearReadySubscription(),!0;if(this.isReadySubscription??=t.subscribeToStatChanges((n)=>{if(n.managerState!=="initialized"&&!n.workersFailed)return;this.clearReadySubscription(),this.render(!0)}),t.getStats().managerState==="waiting")t.initialize().catch(()=>{});return!1}clearReadySubscription(){if(this.isReadySubscription==null)return;this.isReadySubscription(),this.isReadySubscription=void 0}instanceChanged(t,n){let i=this.instanceToItem.get(t);if(i==null)throw Error("CodeView.instanceChanged: An instance has changed that is not registered");if(n)this.markItemLayoutDirty(i);this.render()}getWindowSpecs(){return this.windowSpecs}getContainerElement(){return this.root}getHeaderElement(){return this.header.element}getFooterElement(){return this.footer.element}getRenderedItems(){let{firstIndex:t,lastIndex:n}=this.renderState;if(t===-1||n===-1||n<t)return[];let i=[];for(let r=t;r<=n;r++){let o=this.items[r];if(o?.element==null)continue;if(o.type==="diff")i.push({id:o.item.id,type:"diff",item:o.item,version:o.version,element:o.element,instance:o.instance});else i.push({id:o.item.id,type:"file",item:o.item,version:o.version,element:o.element,instance:o.instance})}return i}setSlotCoordinator(t){if(t===this.slotCoordinator)return!1;return this.slotCoordinator=t,this.slotSnapshot=void 0,!0}getSlotSnapshot(t){return this.buildSlotSnapshot(t)}buildSlotSnapshot(t){let n=wy(this.getRenderedItems(),t),{element:i}=this.header,{element:r}=this.footer;if(n==null&&i==null&&r==null)return;return{items:n,header:i,footer:r}}subscribeToScroll(t){return this.scrollListeners.add(t),()=>{this.scrollListeners.delete(t)}}getLocalTopForInstance(t){let n=this.instanceToItem.get(t);if(n==null)throw Error("CodeView.getLocalTopForInstance: unknown virtualized instance");return n.top}getTopForItem(t){let n=this.idToItem.get(t);if(n==null)return;return n.top+this.getItemTopOffset()}createItem(t,n,i){let{itemMetricsCache:r}=this;if(t.type==="diff"){let s=new Lc(this.createDiffOptions(t.id),this,r,this.workerManager,this.isContainerManaged);return{type:"diff",item:t,version:t.version,index:n,top:i,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:s}}let o=new ec(this.createFileOptions(t.id),this,r,this.workerManager,this.isContainerManaged);return{type:"file",item:t,version:t.version,index:n,top:i,height:0,element:void 0,renderedOptionsRevision:this.renderOptionsRevision,instance:o}}applySelectedLines(t,n){let{selectedLines:i}=this;if(t==null&&i==null||t!=null&&i?.id===t.id&&nn(i.range,t.range))return;if(i!=null&&i.id!==t?.id)this.idToItem.get(i.id)?.instance.setSelectedLines(null,{notify:!1});this.selectedLines=t,this.idToItem.get(t?.id??"")?.instance.setSelectedLines(t?.range??null,n)}syncSelection(){if(this.selectedLines==null)return;let t=this.idToItem.get(this.selectedLines.id);if(t==null){this.selectedLines=null,this.options.onSelectedLinesChange?.(null);return}t.instance.setSelectedLines(this.selectedLines.range,{notify:!1})}isItemInEditMode(t){return t.item.edit===!0&&t.item.collapsed!==!0}attachItemEditor(t){let{id:n}=t.item,{createEditor:i}=this.options;if(t.element==null||this.attachedEditors.has(n)||!this.isItemInEditMode(t))return;let r=this.itemEditors.get(n),o=!1;try{if(r==null){my(i);let s={id:n},a=i({onChange:(l,d)=>{let c=this.idToItem.get(s.id);if(c==null)return;s.lastChange={item:c.item,file:l,lineAnnotations:d},this.options.onItemEditChange?.(c.item,l,d)}});if(a==null)return;r={editor:a,state:s},this.itemEditors.set(n,r),o=!0}r.editor.edit(t.instance),this.attachedEditors.add(n)}catch(s){if(o&&r!=null)this.itemEditors.delete(n),r.editor.cleanUp();throw this.releaseRenderedItem(t),s}}syncItemEditors(t){if(this.itemEditors.size===0)return;let n=[];for(let[i,r]of this.itemEditors){let o=this.idToItem.get(i),s=t?.get(i);if(s==null&&o!=null&&this.isItemInEditMode(o))continue;r.editor.cleanUp(),this.itemEditors.delete(i),this.attachedEditors.delete(i);let{lastChange:a}=r.state,l=s==null?o?.item??a?.item:a?.item??s.item;if(l?.type==="diff"){if(s==null&&o!=null&&o.type==="diff"&&o.instance.completeEditSession())this.markItemLayoutDirty(o),this.render();Un(l.fileDiff)}if(a!=null)n.push(s!=null||o==null?a:{...a,item:o.item})}for(let{item:i,file:r,lineAnnotations:o}of n)this.options.onItemEditComplete?.(i,r,o)}renamePendingScrollTarget(t,n){let{pendingScrollTarget:i}=this;if(i==null||i.type==="position"||i.id!==t)return;this.pendingScrollTarget={...i,id:n}}renamePendingLayoutAnchor(t,n){if(this.pendingLayoutAnchor?.id===t)this.pendingLayoutAnchor.id=n}createFileOptionsPrototype(){let t={};for(let n of zc)ot(t,n,()=>this.options[n]);ot(t,"stickyHeader",()=>this.options.stickyHeaders),ot(t,"collapsed",(n)=>{let i=ti(n);if(i==null)return;return this.getItemOptions(i,"file")?.item.collapsed});for(let n of Ec)this.defineItemSharedCallback(t,"file",n);for(let n of Tc)this.defineItemSelectionCallback(t,"file",n);return t}createDiffOptionsPrototype(){let t={};for(let n of Uc)ot(t,n,()=>this.options[n]);ot(t,"stickyHeader",()=>this.options.stickyHeaders),ot(t,"hunkSeparators",()=>this.options.hunkSeparators),ot(t,"collapsed",(n)=>{let i=ti(n);if(i==null)return;return this.getItemOptions(i,"diff")?.item.collapsed});for(let n of Ec)this.defineItemSharedCallback(t,"diff",n);for(let n of Tc)this.defineItemSelectionCallback(t,"diff",n);return t}createFileOptions(t){let n=Object.create(this.fileOptionsPrototype);return Ac(n,{id:t}),n}createDiffOptions(t){let n=Object.create(this.diffOptionsPrototype);return Ac(n,{id:t}),n}updateItemOptionsId(t,n){let i=ti(t);if(i==null)throw Error("CodeView.updateItemOptionsId: No valid state");i.id=n}getItemOptions(t,n){let i=this.idToItem.get(t.id);if(i==null||i.type!==n)return;return i}defineItemSharedCallback(t,n,i){ot(t,i,(r)=>{if(this.options[i]==null)return;let o=ti(r);if(o==null)return;let s=o.callbackCache??={},a=s[i];if(a==null)a=(...l)=>{let d=this.getItemOptions(o,n);if(d==null)return;let c=this.options[i];return c?.(...l,d)},s[i]=a;return a})}defineItemSelectionCallback(t,n,i){ot(t,i,(r)=>{let o=ti(r);if(o==null)return;let s=o.callbackCache??={},a=s[i];if(a==null)a=(l)=>{let d=this.getItemOptions(o,n);if(d==null)return;let c=l==null?null:{id:d.item.id,range:l};if(this.options.controlledSelection!==!0){if(l!=null||this.selectedLines?.id===d.item.id)this.applySelectedLines(c,{notify:!1})}this.options.onSelectedLinesChange?.(c);let u=this.options[i];return u?.(l,d)},s[i]=a;return a})}markLayoutDirtyFromIndex(t){this.layoutDirtyIndex=Math.min(this.layoutDirtyIndex??t,t)}markItemLayoutDirty(t){if(this.items[t.index]!==t)throw Error(`CodeView.markItemLayoutDirty: unknown item id "${t.item.id}"`);this.markLayoutDirtyFromIndex(t.index)}tryAppendItems(t){if(t.length<=this.items.length)return!1;for(let n=0;n<this.items.length;n++){let i=this.items[n];if(i==null)throw Error("CodeView.tryAppendItems: missing existing item");let r=t[n];if(r==null||i.item.id!==r.id||i.type!==r.type)return!1}for(let n=0;n<this.items.length;n++){let i=this.items[n];if(i==null)throw Error("CodeView.tryAppendItems: missing existing item");let r=t[n];if(r==null)throw Error("CodeView.tryAppendItems: append candidate missing prefix item");if(this.syncItemRecord(i,r))this.markLayoutDirtyFromIndex(n)}return this.appendItemsInternal(t.slice(this.items.length),!1),this.scrollDirty=!0,this.render(),!0}reconcileItems(t){let{items:n,idToItem:i}=this,r=new Set(n),o=[],s=new Map,a=new Map,l=new Map,d;for(let c=0;c<t.length;c++){let u=t[c];if(u==null)throw Error("CodeView.reconcileItems: missing input item");if(s.has(u.id))throw Error(`CodeView.setItems: duplicate id "${u.id}"`);let h=i.get(u.id),f=h!=null&&h.type===u.type?h:this.createItem(u,c,0);if(f.index=c,h!=null&&h.type===u.type){if(r.delete(h),this.syncItemRecord(f,u))d=Math.min(d??c,c)}else d=Math.min(d??c,c);if(n[c]!==f)d=Math.min(d??c,c);o.push(f),s.set(u.id,f),a.set(f.instance,f)}if(d==null){if(r.size===0)return;d=Math.max(o.length-1,0)}this.capturePendingLayoutAnchor(s);for(let c=0;c<n.length;c++){let u=n[c];if(u==null||!r.has(u))continue;l.set(u.item.id,u),this.releaseRenderedItem(u);let h=Math.max(o.length-1,0);d=Math.min(d??h,h)}if(this.items=o,this.idToItem=s,this.instanceToItem=a,this.renderState.firstIndex>=o.length)this.resetRenderState();else if(this.renderState.lastIndex>=o.length)this.renderState.lastIndex=o.length-1;return this.markLayoutDirtyFromIndex(d),this.scrollDirty=!0,this.render(),l.size>0?l:void 0}syncItemRecord(t,n){if(t.type!==n.type)throw Error(`CodeView.syncItemRecord: type mismatch for id "${n.id}"`);if(t.version===n.version)return!1;return t.item=n,t.version=n.version,t.renderedOptionsRevision=-1,!0}getMaxScrollTopForHeight(t){let{paddingBottom:n,paddingTop:i}=this.getLayout();return Math.max(i+this.header.height+t+this.footer.height+n-this.getHeight(),0)}getMaxScrollTop(){return this.getMaxScrollTopForHeight(this.getScrollHeight())}shouldRebaseScroll(){return this.getMaxScrollTop()>Mc}getPagedScrollHeight(){return this.shouldRebaseScroll()?Math.min(this.getScrollHeight(),xs):this.getScrollHeight()}getMaxPagedScrollTop(){return this.getMaxScrollTopForHeight(this.getPagedScrollHeight())}clampPagedScrollTop(t){let n=this.getMaxPagedScrollTop();return Math.max(0,Math.min(t,n))}clampScrollTop(t){let n=this.getMaxScrollTop();return Math.max(0,Math.min(t,n))}getMaxScrollPageOffset(){return Math.max(this.getMaxScrollTop()-this.getMaxPagedScrollTop(),0)}clampScrollPageOffset(t){let n=this.getMaxScrollPageOffset();return Math.max(0,Math.min(t,n))}resolveScrollPageWindow(t,n){let i=_e(this.clampPagedScrollTop(n)),r=this.clampScrollPageOffset(t-i);return i=_e(this.clampPagedScrollTop(t-r)),r=this.clampScrollPageOffset(t-i),{pagedScrollTop:i,scrollPageOffset:r}}resolvePagedScrollPosition(t){if(!this.shouldRebaseScroll())return{pagedScrollTop:this.clampPagedScrollTop(t),scrollPageOffset:0};let n=this.clampScrollPageOffset(this.scrollPageOffset),i=t-n,r=this.getMaxPagedScrollTop(),o=this.getMaxScrollPageOffset(),s=i>Mc&&n<o,a=i<$c&&n>0;if(i<0||i>r||s||a)return this.resolveScrollPageWindow(t,a?Math.min(py,r):Vc);return{pagedScrollTop:_e(this.clampPagedScrollTop(i)),scrollPageOffset:n}}needsScrollPageUpdate(t){let n=_e(this.clampScrollTop(t)),{scrollPageOffset:i}=this.resolvePagedScrollPosition(n);return i!==this.scrollPageOffset}getPagedLayoutTop(t){if(!this.shouldRebaseScroll())return t;return Math.max(t-this.scrollPageOffset,0)}getStickyHeaderOffset(){return this.options.stickyHeaders===!0&&this.options.disableFileHeader!==!0?this.itemMetricsCache.diffHeaderHeight:0}getScrollTargetRect(t){let n=this.idToItem.get(t.id);if(n==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return{top:n.top,height:n.height};if(t.type==="range"){let r=this.getRangeScrollPosition(n,t);if(r==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Hc(t.range)} for item "${t.id}"`);return}return{top:n.top+r.top,height:r.height}}let i=this.getLineScrollPosition(n,t);if(i==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return{top:n.top+i.top,height:i.height}}normalizeScrollTarget(t){if(t.type==="position"||t.align!=="nearest")return t;let n=this.getScrollTargetRect(t);if(n==null)return;let i=t.offset??0,r=this.getItemTopOffset()+n.top,o=r+n.height,s=this.getScrollTop(),a=s+(t.type==="line"||t.type==="range"?this.getStickyHeaderOffset():0),l=s+this.getHeight();if(r-i<=a&&o+i>=l)return;if(r-i<a)return{...t,align:"start"};if(o+i>l)return{...t,align:"end"}}resolveScrollTargetTop(t){if(t.type==="position"){let r=this.clampScrollTop(t.position);return r!==t.position?r:this.clampScrollTop(t.position-this.getStickyHeaderOffset())}let n=this.idToItem.get(t.id);if(n==null){console.warn(`CodeView.scrollTo: unknown item id "${t.id}"`);return}if(t.type==="item")return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top,n.height,t.align,t.offset));if(t.type==="range"){let r=this.getRangeScrollPosition(n,t);if(r==null){console.warn(`CodeView.scrollTo: unable to resolve range ${Hc(t.range)} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top+r.top,r.height,t.align,t.offset,this.getStickyHeaderOffset()))}let i=this.getLineScrollPosition(n,t);if(i==null){console.warn(`CodeView.scrollTo: unable to resolve line ${t.lineNumber} for item "${t.id}"`);return}return this.clampScrollTop(this.resolveAlignedScrollPosition(n.top+i.top,i.height,t.align,t.offset,this.getStickyHeaderOffset()))}resolveAlignedScrollPosition(t,n,i,r=0,o=0){t+=this.getItemTopOffset();let s=this.getHeight();if(i==="center"&&n+r<s)return t-(s-n)/2+r;if(i==="end")return t-(s-n)+r;return t-o-r}getLineScrollPosition(t,n){if(t.type==="diff")return t.instance.getLinePosition(n.lineNumber,n.side);return t.instance.getLinePosition(n.lineNumber)}getRangeScrollPosition(t,n){let{range:i}=n,r=this.getLineScrollPosition(t,{type:"line",id:n.id,lineNumber:i.start,side:i.side}),o=this.getLineScrollPosition(t,{type:"line",id:n.id,lineNumber:i.end,side:i.endSide??i.side});if(r==null||o==null)return;let s=r.top,a=s+r.height,l=o.top,d=l+o.height,c=Math.min(s,l);return{top:c,height:Math.max(a,d)-c}}computeTargetScrollTopForFrame(t,n){if(this.pendingScrollTarget==null)return t;let i=this.resolveScrollTargetTop(this.pendingScrollTarget);if(i==null)return t;let{scrollAnimation:r}=this;if(r==null)return i;return this.computeSpringStep(r,i,n).position}computeSpringStep(t,n,i){let r=Math.max(0,i-t.lastTimestamp),{omega:o}=this.getSmoothScrollSettings(),s=Math.exp(-o*r),a=t.position-n,l=t.velocity+o*a;return{position:n+(a+l*r)*s,velocity:(l*(1-o*r)-o*a)*s}}advanceScrollAnimation(t,n){if(this.pendingScrollTarget==null)return;let i=this.resolveScrollTargetTop(this.pendingScrollTarget);if(i==null){this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;return}let r=this.scrollAnimation;if(r==null)return i;r.position+=n;let{position:o,velocity:s}=this.computeSpringStep(r,i,t);r.lastTimestamp=t,r.position=o,r.velocity=s;let{positionEpsilon:a,velocityEpsilon:l}=this.getSmoothScrollSettings();if(Math.abs(i-o)<=a&&Math.abs(s)<=l)return r.position=i,r.velocity=0,this.scrollAnimation=void 0,i;return r.position}computeRenderRangeAndEmit=(t=performance.now())=>{if(e.__STOP||this.container==null)return;if(!this.isReady())return;let n=this.getHeight(),i=this.getScrollTop(),r=i,o=this.pendingLayoutAnchor!=null,s=this.getScrollAnchor(r);if(this.layoutDirtyIndex!=null)this.recomputeLayout(this.layoutDirtyIndex,this.pendingLayoutReset),this.layoutDirtyIndex=void 0,this.pendingLayoutReset=void 0,o=!0;if(o&&s!=null){let w=this.resolveAnchoredScrollTop(s);if(w!=null){let T=w-r;if(r=w,this.scrollAnimation!=null)this.scrollAnimation.position+=T}}if(o)r=this.clampScrollTop(r),this.syncContainerHeight();let a=this.computeTargetScrollTopForFrame(r,t),l=!o&&(this.renderState.scrollTop===-1||Math.abs(a-this.renderState.scrollTop)>n+this.config.overscrollSize*2);if(l)s=void 0;this.windowSpecs=ad({scrollTop:a-this.header.height,height:n,scrollHeight:this.getScrollHeight(),fitPerfectly:l,fitPerfectlyOverscroll:this.getFitPerfectlyOverscroll(),overscrollSize:this.config.overscrollSize});let d=i;if(this.pendingScrollTarget!=null&&a!==d||this.needsScrollPageUpdate(a))this.applyScrollFix(a,d,this.windowSpecs),d=a;let{top:c,bottom:u}=this.windowSpecs,{firstIndex:h,lastIndex:f}=this.renderState;if(h>=0)for(let w=h;w<=f;w++){let T=this.items[w];if(T==null)throw Error(`CodeView.computeRenderRangeAndEmit: No item at index: ${w}`);if(!(T.top>c-T.height&&T.top<=u))this.releaseRenderedItem(T)}let m=this.reconcileHeaderFooterHosts(),y,v=new Set,g=this.findFirstVisibleIndex(c),S=this.findLastVisibleIndex(u);for(let w=g;w<=S;w++){let T=this.items[w];if(T==null)throw Error("CodeView.computeRenderRangeAndEmit: missing item");let{instance:L}=T;if(T.element==null){if(T.element=this.acquireElement(),Dc(this.stickyContainer,T.element,y),L.virtualizedSetup(),Nc(T,T.element))T.renderedOptionsRevision=this.renderOptionsRevision,v.add(T);y=T.element}else{if(Dc(this.stickyContainer,T.element,y),Nc(T,void 0,T.renderedOptionsRevision!==this.renderOptionsRevision))T.renderedOptionsRevision=this.renderOptionsRevision,v.add(T);y=T.element}if(T.item.edit===!0)this.attachItemEditor(T)}if(this.renderState.firstIndex=g<=S?g:-1,this.renderState.lastIndex=S,this.flushSlotCoordinator(),this.flushManagers(v),m)this.measureMountedHosts();this.reconcileRenderedItems(v),this.syncContainerHeight(),this.updateStickyPositioning();let b=s!=null?this.resolveAnchoredScrollTop(s):void 0;if(s===this.pendingLayoutAnchor)this.pendingLayoutAnchor=void 0;let x=b!=null?b-r:0,C=a,k=!1;if(this.pendingScrollTarget!=null){let w=this.advanceScrollAnimation(t,x);if(w!=null)C=w,k=!0;else C=r}else C=b??a;if(C!==d)this.applyScrollFix(C,d,this.windowSpecs),d=C;if(k&&this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget))this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;if(this.renderState.scrollTop=_e(d),this.updateStickyPositioning(),this.validateStickyContainerHeight(),this.fixContainerFocus(),l||this.scrollAnimation!=null)this.render()};flushManagers(t){for(let n of t)n.instance.flushManagers()}syncContainerHeight(){let t=this.getPagedScrollHeight();if(this.container==null||this.containerHeight===t)return;this.container.style.height=`${t}px`,this.containerHeight=t}getStickyBounds(t){let{firstIndex:n,lastIndex:i}=t!=null?{firstIndex:this.findFirstVisibleIndex(t.top),lastIndex:this.findLastVisibleIndex(t.bottom)}:this.renderState;if(n===-1||i===-1||n>i)return;let r=this.items[n]?.instance.getAdvancedStickySpecs(t),o=this.items[i]?.instance.getAdvancedStickySpecs(t);if(r==null||o==null)return;return{stickyTop:this.getPagedLayoutTop(Math.max(r.topOffset,0)),stickyBottom:this.getPagedLayoutTop(o.topOffset+o.height)}}applyStickyPositioning({stickyTop:t,stickyBottom:n}){let i=this.getHeight(),{itemMetricsCache:r}=this,o=n-t;this.renderState.stickyHeight=o,this.renderState.stickyTop=t,this.renderState.stickyBottom=n,this.stickyOffset.style.height=`${t}px`;let s=(Math.random()*r.lineHeight>>0)*-1,a=-Math.max(o+s,0)+i;this.stickyContainer.style.top=`${a}px`,this.stickyContainer.style.bottom=`${a+r.diffHeaderHeight}px`}syncPagedScrollScaffolding(t){this.syncContainerHeight();let n=this.getStickyBounds(t);if(n==null)return;this.applyStickyPositioning(n)}reconcileRenderedItems(t){let{firstIndex:n,lastIndex:i}=this.renderState;if(n===-1)return;let r=-1,o=!1;for(let s=n;s<this.items.length;s++){if(!o&&s>i)break;let a=this.items[s];if(a==null)throw Error("CodeView.reconcileRenderedItems: Invalid item");if(r===-1)r=a.top;else if(a.top!==r)a.top=r,a.instance.syncVirtualizedTop(),o=!0;if(t==null?s<=i:t.has(a)){if(a.instance.reconcileHeights())o=!0,a.height=a.instance.getVirtualizedHeight();this.validateRenderedItemHeight(a)}if(r+=a.instance.getVirtualizedHeight(),s<this.items.length-1)r+=this.getLayout().gap}if(o&&r!=null)this.scrollDirty=!0,this.scrollHeight=r}updateStickyPositioning(){let t=this.getStickyBounds();if(t==null){if(this.renderState.firstIndex===-1)this.stickyOffset.style.height="";return}let{stickyTop:n,stickyBottom:i}=t;if(i-n===this.renderState.stickyHeight&&n===this.renderState.stickyTop&&i===this.renderState.stickyBottom)return;this.applyStickyPositioning(t)}handleScroll=()=>{if(e.__STOP)return;this.suspendScrollInteractions(),this.scrollDirty=!0,this.notifyScroll(),this.render()};clearPendingScroll=()=>{this.pendingScrollTarget=void 0,this.pendingLayoutAnchor=void 0,this.scrollAnimation=void 0};handleResize=(t)=>{let n=!1;for(let i of t)if(i.target===this.stickyContainer){let r=i.borderBoxSize[0].blockSize;if(Math.abs(r-this.renderState.stickyHeight)>=Rc){let o=this.getScrollTop(),s=this.getScrollAnchor(o);this.reconcileRenderedItems(),this.updateStickyPositioning();let a=s!=null?this.resolveAnchoredScrollTop(s):void 0;if(a!=null){let l=a-o;if(this.applyScrollFix(a,o,this.windowSpecs),this.scrollAnimation!=null)this.scrollAnimation.position+=l}if(this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget))this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;n=!0}}else if(i.target===this.header.element||i.target===this.footer.element){let r=i.target===this.header.element?this.header:this.footer,o=i.borderBoxSize[0].blockSize;if(o!==r.height){let s=this.getScrollTop(),a=this.getScrollAnchor(s);this.setHostHeight(r,o);let l=a!=null?this.resolveAnchoredScrollTop(a):void 0;if(l!=null){let d=l-s;if(this.applyScrollFix(l,s,this.windowSpecs),this.scrollAnimation!=null)this.scrollAnimation.position+=d}if(this.pendingScrollTarget!=null&&this.isPendingTargetSettled(this.pendingScrollTarget))this.pendingScrollTarget=void 0,this.scrollAnimation=void 0;n=!0}}else this.scrollDirty=!0,this.heightDirty=!0,n=!0;if(n)this.render(!0)};getScrollAnchorViewportTop(t,n){return t<n?n+this.getStickyHeaderOffset():n}getScrollAnchor(t,n=this.idToItem){let i,{pendingLayoutAnchor:r}=this;if(r!=null){let c=this.idToItem.get(r.id);if(c!=null&&n.get(r.id)===c)return r;if(c!=null)i=c}if(t<=0)return;let{firstIndex:o,lastIndex:s,stickyTop:a,stickyBottom:l}=this.renderState;if(o===-1||s===-1)return;let d=this.getHeight();if(a===-1||l===-1)return;for(let c=o;c<=s;c++){let u=this.items[c];if(u==null)continue;let h=this.getItemTopOffset()+u.top;if(h+u.height<=t)continue;if(h>=t+d)break;if(n.get(u.item.id)!==u){i??=u;continue}if(h>=t)return{type:"item",id:u.item.id,viewportOffset:h-t};let f=this.getScrollAnchorViewportTop(h,t)-h,m=u.instance.getNumericScrollAnchor(f);if(m!=null){let y=h+m.top;return{type:"line",id:u.item.id,lineNumber:m.lineNumber,side:m.side,viewportOffset:y-t}}}if(i!=null)for(let c=i.index+1;c<this.items.length;c++){let u=this.items[c];if(u!=null&&n.get(u.item.id)===u)return{type:"item",id:u.item.id,viewportOffset:0}}}resolveAnchoredScrollTop(t){let n=this.idToItem.get(t.id);if(n==null)return;let i=this.getItemTopOffset();if(t.type==="item"){let s=i+n.top;return this.clampScrollTop(s-t.viewportOffset)}let r=n.type==="diff"?n.instance.getLinePosition(t.lineNumber,t.side):n.instance.getLinePosition(t.lineNumber);if(r==null)return;let o=i+n.top+r.top;return this.clampScrollTop(o-t.viewportOffset)}applyScrollFix(t,n,i){if(this.root==null)return;let r=_e(this.clampScrollTop(t)),o=_e(n),{scrollPageOffset:s}=this,a=_e(this.clampPagedScrollTop(o-s)),{pagedScrollTop:l,scrollPageOffset:d}=this.resolvePagedScrollPosition(r),c=l,u=s!==d;if(r===this.renderState.scrollTop&&r===o&&c===a&&!u)return;if(this.suspendScrollInteractions(),c!==a||u)this.scrollPageOffset=d,this.syncPagedScrollScaffolding(i);if(c!==a)this.root.scrollTo({top:c,behavior:"instant"});this.renderState.scrollTop=r,this.scrollTop=r,this.scrollDirty=!1}isPendingTargetSettled(t){let n=this.resolveScrollTargetTop(t);if(n==null)return!0;return _e(this.getScrollTop())===_e(n)}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let t=this.root?.scrollTop??0;return this.scrollTop=this.clampScrollTop(t+this.scrollPageOffset),this.scrollTop}getHeight(){if(!this.heightDirty)return this.height;return this.heightDirty=!1,this.height=this.root?.getBoundingClientRect().height??0,this.height}getScrollHeight(){return this.scrollHeight}flushSlotCoordinator(){if(this.slotCoordinator==null)return;let t=this.buildSlotSnapshot(this.slotCoordinator);if(nd(this.slotSnapshot,t))return;this.slotSnapshot=t,this.slotCoordinator.onSnapshotChange(t)}notifyScroll(){if(this.scrollListeners.size===0)return;let t=this.getScrollTop();for(let n of this.scrollListeners)n(t,this)}findFirstVisibleIndex(t){let n=0,i=this.items.length-1,r=this.items.length;while(n<=i){let o=n+i>>1,s=this.items[o];if(s==null)throw Error("CodeView.findFirstVisibleIndex: invalid item index");if(s.top+s.height>t)r=o,i=o-1;else n=o+1}return r}findLastVisibleIndex(t){let n=0,i=this.items.length-1,r=-1;while(n<=i){let o=n+i>>1,s=this.items[o];if(s==null)throw Error("CodeView.findLastVisibleIndex: invalid item index");if(s.top<=t)r=o,n=o+1;else i=o-1}return r}recomputeLayout(t=0,n){if(this.items.length===0){this.scrollHeight=0;return}let i=this.getLayout(),r=0;if(t>0){let o=this.items[t-1];if(o==null)throw Error("CodeView.recomputeLayout: invalid dirty index");r=o.top+o.height+i.gap}for(let o=t;o<this.items.length;o++){let s=this.items[o];if(s==null)throw Error("CodeView.recomputeLayout: invalid item index");if(s.top=r,s.type==="diff"){let a=s.instance.consumeCodeViewLayoutChanges(s.item.fileDiff);if(a!=null)Object.assign(s.item.fileDiff,a);s.height=s.instance.prepareCodeViewItem(s.item.fileDiff,r,n,s.item.annotations??[])}else s.height=s.instance.prepareCodeViewItem(s.item.file,r,n,s.item.annotations??[]);if(r+=s.height,o<this.items.length-1)r+=i.gap}if(r!==this.scrollHeight)this.scrollDirty=!0;this.scrollHeight=r}resetRenderState(){this.renderState.scrollTop=-1,this.renderState.firstIndex=-1,this.renderState.lastIndex=-1,this.renderState.stickyHeight=0,this.renderState.stickyTop=-1,this.renderState.stickyBottom=-1}getFitPerfectlyOverscroll(){return this.getLayout().gap+this.itemMetricsCache.diffHeaderHeight}};function Sy(e){if(e.instance.cleanUp(!0),e.type==="diff")return e.instance.prepareCodeViewItem(e.item.fileDiff,e.top,void 0,e.item.annotations??[]);else return e.instance.prepareCodeViewItem(e.item.file,e.top,void 0,e.item.annotations??[])}function vy(e,t){return!Ie(e.theme??z,t.theme??z)||(e.themeType??"system")!==(t.themeType??"system")||e.unsafeCSS!==t.unsafeCSS}function by(e,t){return(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||e.unsafeCSS!==t.unsafeCSS||(e.diffStyle??"split")!==(t.diffStyle??"split")||(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)}function Cy(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 xy(e){if(e instanceof SVGElement)return!0;return pt(e)&&(e.hasAttribute("data-core-css")||e.hasAttribute("data-theme-css")||e.hasAttribute("data-unsafe-css"))}function Hc(e){let t=Pc(e.start,e.side),n=Pc(e.end,e.endSide??e.side);return t===n?t:`${t}-${n}`}function Pc(e,t){if(t==null)return`${e}`;return`${t==="deletions"?"D":"A"}${e}`}function Nc(e,t,n=!1){if(e.type==="diff")return e.instance.render({deferManagers:!0,fileContainer:t,fileDiff:e.item.fileDiff,forceRender:n,lineAnnotations:e.item.annotations??[]});else return e.instance.render({deferManagers:!0,fileContainer:t,file:e.item.file,forceRender:n,lineAnnotations:e.item.annotations??[]})}function Dc(e,t,n){if(n==null){if(e.firstChild!==t)e.prepend(t);return}if(n.nextSibling!==t)n.after(t)}function ky(e){return(e.annotations?.length??0)>0}function wy(e,{hasHeaderRenderers:t,hasAnnotationRenderer:n,hasGutterRenderer:i}){if(e.length===0)return;if(t||i)return e;if(!n)return;let r=[];for(let o of e)if(ky(o.item))r.push(o);return r.length>0?r:void 0}var Ly=Gc($r.Object({dark:$r.String(),light:$r.String()}));function IP(e){return Ly.Check(e)}var Ey={dark:"pierre-dark-soft",light:"pierre-light"},Wc=Ey;function MP(){return Wc}function HP(e){Wc={dark:e.dark,light:e.light}}
|
|
1530
|
+
export{eu as a,je as b,$l as c,Vl as d,de as e,jo as f,Jl as g,Zl as h,en as i,Dn as j,um as k,Ie as l,fe as m,Gn as n,un as o,Bd as p,Ft as q,jd as r,ms as s,bt as t,vn as u,_t as v,dc as w,yy as x,IP as y,MP as z,HP as A};
|