pulls.review 0.0.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/index.mjs +149 -0
  2. package/package.json +26 -65
  3. package/README.md +0 -15
  4. package/dist/assets/ChatWidget-BD4etTSI.css +0 -1
  5. package/dist/assets/ChatWidget-BXmVT9ns.js +0 -2
  6. package/dist/assets/_number_-ByKh-CJ7.js +0 -1
  7. package/dist/assets/agent-SYDXCLiI.js +0 -90
  8. package/dist/assets/andromeeda-vGVdxbeo.js +0 -1
  9. package/dist/assets/anthropic-messages-XptRMkpJ.js +0 -41
  10. package/dist/assets/aurora-x-CDeNXAV0.js +0 -1
  11. package/dist/assets/ayu-dark-DluEY0Gj.js +0 -1
  12. package/dist/assets/ayu-light-C3h-C4tm.js +0 -1
  13. package/dist/assets/ayu-mirage-Bqwy1Gya.js +0 -1
  14. package/dist/assets/c-BWgYNV7i.js +0 -1
  15. package/dist/assets/catppuccin-frappe-C9Q5zVZY.js +0 -1
  16. package/dist/assets/catppuccin-latte-CtsyrtPq.js +0 -1
  17. package/dist/assets/catppuccin-macchiato-R8nAf1vR.js +0 -1
  18. package/dist/assets/catppuccin-mocha-DjuaAJKi.js +0 -1
  19. package/dist/assets/chat-CP0CZKJo.js +0 -1
  20. package/dist/assets/clojure-DqKBuwfJ.js +0 -1
  21. package/dist/assets/cpp-BBcYm61y.js +0 -1
  22. package/dist/assets/csharp-oqKa8noW.js +0 -1
  23. package/dist/assets/css-dNRduEa-.js +0 -1
  24. package/dist/assets/dark-plus-Cs2F2srj.js +0 -1
  25. package/dist/assets/diff-woXpYk--.js +0 -1
  26. package/dist/assets/diffs-store-B1RXognA.js +0 -1696
  27. package/dist/assets/dist-hXdF5ZNr.js +0 -1
  28. package/dist/assets/docker-IyjqRm3v.js +0 -1
  29. package/dist/assets/dracula-BHWKrbxM.js +0 -1
  30. package/dist/assets/dracula-soft-5eyTD99u.js +0 -1
  31. package/dist/assets/elixir-BMAS0SZ2.js +0 -1
  32. package/dist/assets/error-CJ3RHG07.js +0 -1
  33. package/dist/assets/everforest-dark-sB-x3p7T.js +0 -1
  34. package/dist/assets/everforest-light-Df2xbC6M.js +0 -1
  35. package/dist/assets/fonts/dmmono-53a90e28.woff2 +0 -0
  36. package/dist/assets/fonts/dmmono-cd6ed524.woff2 +0 -0
  37. package/dist/assets/fonts/dmsans-56778fc7.woff2 +0 -0
  38. package/dist/assets/fonts/dmsans-7c37c8a6.woff2 +0 -0
  39. package/dist/assets/fonts/dmserifdisplay-1f997542.woff2 +0 -0
  40. package/dist/assets/fonts/dmserifdisplay-b6206db2.woff2 +0 -0
  41. package/dist/assets/github-dark-C-LZuMrd.js +0 -1
  42. package/dist/assets/github-dark-default-DXG-b-1a.js +0 -1
  43. package/dist/assets/github-dark-dimmed-Bx1FflLF.js +0 -1
  44. package/dist/assets/github-dark-high-contrast-B_tTalzw.js +0 -1
  45. package/dist/assets/github-light-EUqPIrTm.js +0 -1
  46. package/dist/assets/github-light-default-BXViO-2h.js +0 -1
  47. package/dist/assets/github-light-high-contrast-B68TUdTA.js +0 -1
  48. package/dist/assets/go-rLFTqkRN.js +0 -1
  49. package/dist/assets/graphql-DC6gMr7C.js +0 -1
  50. package/dist/assets/groovy-CacY0gHj.js +0 -1
  51. package/dist/assets/gruvbox-dark-hard-C820rvS2.js +0 -1
  52. package/dist/assets/gruvbox-dark-medium-BPjhmG05.js +0 -1
  53. package/dist/assets/gruvbox-dark-soft-MrdJrrXF.js +0 -1
  54. package/dist/assets/gruvbox-light-hard-BC_s9l72.js +0 -1
  55. package/dist/assets/gruvbox-light-medium-BAWPOn9u.js +0 -1
  56. package/dist/assets/gruvbox-light-soft-BSMLrYjP.js +0 -1
  57. package/dist/assets/haskell-D8IpX4py.js +0 -1
  58. package/dist/assets/horizon-CE9ld1lL.js +0 -1
  59. package/dist/assets/horizon-bright-DSNQnXHK.js +0 -1
  60. package/dist/assets/houston-CsvMBhTu.js +0 -1
  61. package/dist/assets/html-9bR0RcZU.js +0 -1
  62. package/dist/assets/index-BD_DzwAn.js +0 -3
  63. package/dist/assets/index-Yd4-oLpR.css +0 -1
  64. package/dist/assets/indexedb-Cu6ZJjpB.js +0 -1
  65. package/dist/assets/ini-B5eOa1yu.js +0 -1
  66. package/dist/assets/java-C0DRq53f.js +0 -1
  67. package/dist/assets/javascript-UWfzLVwt.js +0 -1
  68. package/dist/assets/json-qhed-kSA.js +0 -1
  69. package/dist/assets/jsonc-CYpm1nAK.js +0 -1
  70. package/dist/assets/jsx-B85L4NBR.js +0 -1
  71. package/dist/assets/kanagawa-dragon-Bozd7klA.js +0 -1
  72. package/dist/assets/kanagawa-lotus-BmuOG9ZW.js +0 -1
  73. package/dist/assets/kanagawa-wave-BML5mF2J.js +0 -1
  74. package/dist/assets/kotlin-DhhofPvG.js +0 -1
  75. package/dist/assets/laserwave-C_8bwKvT.js +0 -1
  76. package/dist/assets/less-DVTAwKKz.js +0 -1
  77. package/dist/assets/light-plus-DVQuIRkW.js +0 -1
  78. package/dist/assets/lua-ByOrBoZ-.js +0 -1
  79. package/dist/assets/make-Dixweg8N.js +0 -1
  80. package/dist/assets/markdown-BYOwaDjH.js +0 -1
  81. package/dist/assets/material-theme-Bm3Qr25_.js +0 -1
  82. package/dist/assets/material-theme-darker-2IIEA8gg.js +0 -1
  83. package/dist/assets/material-theme-lighter-uhdI0v04.js +0 -1
  84. package/dist/assets/material-theme-ocean-CHQ94UKr.js +0 -1
  85. package/dist/assets/material-theme-palenight-B5W6OYN7.js +0 -1
  86. package/dist/assets/mdx-DQZ5AkYe.js +0 -1
  87. package/dist/assets/min-dark-BSWPekZh.js +0 -1
  88. package/dist/assets/min-light-DDpmG2fV.js +0 -1
  89. package/dist/assets/monokai-B_bV9PQ9.js +0 -1
  90. package/dist/assets/nginx-DBTb8aIg.js +0 -1
  91. package/dist/assets/night-owl-DhmEMT88.js +0 -1
  92. package/dist/assets/night-owl-light-eJ-hLW7d.js +0 -1
  93. package/dist/assets/node.browser-C40HpO0s.js +0 -1
  94. package/dist/assets/node.browser-DFtqp6Hr.js +0 -1
  95. package/dist/assets/nord-Cb4Vim4T.js +0 -1
  96. package/dist/assets/objective-c-D1A_Heim.js +0 -1
  97. package/dist/assets/objective-cpp-BsSzOQcm.js +0 -1
  98. package/dist/assets/one-dark-pro-CLwyXe_n.js +0 -1
  99. package/dist/assets/one-light-D7Lr4KcI.js +0 -1
  100. package/dist/assets/openai-completions-Cb_BwZvN.js +0 -21
  101. package/dist/assets/pages-KWcQcyk5.js +0 -1
  102. package/dist/assets/perl-Bk6ijEF5.js +0 -1
  103. package/dist/assets/php-CwqKKdmW.js +0 -1
  104. package/dist/assets/pierre-dark-CpLgRqie.js +0 -1
  105. package/dist/assets/pierre-dark-protanopia-deuteranopia-B35FxJx-.js +0 -1
  106. package/dist/assets/pierre-dark-soft-kZQmAZld.js +0 -1
  107. package/dist/assets/pierre-dark-tritanopia-CpjhbsIL.js +0 -1
  108. package/dist/assets/pierre-dark-vibrant-CpQYzh95.js +0 -1
  109. package/dist/assets/pierre-light-CoaEpmwp.js +0 -1
  110. package/dist/assets/pierre-light-protanopia-deuteranopia-0fSaH845.js +0 -1
  111. package/dist/assets/pierre-light-soft-lWLdNTOI.js +0 -1
  112. package/dist/assets/pierre-light-tritanopia-CEbqgOJL.js +0 -1
  113. package/dist/assets/pierre-light-vibrant-D80Fkn33.js +0 -1
  114. package/dist/assets/plastic-DQwYfKfQ.js +0 -1
  115. package/dist/assets/poimandres-DRFjx7u4.js +0 -1
  116. package/dist/assets/pr-cache-DNR7E646.js +0 -94
  117. package/dist/assets/proto-DB4EqR-F.js +0 -1
  118. package/dist/assets/python-gzcpVVnB.js +0 -1
  119. package/dist/assets/r-C5FwQflr.js +0 -1
  120. package/dist/assets/red-DX1BQOs8.js +0 -1
  121. package/dist/assets/rose-pine-aMsaMD1D.js +0 -1
  122. package/dist/assets/rose-pine-dawn-8PwUyIlP.js +0 -1
  123. package/dist/assets/rose-pine-moon-DO-qXg-I.js +0 -1
  124. package/dist/assets/ruby-Cf2R6w0b.js +0 -1
  125. package/dist/assets/runtime-core.esm-bundler-B8D2lM98.js +0 -3
  126. package/dist/assets/rust-Cfkwpbl8.js +0 -1
  127. package/dist/assets/scala-BiFt_7mu.js +0 -1
  128. package/dist/assets/scss-Dl-NjxyA.js +0 -1
  129. package/dist/assets/shellscript-CLZ0U2zV.js +0 -1
  130. package/dist/assets/shiki-wasm-noop-Gxv9UHE7.js +0 -1
  131. package/dist/assets/slack-dark-DnToyrRv.js +0 -1
  132. package/dist/assets/slack-ochin-B2OO5cIa.js +0 -1
  133. package/dist/assets/snazzy-light-4G7pJPwS.js +0 -1
  134. package/dist/assets/solarized-dark-UdsmMDCL.js +0 -1
  135. package/dist/assets/solarized-light-C1IUL_tW.js +0 -1
  136. package/dist/assets/sql-BsFa4tDR.js +0 -1
  137. package/dist/assets/swift-CyEgAFGc.js +0 -1
  138. package/dist/assets/synthwave-84-nFMaYfgc.js +0 -1
  139. package/dist/assets/terraform-DswuEJGm.js +0 -1
  140. package/dist/assets/tokyo-night-oM2G3aXe.js +0 -1
  141. package/dist/assets/toml-CcmNWLt0.js +0 -1
  142. package/dist/assets/transform-messages-DOewMBlN.js +0 -3
  143. package/dist/assets/tsx-CssvfOw5.js +0 -1
  144. package/dist/assets/typescript-CttGnwgr.js +0 -1
  145. package/dist/assets/upload-D7N53Rri.js +0 -1
  146. package/dist/assets/uploadSession-BUj4FNau.js +0 -1
  147. package/dist/assets/vesper-DdrHHSXu.js +0 -1
  148. package/dist/assets/vitesse-black-fwtXNY1n.js +0 -1
  149. package/dist/assets/vitesse-dark-BZCL-v6S.js +0 -1
  150. package/dist/assets/vitesse-light-VbXTXTou.js +0 -1
  151. package/dist/assets/vue-BeqRp0z0.js +0 -1
  152. package/dist/assets/vue-html-E9GYf_6s.js +0 -1
  153. package/dist/assets/xml-Dz7PSrBs.js +0 -1
  154. package/dist/assets/yaml-rwi0_p6S.js +0 -1
  155. package/dist/diffs-github.user.js +0 -23
  156. package/dist/embed/diffs-embed.js +0 -1948
  157. package/dist/index.html +0 -24
  158. package/dist/pulls-review-github.user.js +0 -23
  159. package/dist/robots.txt +0 -2
@@ -1,1696 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-SYDXCLiI.js","assets/pr-cache-DNR7E646.js","assets/runtime-core.esm-bundler-B8D2lM98.js","assets/index-BD_DzwAn.js","assets/index-Yd4-oLpR.css","assets/dist-hXdF5ZNr.js","assets/typescript-CttGnwgr.js","assets/javascript-UWfzLVwt.js","assets/jsx-B85L4NBR.js","assets/tsx-CssvfOw5.js","assets/vue-BeqRp0z0.js","assets/css-dNRduEa-.js","assets/html-9bR0RcZU.js","assets/json-qhed-kSA.js","assets/vue-html-E9GYf_6s.js","assets/scss-Dl-NjxyA.js","assets/xml-Dz7PSrBs.js","assets/java-C0DRq53f.js","assets/c-BWgYNV7i.js","assets/cpp-BBcYm61y.js","assets/ruby-Cf2R6w0b.js","assets/graphql-DC6gMr7C.js","assets/lua-ByOrBoZ-.js","assets/sql-BsFa4tDR.js","assets/shellscript-CLZ0U2zV.js","assets/yaml-rwi0_p6S.js","assets/php-CwqKKdmW.js","assets/perl-Bk6ijEF5.js","assets/elixir-BMAS0SZ2.js","assets/nginx-DBTb8aIg.js","assets/ChatWidget-BXmVT9ns.js","assets/ChatWidget-BD4etTSI.css","assets/chat-CP0CZKJo.js"])))=>i.map(i=>d[i]);
2
- import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,L as l,M as u,N as d,O as f,P as p,R as m,S as h,T as g,U as _,V as v,W as y,_ as b,a as x,b as S,c as C,d as w,f as ee,g as T,i as te,j as ne,k as E,l as re,n as ie,nt as ae,o as oe,p as se,q as ce,rt as le,s as D,t as ue,tt as de,u as fe,v as O,w as k,x as pe,y as me,z as he}from"./pr-cache-DNR7E646.js";import{$ as ge,B as _e,Cn as ve,D as A,Dn as ye,E as j,Ft as M,Ht as be,J as xe,L as Se,Nt as Ce,O as we,On as N,Rt as Te,Tn as Ee,Yt as De,Zn as Oe,_ as P,an as ke,b as F,bt as Ae,ct as je,er as Me,et as Ne,ft as Pe,g as I,gn as Fe,gt as Ie,it as Le,k as L,l as Re,mt as R,o as ze,pn as Be,qt as z,st as Ve,tr as B,tt as He,v as V,vn as H,wt as Ue,xn as We,xt as Ge,y as U}from"./runtime-core.esm-bundler-B8D2lM98.js";import{D as Ke,O as qe,T as Je,t as W}from"./index-BD_DzwAn.js";import{a as Ye,c as Xe,l as Ze,o as Qe,r as $e,s as et,t as tt,u as nt}from"./dist-hXdF5ZNr.js";var rt=de(((e,t)=>{var n=`\\\\/`,r=`[^${n}]`,i=0,a=`\\.`,o=`\\+`,s=`\\?`,c=`\\/`,l=`(?=.)`,u=`[^/]`,d=`(?:${c}|$)`,f=`(?:^|${c})`,p=`${a}{1,2}${d}`,m={DOT_LITERAL:a,PLUS_LITERAL:o,QMARK_LITERAL:s,SLASH_LITERAL:c,ONE_CHAR:l,QMARK:u,END_ANCHOR:d,DOTS_SLASH:p,NO_DOT:`(?!${a})`,NO_DOTS:`(?!${f}${p})`,NO_DOT_SLASH:`(?!${a}{0,1}${d})`,NO_DOTS_SLASH:`(?!${p})`,QMARK_NO_DOT:`[^.${c}]`,STAR:`${u}*?`,START_ANCHOR:f,SEP:`/`},h={...m,SLASH_LITERAL:`[${n}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${a}{1,2}(?:[${n}]|$)`,NO_DOT:`(?!${a})`,NO_DOTS:`(?!(?:^|[${n}])${a}{1,2}(?:[${n}]|$))`,NO_DOT_SLASH:`(?!${a}{0,1}(?:[${n}]|$))`,NO_DOTS_SLASH:`(?!${a}{1,2}(?:[${n}]|$))`,QMARK_NO_DOT:`[^.${n}]`,START_ANCHOR:`(?:^|[${n}])`,END_ANCHOR:`(?:[${n}]|$)`,SEP:`\\`};t.exports={DEFAULT_MAX_EXTGLOB_RECURSION:i,MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{__proto__:null,alnum:`a-zA-Z0-9`,alpha:`a-zA-Z`,ascii:`\\x00-\\x7F`,blank:` \\t`,cntrl:`\\x00-\\x1F\\x7F`,digit:`0-9`,graph:`\\x21-\\x7E`,lower:`a-z`,print:`\\x20-\\x7E `,punct:`\\-!"#$%&'()\\*+,./:;<=>?@[\\]^_\`{|}~`,space:` \\t\\r\\n\\v\\f`,upper:`A-Z`,word:`A-Za-z0-9_`,xdigit:`A-Fa-f0-9`},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":`*`,"**/**":`**`,"**/**/**":`**`},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(e){return{"!":{type:`negate`,open:`(?:(?!(?:`,close:`))${e.STAR})`},"?":{type:`qmark`,open:`(?:`,close:`)?`},"+":{type:`plus`,open:`(?:`,close:`)+`},"*":{type:`star`,open:`(?:`,close:`)*`},"@":{type:`at`,open:`(?:`,close:`)`}}},globChars(e){return e===!0?h:m}}})),it=de((e=>{var{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=rt();e.isObject=e=>typeof e==`object`&&!!e&&!Array.isArray(e),e.hasRegexChars=e=>r.test(e),e.isRegexChar=t=>t.length===1&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(i,`\\$1`),e.toPosixSlashes=e=>e.replace(t,`/`),e.isWindows=()=>{if(typeof navigator<`u`&&navigator.platform){let e=navigator.platform.toLowerCase();return e===`win32`||e===`windows`}return typeof process<`u`&&process.platform?process.platform===`win32`:!1},e.removeBackslashes=e=>e.replace(n,e=>e===`\\`?``:e),e.escapeLast=(t,n,r)=>{let i=t.lastIndexOf(n,r);return i===-1?t:t[i-1]===`\\`?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith(`./`)&&(n=n.slice(2),t.prefix=`./`),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?``:`^`}(?:${e})${n.contains?``:`$`}`;return t.negated===!0&&(r=`(?:^(?!${r}).*$)`),r},e.basename=(e,{windows:t}={})=>{let n=e.split(t?/[\\/]/:`/`),r=n[n.length-1];return r===``?n[n.length-2]:r}})),at=de(((e,t)=>{var n=it(),{CHAR_ASTERISK:r,CHAR_AT:i,CHAR_BACKWARD_SLASH:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:c,CHAR_FORWARD_SLASH:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_PLUS:p,CHAR_QUESTION_MARK:m,CHAR_RIGHT_CURLY_BRACE:h,CHAR_RIGHT_PARENTHESES:g,CHAR_RIGHT_SQUARE_BRACKET:_}=rt(),v=e=>e===l||e===a,y=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)};t.exports=(e,t)=>{let b=t||{},x=e.length-1,S=b.parts===!0||b.tokens===!0||b.scanToEnd===!0,C=[],w=[],ee=[],T=e,te=-1,ne=0,E=0,re=!1,ie=!1,ae=!1,oe=!1,se=!1,ce=!1,le=!1,D=!1,ue=!1,de=!1,fe=0,O,k,pe={value:``,depth:0,isGlob:!1},me=()=>te>=x,he=()=>T.charCodeAt(te+1),ge=()=>(O=k,T.charCodeAt(++te));for(;te<x;){k=ge();let e;if(k===a){le=pe.backslashes=!0,k=ge(),k===u&&(ce=!0);continue}if(ce===!0||k===u){for(fe++;me()!==!0&&(k=ge());){if(k===a){le=pe.backslashes=!0,ge();continue}if(k===u){fe++;continue}if(ce!==!0&&k===s&&(k=ge())===s){if(re=pe.isBrace=!0,ae=pe.isGlob=!0,de=!0,S===!0)continue;break}if(ce!==!0&&k===o){if(re=pe.isBrace=!0,ae=pe.isGlob=!0,de=!0,S===!0)continue;break}if(k===h&&(fe--,fe===0)){ce=!1,re=pe.isBrace=!0,de=!0;break}}if(S===!0)continue;break}if(k===l){if(C.push(te),w.push(pe),pe={value:``,depth:0,isGlob:!1},de===!0)continue;if(O===s&&te===ne+1){ne+=2;continue}E=te+1;continue}if(b.noext!==!0&&(k===p||k===i||k===r||k===m||k===c)&&he()===d){if(ae=pe.isGlob=!0,oe=pe.isExtglob=!0,de=!0,k===c&&te===ne&&(ue=!0),S===!0){let e=0;for(;me()!==!0&&(k=ge());){if(k===a){le=pe.backslashes=!0,ge();continue}if(k===d){e++;continue}if(k===g&&--e===0){de=!0;break}}continue}break}if(k===r){if(O===r&&(se=pe.isGlobstar=!0),ae=pe.isGlob=!0,de=!0,S===!0)continue;break}if(k===m){if(ae=pe.isGlob=!0,de=!0,S===!0)continue;break}if(k===f){for(;me()!==!0&&(e=ge());){if(e===a){le=pe.backslashes=!0,ge();continue}if(e===_){ie=pe.isBracket=!0,ae=pe.isGlob=!0,de=!0;break}}if(S===!0)continue;break}if(b.nonegate!==!0&&k===c&&te===ne){D=pe.negated=!0,ne++;continue}if(b.noparen!==!0&&k===d){if(ae=pe.isGlob=!0,S===!0){let e=1;for(;me()!==!0&&(k=ge());){if(k===a){le=pe.backslashes=!0,ge();continue}if(k===d){e++;continue}if(k===g&&--e===0){de=!0;break}}continue}break}if(ae===!0){if(de=!0,S===!0)continue;break}}b.noext===!0&&(oe=!1,ae=!1);let _e=T,ve=``,A=``;ne>0&&(ve=T.slice(0,ne),T=T.slice(ne),E-=ne),_e&&ae===!0&&E>0?(_e=T.slice(0,E),A=T.slice(E)):ae===!0?(_e=``,A=T):_e=T,_e&&_e!==``&&_e!==`/`&&_e!==T&&v(_e.charCodeAt(_e.length-1))&&(_e=_e.slice(0,-1)),b.unescape===!0&&(A&&=n.removeBackslashes(A),_e&&le===!0&&(_e=n.removeBackslashes(_e)));let ye={prefix:ve,input:e,start:ne,base:_e,glob:A,isBrace:re,isBracket:ie,isGlob:ae,isExtglob:oe,isGlobstar:se,negated:D,negatedExtglob:ue};if(b.tokens===!0&&(ye.maxDepth=0,v(k)||w.push(pe),ye.tokens=w),b.parts===!0||b.tokens===!0){let t;for(let n=0;n<C.length;n++){let r=t===void 0?ne:t+1,i=C[n],a=e.slice(r,i);b.tokens&&(n===0&&ne!==0?(w[n].isPrefix=!0,w[n].value=ve):w[n].value=a,y(w[n]),ye.maxDepth+=w[n].depth),i>=ne&&(ee.push(a),t=i)}let n=t===void 0?ne:t+1,r=e.slice(n);ee.push(r),b.tokens&&t&&t+1<e.length&&(w[w.length-1].value=r,y(w[w.length-1]),ye.maxDepth+=w[w.length-1].depth),ye.slashes=C,ye.parts=ee}return ye}})),ot=de(((e,t)=>{var n=rt(),r=it(),{MAX_LENGTH:i,POSIX_REGEX_SOURCE:a,REGEX_NON_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:c}=n,l=(e,t)=>{if(typeof t.expandRange==`function`)return t.expandRange(...e,t);e.sort();let n=`[${e.join(`-`)}]`;try{new RegExp(n)}catch{return e.map(e=>r.escapeRegex(e)).join(`..`)}return n},u=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,d=e=>{let t=[],n=0,r=0,i=0,a=``,o=!1;for(let s of e){if(o===!0){a+=s,o=!1;continue}if(s===`\\`){a+=s,o=!0;continue}if(s===`"`){i=i===1?0:1,a+=s;continue}if(i===0){if(s===`[`)n++;else if(s===`]`&&n>0)n--;else if(n===0){if(s===`(`)r++;else if(s===`)`&&r>0)r--;else if(s===`|`&&r===0){t.push(a),a=``;continue}}}a+=s}return t.push(a),t},f=e=>{let t=!1;for(let n of e){if(t===!0){t=!1;continue}if(n===`\\`){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},p=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(f(t))return t.replace(/\\(.)/g,`$1`)},m=e=>{let t=e.map(p).filter(Boolean);for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let r=t[e],i=t[n],a=r[0];if(a&&r===a.repeat(r.length)&&i===a.repeat(i.length)&&(r===i||r.startsWith(i)||i.startsWith(r)))return!0}return!1},h=(e,t=!0)=>{if(e[0]!==`+`&&e[0]!==`*`||e[1]!==`(`)return;let n=0,r=0,i=0,a=!1;for(let o=1;o<e.length;o++){let s=e[o];if(a===!0){a=!1;continue}if(s===`\\`){a=!0;continue}if(s===`"`){i=i===1?0:1;continue}if(i!==1){if(s===`[`){n++;continue}if(s===`]`&&n>0){n--;continue}if(!(n>0)){if(s===`(`){r++;continue}if(s===`)`&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},g=e=>`${e.length===1?r.escapeRegex(e[0]):`[${e.map(e=>r.escapeRegex(e)).join(``)}]`}*`,_=e=>{let t=0,n=[];for(;t<e.length;){let r=h(e.slice(t),!1);if(!r||r.type!==`*`)return;let i=d(r.body).map(e=>e.trim());if(i.length!==1)return;let a=p(i[0]);if(!a||a.length!==1)return;n.push(a),t+=r.end+1}if(!(n.length<1))return n},v=e=>{let t=0,n=e.trim(),r=h(n);for(;r;)t++,n=r.body.trim(),r=h(n);return t},y=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};let r=typeof t.maxExtglobRecursion==`number`?t.maxExtglobRecursion:n.DEFAULT_MAX_EXTGLOB_RECURSION,i=d(e).map(e=>e.trim());if(i.length>1&&(i.some(e=>e===``)||i.some(e=>/^[*?]+$/.test(e))||m(i)))return{risky:!0};let a=[],o=!1,s=!0;for(let e of i){let t=_(e);if(t){o=!0,a.push(...t);continue}let n=p(e);if(n&&n.length===1){a.push(n);continue}if(s=!1,v(e)>r)return{risky:!0}}return o?s?{risky:!0,safeOutput:g([...new Set(a)])}:{risky:!0}:{risky:!1}},b=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);e=c[e]||e;let d={...t},f=typeof d.maxLength==`number`?Math.min(i,d.maxLength):i,p=e.length;if(p>f)throw SyntaxError(`Input length: ${p}, exceeds maximum allowed length: ${f}`);let m={type:`bos`,value:``,output:d.prepend||``},h=[m],g=d.capture?``:`?:`,_=n.globChars(d.windows),v=n.extglobChars(_),{DOT_LITERAL:x,PLUS_LITERAL:S,SLASH_LITERAL:C,ONE_CHAR:w,DOTS_SLASH:ee,NO_DOT:T,NO_DOT_SLASH:te,NO_DOTS_SLASH:ne,QMARK:E,QMARK_NO_DOT:re,STAR:ie,START_ANCHOR:ae}=_,oe=e=>`(${g}(?:(?!${ae}${e.dot?ee:x}).)*?)`,se=d.dot?``:T,ce=d.dot?E:re,le=d.bash===!0?oe(d):ie;d.capture&&(le=`(${le})`),typeof d.noext==`boolean`&&(d.noextglob=d.noext);let D={input:e,index:-1,start:0,dot:d.dot===!0,consumed:``,output:``,prefix:``,backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};e=r.removePrefix(e,D),p=e.length;let ue=[],de=[],fe=[],O=m,k,pe=()=>D.index===p-1,me=D.peek=(t=1)=>e[D.index+t],he=D.advance=()=>e[++D.index]||``,ge=()=>e.slice(D.index+1),_e=(e=``,t=0)=>{D.consumed+=e,D.index+=t},ve=e=>{D.output+=e.output==null?e.value:e.output,_e(e.value)},A=()=>{let e=1;for(;me()===`!`&&(me(2)!==`(`||me(3)===`?`);)he(),D.start++,e++;return e%2!=0&&(D.negated=!0,D.start++,!0)},ye=e=>{D[e]++,fe.push(e)},j=e=>{D[e]--,fe.pop()},M=e=>{if(O.type===`globstar`){let t=D.braces>0&&(e.type===`comma`||e.type===`brace`),n=e.extglob===!0||ue.length&&(e.type===`pipe`||e.type===`paren`);e.type!==`slash`&&e.type!==`paren`&&!t&&!n&&(D.output=D.output.slice(0,-O.output.length),O.type=`star`,O.value=`*`,O.output=le,D.output+=O.output)}if(ue.length&&e.type!==`paren`&&(ue[ue.length-1].inner+=e.value),(e.value||e.output)&&ve(e),O&&O.type===`text`&&e.type===`text`){O.output=(O.output||O.value)+e.value,O.value+=e.value;return}e.prev=O,h.push(e),O=e},be=(e,t)=>{let n={...v[t],conditions:1,inner:``};n.prev=O,n.parens=D.parens,n.output=D.output,n.startIndex=D.index,n.tokensIndex=h.length;let r=(d.capture?`(`:``)+n.open;ye(`parens`),M({type:e,value:t,output:D.output?``:w}),M({type:`paren`,extglob:!0,value:he(),output:r}),ue.push(n)},xe=n=>{let i=e.slice(n.startIndex,D.index+1),a=y(e.slice(n.startIndex+2,D.index),d);if((n.type===`plus`||n.type===`star`)&&a.risky){let e=a.safeOutput?(n.output?``:w)+(d.capture?`(${a.safeOutput})`:a.safeOutput):void 0,t=h[n.tokensIndex];t.type=`text`,t.value=i,t.output=e||r.escapeRegex(i);for(let e=n.tokensIndex+1;e<h.length;e++)h[e].value=``,h[e].output=``,delete h[e].suffix;D.output=n.output+t.output,D.backtrack=!0,M({type:`paren`,extglob:!0,value:k,output:``}),j(`parens`);return}let o=n.close+(d.capture?`)`:``),s;if(n.type===`negate`){let e=le;n.inner&&n.inner.length>1&&n.inner.includes(`/`)&&(e=oe(d)),(e!==le||pe()||/^\)+$/.test(ge()))&&(o=n.close=`)$))${e}`),n.inner.includes(`*`)&&(s=ge())&&/^\.[^\\/.]+$/.test(s)&&(o=n.close=`)${b(s,{...t,fastpaths:!1}).output})${e})`),n.prev.type===`bos`&&(D.negatedExtglob=!0)}M({type:`paren`,extglob:!0,value:k,output:o}),j(`parens`)};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let n=!1,i=e.replace(s,(e,t,r,i,a,o)=>i===`\\`?(n=!0,e):i===`?`?t?t+i+(a?E.repeat(a.length):``):o===0?ce+(a?E.repeat(a.length):``):E.repeat(r.length):i===`.`?x.repeat(r.length):i===`*`?t?t+i+(a?le:``):le:t?e:`\\${e}`);return n===!0&&(i=d.unescape===!0?i.replace(/\\/g,``):i.replace(/\\+/g,e=>e.length%2==0?`\\\\`:e?`\\`:``)),i===e&&d.contains===!0?(D.output=e,D):(D.output=r.wrapOutput(i,D,t),D)}for(;!pe();){if(k=he(),k===`\0`)continue;if(k===`\\`){let e=me();if(e===`/`&&d.bash!==!0||e===`.`||e===`;`)continue;if(!e){k+=`\\`,M({type:`text`,value:k});continue}let t=/^\\+/.exec(ge()),n=0;if(t&&t[0].length>2&&(n=t[0].length,D.index+=n,n%2!=0&&(k+=`\\`)),d.unescape===!0?k=he():k+=he(),D.brackets===0){M({type:`text`,value:k});continue}}if(D.brackets>0&&(k!==`]`||O.value===`[`||O.value===`[^`)){if(d.posix!==!1&&k===`:`){let e=O.value.slice(1);if(e.includes(`[`)&&(O.posix=!0,e.includes(`:`))){let e=O.value.lastIndexOf(`[`),t=O.value.slice(0,e),n=a[O.value.slice(e+2)];if(n){O.value=t+n,D.backtrack=!0,he(),!m.output&&h.indexOf(O)===1&&(m.output=w);continue}}}(k===`[`&&me()!==`:`||k===`-`&&me()===`]`)&&(k=`\\${k}`),k===`]`&&(O.value===`[`||O.value===`[^`)&&(k=`\\${k}`),d.posix===!0&&k===`!`&&O.value===`[`&&(k=`^`),O.value+=k,ve({value:k});continue}if(D.quotes===1&&k!==`"`){k=r.escapeRegex(k),O.value+=k,ve({value:k});continue}if(k===`"`){D.quotes=D.quotes===1?0:1,d.keepQuotes===!0&&M({type:`text`,value:k});continue}if(k===`(`){ye(`parens`),M({type:`paren`,value:k});continue}if(k===`)`){if(D.parens===0&&d.strictBrackets===!0)throw SyntaxError(u(`opening`,`(`));let e=ue[ue.length-1];if(e&&D.parens===e.parens+1){xe(ue.pop());continue}M({type:`paren`,value:k,output:D.parens?`)`:`\\)`}),j(`parens`);continue}if(k===`[`){if(d.nobracket===!0||!ge().includes(`]`)){if(d.nobracket!==!0&&d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));k=`\\${k}`}else ye(`brackets`);M({type:`bracket`,value:k});continue}if(k===`]`){if(d.nobracket===!0||O&&O.type===`bracket`&&O.value.length===1){M({type:`text`,value:k,output:`\\${k}`});continue}if(D.brackets===0){if(d.strictBrackets===!0)throw SyntaxError(u(`opening`,`[`));M({type:`text`,value:k,output:`\\${k}`});continue}j(`brackets`);let e=O.value.slice(1);if(O.posix!==!0&&e[0]===`^`&&!e.includes(`/`)&&(k=`/${k}`),O.value+=k,ve({value:k}),d.literalBrackets===!1||r.hasRegexChars(e))continue;let t=r.escapeRegex(O.value);if(D.output=D.output.slice(0,-O.value.length),d.literalBrackets===!0){D.output+=t,O.value=t;continue}O.value=`(${g}${t}|${O.value})`,D.output+=O.value;continue}if(k===`{`&&d.nobrace!==!0){ye(`braces`);let e={type:`brace`,value:k,output:`(`,outputIndex:D.output.length,tokensIndex:D.tokens.length};de.push(e),M(e);continue}if(k===`}`){let e=de[de.length-1];if(d.nobrace===!0||!e){M({type:`text`,value:k,output:k});continue}let t=`)`;if(e.dots===!0){let e=h.slice(),n=[];for(let t=e.length-1;t>=0&&(h.pop(),e[t].type!==`brace`);t--)e[t].type!==`dots`&&n.unshift(e[t].value);t=l(n,d),D.backtrack=!0}if(e.comma!==!0&&e.dots!==!0){let n=D.output.slice(0,e.outputIndex),r=D.tokens.slice(e.tokensIndex);e.value=e.output=`\\{`,k=t=`\\}`,D.output=n;for(let e of r)D.output+=e.output||e.value}M({type:`brace`,value:k,output:t}),j(`braces`),de.pop();continue}if(k===`|`){ue.length>0&&ue[ue.length-1].conditions++,M({type:`text`,value:k});continue}if(k===`,`){let e=k,t=de[de.length-1];t&&fe[fe.length-1]===`braces`&&(t.comma=!0,e=`|`),M({type:`comma`,value:k,output:e});continue}if(k===`/`){if(O.type===`dot`&&D.index===D.start+1){D.start=D.index+1,D.consumed=``,D.output=``,h.pop(),O=m;continue}M({type:`slash`,value:k,output:C});continue}if(k===`.`){if(D.braces>0&&O.type===`dot`){O.value===`.`&&(O.output=x);let e=de[de.length-1];O.type=`dots`,O.output+=k,O.value+=k,e.dots=!0;continue}if(D.braces+D.parens===0&&O.type!==`bos`&&O.type!==`slash`){M({type:`text`,value:k,output:x});continue}M({type:`dot`,value:k,output:x});continue}if(k===`?`){if(!(O&&O.value===`(`)&&d.noextglob!==!0&&me()===`(`&&me(2)!==`?`){be(`qmark`,k);continue}if(O&&O.type===`paren`){let e=me(),t=k;(O.value===`(`&&!/[!=<:]/.test(e)||e===`<`&&!/<([!=]|\w+>)/.test(ge()))&&(t=`\\${k}`),M({type:`text`,value:k,output:t});continue}if(d.dot!==!0&&(O.type===`slash`||O.type===`bos`)){M({type:`qmark`,value:k,output:re});continue}M({type:`qmark`,value:k,output:E});continue}if(k===`!`){if(d.noextglob!==!0&&me()===`(`&&(me(2)!==`?`||!/[!=<:]/.test(me(3)))){be(`negate`,k);continue}if(d.nonegate!==!0&&D.index===0){A();continue}}if(k===`+`){if(d.noextglob!==!0&&me()===`(`&&me(2)!==`?`){be(`plus`,k);continue}if(O&&O.value===`(`||d.regex===!1){M({type:`plus`,value:k,output:S});continue}if(O&&(O.type===`bracket`||O.type===`paren`||O.type===`brace`)||D.parens>0){M({type:`plus`,value:k});continue}M({type:`plus`,value:S});continue}if(k===`@`){if(d.noextglob!==!0&&me()===`(`&&me(2)!==`?`){M({type:`at`,extglob:!0,value:k,output:``});continue}M({type:`text`,value:k});continue}if(k!==`*`){(k===`$`||k===`^`)&&(k=`\\${k}`);let e=o.exec(ge());e&&(k+=e[0],D.index+=e[0].length),M({type:`text`,value:k});continue}if(O&&(O.type===`globstar`||O.star===!0)){O.type=`star`,O.star=!0,O.value+=k,O.output=le,D.backtrack=!0,D.globstar=!0,_e(k);continue}let t=ge();if(d.noextglob!==!0&&/^\([^?]/.test(t)){be(`star`,k);continue}if(O.type===`star`){if(d.noglobstar===!0){_e(k);continue}let n=O.prev,r=n.prev,i=n.type===`slash`||n.type===`bos`,a=r&&(r.type===`star`||r.type===`globstar`);if(d.bash===!0&&(!i||t[0]&&t[0]!==`/`)){M({type:`star`,value:k,output:``});continue}let o=D.braces>0&&(n.type===`comma`||n.type===`brace`),s=ue.length&&(n.type===`pipe`||n.type===`paren`);if(!i&&n.type!==`paren`&&!o&&!s){M({type:`star`,value:k,output:``});continue}for(;t.slice(0,3)===`/**`;){let n=e[D.index+4];if(n&&n!==`/`)break;t=t.slice(3),_e(`/**`,3)}let c=pe()||D.parens>0&&t===`)`.repeat(D.parens)&&!ue.some(e=>e.type===`negate`);if(n.type===`bos`&&pe()){O.type=`globstar`,O.value+=k,O.output=oe(d),D.output=O.output,D.globstar=!0,_e(k);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&!a&&c){D.output=D.output.slice(0,-(n.output+O.output).length),n.output=`(?:${n.output}`,O.type=`globstar`,O.output=oe(d)+(d.strictSlashes?`)`:`|$)`),O.value+=k,D.globstar=!0,D.output+=n.output+O.output,_e(k);continue}if(n.type===`slash`&&n.prev.type!==`bos`&&t[0]===`/`){let e=t[1]===void 0?``:`|$`;D.output=D.output.slice(0,-(n.output+O.output).length),n.output=`(?:${n.output}`,O.type=`globstar`,O.output=`${oe(d)}${C}|${C}${e})`,O.value+=k,D.output+=n.output+O.output,D.globstar=!0,_e(k+he()),M({type:`slash`,value:`/`,output:``});continue}if(n.type===`bos`&&t[0]===`/`){O.type=`globstar`,O.value+=k,O.output=`(?:^|${C}|${oe(d)}${C})`,D.output=O.output,D.globstar=!0,_e(k+he()),M({type:`slash`,value:`/`,output:``});continue}D.output=D.output.slice(0,-O.output.length),O.type=`globstar`,O.output=oe(d),O.value+=k,D.output+=O.output,D.globstar=!0,_e(k);continue}let n={type:`star`,value:k,output:le};if(d.bash===!0){n.output=`.*?`,(O.type===`bos`||O.type===`slash`)&&(n.output=se+n.output),M(n);continue}if(O&&(O.type===`bracket`||O.type===`paren`)&&d.regex===!0){n.output=k,M(n);continue}(D.index===D.start||O.type===`slash`||O.type===`dot`)&&(O.type===`dot`?(D.output+=te,O.output+=te):d.dot===!0?(D.output+=ne,O.output+=ne):(D.output+=se,O.output+=se),me()!==`*`&&(D.output+=w,O.output+=w)),M(n)}for(;D.brackets>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`]`));D.output=r.escapeLast(D.output,`[`),j(`brackets`)}for(;D.parens>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`)`));D.output=r.escapeLast(D.output,`(`),j(`parens`)}for(;D.braces>0;){if(d.strictBrackets===!0)throw SyntaxError(u(`closing`,`}`));D.output=r.escapeLast(D.output,`{`),j(`braces`)}if(d.strictSlashes!==!0&&(O.type===`star`||O.type===`bracket`)&&M({type:`maybe_slash`,value:``,output:`${C}?`}),D.backtrack===!0){D.output=``;for(let e of D.tokens)D.output+=e.output==null?e.value:e.output,e.suffix&&(D.output+=e.suffix)}return D};b.fastpaths=(e,t)=>{let a={...t},o=typeof a.maxLength==`number`?Math.min(i,a.maxLength):i,s=e.length;if(s>o)throw SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${o}`);e=c[e]||e;let{DOT_LITERAL:l,SLASH_LITERAL:u,ONE_CHAR:d,DOTS_SLASH:f,NO_DOT:p,NO_DOTS:m,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:_}=n.globChars(a.windows),v=a.dot?m:p,y=a.dot?h:p,b=a.capture?``:`?:`,x={negated:!1,prefix:``},S=a.bash===!0?`.*?`:g;a.capture&&(S=`(${S})`);let C=e=>e.noglobstar===!0?S:`(${b}(?:(?!${_}${e.dot?f:l}).)*?)`,w=e=>{switch(e){case`*`:return`${v}${d}${S}`;case`.*`:return`${l}${d}${S}`;case`*.*`:return`${v}${S}${l}${d}${S}`;case`*/*`:return`${v}${S}${u}${d}${y}${S}`;case`**`:return v+C(a);case`**/*`:return`(?:${v}${C(a)}${u})?${y}${d}${S}`;case`**/*.*`:return`(?:${v}${C(a)}${u})?${y}${S}${l}${d}${S}`;case`**/.*`:return`(?:${v}${C(a)}${u})?${l}${d}${S}`;default:{let t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;let n=w(t[1]);return n?n+l+t[2]:void 0}}},ee=w(r.removePrefix(e,x));return ee&&a.strictSlashes!==!0&&(ee+=`${u}?`),ee},t.exports=b})),st=de(((e,t)=>{var n=at(),r=ot(),i=it(),a=rt(),o=e=>e&&typeof e==`object`&&!Array.isArray(e),s=(e,t,n=!1)=>{if(Array.isArray(e)){let r=e.map(e=>s(e,t,n));return e=>{for(let t of r){let n=t(e);if(n)return n}return!1}}let r=o(e)&&e.tokens&&e.input;if(e===``||typeof e!=`string`&&!r)throw TypeError(`Expected pattern to be a non-empty string`);let i=t||{},a=i.windows,c=r?s.compileRe(e,t):s.makeRe(e,t,!1,!0),l=c.state;delete c.state;let u=()=>!1;if(i.ignore){let e={...t,ignore:null,onMatch:null,onResult:null};u=s(i.ignore,e,n)}let d=(n,r=!1)=>{let{isMatch:o,match:d,output:f}=s.test(n,c,t,{glob:e,posix:a}),p={glob:e,state:l,regex:c,posix:a,input:n,output:f,match:d,isMatch:o};return typeof i.onResult==`function`&&i.onResult(p),o===!1?(p.isMatch=!1,r?p:!1):u(n)?(typeof i.onIgnore==`function`&&i.onIgnore(p),p.isMatch=!1,r?p:!1):(typeof i.onMatch==`function`&&i.onMatch(p),!r||p)};return n&&(d.state=l),d};s.test=(e,t,n,{glob:r,posix:a}={})=>{if(typeof e!=`string`)throw TypeError(`Expected input to be a string`);if(e===``)return{isMatch:!1,output:``};let o=n||{},c=o.format||(a?i.toPosixSlashes:null),l=e===r,u=l&&c?c(e):e;return l===!1&&(u=c?c(e):e,l=u===r),(l===!1||o.capture===!0)&&(l=o.matchBase===!0||o.basename===!0?s.matchBase(e,t,n,a):t.exec(u)),{isMatch:!!l,match:l,output:u}},s.matchBase=(e,t,n,r=n&&n.windows)=>(t instanceof RegExp?t:s.makeRe(t,n)).test(i.basename(e,{windows:r})),s.isMatch=(e,t,n)=>s(t,n)(e),s.parse=(e,t)=>Array.isArray(e)?e.map(e=>s.parse(e,t)):r(e,{...t,fastpaths:!1}),s.scan=(e,t)=>n(e,t),s.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;let i=t||{},a=i.contains?``:`^`,o=i.contains?``:`$`,c=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(c=`^(?!${c}).*$`);let l=s.toRegex(c,t);return r===!0&&(l.state=e),l},s.makeRe=(e,t={},n=!1,i=!1)=>{if(!e||typeof e!=`string`)throw TypeError(`Expected a non-empty string`);let a={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]===`.`||e[0]===`*`)&&(a.output=r.fastpaths(e,t)),a.output||(a=r(e,t)),s.compileRe(a,t,n,i)},s.toRegex=(e,t)=>{try{let n=t||{};return new RegExp(e,n.flags||(n.nocase?`i`:``))}catch(e){if(t&&t.debug===!0)throw e;return/$^/}},s.constants=a,t.exports=s})),ct=de(((e,t)=>{var n=st(),r=it();function i(e,t,i=!1){return t&&(t.windows===null||t.windows===void 0)&&(t={...t,windows:r.isWindows()}),n(e,t,i)}Object.assign(i,n),t.exports=i})),lt=le(ct(),1),ut=[`**/*.generated.*`,`**/pnpm-lock.yaml`,`**/yarn.lock`,`**/package-lock.json`,`**/Cargo.lock`,`**/go.sum`,`**/dist/**`,`**/*.lock`],dt=[{category:`docs`,patterns:[`**/*.md`,`**/*.mdx`,`**/*.mdc`,`**/docs/**`,`**/README*`]},{category:`code`},{category:`tests`,patterns:[`**/*.test.*`,`**/*.spec.*`,`**/__tests__/**`,`**/test/**`,`**/tests/**`]},{category:`config`,patterns:[`*.config.*`,`.*rc`,`.*rc.*`,`.github/**`,`.git*`,`**/tsconfig*.json`,`**/Dockerfile`,`**/docker-compose*.y*ml`,`**/.dockerignore`,`**/Makefile`]},{category:`deps`,patterns:[`**/package.json`,`**/pnpm-workspace.yaml`,`**/Cargo.toml`,`**/go.mod`]},{category:`generated`,patterns:ut},{category:`other`}],ft=`llm adapter is not configured: add a gateway token or a vendor API key in Settings`;function pt(e,t,n,r){return{id:e,name:e,api:t,provider:n,baseUrl:r,reasoning:!1,input:[`text`],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:16e3}}function mt(){let e=o.value.llm;switch(e.provider){case`gateway`:return e.gatewayToken?{model:pt(e.gatewayModel,`anthropic-messages`,`vercel-ai-gateway`,`https://ai-gateway.vercel.sh`),apiKey:e.gatewayToken}:void 0;case`anthropic`:return e.anthropicApiKey?{model:pt(e.anthropicModel,`anthropic-messages`,`anthropic`,`https://api.anthropic.com`),apiKey:e.anthropicApiKey}:void 0;case`openai-compatible`:return e.openaiApiKey?{model:pt(e.openaiModel,`openai-completions`,`openai-compatible`,e.openaiBaseUrl),apiKey:e.openaiApiKey}:void 0}}function ht(e,t){let n=new Set(e.files.map(e=>e.path)),r=new Set,i=[];for(let e of t.groups){let t=e.filePaths.filter(e=>n.has(e)&&!r.has(e));t.forEach(e=>r.add(e));let a=e.children?.map(e=>({...e,filePaths:e.filePaths.filter(e=>!n.has(e)||r.has(e)?!1:(r.add(e),!0))})).filter(e=>e.filePaths.length>0);(t.length!==0||a?.length)&&i.push({...e,filePaths:t,children:a?.length?a:void 0})}let a=e.files.map(e=>e.path).filter(e=>!r.has(e));return a.length>0&&i.push({key:`llm-unassigned`,label:`Other`,filePaths:a}),i}function gt(e,t){let n={overallSummary:t.overallSummary,groups:ht(e,t),schemaVersion:1};return ce(`llm`,n)}async function _t(e,t){let n=mt();if(!n)throw Error(ft);let{runAgent:r}=await W(async()=>{let{runAgent:e}=await import(`./agent-SYDXCLiI.js`).then(e=>e.t);return{runAgent:e}},__vite__mapDeps([0,1,2,3,4,5])),{analysis:i,transcript:a}=await r(e,n,t);return{result:gt(e,i),transcript:a}}var vt={id:`llm`,get available(){return mt()!==void 0},async analyze(e,t){return(await _t(e,t)).result}};function yt(e){let t=[],n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=a===`|`&&i>0&&e[i-1]===`\\`;a===`|`&&!o?(r&&n&&(t.push(n.length),n=``),r=!0):r&&(n+=a)}return r&&n&&t.push(n.length),t}function bt(e){let t=[],n=``,r=!1;for(let i=0;i<e.length;i++){let a=e[i],o=a===`|`&&i>0&&e[i-1]===`\\`;a===`|`&&!o?(r&&(t.push(n.trim()),n=``),r=!0):r&&(n+=a)}return n.trim()&&t.push(n.trim()),t}function xt(e){let t=e.split(`
3
- `),n=[],r=-1;for(let e=0;e<t.length;e++)t[e].trim().startsWith(`|`)?r===-1&&(r=e):r!==-1&&(n.push({start:r,end:e-1}),r=-1);if(r!==-1&&n.push({start:r,end:t.length-1}),n.length===0)return e;let{start:i,end:a}=n[n.length-1];t[i].trim().endsWith(`|`)||(t[i]+=` |`);let o=yt(t[i].trim()).length,s=()=>`| `+Array(o).fill(`---`).join(` | `)+` |`,c=a-i>=1?t[i+1].trim():``,l=c.startsWith(`|`)&&(c.includes(`-`)||c.includes(`:`)),u=t[a].trim();if(u.startsWith(`|`)&&(u.includes(`-`)||u.includes(`:`))){let e=bt(u).map(e=>{let t=e.startsWith(`:`),n=e.endsWith(`:`)&&e.length>1,r=e.replace(/^:/,``).replace(/:$/,``);if(t&&n)return r.length<1&&(r=`-`),`:`+r+`:`;if(t)return r.length<1&&(r=`-`),`:`+r;if(n)return r.length<1&&(r=`-`),r+`:`;for(;r.length<3;)r+=`-`;return r});for(;e.length<o;)e.push(`---`);t[a]=`| `+e.join(` | `)+` |`}else if(u.startsWith(`|`)&&!u.endsWith(`|`)){let e=t[i].trim();for(let n=i+(l?2:1);n<a;n++){let r=t[n].trim();if(r.startsWith(`|`)&&r.endsWith(`|`)&&!r.includes(`-`)){e=r;break}}let n=yt(e),r=bt(u),o=r[r.length-1]??``,s=/(?:\*\*?|__?|~~|`|\$)$/.test(o)||/(?:\*\*|__|~~|`)[^\s*_~`]+$/.test(o),c=`| `+r.map((e,t)=>{let r=n[t]||e.length+2;return e+` `.repeat(Math.max(0,r-e.length-2))}).join(` | `);t[a]=s?c:c+` |`}return l||t.splice(i+1,0,s()),t.join(`
4
- `)}function St(e,t={}){if(!e)return e;let n=t.syntax!==!1,r=t.attributes??n,i=t.linkMode??`protocol`,a=t.incompleteLinkPlaceholder??`comark:incomplete-link`,o=t.incompleteImagePlaceholder??`comark:incomplete-image`,s=t.math===!0;t.dropTrailingOpeners===!0&&(e=Dt(e));let c=e.split(`
5
- `),l=c.length,u=!1,d=!1,f=-1,p=null,m=!1,h=!1,g=[],_=/^<(script|pre|style|textarea)(\s|>|$)/i;for(let e=0;e<l;e++){let r=c[e],i=r.trim();if(p){RegExp(`</${p}\\s*>`,`i`).test(r)&&(p=null);continue}let a=i.match(_);if(a){let e=a[1].toLowerCase();RegExp(`</${e}\\s*>`,`i`).test(r)||(p=e);continue}if(Ct(r)){let e=r.trim();if(e.startsWith("```")&&e.endsWith("``")&&!e.endsWith("```")&&!e.slice(3).includes("```"))continue;m=!m;continue}if(!m){if(s&&i===`$$`){h=!h;continue}if(e===0&&t.frontmatter&&i===`---`){u=!0;continue}if(u){i===`---`?u=!1:i&&(d=!0);continue}if(i===`---`&&g.length>0){let e=g[g.length-1];e.hasYamlProps=!e.hasYamlProps;continue}if(i.startsWith(`|`)?f=f===-1?e:f:f!==-1&&(f=-1),e===l-1&&n&&i[0]===`:`&&g.length===0){let t=0;for(;t<i.length&&i[t]===`:`;)t++;i.slice(t).trim()===``&&(c[e]=``)}if(n&&i[0]===`:`){let e=0;for(;e<i.length&&i[e]===`:`;)e++;if(e>=2){let t=0;for(;t<r.length&&(r[t]===` `||r[t]===` `);)t++;let n=r.slice(0,t),a=i[e]??``;if(a>=`a`&&a<=`z`||a>=`A`&&a<=`Z`||a===`$`){let t=e;for(;t<i.length;){let e=i[t];if(!(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`$`||e===`.`||e===`-`||e===`_`))break;t++}g.push({depth:e,name:i.slice(e,t),indent:n,hasYamlProps:!1})}else e===i.length&&g.length>0&&g[g.length-1].depth===e&&g.pop()}}}}if(!m&&!u&&!h){let e=l-1;for(;e>0&&c[e]===``;)e--;let t=e>=0?c[e]:``,n=t.trim(),u=n.startsWith("```")&&n.endsWith("``")&&!n.endsWith("```");t!==``&&n!==`$$`&&(!Ct(t)||u)&&(c[e]=Ot(t,{attributesEnabled:r,linkMode:i,linkPh:a,imagePh:o,math:s}))}let v=c.join(`
6
- `);if(v=Pt(v),f!==-1&&(v=xt(v)),s&&h&&(v+=v.endsWith(`
7
- `)?`$$`:`
8
- $$`),u&&d){let e=(v.includes(`
9
- `)?v.slice(v.lastIndexOf(`
10
- `)+1):v).trim().replace(/\u200B/g,``);e===`-`||e===`--`?v=v.replace(/\u200B+$/,``)+`-`.repeat(3-e.length):v+=v.endsWith(`
11
- `)?`---`:`
12
- ---`}if(n&&e.includes(`::`)){let e=v.lastIndexOf(`
13
- `)+1,t=v.slice(e),n=-1;for(let e=t.length-1;e>=0&&t[e]!==`}`;e--)if(t[e]===`{`){n=e;break}if(n>=0){let e=t.slice(n+1),r=0,i=0;for(let t=0;t<e.length;t++)e[t]===`"`&&r++,e[t]===`'`&&i++;v+=(r%2==1?`"`:``)+(i%2==1?`'`:``)+`}`}if(g.length>0){let e=g[g.length-1],t=v.slice(v.lastIndexOf(`
14
- `)+1).trim().replace(/\u200B/g,``);e.hasYamlProps&&(t===`-`||t===`--`)&&(v=v.replace(/\u200B+$/,``)+`-`.repeat(3-t.length),e.hasYamlProps=!1);let n=[];for(;g.length;){let e=g.pop();e.hasYamlProps&&n.push(e.indent+`---`),n.push(e.indent+`:`.repeat(e.depth))}v+=`
15
- `+n.join(`
16
- `)}}return v}function Ct(e){let t=0;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;let n=e[t];if(n!=="`"&&n!==`~`)return!1;let r=0;for(;t+r<e.length&&e[t+r]===n;)r++;return r>=3}function wt(e){if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95}function Tt(e){return e===``||e===` `||e===` `||e===`
17
- `}var Et=`*_$:[{!`;function Dt(e){let t=e.length;for(;t>0;){let n=e[t-1];if(n===` `||n===` `||n===`
18
- `||n===`\r`)t--;else break}if(t===0)return e;let n=t;for(;n>0&&Et.includes(e[n-1])&&!(n>=2&&e[n-2]===`\\`);)n--;if(n===t)return e;let r=n>0?e[n-1]:``;if(r!==``&&r!==` `&&r!==` `&&r!==`
19
- `&&r!==`\r`)return e;let i=n;return i>0&&(e[i-1]===` `||e[i-1]===` `)&&i--,e.slice(0,i)+e.slice(t)}function Ot(e,t){if(e.endsWith(` `)&&!e.endsWith(` `)){let t=e.lastIndexOf(`
20
- `),n=t===-1?e:e.slice(t+1);/^[ \t]*[A-Za-z_][\w.-]*: $/.test(n)||(e=e.slice(0,-1))}let n=e.length,r=[],i=[],a=!1,o=!1,s=!1,c=!1,l=!1,u=!1,d=0,f=0,p=0,m=!1,h=-1,g=0,_=0,v=0,y=(e,t,n)=>{let r=!Tt(t)&&i[i.length-1]===e,a=!Tt(n);r?i.pop():a&&i.push(e)},b=e=>{i[i.length-1]===e?i.pop():i.push(e)};for(let x=0;x<n;x++){let S=e[x],C=x>0?e[x-1]:``,w=x+1<n?e[x+1]:``;if(S===`
21
- `){r.push(S),f=x+1;continue}if(x===f||x>0&&e[x-1]===`
22
- `){let t=x;for(;t<n&&(e[t]===` `||e[t]===` `);)t++;let i=e[t];if(i==="`"||i===`~`){let o=0;for(;t+o<n&&e[t+o]===i;)o++;if(o>=3){let o=t;for(;o<n&&e[o]!==`
23
- `;)o++;let s=e.slice(t,o);if(i==="`"&&s.startsWith("```")&&s.endsWith("``")&&!s.endsWith("```")&&!s.slice(3).includes("```")){for(;x<o;)r.push(e[x]),x++;r.push("`"),x--;continue}for(a=!a;x<n&&e[x]!==`
24
- `;)r.push(e[x]),x++;x<n?(r.push(`
25
- `),f=x+1):x--;continue}}}if(a){r.push(S);continue}if(S===`\\`){r.push(S),x+1<n&&r.push(e[++x]);continue}if(S===`>`){let t=x;for(;t>0&&e[t-1]!==`
26
- `;)t--;let n=e.slice(t,x);if(/^(\s*(?:[-*+]|\d+[.)]) +)$/.test(n)&&/^=?\s*\$?\d/.test(e.slice(x+1))){r.push(`\\`,`>`);continue}}if(S===`~`&&w!==`~`&&C!==`~`&&wt(C)&&wt(w)&&!o&&!s&&!c&&!Ft(e,x)){r.push(`\\`,`~`);continue}if(S===`<`&&(w>=`a`&&w<=`z`||w>=`A`&&w<=`Z`||w===`/`)&&(h=r.length),S===`>`&&(h=-1),o){r.push(S),S==="`"&&w!=="`"&&C!=="`"&&(o=!1,i[i.length-1]==="`"&&i.pop());continue}if(c){r.push(S),S===`$`&&w===`$`&&(r.push(`$`),x++,c=!1,i[i.length-1]===`$$`&&i.pop());continue}if(s){r.push(S),S===`$`&&w!==`$`&&(s=!1,i[i.length-1]===`$`&&i.pop());continue}if(l){r.push(S),S===`\\`&&w===`)`&&(r.push(`)`),x++,l=!1);continue}if(u){r.push(S),S===`\\`&&w===`]`&&(r.push(`]`),x++,u=!1);continue}if(t.attributesEnabled&&S===`{`&&C&&C!==` `&&C!==` `&&C!==`
27
- `){d++,r.push(S);continue}if(t.attributesEnabled&&S===`}`){d>0&&d--,r.push(S);continue}if(d>0){r.push(S);continue}if(S===`[`){p++,r.push(S);continue}if(S===`]`){p>0&&p--,r.push(S),w===`(`&&(m=!0);continue}if(m){r.push(S),S===`)`&&p===0&&(m=!1);continue}if(p>0){r.push(S);continue}if(S==="`"){if(w==="`"&&e[x+2]==="`"){r.push("`","`","`"),x+=2;continue}r.push(S),o=!0,i.push("`");continue}if(S===`$`){r.push(S),w===`$`?(r.push(`$`),x++,t.math&&(c=!c,b(`$$`))):t.math&&It(e,x)&&(s=!0,i.push(`$`));continue}if(S===`*`){let t=x;for(;t+1<n&&e[t+1]===`*`;)t++;let a=t-x+1,o=t+1<n?e[t+1]:``,s=Tt(C),c=Tt(o),l=a===1&&s&&c;for(let e=x;e<=t;e++)r.push(`*`);if(!l){if(a===1&&wt(C)&&wt(o)&&g%2==0){x=t;continue}if(g+=a,a===1)y(`*`,C,o);else if(a===2)_++,y(`**`,C,o);else if(a>=3){let r=x;for(;r>0&&e[r-1]!==`
28
- `;)r--;let c=t+1;for(;c<n&&e[c]!==`
29
- `;)c++;let l=e.slice(r,c),u=!0;for(let e=0;e<l.length;e++){let t=l[e];if(t!==`*`&&t!==` `&&t!==` `){u=!1;break}}if(u){x=t;continue}if(a===3){let e=i.includes(`*`),t=i.includes(`**`);if(e&&t&&!s){for(let e=i.length-1;e>=0;e--)(i[e]===`*`||i[e]===`**`)&&i.splice(e,1);_++}else v++,y(`***`,C,o)}else{let e=Math.floor(a/2);for(let t=0;t<e;t++)_++,y(`**`,C,o);a%2==1&&y(`*`,C,o)}x=t;continue}}x=t;continue}if(S===`_`){let t=x;for(;t+1<n&&e[t+1]===`_`;)t++;let i=t-x+1,a=t+1<n?e[t+1]:``,o=Tt(C)&&Tt(a);for(let e=x;e<=t;e++)r.push(`_`);if(i>=3){let r=x;for(;r>0&&e[r-1]!==`
30
- `;)r--;let i=t+1;for(;i<n&&e[i]!==`
31
- `;)i++;let a=e.slice(r,i),o=!0;for(let e=0;e<a.length;e++){let t=a[e];if(t!==`_`&&t!==` `&&t!==` `){o=!1;break}}if(o){x=t;continue}}if(!(wt(C)&&wt(a))&&!o){if(i===1)y(`_`,C,a);else if(i>=2){let e=Math.floor(i/2);for(let t=0;t<e;t++)y(`__`,C,a);i%2==1&&y(`_`,C,a)}}x=t;continue}if(S===`~`){let t=x;for(;t+1<n&&e[t+1]===`~`;)t++;let i=t-x+1,a=t+1<n?e[t+1]:``,o=Tt(C)&&Tt(a);for(let e=x;e<=t;e++)r.push(`~`);if(!o&&i>=2){let e=Math.floor(i/2);for(let t=0;t<e;t++)y(`~~`,C,a)}x=t;continue}r.push(S)}let x=r.join(``);h>=0&&(x=kt(x));let S=Mt(x,t);if(S!==x){if(t.linkMode===`protocol`&&(S.endsWith(`](${t.linkPh})`)||S.endsWith(`](${t.imagePh})`)))return S;x=S}if(i.length===0||At(x))return x;if(o){let e=x.lastIndexOf("`");if((e>=0?x.slice(e+1):``).length>0){let e=-1;for(let t=0;t<i.length;t++)i[t]==="`"&&(e=t);let t=``;if(e>0)for(let n=e-1;n>=0;n--){let e=i[n];(e===`**`||e===`*`||e===`__`||e===`_`||e===`~~`||e===`***`)&&(t+=e)}for(let n=i.length-1;n>e;n--){let e=i[n];(e===`**`||e===`*`||e===`__`||e===`_`||e===`~~`||e===`***`)&&(t+=e)}return x+t+"`"}return x}return x=jt(x,i,{asteriskTotal:g,doubleAsteriskCount:_,tripleCount:v}),x}function kt(e){for(let t=e.length-1;t>=0;t--){if(e[t]===`>`||e[t]===`
32
- `)return e;if(e[t]===`<`){let n=e[t+1]??``;return n>=`a`&&n<=`z`||n>=`A`&&n<=`Z`||n===`/`?e.slice(0,t).replace(/[ \t]+$/,``):e}}return e}function At(e){let t=e.lastIndexOf(`
33
- `),n=(t===-1?e:e.slice(t+1)).trim();return n?!!(n===`*`||n===`**`||n===`***`||n===`****`||n===`_`||n===`__`||n===`___`||n===`~`||n===`~~`||n==="`"||/^\*{3,}$/.test(n)||/^_{3,}$/.test(n)||/^-{3,}$/.test(n)):!1}function jt(e,t,n){if(/\*\*\*[^*]+\*{1,2}$/.test(e)&&!/\*{3}$/.test(e)){let r=e.match(/\*+$/)?.[0].length??0;if(r>=1&&r<=2&&(t.includes(`***`)||n.tripleCount%2==1))return e+`*`.repeat(3-r)}if(/\*\*[^*]+\*$/.test(e)&&t.includes(`**`)&&!t.includes(`***`))return e+`*`;if(/__[^_]+_$/.test(e)&&t.includes(`__`))return e+`_`;if(/~~[^~]+~$/.test(e)&&t.includes(`~~`))return e+`~`;let r=n.doubleAsteriskCount>=2&&n.doubleAsteriskCount%2==0&&n.asteriskTotal%2==0,i=t.slice();r&&(i=i.filter(e=>e!==`***`&&e!==`**`&&e!==`*`));let a=[];for(let t=i.length-1;t>=0;t--){let n=i[t];if(n===`$$`){a.push(`$$`);continue}if(n===`$`){a.push(`$`);continue}if(n==="`")continue;let r=n,o=e.lastIndexOf(r);o<0||Lt(e.slice(o+r.length))&&a.push(n)}if(a.length===0)return e;if(a.includes(`*`)||a.includes(`**`)||a.includes(`***`)){let e=null;for(let t of a)if(t===`*`||t===`**`||t===`***`){e=t;break}if(e===`*`&&a.includes(`**`)&&!a.includes(`***`)&&a[0]===`*`)for(let e=a.length-1;e>=0;e--)(a[e]===`**`||a[e]===`***`)&&a.splice(e,1)}let o=``;for(let t of a)if(t===`$$`){if(e.endsWith(`$`)&&!e.endsWith(`$$`))o+=`$`;else{let t=e.indexOf(`$$`),n=t!==-1&&e.indexOf(`
34
- `,t)!==-1;o+=n&&!e.endsWith(`
35
- `)?`
36
- $$`:`$$`}}else o+=t;if(e.endsWith(` `)&&!e.endsWith(` `))return e.slice(0,-1)+o;let s=e.length;for(;s>0&&e[s-1]===`
37
- `;)s--;return s<e.length?e.slice(0,s)+o+e.slice(s):e+o}function Mt(e,t){let n=e.lastIndexOf(`](`);if(n!==-1&&!e.slice(n+2).includes(`)`)&&!Nt(e,n)){let r=1,i=-1;for(let t=n-1;t>=0;t--)if(e[t]===`]`)r++;else if(e[t]===`[`&&(r--,r===0)){i=t;break}if(i>=0&&!Nt(e,i)){let r=i>0&&e[i-1]===`!`,a=r?i-1:i,o=e.slice(0,a),s=e.slice(i+1,n);return r?`${o}![${s}](${t.imagePh})`:t.linkMode===`text-only`?o+s:`${o}[${s}](${t.linkPh})`}}for(let n=e.length-1;n>=0;n--){if(e[n]!==`[`||Nt(e,n))continue;let r=n>0&&e[n-1]===`!`,i=1,a=-1;for(let t=n+1;t<e.length;t++)if(e[t]===`[`)i++;else if(e[t]===`]`&&(i--,i===0)){a=t;break}if(a===-1){let i=r?n-1:n,a=e.slice(0,i);return r?`${a}![${e.slice(n+1)}](${t.imagePh})`:t.linkMode===`text-only`?e.slice(0,n)+e.slice(n+1):`${e}](${t.linkPh})`}if(r&&(a===e.length-1||e[a+1]!==`(`)&&e.slice(a+1).trim()===``)return`${e.slice(0,n-1)}![${e.slice(n+1,a)}](${t.imagePh})`}return e}function Nt(e,t){let n=!1,r=0;for(;r<t;){if(r===0||e[r-1]===`
38
- `){let t=r;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;let i=e[t];if(i==="`"||i===`~`){let a=0;for(;t+a<e.length&&e[t+a]===i;)a++;if(a>=3){for(n=!n;r<e.length&&e[r]!==`
39
- `;)r++;r<e.length&&r++;continue}}}r++}return n}function Pt(e){let t=e.lastIndexOf(`
40
- `);if(t===-1)return e;let n=e.slice(t+1),r=n.trim();if(!/^(-{1,2}|={1,2})$/.test(r)||/\s$/.test(n)&&n!==r)return e;let i=e.slice(0,t),a=i.lastIndexOf(`
41
- `),o=(a===-1?i:i.slice(a+1)).trim();return!o||o===`---`||/^[A-Za-z_][\w.-]*\s*:/.test(o)?e:e+`​`}function Ft(e,t){let n=t=>{if(e[t]!==`~`)return!1;let n=t>0?e[t-1]:``,r=t+1<e.length?e[t+1]:``;return n!==`~`&&r!==`~`},r=(t,n)=>{if(n-t<1)return!1;for(let r=t;r<n;r++){let t=e[r];if(t===`~`||t===` `||t===` `||t===`
42
- `||t===`\r`)return!1}return!0};for(let i=t-1;i>=0&&e[i]!==`
43
- `;i--)if(e[i]===`~`)return!n(i)||!wt(i>0?e[i-1]:``)||!wt(t+1<e.length?e[t+1]:``)?!1:r(i+1,t);for(let i=t+1;i<e.length&&e[i]!==`
44
- `;i++)if(e[i]===`~`)return!n(i)||!wt(t>0?e[t-1]:``)||!wt(i+1<e.length?e[i+1]:``)?!1:r(t+1,i);return!1}function It(e,t){let n=t+1<e.length?e[t+1]:``;return!(!n||n===` `||n===` `||n===`
45
- `||n>=`0`&&n<=`9`||(t>0?e[t-1]:``)===`:`)}function Lt(e){for(let t=0;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
46
- `&&n!==`\r`&&n!==`*`&&n!==`_`&&n!==`~`&&n!=="`")return!0}return!1}function Rt(e){if(typeof e==`string`||e.length<2)return e;let[t,n,...r]=e,i=r.filter(e=>typeof e!=`string`||e&&e.trim());if(i.length===0)return e;if(i.length>1||typeof i[0]==`string`||i[0][0]!==`p`)return[t,n,...r.map(e=>Rt(e))];let a=i[0][1];return[t,a&&Object.keys(a).length>0?{...a,...n}:n,...i[0].slice(2)]}var zt=Object.defineProperty,Bt=(e,t)=>{let n={};for(var r in e)zt(n,r,{get:e[r],enumerable:!0});return t&&zt(n,Symbol.toStringTag,{value:`Module`}),n},Vt=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Ht=String.fromCodePoint??(e=>{let t=``;return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t});function Ut(e){return e>=55296&&e<=57343||e>1114111?65533:Vt.get(e)??e}function Wt(e){let t=typeof atob==`function`?atob(e):typeof Buffer.from==`function`?Buffer.from(e,`base64`).toString(`binary`):new Buffer(e,`base64`).toString(`binary`),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return r}var Gt=Wt(`QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg`),Kt;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(Kt||={});var qt;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(qt||={});var Jt=32;function Yt(e){return e>=qt.ZERO&&e<=qt.NINE}function Xt(e){return e>=qt.UPPER_A&&e<=qt.UPPER_F||e>=qt.LOWER_A&&e<=qt.LOWER_F}function Zt(e){return e>=qt.UPPER_A&&e<=qt.UPPER_Z||e>=qt.LOWER_A&&e<=qt.LOWER_Z||Yt(e)}function Qt(e){return e===qt.EQUALS||Zt(e)}var $t;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})($t||={});var en;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(en||={});var tn=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=$t.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=en.Strict,this.runConsumed=0}startEntity(e){this.decodeMode=e,this.state=$t.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case $t.EntityStart:return e.charCodeAt(t)===qt.NUM?(this.state=$t.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=$t.NamedEntity,this.stateNamedEntity(e,t));case $t.NumericStart:return this.stateNumericStart(e,t);case $t.NumericDecimal:return this.stateNumericDecimal(e,t);case $t.NumericHex:return this.stateNumericHex(e,t);case $t.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Jt)===qt.LOWER_X?(this.state=$t.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=$t.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(Yt(n)||Xt(n)){let e=n<=qt.NINE?n-qt.ZERO:(n|Jt)-qt.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(Yt(n))this.result=this.result*10+(n-qt.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===qt.SEMI)this.consumed+=1;else if(this.decodeMode===en.Strict)return 0;return this.emitCodePoint(Ut(this.result),this.consumed),this.errors&&(e!==qt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Kt.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&Kt.FLAG13)!==0){let a=(r&Kt.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&Kt.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],i=(r&Kt.VALUE_LENGTH)>>14}if(t>=e.length)break;let a=e.charCodeAt(t);if(a===qt.SEMI&&i!==0&&(r&Kt.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=rn(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===en.Attribute&&(i===0||Qt(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Kt.VALUE_LENGTH)>>14,i!==0){if(a===qt.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==en.Strict&&(r&Kt.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&Kt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(Kt.VALUE_LENGTH|Kt.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case $t.NamedEntity:return this.result!==0&&(this.decodeMode!==en.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case $t.NumericDecimal:return this.emitNumericEntity(0,2);case $t.NumericHex:return this.emitNumericEntity(0,3);case $t.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case $t.EntityStart:return 0}}};function nn(e){let t=``,n=new tn(e,e=>t+=Ht(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function rn(e,t,n,r){let i=(t&Kt.BRANCH_LENGTH)>>7,a=t&Kt.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=i+1>>1,s=0,c=i-1;for(;s<=c;){let t=s+c>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)s=t+1;else if(i>r)c=t-1;else return e[n+o+t]}return-1}var an=nn(Gt);function on(e,t=en.Legacy){return an(e,t)}function sn(e){return an(e,en.Strict)}var cn={};function ln(e){let t=cn[e];if(t)return t;t=cn[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function un(e,t){typeof t!=`string`&&(t=un.defaultChars);let n=ln(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128){t+=n[a];continue}if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;t+=e<128?`��`:String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;t+=e<2048||e>=55296&&e<=57343?`���`:String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}return t})}un.defaultChars=`;/?:@&=+$,#`,un.componentChars=``;var dn={};function fn(e){let t=dn[e];if(t)return t;t=dn[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function pn(e,t,n){typeof t!=`string`&&(n=t,t=pn.defaultChars),n===void 0&&(n=!0);let r=fn(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3))){i+=e.slice(t,t+3),t+=2;continue}if(o<128){i+=r[o];continue}if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`;continue}i+=encodeURIComponent(e[t])}return i}pn.defaultChars=`;/?:@&=+$,-_.!~*'()#`,pn.componentChars=`-_.!~*'()`;function mn(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function hn(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var gn=/^([a-z0-9.+-]+:)/i,_n=/:[0-9]*$/,vn=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,yn=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
47
- `,` `],bn=[`/`,`?`,`#`],xn=255,Sn=/^[+a-z0-9A-Z_-]{0,63}$/,Cn=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,wn={javascript:!0,"javascript:":!0},Tn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function En(e,t){if(e&&e instanceof hn)return e;let n=new hn;return n.parse(e,t),n}hn.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=vn.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=gn.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&wn[o])&&(a=a.substr(2),this.slashes=!0)),!wn[o]&&(i||o&&!Tn[o])){let e=-1;for(let t=0;t<bn.length;t++)r=a.indexOf(bn[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<yn.length;t++)r=a.indexOf(yn[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(Sn)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(Sn)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(Cn);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>xn&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Tn[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},hn.prototype.parseHost=function(e){let t=_n.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Dn=ae({decode:()=>un,encode:()=>pn,format:()=>mn,parse:()=>En}),On=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,kn=/[\0-\x1F\x7F-\x9F]/,An=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,jn=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Mn=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Nn=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Pn=ae({Any:()=>On,Cc:()=>kn,Cf:()=>An,P:()=>jn,S:()=>Mn,Z:()=>Nn});function Fn(e){let t={};e||={},t.src_Any=On.source,t.src_Cc=kn.source,t.src_Z=Nn.source,t.src_P=jn.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><|]`;return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function In(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Ln(e){return Object.prototype.toString.call(e)}function Rn(e){return Ln(e)===`[object String]`}function zn(e){return Ln(e)===`[object Object]`}function Bn(e){return Ln(e)===`[object RegExp]`}function Vn(e){return Ln(e)===`[object Function]`}function Hn(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var Un={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Wn(e){return Object.keys(e||{}).reduce(function(e,t){return e||Un.hasOwnProperty(t)},!1)}var Gn={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Kn=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,qn=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`.split(`|`);function Jn(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function Yn(){return function(e,t){t.normalize(e)}}function Xn(e){let t=e.re=Fn(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Kn),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,zn(n)){Bn(n.validate)?r.validate=Jn(n.validate):Vn(n.validate)?r.validate=n.validate:a(t,n),Vn(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=Yn();return}if(Rn(n)){i.push(t);return}a(t,n)}),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:Yn()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Hn).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`ig`),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,`i`),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,`i`)}function Zn(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function Qn(e,t){if(!(this instanceof Qn))return new Qn(e,t);t||Wn(e)&&(t=e,e={}),this.__opts__=In({},Un,t),this.__schemas__=In({},Gn,e),this.__compiled__={},this.__tlds__=qn,this.__tlds_replaced__=!1,this.re={},Xn(this)}Qn.prototype.add=function(e,t){return this.__schemas__[e]=t,Xn(this),this},Qn.prototype.set=function(e){return this.__opts__=In(this.__opts__,e),this},Qn.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},Qn.prototype.pretest=function(e){return this.re.pretest.test(e)},Qn.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Qn.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new Zn(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},Qn.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new Zn(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},Qn.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),Xn(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Xn(this),this)},Qn.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},Qn.prototype.onCompile=function(){};var $n=2147483647,er=36,tr=1,nr=26,rr=38,ir=700,ar=72,or=128,sr=`-`,cr=/^xn--/,lr=/[^\0-\x7F]/,ur=/[\x2E\u3002\uFF0E\uFF61]/g,dr={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},fr=35,pr=Math.floor,mr=String.fromCharCode;function hr(e){throw RangeError(dr[e])}function gr(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function _r(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(ur,`.`);let i=gr(e.split(`.`),t).join(`.`);return r+i}function vr(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}var yr=e=>String.fromCodePoint(...e),br=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:er},xr=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},Sr=function(e,t,n){let r=0;for(e=n?pr(e/ir):e>>1,e+=pr(e/t);e>455;r+=er)e=pr(e/fr);return pr(r+36*e/(e+rr))},Cr=function(e){let t=[],n=e.length,r=0,i=or,a=ar,o=e.lastIndexOf(sr);o<0&&(o=0);for(let n=0;n<o;++n)e.charCodeAt(n)>=128&&hr(`not-basic`),t.push(e.charCodeAt(n));for(let s=o>0?o+1:0;s<n;){let o=r;for(let t=1,i=er;;i+=er){s>=n&&hr(`invalid-input`);let o=br(e.charCodeAt(s++));o>=er&&hr(`invalid-input`),o>pr(($n-r)/t)&&hr(`overflow`),r+=o*t;let c=i<=a?tr:i>=a+nr?nr:i-a;if(o<c)break;let l=er-c;t>pr($n/l)&&hr(`overflow`),t*=l}let c=t.length+1;a=Sr(r-o,c,o==0),pr(r/c)>$n-i&&hr(`overflow`),i+=pr(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},wr=function(e){let t=[];e=vr(e);let n=e.length,r=or,i=0,a=ar;for(let n of e)n<128&&t.push(mr(n));let o=t.length,s=o;for(o&&t.push(sr);s<n;){let n=$n;for(let t of e)t>=r&&t<n&&(n=t);let c=s+1;n-r>pr(($n-i)/c)&&hr(`overflow`),i+=(n-r)*c,r=n;for(let n of e)if(n<r&&++i>$n&&hr(`overflow`),n===r){let e=i;for(let n=er;;n+=er){let r=n<=a?tr:n>=a+nr?nr:n-a;if(e<r)break;let i=e-r,o=er-r;t.push(mr(xr(r+i%o,0))),e=pr(i/o)}t.push(mr(xr(e,0))),a=Sr(i,c,s===o),i=0,++s}++i,++r}return t.join(``)},Tr={version:`2.3.1`,ucs2:{decode:vr,encode:yr},decode:Cr,encode:wr,toASCII:function(e){return _r(e,function(e){return lr.test(e)?`xn--`+wr(e):e})},toUnicode:function(e){return _r(e,function(e){return cr.test(e)?Cr(e.slice(4).toLowerCase()):e})}},Er=Bt({arrayReplaceAt:()=>jr,asciiTrim:()=>ei,assign:()=>Ar,escapeHtml:()=>Wr,escapeRE:()=>Kr,fromCodePoint:()=>Nr,has:()=>kr,isMdAsciiPunct:()=>Zr,isPromiseLike:()=>ti,isPunctChar:()=>Yr,isPunctCharCode:()=>Xr,isSpace:()=>qr,isString:()=>Dr,isValidEntityCode:()=>Mr,isWhiteSpace:()=>Jr,lib:()=>ni,normalizeReference:()=>Qr,unescapeAll:()=>zr,unescapeMd:()=>Rr});function Dr(e){return typeof e==`string`}var Or=Object.prototype.hasOwnProperty;function kr(e,t){return Or.call(e,t)}function Ar(e,...t){for(let n of t)if(n){if(typeof n!=`object`)throw TypeError(`source must be object`);Object.assign(e,n)}return e}function jr(e,t,n){return e.slice(0,t).concat(n,e.slice(t+1))}function Mr(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Nr(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Pr=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Fr=RegExp(`${Pr.source}|&([a-z#][a-z0-9]{1,31});`,`gi`),Ir=/^#(x[a-f0-9]{1,8}|\d{1,8})$/i;function Lr(e,t){if(t.charCodeAt(0)===35&&Ir.test(t)){let n=t[1].toLowerCase()===`x`?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return Mr(n)?Nr(n):e}let n=on(e);return n===e?e:n}function Rr(e){return e.includes(`\\`)?e.replace(Pr,`$1`):e}function zr(e){return!e.includes(`\\`)&&!e.includes(`&`)?e:e.replace(Fr,(e,t,n)=>t||Lr(e,n))}var Br=/[&<>"]/,Vr=/[&<>"]/g,Hr={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`};function Ur(e){return Hr[e]}function Wr(e){return Br.test(e)?e.replace(Vr,Ur):e}var Gr=/[.?*+^$[\]\\(){}|-]/g;function Kr(e){return e.replace(Gr,`\\$&`)}function qr(e){switch(e){case 9:case 32:return!0}return!1}function Jr(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Yr(e){return jn.test(e)||Mn.test(e)}function Xr(e){return Yr(Nr(e))}function Zr(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Qr(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function $r(e){return e===32||e===9||e===10||e===13}function ei(e){let t=0;for(;t<e.length&&$r(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&$r(e.charCodeAt(n));n--);return e.slice(t,n+1)}function ti(e){return typeof e?.then==`function`}var ni={mdurl:Dn,ucmicro:Pn},ri=class{type;tag;attrs=null;map=null;nesting;level=0;children=null;content=``;markup=``;info=``;meta=null;block=!1;hidden=!1;constructor(e,t,n){this.type=e,this.tag=t,this.nesting=n}attrIndex(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},ii=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType=`root`;level=0;Token=ri;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r;let i=this.src,a=i.length;for(let e=0;e<a;){let t=i.indexOf(`
48
- `,e),n=t===-1?a:t,r=0,o=0,s=e;for(;s<n;){let e=i.charCodeAt(s);if(qr(e)){r++,o+=e===9?4-o%4:1,s++;continue}break}this.bMarks.push(e),this.eMarks.push(n),this.tShift.push(r),this.sCount.push(o),this.bsCount.push(0),e=n+1}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}push(e,t,n){let r=new ri(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e}skipSpaces(e){let t=this.src;for(let n=t.length;e<n&&qr(t.charCodeAt(e));e++);return e}skipSpacesBack(e,t){if(e<=t)return e;let n=this.src;for(;e>t;)if(!qr(n.charCodeAt(--e)))return e+1;return e}skipChars(e,t){let n=this.src;for(let r=n.length;e<r&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;let r=this.src;for(;e>n;)if(t!==r.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return``;let i=Array(t-e),a=this.src;for(let o=0,s=e;s<t;s++,o++){let e=0,c=this.bMarks[s],l=c,u;for(u=s+1<t||r?this.eMarks[s]+1:this.eMarks[s];l<u&&e<n;){let t=a.charCodeAt(l);if(qr(t))t===9?e+=4-(e+this.bsCount[s])%4:e++;else if(l-c<this.tShift[s])e++;else break;l++}e>n?i[o]=` `.repeat(e-n)+this.src.slice(l,u):i[o]=this.src.slice(l,u)}return i.join(``)}},ai=class{src;env;tokens=[];inlineMode=!1;md;constructor(e,t,n){this.src=e,this.env=n,this.md=t}Token=ri},oi=class{src;env;md;tokens;tokens_meta;pos=0;posMax;level=0;pending=``;pendingLevel=0;cache={};delimiters=[];_prev_delimiters=[];backticks={};backticksScanned=!1;linkLevel=0;constructor(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.posMax=this.src.length}pushPending(){let e=new ri(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e}push(e,t,n){this.pending&&this.pushPending();let r=new ri(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()??[]),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){let n=this.src,r=this.posMax,i=n.charCodeAt(e),a;if(e===0)a=32;else if(e===1)a=this.src.charCodeAt(0),(a&63488)==55296&&(a=65533);else if(a=this.src.charCodeAt(e-1),(a&64512)==56320){let t=this.src.charCodeAt(e-2);a=(t&64512)==55296?65536+(t-55296<<10)+(a-56320):65533}else(a&64512)==55296&&(a=65533);let o=e;for(;o<r&&n.charCodeAt(o)===i;)o++;let s=o-e,c=o<r?this.src.charCodeAt(o):32;if((c&64512)==55296){let e=this.src.charCodeAt(o+1);c=(e&64512)==56320?65536+(c-55296<<10)+(e-56320):65533}else(c&64512)==56320&&(c=65533);let l=Zr(a)||Xr(a),u=Zr(c)||Xr(c),d=Jr(a),f=Jr(c),p=!f&&(!u||d||l),m=!d&&(!l||f||u);return{can_open:p&&(t||!m||l),can_close:m&&(t||!p||u),length:s}}Token=ri},si=class{__rules__=[];__cache__=null;__find__(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1}__compile__(){let e=new Set([``]);for(let t of this.__rules__)if(t.enabled)for(let n of t.alt)e.add(n);this.__cache__={};for(let t of e){let e=[];for(let n of this.__rules__)n.enabled&&(!t||n.alt.includes(t))&&e.push(n.fn);this.__cache__[t]=e}}at(e,t,n={}){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null}before(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null}after(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: ${e}`);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null}push(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null}enable(e,t){Array.isArray(e)||(e=[e]);let n=[];for(let r of e){let e=this.__find__(r);if(e<0){if(t)continue;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[e].enabled=!0,n.push(r)}return this.__cache__=null,n}enableOnly(e,t){Array.isArray(e)||(e=[e]);for(let e of this.__rules__)e.enabled=!1;this.enable(e,t)}disable(e,t){Array.isArray(e)||(e=[e]);let n=[];for(let r of e){let e=this.__find__(r);if(e<0){if(t)continue;throw Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[e].enabled=!1,n.push(r)}return this.__cache__=null,n}getRules(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]}};function ci(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(qr(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function li(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=`${e.getLines(t,i,4+e.blkIndent,!1)}\n`,a.map=[t,e.line],!0}function ui(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.includes(String.fromCharCode(o)))return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function di(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!qr(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&qr(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h${String(s)}`,1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=ei(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h${String(s)}`,-1);return d.markup=`########`.slice(0,s),!0}function fi(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!qr(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=String.fromCharCode(o).repeat(s),!0}var pi=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),mi=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,hi=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,gi=RegExp(`^(?:${mi}|${hi}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),_i=RegExp(`^(?:${mi}|${hi})`),vi=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(${pi.join(`|`)})(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(`${_i.source}\\s*$`),/^$/,!1]];function yi(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<vi.length&&!vi[s][0].test(o);s++);if(s===vi.length)return!1;if(r)return vi[s][2];let c=t+1,l=vi[s][1].test(``);if(!vi[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),vi[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function bi(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a||o===void 0)return e.parentType=i,!1;let c=ei(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h${String(a)}`,1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h${String(a)}`,-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function xi(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!qr(e.src.charCodeAt(r))?-1:r}function Si(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!qr(a))?-1:i}function Ci(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function wi(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p=Si(e,c);if(p>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if(p=xi(e,c),p>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f.toString()]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,b=e.tShift[c],x=e.sCount[c],S=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[c]=b,e.sCount[c]=x,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let C=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){C=!0;break}if(C)break;if(d){if(p=Si(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=xi(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&Ci(e,h),!0}function Ti(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=ei(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}function Ei(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!qr(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!qr(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&qr(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&qr(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=Qr(c.slice(1,l));if(!_)return!1;if(r)return!0;e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o;let v=e.push(`reference`,``,0);return v.map=[t,e.line],v.info=_,v.meta={title:g,href:d},!0}var Di=65536;function Oi(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function ki(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function Ai(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!qr(s)||o===45&&qr(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!qr(t))return!1;a++}let c=Oi(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=Oi(e,t).trim(),!c.includes(`|`)||e.sCount[t]-e.blkIndent>=4)return!1;l=ki(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=Oi(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=ki(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>Di))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}var ji=[[`table`,Ai,[`paragraph`,`reference`]],[`code`,li],[`fence`,ui,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,ci,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,fi,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,wi,[`paragraph`,`reference`,`blockquote`]],[`reference`,Ei],[`html_block`,yi,[`paragraph`,`reference`,`blockquote`]],[`heading`,di,[`paragraph`,`reference`,`blockquote`]],[`lheading`,bi],[`paragraph`,Ti]],Mi=class{ruler;constructor(){this.ruler=new si;for(let e=0;e<ji.length;e++)this.ruler.push(ji[e][0],ji[e][1],{alt:(ji[e][2]||[]).slice()})}tokenize(e,t,n,r){let i=this.ruler.getRules(``),a=i.length,o=e.md.options.maxNesting,s=t,c=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=o){e.line=n;break}let t=e.line,r=!1;for(let o=0;o<a;o++)if(r=i[o](e,s,n,!1),r){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!r)throw Error(`none of the block rules matched`);e.tight=!c,e.isEmpty(e.line-1)&&(c=!0),s=e.line,s<n&&e.isEmpty(s)&&(c=!0,s++,e.line=s)}}parse(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)}State=ii};function Ni(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Pi(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function Fi(e){return/^<a[>\s]/i.test(e)}function Ii(e){return/^<\/a\s*>/i.test(e)}function Li(e){if(!e.md.options.linkify)return;let t=e.tokens,n=e.md.linkify;for(let r=0,i=t.length;r<i;r++){if(t[r].type!==`inline`||!n.pretest(t[r].content))continue;let i=t[r].children,a=0;for(let t=i.length-1;t>=0;t--){let r=i[t];if(r.type===`link_close`){for(t--;i[t].level!==r.level&&i[t].type!==`link_open`;)t--;continue}if(r.type===`html_inline`&&(Fi(r.content)&&a>0&&a--,Ii(r.content)&&a++),!(a>0)&&r.type===`text`){let a=r.content;if(!n.pretest(a))continue;let o=n.match(a);if(!o?.length)continue;let s=[],c=r.level,l=0,u=+(o[0].index===0&&t>0&&i[t-1].type===`text_special`);for(let t=u;t<o.length;t++){let n=o[t],r=e.md.normalizeLink(n.url);if(!e.md.validateLink(r))continue;let i=n.text;i=n.schema?n.schema===`mailto:`&&!/^mailto:/i.test(i)?e.md.normalizeLinkText(`mailto:${i}`).replace(/^mailto:/,``):e.md.normalizeLinkText(i):e.md.normalizeLinkText(`http://${i}`).replace(/^http:\/\//,``);let u=n.index;if(u>l){let t=new e.Token(`text`,``,0);t.content=a.slice(l,u),t.level=c,s.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=c++,d.markup=`linkify`,d.info=`auto`,s.push(d);let f=new e.Token(`text`,``,0);f.content=i,f.level=c,s.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--c,p.markup=`linkify`,p.info=`auto`,s.push(p),l=n.lastIndex}if(l<a.length){let t=new e.Token(`text`,``,0);t.content=a.slice(l),t.level=c,s.push(t)}i.splice(t,1,...s)}}}}var Ri=/\r\n?|\n/g,zi=/\0/g;function Bi(e){let t=e.src,n=t.includes(`\r`),r=t.includes(`\0`);(n||r)&&(n&&(t=t.replace(Ri,`
49
- `)),r&&(t=t.replace(zi,`�`)),e.src=t)}var Vi=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,Hi=/\((?:c|tm|r)\)/i,Ui=/\((c|tm|r)\)/gi,Wi={c:`©`,r:`®`,tm:`™`};function Gi(e,t){return Wi[t.toLowerCase()]}function Ki(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(Ui,Gi)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function qi(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&Vi.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function Ji(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(Hi.test(e.tokens[t].content)&&Ki(e.tokens[t].children),Vi.test(e.tokens[t].content)&&qi(e.tokens[t].children))}var Yi=/['"]/,Xi=/['"]/g,Zi=`’`;function Qi(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function $i(e,t){let n=``,r=0;t.sort((e,t)=>e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function ea(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){Xi.lastIndex=l;let o=Xi.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=Zr(m)||Xr(m),_=Zr(h)||Xr(h),v=Jr(m),y=Jr(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&Qi(i,a,o.index,Zi);continue}if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),Qi(i,a,o.index,c),Qi(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&Qi(i,a,o.index,Zi)}}Object.keys(i).forEach(t=>{e[t].content=$i(e[t].content,i[t])})}function ta(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&Yi.test(e.tokens[t].content)&&ea(e.tokens[t].children,e)}function na(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var ra=[[`normalize`,Bi],[`block`,Ni],[`inline`,Pi],[`linkify`,Li],[`replacements`,Ji],[`smartquotes`,ta],[`text_join`,na]],ia=class{ruler;constructor(){this.ruler=new si;for(let e=0;e<ra.length;e++)this.ruler.push(ra[e][0],ra[e][1])}process(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)}State=ai};function aa(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=zr(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=zr(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function oa(e,t,n=!1){let r,i=!1,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function sa(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=zr(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=zr(e.slice(t,a)),o}var ca={parseLinkDestination:aa,parseLinkLabel:oa,parseLinkTitle:sa},la=/^([\w.!#$%&'*+/=?^`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*)$/i,ua=/^([a-z][a-z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/i;function da(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(ua.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(la.test(a)){let n=e.md.normalizeLink(`mailto:${a}`);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function fa(e,t){let n=e.pos,r=e.src;if(r.charCodeAt(n)!==96)return!1;let i=n;n++;let a=e.posMax;for(;n<a&&r.charCodeAt(n)===96;)n++;let o=r.slice(i,n),s=o.length;if(e.backticksScanned&&(e.backticks[s]||0)<=i)return t||(e.pending+=o),e.pos+=s,!0;let c=n,l;for(;l=r.indexOf("`",c),l!==-1;){for(c=l+1;c<a&&r.charCodeAt(c)===96;)c++;let i=c-l;if(i===s){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=o,t.content=r.slice(n,l).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=c,!0}e.backticks[i]=l}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=s,!0}function pa(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function ma(e){let t=e.tokens_meta,n=e.tokens_meta.length;pa(e.delimiters);for(let e=0;e<n;e++){let n=t[e]?.delimiters;n&&pa(n)}}function ha(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function ga(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function _a(e){let t=e.tokens_meta,n=e.tokens_meta.length;ga(e,e.delimiters);for(let r=0;r<n;r++){let n=t[r]?.delimiters;n&&ga(e,n)}}var va={tokenize:ha,postProcess:_a},ya=/^&#(x[a-f0-9]{1,6}|\d{1,7});/i,ba=/^&([a-z][a-z0-9]{1,31});/i;function xa(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(ya);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?Number.parseInt(r[1].slice(1),16):Number.parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=Mr(t)?Nr(t):Nr(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(ba);if(r){let n=sn(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}var Sa=[];for(let e=0;e<256;e++)Sa.push(0);for(let e of`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``))Sa[e.charCodeAt(0)]=1;function Ca(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(i=e.src.charCodeAt(n),qr(i));)n++;return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\${a}`;if(!t){let t=e.push(`text_special`,``,0);t.content=i<256&&Sa[i]!==0?a:o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function wa(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}function Ta(e){return/^<a[>\s]/i.test(e)}function Ea(e){return/^<\/a\s*>/i.test(e)}function Da(e){let t=e|32;return t>=97&&t<=122}function Oa(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Da(i))return!1;let a=e.src.slice(r).match(gi);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],Ta(t.content)&&e.linkLevel++,Ea(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}function ka(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),qr(n)||n===10);a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),qr(n)||n===10);a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),qr(n)||n===10);a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Qr(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}function Aa(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),qr(n)||n===10);m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),qr(n)||n===10);m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),qr(n)||n===10);m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[Qr(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}var ja=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Ma(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(ja);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function Na(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t){if(r>=0&&e.pending.charCodeAt(r)===32){if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0)}else e.push(`softbreak`,`br`,0)}for(n++;n<i&&qr(e.src.charCodeAt(n));)n++;return e.pos=n,!0}function Pa(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function Fa(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function Ia(e){let t=e.tokens_meta,n=e.tokens_meta.length;Fa(e,e.delimiters);for(let r=0;r<n;r++){let n=t[r]?.delimiters;n&&Fa(e,n)}}var La={tokenize:Pa,postProcess:Ia};function Ra(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function za(e,t){let n=e.pos,r=e.src;for(;n<e.posMax&&!Ra(r.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=r.slice(e.pos,n)),e.pos=n,!0)}var Ba=[[`text`,za],[`linkify`,Ma],[`newline`,Na],[`escape`,Ca],[`backticks`,fa],[`strikethrough`,La.tokenize],[`emphasis`,va.tokenize],[`link`,Aa],[`image`,ka],[`autolink`,da],[`html_inline`,Oa],[`entity`,xa]],Va=[[`balance_pairs`,ma],[`strikethrough`,La.postProcess],[`emphasis`,va.postProcess],[`fragments_join`,wa]],Ha=class{ruler;ruler2;constructor(){this.ruler=new si;for(let e=0;e<Ba.length;e++)this.ruler.push(Ba[e][0],Ba[e][1]);this.ruler2=new si;for(let e=0;e<Va.length;e++)this.ruler2.push(Va[e][0],Va[e][1])}skipToken(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache,o=a[t];if(o!==void 0){e.pos=o;return}let s=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;s||e.pos++,a[t]=e.pos}tokenize(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)}State=oi},Ua=/^(vbscript|javascript|file|data):/,Wa=/^data:image\/(gif|png|jpeg|webp);/;function Ga(e){let t=e.trim().toLowerCase();return!Ua.test(t)||Wa.test(t)}var Ka=[`http:`,`https:`,`mailto:`];function qa(e){let t=En(e,!0);if(t.hostname&&(!t.protocol||Ka.includes(t.protocol)))try{t.hostname=Tr.toASCII(t.hostname)}catch{}return pn(mn(t))}function Ja(e){let t=En(e,!0);if(t.hostname&&(!t.protocol||Ka.includes(t.protocol)))try{t.hostname=Tr.toUnicode(t.hostname)}catch{}return un(mn(t),`${un.defaultChars}%`)}var Ya={html:!1,linkify:!1,typographer:!1,quotes:`“”‘’`,maxNesting:100},Xa=class{inline=new Ha;block=new Mi;core=new ia;linkify=new Qn;validateLink=Ga;normalizeLink=qa;normalizeLinkText=Ja;helpers={...ca};options={...Ya};parse(e,t={}){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}parseInline(e,t={}){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}},Za={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}},Qa={options:{...Ya,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,highlight:null},components:{core:{},block:{},inline:{}}},$a={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},eo={};eo.code_inline=function(e,t,n,r,i){let a=e[t];return`<code${i.renderAttrs(a)}>${Wr(a.content)}</code>`},eo.code_block=function(e,t,n,r,i){let a=e[t];return`<pre${i.renderAttrs(a)}><code>${Wr(e[t].content)}</code></pre>\n`},eo.fence=function(e,t,n,r,i){let a=e[t],o=a.info?zr(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}function l(e){if(e.indexOf(`<pre`)===0)return`${e}\n`;if(o){let t=a.attrIndex(`class`),r=a.attrs?a.attrs.slice():[];t<0?r.push([`class`,n.langPrefix+s]):(r[t]=r[t].slice(),r[t][1]+=` ${n.langPrefix}${s}`);let o={attrs:r};return`<pre><code${i.renderAttrs(o)}>${e}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${e}</code></pre>\n`}let u=(()=>{if(!n.highlight)return Wr(a.content);let e=n.highlight(a.content,s,c,r);return ti(e)?e.then(e=>e||Wr(a.content)):e||Wr(a.content)})();return ti(u)?u.then(l):l(u)},eo.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},eo.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
50
- `:`<br>
51
- `},eo.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
52
- `:`<br>
53
- `:`
54
- `},eo.text=function(e,t){return Wr(e[t].content)},eo.html_block=function(e,t){return e[t].content},eo.html_inline=function(e,t){return e[t].content},eo.reference=function(e,t){return e[t].content};var to=class{rules=Ar({},eo);constructor(){}renderAttrs(e){let t=e.attrs;if(!t)return``;let n=t.length;if(n===0)return``;let r=``;for(let e=0;e<n;e++)r+=` ${Wr(t[e][0])}="${Wr(t[e][1])}"`;return r}renderToken(e,t,n,r={}){let i=e[t],a=``;if(i.hidden)return``;i.block&&i.nesting!==-1&&t&&e[t-1].hidden&&(a+=`
55
- `),a+=(i.nesting===-1?`</`:`<`)+i.tag,a+=this.renderAttrs(i),i.nesting===0&&n.xhtmlOut&&(a+=` /`);let o=!1;if(i.block&&(o=!0,i.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.type===`reference`||n.hidden||n.nesting===-1&&n.tag===i.tag)&&(o=!1)}return a+=o?`>
56
- `:`>`,a}renderInline(e,t,n={}){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=i[e[a].type];if(o){let i=o(e,a,t,n,this);if(ti(i))throw Error(`Renderer.renderInline: async rule detected, use renderInlineAsync()`);r+=i}else r+=this.renderToken(e,a,t,n)}return r}renderInlineAsText(e,t,n={}){let r=``;for(let i=0,a=e.length;i<a;i++){let a=e[i];switch(a.type){case`text`:r+=a.content;break;case`image`:r+=this.renderInlineAsText(a.children,t,n);break;case`html_inline`:case`html_block`:r+=a.content;break;case`softbreak`:case`hardbreak`:r+=`
57
- `}}return r}render(e,t,n={}){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;if(o===`inline`)r+=this.renderInline(e[a].children,t,n);else{let s=i[o];if(s){let i=s(e,a,t,n,this);if(ti(i))throw Error(`Renderer.render: async rule detected, use renderAsync()`);r+=i}else r+=this.renderToken(e,a,t,n)}}return r}async renderInlineAsync(e,t,n){let r=[],i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=i[e[a].type];o?r.push(Promise.resolve(o(e,a,t,n,this))):r.push(Promise.resolve(this.renderToken(e,a,t,n)))}return(await Promise.all(r)).join(``)}async renderAsync(e,t,n){let r=[],i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a],s=o.type;if(s===`inline`)r.push(this.renderInlineAsync(o.children,t,n));else{let o=i[s];o?r.push(Promise.resolve(o(e,a,t,n,this))):r.push(Promise.resolve(this.renderToken(e,a,t,n)))}}return(await Promise.all(r)).join(``)}},no={default:Qa,zero:$a,commonmark:Za},ro=class extends Xa{renderer=new to;utils=Er;options={...no.default.options};constructor(e,t){super();let[n,r]=typeof e==`string`?[e,t]:[`default`,e];this.configure(n),r&&this.set(r)}set(e){return Ar(this.options,e),this}configure(e){if(typeof e==`string`){let t=e;if(e=no[t],!e)throw Error(`Wrong \`markdown-exit\` preset "${t}", check name`)}if(!e)throw Error("Wrong `markdown-exit` preset, can't be empty");if(e.options&&this.set(e.options),e.components)for(let t of Object.keys(e.components)){let n=e.components[t];n.rules&&this[t].ruler.enableOnly(n.rules),n.rules2&&this[t].ruler2?.enableOnly(n.rules2)}return this}enable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(let t of[`core`,`block`,`inline`])n=n.concat(this[t].ruler.enable(e,!0));n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(e=>!n.includes(e));if(r.length&&!t)throw Error(`MarkdownExit. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t){let n=[];Array.isArray(e)||(e=[e]);for(let t of[`core`,`block`,`inline`])n=n.concat(this[t].ruler.disable(e,!0));n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(e=>!n.includes(e));if(r.length&&!t)throw Error(`MarkdownExit. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}renderAsync(e,t={}){return this.renderer.renderAsync(this.parse(e,t),this.options,t)}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}renderInlineAsync(e,t={}){return this.renderer.renderAsync(this.parseInline(e,t),this.options,t)}};function io(e){function t(...t){return new e(...t)}return Object.setPrototypeOf(t,ro),t.prototype=ro.prototype,t.prototype.constructor=t,t}var ao=io(ro);function oo(e){let t=Promise.resolve(null);return(...n)=>(t=t.then(()=>e(...n)).catch(()=>null),t)}function so(e,t){let n=new Map;for(let t of e)n.set(t.name,t);let r=new Set;for(let e of t)r.has(e.name)||(r.add(e.name),n.delete(e.name),n.set(e.name,e));return[...n.values()]}function co(e){return e}function lo(e,t){if(e[t]!==`[`)return-1;let n=t+1,r=0;for(;n<e.length;){if(e[n]===`\\`&&n+1<e.length){n+=2;continue}if(e[n]===`[`)r++;else if(e[n]===`]`){if(r===0)return n;r--}n+=1}return-1}function uo(e,t){let n=lo(e,t);return n===-1?null:{content:e.slice(t+1,n),endIndex:n+1}}var fo=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function po(e){return e===0||e>=55296&&e<=57343||e>1114111}function mo(e){return po(e)?65533:e>=128&&e<=159&&fo[e-128]||e}function ho(e){return po(e)?65533:e}function go(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(mo(e))}var _o=(()=>{let e=new Uint8Array(127),t=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=t++);return e})();function vo(e,t,n,r,i,a){let o=e.length,s=a*90,c=0,l=()=>{let t=_o[e.charCodeAt(c++)];return t<a?t:t*91-s+_o[e.charCodeAt(c++)]},u=n-r,d=n+i,f=new Int32Array(d);f.fill(-1,r,a),f.fill(-1,a+u,d);let p=new Int32Array(d),m=new Int32Array(d);function h(t,n){let r=0,i=n,a=n+t;for(;i<a;){let t=_o[e.charCodeAt(c++)];if(t<89)r+=t,f[i++]=r;else if(t===89){let t=_o[e.charCodeAt(c++)]+2;for(;t--;)f[i++]=++r}else{let t=_o[e.charCodeAt(c++)];r+=89+(t<90?t*91+_o[e.charCodeAt(c++)]:_o[e.charCodeAt(c++)]*8281+_o[e.charCodeAt(c++)]*91+_o[e.charCodeAt(c++)]),f[i++]=r}}}h(r,0),h(u,a);let g=new Int32Array(i*2),_=0,v=0;function y(e,t){for(let n=0;n<e;n++){let e=t+n,r=l(),i=l();g[v*2]=r,g[v*2+1]=i,v+=1,p[e]=_;let a=(f[r]<0?m[r]:1)+(f[i]<0?m[i]:1);m[e]=a,_+=a}}y(i-a+r,a+u),y(a-r,r);let b=new Uint16Array(_),x=0;for(let e=0;e<v;e++)for(let t=0;t<2;t++){let n=g[e*2+t],r=f[n];if(r<0){let e=p[n],t=e+m[n];for(;e<t;)b[x++]=b[e++]}else b[x++]=r}let S=new Uint16Array(t),C=0;for(;c<o;){let t=_o[e.charCodeAt(c++)];t>=a&&(t=t*91-s+_o[e.charCodeAt(c++)]);let n=f[t];if(n<0){let e=p[t],n=e+m[t];for(;e<n;)S[C++]=b[e++]}else S[C++]=n}return S}var yo=vo("!}.&u%}'&}*'~!6*)%&,~!J~!J~%L~y<~!R,~~%Lu~~#GD~~#|)1#%}^%}2%+#.##%##%}&%##%'#%##&%#%#'%#&#%#&#'#%%#&#%##%#)%''%&%#%#'%#%%#%%}%%%#%#&(23#%%#&-%0%('1#(##%#'##+%'*.:1}#%#6-+(%'%%#%%%}#L'2351&('%}&/N'(0(/*-%(%%}#'+&T%7.2}#&%&#%#36/5##%&%%#&#%%#))2%%##%&&'0~!#*+&'%1~!%).'3q?&%'1~!.##%6(~!+%%%(Gw'rT~!E#<nA%#jZ~!H%(~!42##~!*31&~!G%U~#)5~#`3~!J~!Z~%]~%Y~%C~!q~!u~#kz~%#~!6'~!D~!U~!?~#T~!c%~!G#'~%7|~!G~!J~!G&~#pb~(Df}#%}*&}#%##%##%##&#-}&'#'&%#.++}%mI,#,@&(}*%}*'%&##&#%##%}&0}#.},U},%}+%}&%}#%##&}B%(}(%}+%)})%##%#&}&%##%&}<%}>%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)#&}(.}&%#&}%%}*&#%},&&}&%}#%*'#%})%}D&}&%}-&}6&#&}-,%}#%})-(~+`~,=?~I9'9%~!,#%})%})%}@%}?%}(~!?~#<~#pP~#BG~#=1#%K+~#?#~%;)~#A~#mF1~#A'~'X%'~#lR~#N~'N~#r~#m#-~#i'?%#'%~#B%##%,%#~#_%#0%~#]732~,w~2+#:&#%&'0%&>%}#>##F+)#%&&#(+_}4&}-%}(&}@&}O7Fdf0@+/v4}&WU##&/0#&'('B#%}.%}'+#%}#%%&#&%#%##+#&#)#6#'#.},%}c%},%#%##%&#&%#&~#>'*-.%##%##%}#%%}%'~#)D1}#%*&~#_%%'(~#S2%'.}#~#=##*'*-%}&'%'##&&~'E%.#&~#M4}%%##&'%#~#O1##%&#'+~#<B%##%%'%+~#;#@%}#&%#&&%#(~#H1}'%'##&&~#?A}&'~#D#%32}'&&&&~#[}'(#%}'~#;C})&}%%#%~#=&%,3}%'(#%%~#^'#&&)#%'~#Y%-~#d-%'~#^%%&#&&&}#~#b~2t*&'~&(~&@~0%~e~3}%*''0})&}+~!9##-}#%-hD*)1fC#%/&/fB#40~!+#)*4~!+~!K'&:~!/*7~!.#~!H~!L':~%x&~!H#~!*~%1~!I#~!+A~#p'~!F~~#-#~,,(~.Z~!V~%;'B'mq-W~!N~%I%#&&#&}#%},%%}'%}+X#%}#&}(%}'%}<%}#%}%%'}'%}:~![)9@~%>~#UA%-%##&~!C%~!-.9:~!1~!-^2/:a~!y,D*J#-5)/4~%23,~#G~!L1~!0X3`~!2+~!!0-~&E~!W~!o,>Y&]~%cZx_&~#O*9#A#'#+I'%#)~!0B*-5A+-((F&*M#)(-7-5+'-3a5Vi~!Y~!?+[)%3),ERHm~!+:D,VG.+)?fB%%*(%)'(#&80%1'8`K8?`+'Z#&O&'H5#*9)A%%5&3))0%39+.*7#()&&*=4@**L)<'_&*+..;(#*+)./&0#3)%')-8(4ixD(&.}%,('aI:,)%,k2231T)I'#/-W7,/'Q#.'Y24+h')37</31&83##&0#),H(?'&?/1##%#&&#%''-%&&&#(&''&#.-'%#%%(,')*'&#&#'##%(%(#%('#&##%%%%('%#%#%%#%#&%##h>w+v<ayvyvcg.uuhKr}g/v|g>u9i[~>g5uI~=RvdwEg;v/g;uk!!TTSx]@RT!U!#!@VBRUU!'UTe-d0c`e&gSdicedFcrdTaqb.kYcAohdYd@a3e+d}dMdtd.aJ#bqcK`dle/e.e'dwdPdodddjbEb}ogd^ofdpduc6j?l%d{drdqc)d7bacOdQ%T#Y)X.sR[yH>6Vyv3[xwLu>vo'!*.[yBacahoj>6Rew3[xqdZa#!a&#^(X-[yG>6Vyu3[xvg3sEr|g.u/Ri9db0T#^(Xa)!-[y;>6Vylg4wKs{JwNZt3@3r=c4Z([xlg;wKt!cpq's@v7A'*a(a+!-a#[y<3Dt?3Dt'>6Vym3[xmg9rxsNJwLZt4~?r?db1T#`-!(Xa,!0[yS>6Vz%NuQs.g4wKtnJwNZtS@3r>c4Z([y%g;wKtrdga8!a(!#&T*Y-Xa#!a0<or[yc3Dtq>6Vz43[y3JwNZtf@3s!Ju}!%Dti:pm3c_%X#tjB5pkd6q!r]u?voC'*-a.a2!0a&a+[yI3DtI3Ds~3DtH>6Vyw3[xx;:s#~<5pKJwNZtE@3r~d`a)!a2T#a.(!+U.X1[yT3Dt`3Dtv>6Vz&3[y&g9rxwzcxstPu.<rAJwLZtT~?r@dZa%!a.&^*Za(/Reu[ya>6Vz23[y1g3sEr}wkg{NuQRg{ci(U#5@b`~,cg#U(2WnH5wugcRh7dX#T(Y,a'Ta!!a,[yZ<]mj>6Vz,3[y+Pv#5ReZKu+=,%!H}7ABwkaS?Rh:BcW(X#<]mrj:ubv/ARekdg%!(!a.*Ta(Y.X1!#sP>Rl*Dt6[y>>6Vyo3Wf*jOvuumvuRgRJuq*!:9<B@bX~3jVv&v@s@5Re[d/rQt{uAvo&a&a*)a2!,0Wf!3Dt0=Bs'>6Re}3[xy~<5s%JwJZt1~Gs)c;&!#2sJkNuXvzq7rxu,Re8dka4!a8(aEZ+a@Y.X1Xa)[yd=Bs(3DtP>6Vz53[y4cX#X&Re:avRe9~<5s&JwJZtQ~Gs*i^rzvdRg+Jv{%!2sbB@bX}kdga,!Za?&^*T1/!a'Dt+[y6>6Vyf3Wf%g/u;s4hGu6?Rh-JvZ,!c%#&RoX54Rivj7uyvf8RgTKvZB%*!2sGh<vu5Rgq<=C::9bb~#dZ#T&Ta6Y.X*Dt>[y93Wf)coZ(T,6VyifluvRgC@95@B@bX~/hFu34cC#T,k/unq8w8Q5RkUklwQuzunq8w8Q5Rk8d/rJu?v8w9)-&!a0a;a&aIWejg3sEr/h1s<DtDJvyZqY5aws3Jvy!&Wei~Hr1:au5@Bag>23E~5c:Z&bX};kKv?w&unuVu5Rjc;>bs)#~@:Rh.=ay<a]C;b`}Vd6s/t{uAvoaxa()!a,a7%-a#a2Dt,[yF2Wo[>6Vyt3[xuNuPRi&NuPwpi#RoWh?vf8Ri%Jv]!%Ri:KvxD!.'2WeAjZu`q9rxu,Re7woeAg-unLq(qA_/*2Wg_g3u5q^9:4E}/jTrxrzv=Wkkd~0UX#^^Xa-a1a5T&a=U1a'*aEa]!a*aPaA-adok[y54Rn>;:p3~Dp5g9rpsFNvZqjg3uJp4~<5p0Pw;5qlJwNZt*@3p1Pw:5p/Ou!5p2JvG'!6Vye=<qnJvh_[xhg3v,Rh3kOwOw-sDuev/Re^dha[a%!%!a+#Ta7)-5TaCaO!aka!a)sf[yb2>Rl!9ARiq5E}Qg=ucRkBE|oJrJ_@Wk~@Wk{JrJ_@Wk|@WkyJrJ_@Wk}@WkzJvO_[y2g-vMRmiKuYC!)&>Ri;>Ri<@3RkNc](X#@9Rk=g5vuRmhKvDB!+'=]meg3u4Rmgd)#Y'Vz3CARmfd`a+!%T'!+#Ta1Ta6TaM-sTDt9[yA9sYd'%Y#s[[xpj:ueunaXRgEjRq,v-vuqdd2'`#6Rev<32@5>:2<E}5xIo9a*X#Y(;5RePJvD_g>vyRgNj8w)v8<wggs:RgXiZt|vjx,hSq3ah!-(~@:Ro/Ou!5RhWj^v(pyw8unRhUdx-UY#^Ua.a3a70!)%UX1TaDa)'omRiRRhE[y:3Dsz=Br,>6Vyj3[xkg6ruwjcqsrPw;5r*Ku]D'Zt-@3r(~?r.i[vwv]dU1a--U#`a4(g/vsRhPOu!5RhLj:rmu9Wo!~@:wdh@g/vsRiTjXuvvNr}:RhBj^v(pyw8unRn]dz1UYa'a+^Y(!aETZalaRY.Ta?a4[yDJw1!#qLsW>6Vyrfzq-pLflpwRe|Js>%!Dt@3Dt&Jvy_[xs~HrnjMuwpsw'RecKu+D#'!t<~Grl~?rjg5u-x,gwp{ah!-(~@:Rg~Ou!5Rh'jXuvvNr}:Rh#cW#X/c;&!#2sLi[v7u7RgpJv)(!iLrxu,Re6j7v@s@5Se[e7d`aW!Za(a`T.a#!a3!&aDa-!9)Dt_=6s+3[x~~DR|h~DS6avhGun5RkZj3w)v-]mkKunB!&*]kb97R|i<ARk<c:Z(6Vy}Juh'!wziMRoS:F|vkLuauJv5vtvQRh1d='T+Y#VyO~DR|jcF#T'7R|g97R|kJv3'!ay<Rj,Jvh&!:ReXcsa6*a+#a#_aIRf9aLRf?c,Z&Rf5Rf7c.Z&Rf;Rf>cQ#%T'p-Rf8Rf=ct#%'(*!,p,Rf4p+Rf6Rf:Rf<d~'Ua%U*^UYa(!a,-!#a4YaTalaEX0a8a<Weo3Dt/3Dsx=Br93Wen~Dr;~<5p<JwNZt2@3p=Pw:5p;Ou!5r3c7&!#:p>3Ds}KvGB)_6Vyk2sM=<r7x'eovA(!hFu1ARf}cV#X&@r5j6rvwQa^Rf3c=Za'wkghJv__g;unRggA53B9=b^}%j6uduo5Jq;!(hIv%2Re`Ou4ARe_e%a#^^^Xa&!a*a2!&a6YaP!*ad!#a:aE/5Rn?[y@>6Vyp;:pE~DrY~<5pBJwNZt8@3pCh=rt3rWPw:5pAJup_[xoNuPpF9c!#'45pD5ARn)d8#X'X*3@rU72s]h>v<<sSjJpqvewOJq/(!hNw'5ReBk0s2u3w/w'5ReE5@Jq.!a+JQ!&WeU23d(#Y&RjG5]jBk!u7w&u0udARjEe#+^^^Ub#!a2/a`Z(agT1!a-a;|@TaG!aS[yV=Re~fow'RguNuPRe?bz#'>RoUWeL>:Cbb|?JwPZtVg6ruRmzJvD'!6Vz(g/vmRh~Jvy_[y(g9voRgyx*cy(#2>Ri2B9b]~9kIw9u7rluJu3Rg]dI#a%UY'@=p%CAx.gQZ&RhwwygtRm{x5g_Z'+ABqR9Woa=Bp&dV#^*Xa'!&@o{g4v]Rk;Jv{!%Rk[wkkiA5RkiwwfUB=x,fUuqC&*!>RfTg8v0RfV~ARfSd;rJsAuAv9wR'ae+/aO!a@aza/a#[yQ@Wg!2Wemg3sEr0JvB_g>uvReWg2v+Re=KupB_+[y!2AbY~-~Hr2AJwD!(h<~El>h<~El?Kun@+_:9b`}Kg-v/Ri3g;vtwyk_9]k_d=&T#*U.6qh@Ab`|K9:H|CJv[!&3Dtex'fDwC%!Rf[9WlMd[(^X,!a%Z06Vz!@WgBg=v~Rgvg,QRe@awd,#Y+jTv|Q~EfWj]uNr|~FRfXdy#Y&^Ua%!aO.!(a)Ua;=!a@aKap!a-,a!Ta]a[rSa]p?[y82sK=Bq~;:p:~<5p8Pw:5p7d'#Y'Wf(;RnRi[u4w&RgJJvG'!6Vyh=<r#ijuuv/sIKuYD'ZtG@3p9~Gr&d2#`(g<vtRgFj`u5w&rqpxRf2CJuY!+:wfnTOu!5Rg}jNs1ucv&RfwJvA!&3@q|BDcC#T,k/unq8w8Q5RkTklwQuzunq8w8Q5Rk9dga#!a'!a=#a0!:+Tb*b@aO.a4!aba8aFJv^}?!VyR~Dr<g;u%Rn.~<5p[x'e`wNZtR@3p]Pw:5pZhNvjBp.woe_g5u-r4JwF!%DtO3:ooc7&!#:p^3DtpLuGw(!+%)Dtk6Vz#2sd=<r8d'#Y([y#<x3gJt`w@!)%}MRiowzikRij=]ilxAf3,U(#B2Rf#g0v-Rm[ck{`U#]giKv3>)!&6Ri154s,KuGB_%@r68r:dJ|t`#X(9<E|u2@H|rx3gJu?w'!+'1Nu7Reg4=H~+9<wxgY95Rm]xLggZ-`(X}U2:Ri4h<uOawRmsJv__5@bb{jbV~3dka#a'a]!,#a+U=a>b6a3b%!/aKa/)!arwve^VyJ;:pR~DpTg3uJpS~<5pOPw;5qmPw:5pNOu!5pQJvG'!6Vyx=<qoJvA!{~Jup!%@qk7Rn/KvyD!}''[xz;>wkh'?Rh,x8gyt`w5D!&),(SgyccRgztJ@3pPB5p#d'(Y#<]mmifubw&RgoJvE&!82s^JvF&!8Rf,ADb]~;x=h'rNu]vK!,%'*0RnORh)4Rh*AqQg-vaRnNg;wHwkh'ba~4cE#Ta*x3gctyw@'!+%RnFRnD<4Rn@hFvK5RnCxWg[#`&a0Ua()`1Rm75Rg[c]%X#qi8Rg^NvdRj>BwzgZauwji7Rm6A4wgg]d1#&(*,.0a#Rm;Rm<Rm=Rm>Rm?Rm@RmARmBe%#^^^Xaea?aC/b+(,!a+a#!a/!>a&Ta<aKbD!2wphBRnk[yPw}hE|.=Br-3Dtm>6Vy~g6urRf.x,hPrNav!%'RnqRo%Ro#Nu;q[Pw;5r+JwNZtM@3r)d'#Y'Weh;xChL#`&RnmRnoKu}>%(!Rne~Bs-;2wjcussJv+'!aYSO}6@B<5?ba~8LrNvj!.%*ROwungw~ng~:9;Ri^>wtnig;wHRnixDh@|(UZ.x1h@|)!#:2<H|*xHn]#-UX'3Ro)z=iT}6ARns=Bwsn_wpnaRncw]aR(#UXa&Ua*a/=]iPd'#Y&Ro'WnXf{QRm2hNvj]nZd`'T~&1`{|`#9b]{}c:'!#Wl{>@=be}]?cl{{U#:5Abb}Jds#^YaF!a*b4a#a3aPa>&Tb!bH!*a_!Eau?/a&RjY<]gj>6Vz*;:pe~DrZg,QRj1JwNZtX@wihspcJvZ&!VyX9WmOJu|!|N2WmHJvh&!]ht~Bpbcn&T(!#RmQ<s7Nu;padH#X'`+WmJ@>RmKCARhnKup=!)&Wf+:RhqNuPpf9c!#'45pd5AwghpARn(Ls@w!%,)!RmP@Wfe<E|IJva!&WmNg8vsRmLd`*.`#Y'Xa!axRn*]hrA8Rhug5s@rXg8u!RmMd8#X'X*3@rV72smdI*#UY&RmICARho~GsgxVgd)Ta'U-Y&Xa!T#RnEWnA@Wffg1uDRi0hFvK5RnBxGnG&#`%owp)@wsf+bX}Ze-*1!a*^^^Ua|!#a.aq&Ya2!a>.a6!a:aO`aJDtL[y`@Wg#>6Vz12@wzoYRoZNuPRi!NuPRhzg=ucRi,@=b`{Yg=ucRi-ACJvB!&Sh[ebSh]ebi`wUuFRm4Jw2_[y0JvB!.<Ju(!&SoG}6Shd}6<Ju(!&SoH}6She}6Kur@._g5vHRieJvx!{L2G{Kx6gd'T#?Rh82Wi5cZ#X(g1w)Rm5dW-Y(Ta#!a)!#aYa=wnfE=su2>>bU{0j9udv:<svj8uQv-7RgHdE%#^'sq9sp=>Bb_{TJv`!&g/r|snj6v(us5d,#Y(56H}[978H}]Jw5!&g1rushJvB!+j;v{u5?zDhd}6}bj;v{u5?zDhe}6}ce*#`(^^^a[aea!=!a6a*aoXb1a.!aAbL!b>,b'aL!aV@Wf|2Wlg3[y/JwNZt^@3piPw:5pgJunZou3@rsJva&!Vy_g<v~Rm#JvG'!6Vz0=<r{Ju{%!:pj@WfsiXuJu3Rm:JvZ&!WfA~Bph@c4Z&Dtwax5rubx(#:awRk1@d,#Y&RfjRfid1#,Y(@Wfp2Wlrg5s@ryKu[@!,'=]ig9wlk?Rk>g5u-rqJvy'!@9RkQcH(T#=>Ri~@<wkj(Wj(KuZB*!&<7rw@9RkRcH(T#=>Ri}@<wkj)Wj)dg(Ta2Xa9X#`-!a*CARhg@@=I}d9x;c~#X%so=<sj>2@@=aybb}XjWv0Q~EfEj3vLv;<d,#Y(56H}`978H}_dgaPaFa'a/!#a3Y0a_a;a|!1(a7-[yE3[xt;:pJNvZrrg3uJrvJwNZt=@3pIh=rt3rxPw:5pGOu!5rpJvG'!6Vys=<rz@c4Z&Dt(ax5rtJvZ!&~BpH@wsfNg-vaRlNci*U#=<wei<F}a5@Jq.!a*JQ!%@qZ23d(#Y&RjH5]jCk!u7w&u0udARjFd/prq=tyvpaEa(a:.!a1aZ(@@=I}:9wpd%=<sX55w_h}@@=I{t=ay<aU@@=I}T=ay<2@@=I})?C9:9au@9Cb]}DP~=x-fAZ(2Wl1=ay<aU@@=I}>5@d##Y+jTv|vV~EfFj]uNpn~FRfGdgaK!Z2&!a8a-Tb({E!acTbM*!a(DtY[yYd'%Y#sl[y*hHvh>Re5x2c{Z}.j4uCvcawRiMd+#X+_x&d!},<5RkX;2Hzw@x,gavfB-!{CcF&T#Roe;RodwWbBg5urRgaKvHC*_6Vz+<4opieuew&Rmq@d]&Y)X,T#X0Rh}<BqP=4qS9:ReMg/ujReNJw0!/<Jui%!bd{kawwnemRelAxUa?a3#*.&UX(Ya+a/RhvRnQ<o}9Wmtd-#Y&RgSRmw9;Rmxay=Rmyg-vaRmuxEhSrNu,v-voC!%(aR.a(a7+1Ro1>Ro5CE{A9b]{@;5x#eO{:g;urRi+KrNA!%(Ro3>Ro79;Ri_Ku@>{;&!x%gX|{KunA_+g5QRj/g3u5Rj#g>uERj%wio/xRhS&!,!#^1U}wba{8>>@=be}qC@:D5ba{7Ku+A&!}x?ba}t>>@=be}se(aA^^^Uat!b0#{pa+awUazbGa#aLb9bgaWac'a5TbS=Br!d1#`%scp_Jvl!#rT>Re0JvX&!VyN=H{Fcm#U&:pY=ReaJv2&!]h0=]nUJvG'!6Vy|=<r%JrM_=]h2@Wlud'#)U'Wf'b]{i=]h/Jvh!&~BpWg=v]RnMx+ny#'Nu;pVwjnu=]nwxJnx,T#`&Reqwjnt=]nvieu9vrRjLLuYwP(#+!th@wih5pX~Gr'g5v/Rh4KunA'!-CARnP@wwiN:Rm_9x'cvw>!|l=<saKvAA!0&3@q}>w^e1bp#&Re2Re3BDx7gH#T|f5H|eKuZ>!%(:qNAH{]Jv6!+3B2B9=b^{X<5<B92:E{ZLvhwA(a;a%!igQuyRmad+#Y}m@3Rh5d8#X'X*:AqUAHzmaxwbh<aXRnVcF}RT#Nw&cj#U(BWnug/vsRntdka)(a3+.Zb7aYYan1!bVa@Xa}[y^@b[{G=H{+hFu73Rj&Pv#5ReQcK%T#sig1v{Rj'Ku+D#'!t]~Grm~?rkKuMB!01d5#`'Vy.ta3Dtu~Hroc8#'{^45s85AwZbP&!#Rn!wghxWn#KvEA!)&2RlA2RlBx:h|#(T,=]j09Wobz>x]z/@awRoTd+#Y(az]hFhCrm4d,#Y+jTv|Q~EfMj]uNr|~FRfOdCa!Xa9_X#@<plJvf!%b`{(9;Rgwc;.!#2x7cw#T|UDb]|T5Ju={(!=@E{&Jv)&!Ab`{'awJvf!~*>>@=be{#KuY>!+&4Ezyi[ugv&RjIdea+T)#UXa&T-T&a!Rh9auRmW=]kLg5vuRn+g3u4Rn-Ow6ARn,hHus5xNk?#UX(U~)/g8v0RkD~AwkkF?Ri.OuNBwkkA?Ri/d|a2`a*^UYa.!aBTZaTa'Xa;!(!2!-a#b2[yC>6Vyq3[xr2Wi?g1rusVh%s?DtF~<5rbJs;%!DtBfswKtCj[uvuSsEu3RgVx3o:u+wN'*Zt;@3rd~Grh~?rfg8w)Lq)qE&-a%!>bI|`jWv0vV~EfCjTv|vV~Ef@j]uNpn~FRfBcK#T']gWNu7x,k7q4ai(0!hHv8<RhmkMu9vrsBuev/RhlCJvB!,g<v{wchh~@:Rhji[vrv{wchi~@:RhkdS&a5UY#Ta!RgPwwiI5BwciI~@:Rh`x'iJvj'!5]iJPu8Bwch]~@:Rhach)U#h3rp]gLh@t|Ax,hTq3ah!-(~@:Ro0Ou!5RhXj^v(pyw8unRhVd|)`,^UYas!a?/a2Z'a^Ta{Tb7Ta(a#!a,Wf&9sZ3DtAadamov=Bqt3[xig8vsRm~>waiL2b`{QJv*_Ouv2qgj<v]v2BqfdR'X*X#Y-@3qr~Gqv~?p6hHv-]glPup5Lq+q?_%*b_{qF{n9b^{rOu4ARhpKvCD!+&~Bqp:5Dbb}nwoiKl&unuTuBv]v+ueunaXRf0=Jvh!0nKufu8v1w&w7q%w&uHrz:Rgnj5w,uxDJq/(!hNw'5ReCk0s2u3w/w'5ReFd>Za&!*UaA=<wkgsRnSJv^!%Refifw3vyRgOKu_B'!,<]gkiiu:w&Rh<=C@a^<B57@2F{[<B5@aW:=3away9A5aW=<B=C@a^<B57@2F{Ie-#`(^^^bCara.b8aza6!/bZ,!adTbnTbOb+aFaS!aAT9@Wf~2Wli3Dtl2@d,#Y&RfnRfmJwJZtN~GqyJva&!VyMg<v~Rm%iXuJu3Rm9Jv[_=]ih9wlkDRkCd1#`(@Wg>2Wls3cH#T(@<Rj*=>Ri|b~'#23s9h<~El.d'#Y&Dtxi^rzvdRl#d*#U%(o|B2s`hJwSaxRmDKv4B&!1:Rmdd5#`'Vx}to~Hq{x'f1v3(!BA5ba|bJv_&!Wfug1v]ReIdO+U/Y#&G}-8wze=Rh{g1v]ReHg/uQRf/by#)ibQwERl/cH#T(@<Rj+=>Ri{cNu+vlax-!(#a0qa9<Rii2;;bU{H;x<i=&X#Rk`<4wwi=C9H~8xAI(Y#<azRi@45wXI<B9;5bb~7dL(X#Xa(+!aL6Vy{g5QqOau:5au2@ay547EzbxOcU(UX-T#Ta#:Cbb|A?wjh/b_|SOw6ARgtihr}u7Rhy<d1#T)X1@@=I|~=ay<2@@=aybb}Sj3vLv;<d,#Y(56H}A978H}@dGpvs@uAu`vcw9*!aFa+ai%(b!aXa8.a?a[ozWey=sU2@G}Nch&U#Rf_WexKu+D#'!t:~Gr`~?r^j]uNr|~FRg*j^psurwJt|RmcKv)@&!)7Rkv~Br[@wxfO:Rl3co#U'6Rezj_q#vIuavjRltwzeyh@vr5JqD0!>aY?C9:9au@9Cb]}9cl#U*5;5<H||jbuus1ucv&Rfvg1v~d/pppzqFr^a--a~!aMat1(hFv;Wiz@@=Izoj5uuv-7Rix~Cw`fk2WlVcZ#X,k)u3vWs@u2]ktg;wEx'fBq(_2Wg/jTv|vV~EfoJv]!15x'hzqG!(P~EfU~CRl_j6v(us5x4i-#T(2WmZ?C2F|d>Kq<aj1!*jTqIsBv=Wl`~Cw`fi2WlWj`v0u*~>RlR=c>Z,k#u3vWs@u2]kr<c1Z+jTqIsBv=Wla~Cw`fm2WlXdmb3!a{(arZa`bkTa%TbQTa-a9+c'!aM!/[yL=Bqug.w'RifhFvyDRj.g>vgwyk^9]k^Jv3_@WfbAARkhJw2_[x|JvB_wkoIRoKwkoJRoLd'(Y#<]gm=<9<H|yd'%_X#skDtb3awwqkgNulRkgdB#^',9:p'hJwSaxRmEBwVb8@4=H|qLu+w50&!)@3qs~?pU>Awwn;;Rn=c:Z'ARn<=<qwKvC@!/&~BqqJv6!&]eVb^z^xRge'/a%+^`#Sge}6<4Rn3=]n0Pw2>Rn8Jw0!&>Rn:>Rn6cY#a7+!a&=<wkaNw~h3z_c5Z{=wjh#=]nLKv^D!&)Vyz=bW|swYb<WetcG#T(2wxa@qVx@gD#Y&b^|V5JwG&!5bb|pg/w&RgD@x=kHs=uAvn!a%%/'+RmSRh694Ro`g-vaRmRhHv-]mlxCcS#`&ba~.5cD#Ta)P~=d,#Y(56H{>978H{Dd_#{2^Y%_+qbbb{6g3sERhsbU{?dfa.,`a(Xa<!aiX#(55RiG54RiHcI#T'WiU3RiVNvdwtfcRlKNvdd,#Y&RlHRlExQgf.1*^T'X#Sgf}6Wn4=]hfPrk>Rn7Jw0!&>Rn5>Rn9Lunw?&a2!,5<oq@@wqfdRlJj5Q~=d,#Y(~ARfcOuN]fdDKw;ay(}i!547E}j?cI#T(@5bV}iCbV}hdv(^^Tb?a40,b##Tbo!a*bR!a<b|a/!aKai!aU[yK=]o^g:v>ReGJwPZtK<7Rh+h<~El,Pv#5ReR@awwxjCg,ulRjDJv6&!]j!z?aQeeg>w=Sh<eeJw;!&axEzOg,Qosc!#*:wkeJ]eJ>x'h-u(!%Ro.w~h.zPdNZ(X,Ya![x{;9ReY;wkgxRiF:x?ap#Y&RmUg<s2Rkod]+UY0TZ'!a&A9sw<=bczLNvuw{gqzNhJwSaxRmCKuLay!#&s_Rf-55b^{uJvZa!!c%#(55Ri654wmiu5RiuawLu,vp!+}^%b_}Y9;wkgxba}o>A9:=b^}zKuh=a''!3awRk3c*'!#aHRk6c+Z&Rk5Rk4Jv)&!awRjSawd9*`#0?C2@EzMj8u<uJ5RmbjQrquJu3x,k>uq@_+=ayb^|W~ARkEOuN]k@7dhzV^X/X&a-#zRzSb`zXcJzTT#2WkVKvDBzW!%FzY9;5bbzWjQrquJu3Jw3%!b`zU=ayb^zQd:#X(T-a!6Vyywxh}=b]{Jg=u1RiAdGp~qHtzv!w(wA+a+a;<!aJaYai'anasb(=azRmV:Cbb{MLq2vb!%')RjuRjrRjtRjqx3jnqCw3!%')Rk(Rk+Rk&Rk)Lq2vb!%')Rj{RjxRjzRjwLq2vb!%')RjsRjpRjfRjex3jcqCw3!%')Rk'Rk*RjkRjl9<CbbzfOu4ARhxLq2vb!%')RjyRjvRjhRjgx=joq*uKvb!%')+-Rk.Rk%Rj~Rk-Rk#Rj}x=jdq*uKvb!%')+-Rk,Rk!Rj|RjmRjjRjidAq&qKs@uAv8Aa.'*-a@a&0!aM@a5[y73Dsy3Ds|3Dt):wxgI2sHJwJZt.~Gqxwsf0ikrzt}Rl0Jvy_[xj~HqzKv_A|D!&WfP8axRoVcf,U#k(v]v+ueunaXRf1Ju}'!g8u#Ri=jQw!sCunLprq>!,')~<5qeGzq9F{W=c##%s5au:5aU3CBE|;d4#X(D!a&6Vygx(b;#(=]ed?C2F{N<capoq2r[a&!aPa9,'Pw;5s:@@=I|,55w_h|@@=IzcP~=x'fCqB_2Wl2>aU@@=I|1OuNBc1Z+jTqIsBv=Wlc~Cw`fl2WlZ~AcTa%!Z+jTqIsBv=Wlb~Cw`fh2WlYk+uNqJsBv=WlSg,u3dca3#UXaMYa)TaB-=cM|7T#<bI}l5@B932:aV2G{BOuNBJq:|M!5Ezt=<B=C@a^<B57@2F{v>cB{/T#=ay<bI{3Jv6!a.6BKq0ah&+!5E}HP~Ef{978BaU@@=Iza<7d#.Y#978BaU@@=IzH~AJq0!(@@=IzG978BaU@@=IzFe,aU*Y&^^^bvJb,b:bFad!a,c2Ta>aL.bo6!a#CbTa'T#Re{2Wlh2@G{yg6t~Ro_NvdRfticuRQRllJv3&!x&c|zs@Jw3!%RflwpfkRlpKuL;%(!Re<@G|C2GzdhIvuBwgjAg-u0RjAKQB%!(GzZ@G|5NuuRl7d='T+Y#Vy[g<v~Rm!==G|>JvA!)@wma=]m1ifuaw&RmnLs@vT'!|/+[y,g:v>ReTJw1!#qX=x!eC{bLu+wT&)ZtZauq_~Graci&U#F|89:r_Lupvq!.)&2RlG8RfaC=x!eF{_h?rpWlmd&'!#X|&]k::xJey#`'T|+<E|&2@H|%dE#(^,g;u.RiEg6vjRiC9xCkA{O|zY#g=ucRmXKs0@!&*@G|m@awRknJuh!,3d(}gY}eJvj!%Rm):Jw3!%Rm+Rm-Ls0w(&!a(a#@b[|6cZ#X'7RkxWgAOu4ARn'dH'U#Y*Vz-Wm'CARm}d]*#a%^a*T'aK!a<9bV{PC=p*Jw4!&SgxcbB5r]idw(wBRmF7xFkt#&`(Rm/Rm8E|!JuY_9:Rl5=wrgr2:bbxd@xXfB(a*#T+!.X0X1Ta/a'T&RlDRfL>RlyARl9b[z[>RfZ:RlL:RfRwlg/ARl;9;RlxKv,A/!%7s69<74=BA5ba{-8Bde#`a<XaKYa1,a'P~=wxfB2bZ}}?C972@@=I}r8@55B9;5bb}G978B2@@=aybb}3j3vLv;<Jw3&!>Rfk=ayb^}4~Ad1#`*@@=aybb{w2@>==<bbz]dx+UY#^UaF!a9!bB'Ya1.!ajXa#%olRhD[y=3Dt#Ov5BrHKuMB%!(Rf^Wep~HrJwkiQjKr|~FRg)Ku+D#'!t5~GrF~?rDdV)UY,Z/_7RkuG{<~BrBg,rlsO:235B@bX}|d?a1!#`(6Vyn5@d##Y+jTv|vV~EfIj]uNpn~FRfH7Lq2vb1!a9-978BaU@@=Iz9978BbU}#~AJq0!(@@=Iz8978BaU@@=Iz7~AJQ|}!978BbU}!JvkaK!AdUa21-U#`a+(g/vsRn~Ou!5RPj:rmu9WhOjXuvvNr}:RhAj^v(pyw8unRn[kPr}p|u7vwv]RiSBd;pppzq@qHQa?(b.!a.a`@.|xa(hFv;Wiyj5uuv-7Riw~Cw`fg2WlU978BbU|wOuNBJqG!(P~EfD~CRlQcZ#X,k)u3vWs@u2]ksg;wEx'f@q1_2Wg.j]uNpn~FRfqJv]!15x'h{qG!(@@=IzK~CRl^j6v(us5x4i,#T(2WmY?C2F{1>Kq<aj1!*jTqIsBv=Wld~Cw`fj2Wl[j`v0u*~>RlT=c>Z,k#u3vWs@u2]kq<c1Z+jTqIsBv=Wle~Cw`fn2Wl]dn1#c(a(b^a2!b/bAT(bj!aDa7bu,a_a{c0!2T0g:v>ReD2@G{42@G{5~DpM~<5rc=Bx6i>{RT#RnI@zCx]y]z:2Jv[!zr5Awyk]9]k]dD(Y+X#6Vz.g=wKtgwhaCwgmTWj2Lu,w%_+/[y-B;b^xeg3u3Rj-2@bX{*KrJ<!+'@Wg(g?QRlC@Jv`!%b[zIwsfII}8JQ_@w|kW|=Jv(%!AqcOuNBJvEzh!bYzjLs@wP#(0!oy@>RkdJwMZtc3Dtd@BcG#T'9bWxg2@2Fznd*#Y+;2x'c}w<zizixNgwa#Z'U+!/!a'!a+w~g~z6wcn{Rn}wcnzRn|5Rh%=]nJg5vuRmvNvdRlvcprJu}w*az*a#!%.a.'Bot9qT]kj@Wg'ay2Gzv@Jv`!%b[zEwsfHI}1;ck#Ux`<Cbbx_Lu+w!a&0*!wko*wwo,So,}6Juqxf!E}PigQuyRm`d3(`#8>Rn%:A5B;bZ~%KvhCa!a2!x>k7#Uxb@b{#xaRk7Jw0!)>wwhlShl}6>wwhmShm}6CJvB!.x'hhvj{!!5Bwkhhbaz}x'hivjz~!5Bwkhibaz|xEhTrNu,v-vpD!a%&/)a3a.,%Ro2t[CE{)@3re9b]{%wjo09:rgc:Z&Ro6=<riifuaw&RmoKrNA!%(Ro4>Ro89;Ri`dSaL'UYzxZb)7Rka3xRhT&!,!#^1U}vbaz{>>@=be}yC@:D5bazzKu+A&!}{?ba}y>>@=be}wxBh[t`u~vJvr!%a!a()a,a0a4RoC=]o;Ju(!%RoGRhdwjh`=]oAg>w#Ro?g5vuRo=NvdRl|Ku]C.!&;RoEJvB!%RoORoMBx'h[v+_?w~h`}~5?w~hd~!xKh]oiptu-utv.vp!#%&a30a@a'a+(a/aOp(o~p!RoDJu(!%RoHRhewjha=]oBNvdRl}g>w#Ro@g5vuRo>c[#X']o<CauRoRAd-#Y':RkpauRoQKu]C.!&;RoFJvB!%RoNRoPBx'h]v+_?w~ha}t5?w~he}ue!/UbhYacXaW^Tc&a;b:a-c/#b&aja1(!cL+!bKbt!bmcRc9aIc?8[yW3Dtt94Rg`Jv}!&SiRMzBhEebShEMNuPRe>x7gL#TzuwjirRipc<Z&>on;>z=h-MSh.Mwqczx'a7vj&!>Re4@=ResJt__NuPRi*NuPRi)j]uNr|~FRfzKrJ>_+@Wfy@Wf]2WocKrJ<!+'@Wg%g/QRl@@Jv`!&awRl<wsfFIzgLu(w*!.*&ShBMwvhIRhI9;RhNx1hK'!#Sn]Mx1hK~0!#:2<H~7cNu+w7D*'1ZtW>Rn1~?rOc:Z&Rn2=<rQ<7wjh&=BSnLMc]#X(6Vz)w[b=a!U#9wzgMc3#&(RgMRitRis<x,gKt`ax!&+SioM=BSilMc3#&(RgKRinRimKurB,!&SiQMzBhDebShDM6BJQ!(P~Efx978B2@@=I}WLrJw!!,a*&@G}O@9wkibRid@@x'fKwC!&SlDMSfLMjUv~Q~EfKKv3@a+!(hFv-]mpx/hYZ(C5RiWz<o/MwkhY?So/M@x,gbvfB*&!SgEM:SoeeehFu3:Rgbda(,^TZa)X/7Sg[eb:2RgI~BrMC@wgkc:wwkcRerx3h(uUvK!&*,SnOM4Sh*MArRg;wHRh(x=h;rJvPwI!a4',a'0@Wg&=BSh/Mg>w=Rh=g3w*wwgGRgGcW(X#;Sg}M2Gzk@Jv`!&awRl=wsfGIz`dKZ*T'Y-:RhR7RhQg5u-p`j6v(us5d,#Y+~Awkia?RicOuNBwkibba}Ld6p~tyu_vbAa'a+!a/'a3aEa8a!>Sh,ebJv{!&Sh@ebSaReb9;SgwebNuPRi(NvdRl)NuPRi'hHu^<Rm^Jvv_@Wl(g;u1Si/ebKu'B&!*Sh?eb@Wl'z@aPeb95Si.ebcpputyvjB)!,&a+0a%ShAMWeK@G}C@WfJ9;RhMwvhH9w{ia}ix,hJvRA1(!zAn[MRhHx1hJ~*!#hFv(BSn[MBJQ!(@@=I~'978B2@@=I}2db.Ua<'X}+T#a0XaG2G}E;wkg|wuh!Rh!x,hZu,@)!&So0MVy)C5RiXACJvB!&5RiY5RiZg8w)cG}*T#2@bU}=KsA>(!a.3wkhZba~(x,h^u(A!&(SoCMRhb5Bz=h[eb?w~hb~6x,h_u(A!&(SoDMRhc5Bz=h]eb?w~hc~6e)aA1T#T,^^^c-bMb&blcPaP(a/!0!bA=b5c@a(!bfbrc#2afwmhARnjwchORnp2Wlf3DtsNvdRl-2@wpa<]m0bx(#:awRk2@Jw3!%RfhwpfgRlnKQB%!(G{V@G|'NuuRl6d='T+Y#VyUg<v~Rl~==G|<Jv+'!aYShC}6@B<5?ba~8@Jw3'!g2QRljhLrpWlOd+#Y'g.w'rIg>w*wgj@g-u0Rj@Lu+wT&)ZtUauq]~GrGci&U#F|39:rELrNvj!.%*RhCwunfw~nf~:9;Ri]>wtnhg;wHRnhx3hDs@v~!/+'@Wfr@9RkSNu&Rlo=@<5GzoKs0@_+@Wl+@awRkmJuh!-3d(}pY#qWJvj!%Rm(:Jw3!%Rm,Rm*de&!1U-U#`)Re;@G|.@9Ri82@wjfvRlq=@<5GzpLvOvr!).&2RlF8Rf`C=x!eE{.Jw3_g2QRlkhLrpWlPde(!#U{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2<H{mx3n[t{vl!,&a%3Ro(z=iS}6ARnr=Bwsn^wvn`Rnbd`*T}B0!#^X'BG{c9b]{a>>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}<j3vLv;<Jw3&!>Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==<bbzl?C972@@=Ix^d6rSu,v7w*C(0a)a6#B+a%!sQ[y?3Dt%3[xn~<5rLOu!5p@Ku+D#'!t7~GrP~?rNKvlaya7'!h+v-5qMg=t|cd,U#5AAaa5Abb{S@52B5@a[@52B5Gx[iXueu;d<#`a(!/549C;ag>23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!b<bwA!#5@B932:aV2G|:d-)Y#hJrL>RhG<7@C5<H|_=Cau:5aj5@B932:bJ|ng>vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5<H|Eg>unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2<BaY?C2F|GOu!5x,g|p{ah!-(?C2F|c9:4E|OjXuvvNr}:Rh&i[w*t|cd+U#jJvsu)vsSn~Mkfrmu9p}u7vwv]So!McW#Xa!ax5@A5aY:5;5<H|>kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2<BaY?C2F|.5Jvk!a)javYrquJu3x4ia#T)2@SmYM?C2F|HAxPhH(!a#U#`a*-5Abb|4~@:RhJ9:4E|R@52B5G|F:2<BaY?C2F|Sc^#Xa2j=Qq5CJvB!-g<v{z;hhM?C2F|Zi[vrv{z;hiM?C2F|XKsA>!a)-g<v{z;h[eb?C2F|]i[vrv{z;h]eb?C2F|^iZu.vix,hZq3ah!.(?C2F|QOu!5ShXM:2<BaY?C2F|P",13494,2713,49,25,61),bo=new Uint16Array([512,26465,29036,7,0,2,4,116,24638,116,24636,8693,29807,24610,621,1,0,0,3,112,24614,111,115,24615]),xo;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`,e[e.VALUE_MASK=8191]=`VALUE_MASK`})(xo||={});var So;(function(e){e[e.AMP=38]=`AMP`,e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_X=120]=`LOWER_X`})(So||={});var Co=32,wo=21,To=2097151,Eo=2047,Do=0;function Oo(e){let t=e>>>wo;return t===Eo?Do:t}function ko(e){return e-So.ZERO>>>0<=9}function Ao(e){return(e|Co)-So.LOWER_A>>>0<=5}function jo(e){return(e|Co)-So.LOWER_A>>>0<=25}function Mo(e){return e===So.EQUALS||jo(e)||ko(e)}var No;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(No||={});var Po;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Po||={});var Fo=class{decodeTree;emitCodePoint;errors;state=No.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=Po.Strict;runConsumed=0;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}startEntity(e){this.decodeMode=e,this.state=No.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case No.EntityStart:return e.charCodeAt(t)===So.NUM?(this.state=No.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=No.NamedEntity,this.stateNamedEntity(e,t));case No.NumericStart:return this.stateNumericStart(e,t);case No.NumericDecimal:return this.stateNumericDecimal(e,t);case No.NumericHex:return this.stateNumericHex(e,t);default:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|Co)===So.LOWER_X?(this.state=No.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=No.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){let n=e.length,{result:r}=this,{consumed:i}=this;for(;t<n;){let n=e.charCodeAt(t);if(ko(n)||Ao(n)){let e=n<=So.NINE?n-So.ZERO:(n|Co)-So.LOWER_A+10;r=r*16+e,i+=1,t+=1}else return this.result=r,this.consumed=i,this.emitNumericEntity(n,3)}return this.result=r,this.consumed=i,-1}stateNumericDecimal(e,t){let n=e.length,{result:r}=this,{consumed:i}=this;for(;t<n;){let n=e.charCodeAt(t)-So.ZERO;if(n>>>0>9)return this.result=r,this.consumed=i,this.emitNumericEntity(n+So.ZERO,2);r=r*10+n,i+=1,t+=1}return this.result=r,this.consumed=i,-1}emitNumericEntity(e,t){if(this.consumed<=t)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===So.SEMI)this.consumed+=1;else if(this.decodeMode===Po.Strict)return 0;return this.emitCodePoint((this.decodeTree===bo?ho:mo)(this.result),this.consumed),this.errors&&(e!==So.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}flushAndEmitLegacyOrReject(e,t,n,r){return this.consumed=e,this.excess=t,this.result===0||this.decodeMode===Po.Attribute&&(r===0||t>1||Mo(n))?0:this.emitNotTerminatedNamedEntity()}stateNamedEntity(e,t){let{decodeTree:n}=this,r=e.length,i=this.decodeMode===Po.Strict,{treeIndex:a}=this,{excess:o}=this,{consumed:s}=this,c=n[a];for(;t<r;){for(;(c&(xo.VALUE_LENGTH|xo.FLAG13))===0&&(c&xo.JUMP_TABLE)!==0;){let i=e.charCodeAt(t),l=c&xo.JUMP_TABLE,u=(c&xo.BRANCH_LENGTH)>>7;if(u===0){if(i!==l)return this.flushAndEmitLegacyOrReject(s,o,i,0);a+=1}else{let e=i-l;if(e>>>0>=u)return this.flushAndEmitLegacyOrReject(s,o,i,0);let t=n[a+1+e];if(t===0)return this.flushAndEmitLegacyOrReject(s,o,i,0);a=a+u+t&65535}if(c=n[a],t+=1,o+=1,t>=r)break}if(t>=r)break;if((c&(xo.VALUE_LENGTH|xo.FLAG13))===xo.FLAG13){let i=(c&xo.BRANCH_LENGTH)>>7,{runConsumed:l}=this;if(l===0){let n=e.charCodeAt(t);if(n!==(c&xo.JUMP_TABLE))return this.flushAndEmitLegacyOrReject(s,o,n,0);t+=1,o+=1,l=1}for(;l<i;){if(t>=r)return this.treeIndex=a,this.excess=o,this.consumed=s,this.runConsumed=l,-1;let i=l-1,c=n[a+1+(i>>1)]>>((i&1)<<3)&255,u=e.charCodeAt(t);if(u!==c)return this.runConsumed=0,this.flushAndEmitLegacyOrReject(s,o,u,0);t+=1,o+=1,l+=1}this.runConsumed=0,a+=1+(i>>1),c=n[a];continue}let l=c>>>14,u=e.charCodeAt(t);if(l!==0){if(!i&&(c&xo.FLAG13)===0&&(this.result=a,s+=o-1,o=1),u===So.SEMI)return this.emitNamedEntityData(a,l,s+o);if(l===1)return this.flushAndEmitLegacyOrReject(s,o,u,l)}let d=Io(n,c,a+(l||1),u);if(d<0)return this.flushAndEmitLegacyOrReject(s,o,u,l);a=d,c=n[a],t+=1,o+=1}return!i&&c>>>14&&(c&xo.FLAG13)===0&&(this.result=a,s+=o-1,o=1),this.treeIndex=a,this.excess=o,this.consumed=s,-1}emitNotTerminatedNamedEntity(){let{result:e,decodeTree:t}=this,n=t[e]>>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&xo.VALUE_MASK:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){switch(this.state){case No.NamedEntity:return this.result!==0&&(this.decodeMode!==Po.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case No.NumericDecimal:return this.emitNumericEntity(0,2);case No.NumericHex:return this.emitNumericEntity(0,3);case No.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;default:return 0}}};function Io(e,t,n,r){let i=(t&xo.BRANCH_LENGTH)>>7,a=t&xo.JUMP_TABLE;if(a){if(i===0)return r===a?n:-1;let t=r-a;if(t>>>0>=i)return-1;let o=e[n+t];return o===0?-1:n+i+o-1&65535}if(i===0)return-1;let o=i+1>>1,s=n+o+i;for(let t=0;t<i;t++){let i=e[n+(t>>1)]>>((t&1)<<3)&255;if(i===r)return s+e[n+o+t]&65535;if(i>r)return-1}return-1}function Lo(e,t,n){return n===1?String.fromCharCode(e[t]&xo.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function Ro(e,t,n){let r=t+1,i=0,a=r;if(r<n&&(e.charCodeAt(r)|Co)===So.LOWER_X)for(r+=1,a=r;r<n;){let t=e.charCodeAt(r);if(ko(t))i=i*16+(t-So.ZERO);else if(Ao(t))i=i*16+((t|Co)-So.LOWER_A+10);else break;r+=1}else for(;r<n;){let t=e.charCodeAt(r)-So.ZERO;if(t>>>0>9)break;i=i*10+t,r+=1}if(r===a)return 0;r<n&&e.charCodeAt(r)===So.SEMI&&(r+=1),i>1114111&&(i=1114112);let o=r-t;return o>=Eo&&(Do=o,o=Eo),o<<wo|i}function zo(e,t,n){let r=yo,i=e.indexOf(`&`);if(i<0)return e;let a=e.length,o=0,s=``,c=r[0],l=c&xo.JUMP_TABLE,u=(c&xo.BRANCH_LENGTH)>>7;do{let c=i+1,d=e.charCodeAt(c),f,p;if(d===So.NUM){let n=Ro(e,c,a);f=Oo(n),t&&f>0&&e.charCodeAt(c+f-1)!==So.SEMI&&(f=0),p=f===0?``:go(n&To)}else if(jo(d)){f=0,p=``;let n=d-l,i;if(n>>>0<u){let e=r[1+n];i=e===0?-1:u+e&65535}else i=-1;let o=0,s=0,m=i<0?0:r[i],h=c+1;trie:for(;h<a;){for(;(m&(xo.VALUE_LENGTH|xo.FLAG13))===0&&(m&xo.JUMP_TABLE)!==0;){let t=m&xo.JUMP_TABLE,n=(m&xo.BRANCH_LENGTH)>>7;if(n===0){if(e.charCodeAt(h)!==t)break trie;i+=1}else{let a=e.charCodeAt(h)-t;if(a>>>0>=n)break trie;let o=r[i+1+a];if(o===0)break trie;i=i+n+o&65535}if(m=r[i],h+=1,h>=a)break trie}if((m&(xo.VALUE_LENGTH|xo.FLAG13))===xo.FLAG13){let t=(m&xo.BRANCH_LENGTH)>>7;if(e.charCodeAt(h)!==(m&xo.JUMP_TABLE))break;h+=1;let n=t-1,a=i+1,o=0;for(;o+1<n;o+=2){let t=r[a];if(e.charCodeAt(h)!==(t&255)||(h+=1,e.charCodeAt(h)!==(t>>8&255)))break trie;h+=1,a+=1}if(o<n){if(e.charCodeAt(h)!==(r[a]&255))break;h+=1}i+=1+(t>>1),m=r[i];continue}let n=m>>>14,l=e.charCodeAt(h);if(n!==0){if(l===So.SEMI){f=h-c+1,p=n===1?String.fromCharCode(m&xo.VALUE_MASK):Lo(r,i,n);break}if(!t&&(m&xo.FLAG13)===0&&(f=h-c,o=i,s=n),n===1)break}let u=Io(r,m,i+(n||1),l);if(u<0)break;i=u,m=r[i],h+=1}if(p===``){let e=m>>>14;e!==0&&!t&&(m&xo.FLAG13)===0&&(f=h-c,o=i,s=e),f>0&&(p=Lo(r,o,s))}}else f=0,p=``;f===0||n&&d!==So.NUM&&e.charCodeAt(c+f-1)!==So.SEMI&&c+f<a&&Mo(e.charCodeAt(c+f))?i=c:(o<i&&(s+=e.slice(o,i)),s+=p,i=o=c+f),e.charCodeAt(i)!==So.AMP&&(i=e.indexOf(`&`,i))}while(i>=0);return s+e.slice(o)}function Bo(e,t=Po.Legacy){return zo(e,t===Po.Strict,t===Po.Attribute)}var Vo=Symbol(`NOT_RESOLVED`);function Ho(e,t){return{tagName:e,nodeKind:`scalar`,implicit:t.implicit??!1,matchByTagPrefix:t.matchByTagPrefix??!1,implicitFirstChars:t.implicitFirstChars??null,resolve:t.resolve,identify:t.identify,represent:t.represent??(e=>String(e)),representTagName:t.representTagName??(()=>e)}}function Uo(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`sequence`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addItem:t.addItem,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}function Wo(e,t){let n=t.finalize===void 0;return{tagName:e,nodeKind:`mapping`,implicit:!1,matchByTagPrefix:t.matchByTagPrefix??!1,create:t.create,addPair:t.addPair,has:t.has,keys:t.keys,get:t.get,finalize:t.finalize??(e=>e),carrierIsResult:n,identify:t.identify,represent:t.represent??(e=>e),representTagName:t.representTagName??(()=>e)}}var Go=Ho(`tag:yaml.org,2002:str`,{resolve:e=>e,identify:e=>typeof e==`string`}),Ko=[``,`~`,`null`,`Null`,`NULL`],qo=Ho(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>Ko.indexOf(e)===-1?Vo:null,identify:e=>e===null,represent:()=>`null`}),Jo=Ho(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[`n`],resolve:(e,t)=>e===`null`||t&&e===``?null:Vo,identify:e=>e===null,represent:()=>`null`}),Yo=[``,`~`,`null`,`Null`,`NULL`],Xo=Ho(`tag:yaml.org,2002:null`,{implicit:!0,implicitFirstChars:[``,`~`,`n`,`N`],resolve:e=>Yo.indexOf(e)===-1?Vo:null,identify:e=>e===null,represent:()=>`null`}),Zo=[`true`,`True`,`TRUE`],Qo=[`false`,`False`,`FALSE`],$o=Ho(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`T`,`f`,`F`],resolve:e=>Zo.indexOf(e)!==-1||Qo.indexOf(e)===-1&&Vo,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),es=[`true`],ts=[`false`],ns=Ho(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`t`,`f`],resolve:e=>es.indexOf(e)!==-1||ts.indexOf(e)===-1&&Vo,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),rs=[`true`,`True`,`TRUE`,`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`],is=[`false`,`False`,`FALSE`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],as=Ho(`tag:yaml.org,2002:bool`,{implicit:!0,implicitFirstChars:[`y`,`Y`,`n`,`N`,`t`,`T`,`f`,`F`,`o`,`O`],resolve:e=>rs.indexOf(e)!==-1||is.indexOf(e)===-1&&Vo,identify:e=>Object.prototype.toString.call(e)===`[object Boolean]`,represent:e=>e?`true`:`false`}),os=RegExp(`^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$`),ss=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function cs(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function ls(e,t){if(t){if(!ss.test(e))return Vo}else if(!os.test(e))return Vo;let n=cs(e);return Number.isFinite(n)?n:Vo}var us=Ho(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:ls,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),ds=RegExp(`^-?(?:0|[1-9][0-9]*)$`),fs=RegExp(`^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$`);function ps(e){let t=e,n=1;return(t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`)?n*parseInt(t.slice(2),2):t.startsWith(`0o`)?n*parseInt(t.slice(2),8):t.startsWith(`0x`)?n*parseInt(t.slice(2),16):n*parseInt(t,10)}function ms(e,t){if(t){if(!fs.test(e))return Vo}else if(!ds.test(e))return Vo;let n=ps(e);return Number.isFinite(n)?n:Vo}var hs=Ho(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:ms,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),gs=RegExp(`^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$`);function _s(e){let t=e.replace(/_/g,``),n=1;if((t[0]===`-`||t[0]===`+`)&&(t[0]===`-`&&(n=-1),t=t.slice(1)),t.startsWith(`0b`))return n*parseInt(t.slice(2),2);if(t.startsWith(`0x`))return n*parseInt(t.slice(2),16);if(t.includes(`:`)){let e=0;for(let n of t.split(`:`))e=e*60+Number(n);return n*e}return t!==`0`&&t[0]===`0`?n*parseInt(t,8):n*parseInt(t,10)}function vs(e){if(!gs.test(e))return Vo;let t=_s(e);return Number.isFinite(t)?t:Vo}var ys=Ho(`tag:yaml.org,2002:int`,{implicit:!0,implicitFirstChars:[`-`,`+`,...`0123456789`],resolve:vs,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf(`e`)<0,represent:e=>e.toString(10)}),bs=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),xs=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function Ss(e){if(!bs.test(e))return Vo;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)||xs.test(e)?r:Vo}function Cs(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var ws=Ho(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:Ss,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:Cs}),Ts=RegExp(`^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$`),Es=RegExp(`^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function Ds(e,t){if(t){if(!Es.test(e))return Vo;let t=e.toLowerCase(),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=n*parseFloat(t);return Number.isFinite(r)?r:Vo}if(!Ts.test(e))return Vo;let n=Number(e);return Number.isFinite(n)?n:Vo}function Os(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var ks=Ho(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,...`0123456789`],resolve:Ds,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:Os}),As=RegExp(`^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`),js=RegExp(`^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function Ms(e){if(!As.test(e))return Vo;let t=e.toLowerCase().replace(/_/g,``),n=t[0]===`-`?-1:1;if(`+-`.includes(t[0])&&(t=t.slice(1)),t===`.inf`)return n===1?1/0:-1/0;if(t===`.nan`)return NaN;let r=0;if(t.includes(`:`)){for(let e of t.split(`:`))r=r*60+Number(e);r*=n}else r=n*parseFloat(t);return Number.isFinite(r)||js.test(e)?r:Vo}function Ns(e){if(isNaN(e))return`.nan`;if(e===1/0)return`.inf`;if(e===-1/0)return`-.inf`;if(Object.is(e,-0))return`-0.0`;let t=e.toString(10);return/^[-+]?[0-9]+e/.test(t)?t.replace(`e`,`.e`):t}var Ps=Ho(`tag:yaml.org,2002:float`,{implicit:!0,implicitFirstChars:[`-`,`+`,`.`,...`0123456789`],resolve:Ms,identify:e=>typeof e==`number`&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf(`e`)>=0),represent:Ns}),Fs=Ho(`tag:yaml.org,2002:merge`,{implicit:!0,implicitFirstChars:[`<`],resolve:(e,t)=>e===`<<`||t&&e===``?`<<`:Vo,identify:()=>!1}),Is=/^[A-Za-z0-9+/]*={0,2}$/;function Ls(e){let t=e.replace(/\s/g,``);if(t.length%4!=0||!Is.test(t))return Vo;let n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}function Rs(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}var zs=Ho(`tag:yaml.org,2002:binary`,{resolve:Ls,identify:e=>Object.prototype.toString.call(e)===`[object Uint8Array]`,represent:Rs}),Bs=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),Vs=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function Hs(e,t,n,r=0,i=0,a=0,o=0){let s=new Date(Date.UTC(e,t,n,r,i,a,o));return s.setUTCFullYear(e,t,n),s}function Us(e){let t=Bs.exec(e);if(t===null&&(t=Vs.exec(e)),t===null)return Vo;let n=+t[1],r=t[2]-1,i=+t[3];if(!t[4]){let e=Hs(n,r,i);return e.getUTCFullYear()!==n||e.getUTCMonth()!==r||e.getUTCDate()!==i?Vo:e}let a=+t[4],o=+t[5],s=+t[6],c=0;if(a>23||o>59||s>59)return Vo;if(t[7]){let e=t[7].slice(0,3);for(;e.length<3;)e+=`0`;c=+e}let l=Hs(n,r,i,a,o,s,c);if(l.getUTCFullYear()!==n||l.getUTCMonth()!==r||l.getUTCDate()!==i)return Vo;if(t[9]){let e=+t[10],n=+(t[11]||0);if(e>23||n>59)return Vo;let r=(e*60+n)*6e4;l.setTime(l.getTime()-(t[9]===`-`?-r:r))}return l}var Ws=Ho(`tag:yaml.org,2002:timestamp`,{implicit:!0,implicitFirstChars:[...`0123456789`],resolve:Us,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),Gs=Uo(`tag:yaml.org,2002:seq`,{create:()=>[],addItem:(e,t)=>{e.push(t)},identify:Array.isArray});function Ks(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function qs(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}var Js=Uo(`tag:yaml.org,2002:omap`,{create:()=>({list:[],seen:new Set}),addItem:(e,t)=>{let n;if(t instanceof Map){if(t.size!==1)return`cannot resolve an ordered map item`;n=t.keys().next().value}else if(Ks(t)){let e=Object.keys(t);if(e.length!==1)return`cannot resolve an ordered map item`;n=e[0]}else return`cannot resolve an ordered map item`;return e.seen.has(n)?`duplicate key in ordered map`:(e.seen.add(n),e.list.push(t),``)},finalize:e=>e.list,identify:()=>!1}),Ys=Uo(`tag:yaml.org,2002:pairs`,{create:()=>[],addItem:(e,t)=>{if(t instanceof Map)return t.size===1?(e.push(t.entries().next().value),``):`cannot resolve a pairs item`;if(Object.prototype.toString.call(t)!==`[object Object]`)return`cannot resolve a pairs item`;let n=t,r=Object.keys(n);return r.length===1?(e.push([r[0],n[r[0]]]),``):`cannot resolve a pairs item`},identify:()=>!1}),Xs=Wo(`tag:yaml.org,2002:map`,{create:()=>({}),identify:Ks,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{if(typeof t==`object`&&t)return`object-based map does not support complex keys`;let r=String(t);return r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``},has:(e,t)=>typeof t==`object`&&t?!1:Object.prototype.hasOwnProperty.call(e,String(t)),keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}}),Zs=Wo(`tag:yaml.org,2002:set`,{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{let t=new Map;for(let n of e)t.set(n,null);return t},addPair:(e,t,n)=>n===null?(e.add(t),``):`cannot resolve a set item`,has:(e,t)=>e.has(t),keys:e=>e.keys(),get:()=>null});function Qs(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function $s(){return{scalar:[],sequence:[],mapping:[]}}function ec(e){let t=[];for(let n of e){let e=t.length;for(let r=0;r<t.length;r++){let i=t[r];if(i.nodeKind===n.nodeKind&&i.tagName===n.tagName&&i.matchByTagPrefix===n.matchByTagPrefix){e=r;break}}t[e]=n}return t}var tc=class e{tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=ec(e),n=[],r=Qs(),i=$s();for(let e of t){if(e.nodeKind===`scalar`&&e.implicit){if(e.matchByTagPrefix)throw Error(`Implicit scalar tags cannot match by tag prefix`);n.push(e)}switch(e.nodeKind){case`scalar`:e.matchByTagPrefix?i.scalar.push(e):r.scalar[e.tagName]=e;break;case`sequence`:e.matchByTagPrefix?i.sequence.push(e):r.sequence[e.tagName]=e;break;case`mapping`:e.matchByTagPrefix?i.mapping.push(e):r.mapping[e.tagName]=e}}let a=n.filter(e=>e.implicitFirstChars===null),o=new Set;for(let e of n)if(e.implicitFirstChars!==null)for(let t of e.implicitFirstChars)o.add(t);let s=new Map;for(let e of o)s.set(e,n.filter(t=>t.implicitFirstChars===null||t.implicitFirstChars.indexOf(e)!==-1));let c=r.scalar[`tag:yaml.org,2002:str`];if(!c)throw Error(`schema does not define the default scalar tag (tag:yaml.org,2002:str)`);this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=s,this.implicitScalarAnyFirstChar=a,this.defaultScalarTag=c,this.defaultSequenceTag=r.sequence[`tag:yaml.org,2002:seq`],this.defaultMappingTag=r.mapping[`tag:yaml.org,2002:map`],this.exact=r,this.prefix=i}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let t of this.prefix.scalar)if(e.startsWith(t.tagName))return t}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let t of this.prefix.sequence)if(e.startsWith(t.tagName))return t}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let t of this.prefix.mapping)if(e.startsWith(t.tagName))return t}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let n of t){let t=n.resolve(e,!1,n.tagName);if(t!==Vo)return{value:t,tag:n}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...t){let n=[];for(let e of t)n=n.concat(e);return new e([...this.tags,...n])}},nc=new tc([Go,Gs,Xs]),rc=new tc([...nc.tags,Jo,ns,hs,ks]),ic=new tc([...nc.tags,qo,$o,us,ws]);new tc([...nc.tags,Xo,as,ys,Ps,Ws,Fs,zs,Js,Ys,Zs]).withTags({...ys,resolve:(e,t,n)=>{let r=ys.resolve(e,t,n);return r===Vo?us.resolve(e,t,n):r}},{...Ps,resolve:(e,t,n)=>{let r=Ps.resolve(e,t,n);return r===Vo?ws.resolve(e,t,n):r}}),Wo(`tag:yaml.org,2002:map`,{create:()=>new Map,addPair:(e,t,n)=>(e.set(t,n),``),has:(e,t)=>e.has(t),keys:e=>e.keys(),get:(e,t)=>e.get(t),identify:e=>e instanceof Map||Ks(e),represent:e=>{if(e instanceof Map)return e;let t=new Map,n=e;for(let e of Object.keys(n))t.set(e,n[e]);return t}});function ac(e){if(Array.isArray(e)){let t=Array.prototype.slice.call(e);for(let e=0;e<t.length;e++){if(Array.isArray(t[e]))return null;typeof t[e]==`object`&&Object.prototype.toString.call(t[e])===`[object Object]`&&(t[e]=`[object Object]`)}return String(t)}return typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`?`[object Object]`:String(e)}Wo(`tag:yaml.org,2002:map`,{create:()=>({}),identify:Ks,represent:e=>{let t=new Map;for(let n of Object.keys(e))t.set(n,e[n]);return t},addPair:(e,t,n)=>{let r=ac(t);return r===null?`nested arrays are not supported inside keys`:(r===`__proto__`?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,``)},has:(e,t)=>{let n=ac(t);return n!==null&&Object.prototype.hasOwnProperty.call(e,n)},keys:e=>Object.keys(e),get:(e,t)=>{let n=String(t);return Object.prototype.hasOwnProperty.call(e,n)?e[n]:null}});var oc={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function sc(e,t,n,r,i){let a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function cc(e,t){return` `.repeat(Math.max(t-e.length,0))+e}function lc(e,t){if(!e.buffer)return null;let n={...oc,...t},r=/\r?\n|\r|\0/g,i=[0],a=[],o,s=-1;for(;o=r.exec(e.buffer);)a.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);let c=``,l=Math.min(e.line+n.linesAfter,a.length).toString().length,u=n.maxLength-(n.indent+l+3);for(let t=1;t<=n.linesBefore&&!(s-t<0);t++){let r=sc(e.buffer,i[s-t],a[s-t],e.position-(i[s]-i[s-t]),u);c=`${` `.repeat(n.indent)}${cc((e.line-t+1).toString(),l)} | ${r.str}\n${c}`}let d=sc(e.buffer,i[s],a[s],e.position,u);c+=`${` `.repeat(n.indent)}${cc((e.line+1).toString(),l)} | ${d.str}\n`,c+=`${`-`.repeat(n.indent+l+3+d.pos)}^\n`;for(let t=1;t<=n.linesAfter&&!(s+t>=a.length);t++){let r=sc(e.buffer,i[s+t],a[s+t],e.position-(i[s]-i[s+t]),u);c+=`${` `.repeat(n.indent)}${cc((e.line+t+1).toString(),l)} | ${r.str}\n`}return c.replace(/\n$/,``)}function uc(e,t){let n=``;return e.mark?(e.mark.name&&(n+=`in "${e.mark.name}" `),n+=`(${e.mark.line+1}:${e.mark.column+1})`,!t&&e.mark.snippet&&(n+=`\n\n${e.mark.snippet}`),`${e.reason} ${n}`):e.reason}var dc=class e extends Error{reason;mark;constructor(e,t){super(),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=uc(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${uc(this,e)}`}static throwAt(t,n,r,i=``){let a=0,o=0;for(let e=0;e<n;e++){let n=t.charCodeAt(e);n===10?(a++,o=e+1):n===13&&(a++,t.charCodeAt(e+1)===10&&e++,o=e+1)}let s={name:i,buffer:t,position:n,line:a,column:n-o};throw s.snippet=lc(s),new e(r,s)}},fc={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},G={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},pc={BLOCK:1,FLOW:2},mc={CLIP:1,STRIP:2,KEEP:3},hc=-1;function gc(e){switch(e){case 48:return`\0`;case 97:return`\x07`;case 98:return`\b`;case 116:return` `;case 9:return` `;case 110:return`
58
- `;case 118:return`\v`;case 102:return`\f`;case 114:return`\r`;case 101:return`\x1B`;case 32:return` `;case 34:return`"`;case 47:return`/`;case 92:return`\\`;case 78:return`…`;case 95:return`\xA0`;case 76:return`\u2028`;case 80:return`\u2029`;default:return``}}var _c=Array(256),vc=Array(256);for(let e=0;e<256;e++)_c[e]=+!!gc(e),vc[e]=gc(e);function yc(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function bc(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function xc(e){return e===120?2:e===117?4:8}function Sc(e,t,n){let r=0;for(;t<n;){let n=e.charCodeAt(t);if(n===10)r++,t++;else if(n===13)r++,t++,e.charCodeAt(t)===10&&t++;else if(n===32||n===9)t++;else break}return{position:t,breaks:r}}function Cc(e){return e===1?` `:`
59
- `.repeat(e-1)}function wc(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===10||t===13){r+=e.slice(a,o);let t=Sc(e,i,n);r+=Cc(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,o)}function Tc(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===39)r+=e.slice(a,i)+`'`,i+=2,a=o=i;else if(t===10||t===13){r+=e.slice(a,o);let t=Sc(e,i,n);r+=Cc(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,n)}function Ec(e,t,n){let r=``,i=t,a=t,o=t;for(;i<n;){let t=e.charCodeAt(i);if(t===92){r+=e.slice(a,i),i++;let t=e.charCodeAt(i);if(t===10||t===13)i=Sc(e,i,n).position;else if(t<256&&_c[t])r+=vc[t],i++;else{let n=xc(t),a=0;for(;n>0;n--){i++;let t=bc(e.charCodeAt(i));a=(a<<4)+t}r+=yc(a),i++}a=o=i}else if(t===10||t===13){r+=e.slice(a,o);let t=Sc(e,i,n);r+=Cc(t.breaks),i=a=o=t.position}else i++,t!==32&&t!==9&&(o=i)}return r+e.slice(a,n)}function Dc(e,t,n,r,i,a){let o=r<0?0:r,s=e.slice(t,n).replace(/\r\n?/g,`
60
- `),c=s===``?[]:(s.endsWith(`
61
- `)?s.slice(0,-1):s).split(`
62
- `),l=``,u=!1,d=0,f=!1;for(let e of c){let t=0;for(;t<o&&e.charCodeAt(t)===32;)t++;if(r<0||t>=e.length){d++;continue}let n=e.slice(o),i=n.charCodeAt(0);a?i===32||i===9?(f=!0,l+=`
63
- `.repeat(u?1+d:d)):f?(f=!1,l+=`
64
- `.repeat(d+1)):d===0?u&&(l+=` `):l+=`
65
- `.repeat(d):l+=`
66
- `.repeat(u?1+d:d),l+=n,u=!0,d=0}return i===mc.KEEP?l+=`
67
- `.repeat(u?1+d:d):i!==mc.STRIP&&u&&(l+=`
68
- `),l}function Oc(e,t){if(t.valueStart===hc)return``;let{valueStart:n,valueEnd:r}=t;if(t.fast)return e.slice(n,r);switch(t.style){case G.SINGLE_QUOTED:return Tc(e,n,r);case G.DOUBLE_QUOTED:return Ec(e,n,r);case G.LITERAL_BLOCK:return Dc(e,n,r,t.indent,t.chomping,!1);case G.FOLDED_BLOCK:return Dc(e,n,r,t.indent,t.chomping,!0);default:return wc(e,n,r)}}var kc=Object.assign(Object.create(null),{"!":`!`,"!!":`tag:yaml.org,2002:`});function Ac(e,t){if(e.startsWith(`!<`)&&e.endsWith(`>`))return decodeURIComponent(e.slice(2,-1));let n=e.indexOf(`!`,1),r=n===-1?`!`:e.slice(0,n+1),i=t?.[r]??kc[r]??r;return decodeURIComponent(i)+decodeURIComponent(e.slice(r.length))}var jc=-1,Mc=`tag:yaml.org,2002:merge`,Nc={filename:``,schema:ic,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function Pc(e){return`tagStart`in e&&e.tagStart!==jc?e.tagStart:`anchorStart`in e&&e.anchorStart!==jc?e.anchorStart:`valueStart`in e&&e.valueStart!==jc?e.valueStart:`start`in e?e.start:0}function Fc(e,t){dc.throwAt(e.source,e.position,t,e.filename)}function Ic(e,t,n,r){try{return n.finalize(r)}catch(n){if(n instanceof dc)throw n;dc.throwAt(e.source,t,n instanceof Error?n.message:String(n),e.filename)}}function Lc(e,t){let n=Oc(e.source,t),r=t.tagStart===jc?``:e.source.slice(t.tagStart,t.tagEnd),i=e.schema.defaultScalarTag;if(r!==``){if(r===`!`)return{value:n,tag:i};let t=Ac(r,e.tagHandlers),a=e.schema.lookupScalarTag(t);if(a){let r=a.resolve(n,!0,t);return r===Vo&&Fc(e,`cannot resolve a node with !<${t}> explicit tag`),{value:r,tag:a}}let o=e.schema.lookupMappingTag(t)??e.schema.lookupSequenceTag(t);if(o){n!==``&&Fc(e,`cannot resolve a node with !<${t}> explicit tag`);let r=o.create(t);return{value:o.carrierIsResult?r:Ic(e,e.position,o,r),tag:o}}Fc(e,`unknown scalar tag !<${t}>`)}return t.style===G.PLAIN?e.schema.resolveImplicitScalarTag(n):{value:i.resolve(n,!1,i.tagName),tag:i}}function Rc(e,t,n){let r=t.tagStart===jc?``:e.source.slice(t.tagStart,t.tagEnd);return r===``||r===`!`?n:Ac(r,e.tagHandlers)}function zc(e){return e.nodeKind===`mapping`}function Bc(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&Fc(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function Vc(e,t,n,r){Bc(e);for(let i of r.keys(n)){if(Bc(e),t.tag.has(t.value,i))continue;let a=t.tag.addPair(t.value,i,r.get(n,i));a&&Fc(e,a),t.overridable??=new Set,t.overridable.add(i)}}function Hc(e,t,n,r){if(e.position=t.keyPosition,zc(r))Vc(e,t,n,r);else if(r.nodeKind===`sequence`&&Array.isArray(n)){n.length>100&&Fc(e,`abnormal merge sequence size`);for(let r of n){let n=e.nodeTags.get(r);n||Fc(e,`cannot merge mappings; the provided source object is unacceptable`),Vc(e,t,r,n)}}else Fc(e,`cannot merge mappings; the provided source object is unacceptable`)}function Uc(e,t,n,r,i){if(e.position=t.keyPosition,t.keyIsMerge){Hc(e,t,r,i);return}!e.json&&t.tag.has(t.value,n)&&!t.overridable?.has(n)&&Fc(e,`duplicated mapping key`);let a=t.tag.addPair(t.value,n,r);a&&Fc(e,a),t.overridable?.delete(n)}function Wc(e,t,n){let r=e.frames[e.frames.length-1];if(r.kind===`document`)r.value=t,r.hasValue=!0;else if(r.kind===`sequence`){zc(n)&&e.nodeTags.set(t,n);let i=r.tag.addItem(r.value,t,r.index++);i&&Fc(e,i)}else if(r.hasKey){let i=r.key;r.key=void 0,r.hasKey=!1,Uc(e,r,i,t,n)}else r.key=t,r.keyPosition=e.position,r.hasKey=!0,r.keyIsMerge=n.tagName===Mc}function Gc(e,t,n,r,i){if(t.anchorStart!==jc){let a={value:n,tag:r,isValueFinal:i};return e.anchors.set(e.source.slice(t.anchorStart,t.anchorEnd),a),a}return null}function Kc(e,t){let n={...Nc,...t,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;n.eventIndex<n.events.length;){let e=n.events[n.eventIndex++];switch(n.position=Pc(e),e.type){case fc.DOCUMENT:n.anchors=new Map,n.nodeTags=new Map,n.aliasCount=0,n.tagHandlers=Object.create(null);for(let t of e.directives)t.kind===`tag`&&(n.tagHandlers[t.handle]=t.prefix);n.frames.push({kind:`document`,position:n.position,value:void 0,hasValue:!1});break;case fc.SCALAR:{let{value:t,tag:r}=Lc(n,e);Gc(n,e,t,r,!0),Wc(n,t,r);break}case fc.SEQUENCE:{let t=Rc(n,e,`tag:yaml.org,2002:seq`),r=n.schema.lookupSequenceTag(t);r||Fc(n,`unknown sequence tag !<${t}>`);let i=r.create(t),a=Gc(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`sequence`,position:n.position,value:i,tag:r,anchor:a,index:0});break}case fc.MAPPING:{let t=Rc(n,e,`tag:yaml.org,2002:map`),r=n.schema.lookupMappingTag(t);r||Fc(n,`unknown mapping tag !<${t}>`);let i=r.create(t),a=Gc(n,e,i,r,r.carrierIsResult);n.frames.push({kind:`mapping`,position:n.position,value:i,tag:r,anchor:a,key:void 0,keyPosition:n.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case fc.ALIAS:{n.maxAliases!==-1&&++n.aliasCount>n.maxAliases&&Fc(n,`aliases exceeded maxAliases (${n.maxAliases})`);let t=n.source.slice(e.anchorStart,e.anchorEnd),r=n.anchors.get(t);r||Fc(n,`unidentified alias "${t}"`),r.isValueFinal||Fc(n,`recursive alias "${t}" is not supported for tag ${r.tag.tagName} because it uses finalize()`),Wc(n,r.value,r.tag);break}case fc.POP:{let e=n.frames.pop();if(e.kind===`mapping`&&e.hasKey&&(n.position=e.keyPosition,Fc(n,`incomplete mapping pair in event stream`)),e.kind===`document`)n.documents.push(e.value);else{let t=e.tag.carrierIsResult?e.value:Ic(n,e.position,e.tag,e.value);e.anchor&&(e.anchor.value=t,e.anchor.isValueFinal=!0),Wc(n,t,e.tag)}break}}}return n.documents}var qc=-1,Jc=Object.prototype.hasOwnProperty,Yc=1,Xc=2,Zc=3,Qc=4,$c=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,el=/[,\[\]{}]/,tl=/^(?:!|!!|![0-9A-Za-z-]+!)$/,nl=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,rl=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,il=RegExp(`^(?:${nl})*$`),al=RegExp(`^(?:${rl})+$`),ol=RegExp(`^(?:!(?:${nl})*|${rl}(?:${nl})*)$`),sl={filename:``,maxDepth:100};function cl(e,t,n){e.events.push({type:fc.DOCUMENT,explicitStart:t,explicitEnd:n,directives:e.directives})}function ll(e,t,n,r,i,a,o){e.events.push({type:fc.SEQUENCE,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function ul(e,t,n,r,i,a,o){e.events.push({type:fc.MAPPING,start:t,anchorStart:n,anchorEnd:r,tagStart:i,tagEnd:a,style:o})}function dl(e,t){e.events.splice(t.eventsLength,0,{type:fc.MAPPING,start:t.position,anchorStart:qc,anchorEnd:qc,tagStart:qc,tagEnd:qc,style:pc.FLOW})}function fl(e,t,n,r,i,a,o,s,c=mc.CLIP,l=-1,u=!1){e.events.push({type:fc.SCALAR,valueStart:t,valueEnd:n,anchorStart:r,anchorEnd:i,tagStart:a,tagEnd:o,style:s,chomping:c,indent:l,fast:u})}function pl(e,t,n){e.events.push({type:fc.ALIAS,anchorStart:t,anchorEnd:n})}function ml(e){e.events.push({type:fc.POP})}function hl(e){fl(e,qc,qc,qc,qc,qc,qc,G.PLAIN)}function gl(){return{anchorStart:qc,anchorEnd:qc,tagStart:qc,tagEnd:qc}}function _l(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function vl(e,t){e.position=t.position,e.line=t.line,e.lineStart=t.lineStart,e.lineIndent=t.lineIndent,e.firstTabInLine=t.firstTabInLine,e.events.length=t.eventsLength}function K(e,t){dc.throwAt(e.input.slice(0,e.length),e.position,t,e.filename)}function yl(e){return e===10||e===13}function bl(e){return e===9||e===32}function xl(e){return bl(e)||yl(e)}function Sl(e){return e===0||xl(e)}function Cl(e){return e===44||e===91||e===93||e===123||e===125}function wl(e){return e>=48&&e<=57?e-48:-1}function Tl(e){if(e>=48&&e<=57)return e-48;let t=e|32;return t>=97&&t<=102?t-97+10:-1}function El(e){return e===120?2:e===117?4:e===85?8:0}function Dl(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function Ol(e){e.input.charCodeAt(e.position)===10?e.position++:(e.position++,e.input.charCodeAt(e.position)===10&&e.position++),e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function kl(e,t){let n=0,r=e.input.charCodeAt(e.position),i=e.position===e.lineStart||xl(e.input.charCodeAt(e.position-1));for(;r!==0;){for(;bl(r);)i=!0,r===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),r=e.input.charCodeAt(++e.position);if(t&&i&&r===35)do r=e.input.charCodeAt(++e.position);while(!yl(r)&&r!==0);if(!yl(r))break;for(Ol(e),n++,i=!0,r=e.input.charCodeAt(e.position);r===32;)e.lineIndent++,r=e.input.charCodeAt(++e.position)}return n}function Al(e,t=e.position){let n=e.input.charCodeAt(t);if((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)){let n=e.input.charCodeAt(t+3);return n===0||xl(n)}return!1}function jl(e){e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279&&(e.position++,e.lineStart=e.position)}function Ml(e){if(e.position!==e.lineStart)return!1;if(Al(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;let t=_l(e);jl(e),kl(e,!0);let n=e.input.charCodeAt(e.position),r=e.position===e.lineStart&&(n===37||n===45&&Al(e));return vl(e,t),r}function Nl(e){let t=e.input.charCodeAt(e.position);for(;t!==0&&!yl(t);)t=e.input.charCodeAt(++e.position)}function Pl(e,t,n){$c.test(e.input.slice(t,n))&&K(e,`the stream contains non-printable characters`)}function Fl(e,t,n){if(e.input.charCodeAt(e.position)!==33)return!1;t.tagStart!==qc&&K(e,`duplication of a tag property`);let r=e.position,i=!1,a=!1,o=`!`,s=e.input.charCodeAt(++e.position);s===60?(i=!0,s=e.input.charCodeAt(++e.position)):s===33&&(a=!0,o=`!!`,s=e.input.charCodeAt(++e.position));let c=e.position,l;if(i){for(;s!==0&&s!==62;)s=e.input.charCodeAt(++e.position);s!==62&&K(e,`unexpected end of the stream within a verbatim tag`),l=e.input.slice(c,e.position),e.position++}else{for(;s!==0&&!xl(s)&&!(n&&Cl(s));)s===33&&(a?K(e,`tag suffix cannot contain exclamation marks`):(o=e.input.slice(c-1,e.position+1),tl.test(o)||K(e,`named tag handle cannot contain such characters`),a=!0,c=e.position+1)),s=e.input.charCodeAt(++e.position);l=e.input.slice(c,e.position),el.test(l)&&K(e,`tag suffix cannot contain flow indicator characters`)}return l&&!(i?il.test(l):al.test(l))&&K(e,`tag name cannot contain such characters: ${l}`),!i&&o!==`!`&&o!==`!!`&&!Jc.call(e.tagHandlers,o)&&K(e,`undeclared tag handle "${o}"`),t.tagStart=r,t.tagEnd=e.position,!0}function Il(e,t){if(e.input.charCodeAt(e.position)!==38)return!1;t.anchorStart!==qc&&K(e,`duplication of an anchor property`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!xl(e.input.charCodeAt(e.position))&&!Cl(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&K(e,`name of an anchor node must contain at least one character`),t.anchorStart=n,t.anchorEnd=e.position,!0}function Ll(e,t){if(e.input.charCodeAt(e.position)!==42)return!1;(t.anchorStart!==qc||t.tagStart!==qc)&&K(e,`alias node should not have any properties`),e.position++;let n=e.position;for(;e.input.charCodeAt(e.position)!==0&&!xl(e.input.charCodeAt(e.position))&&!Cl(e.input.charCodeAt(e.position));)e.position++;return e.position===n&&K(e,`name of an alias node must contain at least one character`),pl(e,n,e.position),!0}function Rl(e,t){kl(e,!1),e.lineIndent<t&&K(e,`deficient indentation`)}function zl(e,t,n){if(e.input.charCodeAt(e.position)!==39)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===39){if(e.input.charCodeAt(e.position+1)===39){i=!1,e.position+=2;continue}let t=e.position;return e.position++,fl(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,G.SINGLE_QUOTED,mc.CLIP,-1,i),!0}yl(a)?(i=!1,Rl(e,t)):e.position===e.lineStart&&Al(e)?K(e,`unexpected end of the document within a single quoted scalar`):a!==9&&a<32?K(e,`expected valid JSON character`):e.position++}K(e,`unexpected end of the stream within a single quoted scalar`)}function Bl(e,t,n){if(e.input.charCodeAt(e.position)!==34)return!1;e.position++;let r=e.position,i=!0;for(;e.input.charCodeAt(e.position)!==0;){let a=e.input.charCodeAt(e.position);if(a===34){let t=e.position;return e.position++,fl(e,r,t,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,G.DOUBLE_QUOTED,mc.CLIP,-1,i),!0}if(a===92){i=!1;let n=e.input.charCodeAt(++e.position);if(yl(n))Rl(e,t);else if(Dl(n))e.position++;else{let t=El(n);for(t===0&&K(e,`unknown escape sequence`);t-->0;)e.position++,Tl(e.input.charCodeAt(e.position))<0&&K(e,`expected hexadecimal character`);e.position++}}else yl(a)?(i=!1,Rl(e,t)):e.position===e.lineStart&&Al(e)?K(e,`unexpected end of the document within a double quoted scalar`):a!==9&&a<32?K(e,`expected valid JSON character`):e.position++}K(e,`unexpected end of the stream within a double quoted scalar`)}function Vl(e,t,n){let r=e.input.charCodeAt(e.position),i=mc.CLIP,a=-1,o=!1;if(r!==124&&r!==62)return!1;let s=r===124?G.LITERAL_BLOCK:G.FOLDED_BLOCK;for(e.position++;e.input.charCodeAt(e.position)!==0;){let n=e.input.charCodeAt(e.position),r=wl(n);if(n===43||n===45)i!==mc.CLIP&&K(e,`repeat of a chomping mode identifier`),i=n===43?mc.KEEP:mc.STRIP,e.position++;else if(r>=0)r===0&&K(e,`bad explicit indentation width of a block scalar; it cannot be less than one`),o&&K(e,`repeat of an indentation width identifier`),a=t+r-1,o=!0,e.position++;else break}let c=!1;for(;bl(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&Nl(e),yl(e.input.charCodeAt(e.position))?Ol(e):e.input.charCodeAt(e.position)!==0&&K(e,`a line break is expected`);let l=o?a:-1,u=0,d=e.position,f=e.position;for(;e.input.charCodeAt(e.position)!==0;){let n=e.position,r=0;for(;e.input.charCodeAt(n+r)===32;)r++;let i=e.input.charCodeAt(n+r);if(i===0){l>=0?r>l&&(f=n+r):r>0&&(f=n+r);break}if(Ml(e))break;if(!o&&l===-1&&yl(i)&&(u=Math.max(u,r)),!o&&l===-1&&!yl(i)&&(i===9&&r<t&&(e.position=n+r,K(e,`tab characters must not be used in indentation`)),r<u&&(e.position=n+r,K(e,`bad indentation of a mapping entry`))),l===-1&&i!==0&&!yl(i)&&r<t){e.lineIndent=r,e.position=n+r;break}!o&&i!==0&&!yl(i)&&l===-1&&(l=r);let a=l===-1?t+1:l;if(i!==0&&!yl(i)&&r<a){e.lineIndent=r,e.position=n+r;break}Nl(e),f=e.position,yl(e.input.charCodeAt(e.position))&&(Ol(e),f=e.position)}return Pl(e,d,f),fl(e,d,f,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,s,i,l),!0}function Hl(e,t){let n=e.input.charCodeAt(e.position),r=t===Yc;if(n===0||xl(n)||n===35||n===38||n===42||n===33||n===124||n===62||n===39||n===34||n===37||n===64||n===96||r&&Cl(n))return!1;if(n===63||n===45){let t=e.input.charCodeAt(e.position+1);if(Sl(t)||r&&Cl(t))return!1}return!0}function Ul(e,t,n,r){if(!Hl(e,n))return!1;let i=e.position,a=e.position,o=e.input.charCodeAt(e.position),s=n===Yc,c=!1;for(;o!==0&&!Ml(e);){if(o===58){let t=e.input.charCodeAt(e.position+1);if(Sl(t)||s&&Cl(t))break}else if(o===35){if(xl(e.input.charCodeAt(e.position-1)))break}else if(s&&Cl(o))break;else if(yl(o)){let n=e.position,r=e.line,i=e.lineStart,a=e.lineIndent;if(kl(e,!1),e.lineIndent>=t){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=n,e.line=r,e.lineStart=i,e.lineIndent=a;break}bl(o)||(a=e.position+1),o=e.input.charCodeAt(++e.position)}return a!==i&&(Pl(e,i,a),fl(e,i,a,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,G.PLAIN,mc.CLIP,-1,!c),!0)}function Wl(e,t){let n=e.line;kl(e,!0),(e.line>n&&e.lineIndent<t||e.firstTabInLine!==-1&&e.lineIndent<t)&&K(e,`deficient indentation`)}function Gl(e,t,n){let r=e.input.charCodeAt(e.position),i=r===123,a=e.position,o=!0;if(r!==91&&r!==123)return!1;let s=i?125:93;for(i?ul(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,pc.FLOW):ll(e,a,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,pc.FLOW),e.position++;e.input.charCodeAt(e.position)!==0;){Wl(e,t);let n=e.input.charCodeAt(e.position);if(n===s)return e.position++,ml(e),!0;o?n===44&&K(e,`expected the node content, but found ','`):K(e,`missed comma between flow collection entries`);let r=!1,a=!1;n===63&&xl(e.input.charCodeAt(e.position+1))&&(r=a=!0,e.position+=1,Wl(e,t));let c=e.line,l=_l(e),u=Jl(e,t,Yc,!1,!0);Wl(e,t),n=e.input.charCodeAt(e.position),(i||a||e.line===c)&&n===58?(r=!0,e.position++,Wl(e,t),i||dl(e,l),u||hl(e),Jl(e,t,Yc,!1,!0)||hl(e),Wl(e,t),i||ml(e)):i&&r?(u||hl(e),hl(e)):i?hl(e):r&&(dl(e,l),u||hl(e),hl(e),ml(e)),n=e.input.charCodeAt(e.position),n===44?(o=!0,e.position++):o=!1}K(e,`unexpected end of the stream within a flow collection`)}function Kl(e,t,n){if(e.firstTabInLine!==-1||e.input.charCodeAt(e.position)!==45||!Sl(e.input.charCodeAt(e.position+1)))return!1;for(ll(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,pc.BLOCK);e.input.charCodeAt(e.position)===45&&Sl(e.input.charCodeAt(e.position+1));){e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,K(e,`tab characters must not be used in indentation`));let n=e.line;e.position++;let r=kl(e,!0)>0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&Sl(e.input.charCodeAt(e.position+1))&&K(e,`bad indentation of a sequence entry`),r&&e.lineIndent<=t?hl(e):Jl(e,t,Zc,!1,!0),kl(e,!0),e.lineIndent<t||e.position>=e.length)break;e.lineIndent>t&&K(e,`bad indentation of a sequence entry`),e.line===n&&e.input.charCodeAt(e.position)===45&&Sl(e.input.charCodeAt(e.position+1))&&K(e,`bad indentation of a sequence entry`)}return ml(e),!0}function ql(e,t,n,r){let i=!1,a=!1,o=!1,s=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);for(;c!==0;){!i&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,K(e,`tab characters must not be used in indentation`));let l=e.input.charCodeAt(e.position+1),u=e.line;if((c===63||c===58)&&Sl(l))o||=(ul(e,e.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pc.BLOCK),!0),c===63?(i&&hl(e),a=!0,i=!0):i?i=!1:(hl(e),a=!0,i=!1),e.position+=1,s=!0;else{i&&=(hl(e),!1);let t=_l(e);if(!Jl(e,n,Xc,!1,!0))break;if(e.line===u){for(c=e.input.charCodeAt(e.position);bl(c);)c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),Sl(c)||K(e,`a whitespace character is expected after the key-value separator within a block mapping`),!o){for(vl(e,t),ul(e,t.position,r.anchorStart,r.anchorEnd,r.tagStart,r.tagEnd,pc.BLOCK),o=!0,Jl(e,n,Xc,!1,!0),c=e.input.charCodeAt(e.position);bl(c);)c=e.input.charCodeAt(++e.position);e.position++}a=!0,i=!1,s=!1}else if(a)K(e,`expected ':' after a mapping key`);else return r.anchorStart!==qc||r.tagStart!==qc?(vl(e,t),!1):!0}else if(a)K(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return r.anchorStart!==qc||r.tagStart!==qc?(vl(e,t),!1):!0}if(Jl(e,t,Qc,!0,s)&&(s=!1),i||(s&&=(hl(e),!1)),kl(e,!0),c=e.input.charCodeAt(e.position),(e.line===u||e.lineIndent>t)&&c!==0)K(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return a?(i&&hl(e),o&&ml(e),!0):!1}function Jl(e,t,n,r,i,a=!0){e.depth>=e.maxDepth&&K(e,`nesting exceeded maxDepth (${e.maxDepth})`),e.depth++;let o=1,s=!1,c=!1,l=null,u=gl(),d=n===Qc||n===Zc,f=d,p=d;if(r&&kl(e,!0)&&(s=!0,o=e.lineIndent>t?1:e.lineIndent===t?0:-1),o===1)for(;;){let r=e.input.charCodeAt(e.position),i=_l(e);if(s&&o!==1&&(r===33||r===38))break;if(s&&p&&(u.tagStart!==qc||u.anchorStart!==qc)&&(r===33||r===38)){let n=_l(e),r=t+1;if(ql(e,e.position-e.lineStart,r,u)&&e.events[n.eventsLength]?.type===fc.MAPPING)return e.depth--,!0;vl(e,n)}if(s&&(r===33&&u.tagStart!==qc||r===38&&u.anchorStart!==qc)||!Fl(e,u,n===Yc)&&!Il(e,u))break;l===null&&(l=i),kl(e,!0)?(s=!0,f=p,o=e.lineIndent>t?1:e.lineIndent===t?0:-1):f=!1}if(f&&=s||i,o===1||n===Qc){let r=n===Yc||n===Xc?t:t+1,i=e.position-e.lineStart;if(o===1){if(f&&(Kl(e,i,u)||ql(e,i,r,u))||Gl(e,r,u))c=!0;else{let t=e.input.charCodeAt(e.position);if(l!==null&&a&&p&&!f&&t!==124&&t!==62){let t=_l(e),n=l.position-l.lineStart;vl(e,l),ql(e,n,r,gl())&&e.events[t.eventsLength]?.type===fc.MAPPING?c=!0:vl(e,t)}!c&&(d&&Vl(e,r,u)||zl(e,r,u)||Bl(e,r,u)||Ll(e,u)||Ul(e,r,n,u))&&(c=!0)}}else o===0&&(c=f&&Kl(e,i,u))}return d&&=!c,!c&&(u.anchorStart!==qc||u.tagStart!==qc||d)&&(fl(e,qc,qc,u.anchorStart,u.anchorEnd,u.tagStart,u.tagEnd,G.PLAIN),c=!0),e.depth--,c||u.anchorStart!==qc||u.tagStart!==qc}function Yl(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!xl(e.input.charCodeAt(e.position));)e.position++;let n=e.input.slice(t,e.position),r=[];for(n.length===0&&K(e,`directive name must not be less than one character in length`);e.input.charCodeAt(e.position)!==0&&!yl(e.input.charCodeAt(e.position));){for(;bl(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||yl(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;let t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!xl(e.input.charCodeAt(e.position));)e.position++;r.push(e.input.slice(t,e.position))}if(yl(e.input.charCodeAt(e.position))&&Ol(e),n===`YAML`){e.directives.some(e=>e.kind===`yaml`)&&K(e,`duplication of %YAML directive`),r.length!==1&&K(e,`YAML directive accepts exactly one argument`);let t=/^([0-9]+)\.([0-9]+)$/.exec(r[0]);t===null&&K(e,`ill-formed argument of the YAML directive`),parseInt(t[1],10)!==1&&K(e,`unacceptable YAML version of the document`),e.directives.push({kind:`yaml`,version:r[0]})}else if(n===`TAG`){r.length!==2&&K(e,`TAG directive accepts exactly two arguments`);let[t,n]=r;tl.test(t)||K(e,`ill-formed tag handle (first argument) of the TAG directive`),Jc.call(e.tagHandlers,t)&&K(e,`there is a previously declared suffix for "${t}" tag handle`),ol.test(n)||K(e,`ill-formed tag prefix (second argument) of the TAG directive`),e.tagHandlers[t]=n,e.directives.push({kind:`tag`,handle:t,prefix:n})}return!0}function Xl(e){e.directives=[],e.tagHandlers=Object.create(null);let t=!1;for(kl(e,!0);Yl(e);)t=!0,kl(e,!0);let n=!1,r=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&Sl(e.input.charCodeAt(e.position+3))){n=!0;let t=e.line;e.position+=3,kl(e,!0),i=e.line>t}else t&&K(e,`directives end mark is expected`);let a=e.events.length;if(!n&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&Al(e)){e.position+=3,kl(e,!0);return}if(cl(e,n,!1),Jl(e,e.lineIndent-1,Qc,!1,i,i)||hl(e),kl(e,!0),e.position===e.lineStart&&Al(e)&&(r=e.input.charCodeAt(e.position)===46,r)){let t=e.line;e.position+=3,kl(e,!0),e.line===t&&e.position<e.length&&K(e,`end of the stream or a document separator is expected`)}let o=e.events[a];o?.type===fc.DOCUMENT&&(o.explicitEnd=r),ml(e),!r&&e.position<e.length&&!Ml(e)&&K(e,`end of the stream or a document separator is expected`)}function Zl(e,t){let n=e.length,r={...sl,...t,input:`${e}\0`,length:n,position:0,line:0,lineStart:0,lineIndent:0,firstTabInLine:-1,depth:0,directives:[],tagHandlers:Object.create(null),events:[]},i=e.indexOf(`\0`);for(i!==-1&&dc.throwAt(e,i,`null byte is not allowed in input`,r.filename);r.position<r.length&&(jl(r),kl(r,!0),!(r.position>=r.length));){let e=r.position;Xl(r),r.position===e&&K(r,`can not read a document`)}return r.events}var Ql={...sl,...Nc};function $l(e,t={}){let n={...Ql,...t},r=String(e),i=Object.keys(sl),a=Object.keys(Nc);return Kc(Zl(r,qs(n,i)),{...qs(n,a),source:r})}function eu(e,t,n){let r=null;typeof t==`function`?r=t:typeof t==`object`&&t&&(n=t);let i=$l(e,n);if(r===null)return i;for(let e of i)r(e)}function tu(e,t){return!!(e&1<<t)}var nu={applyQuoteFlowKeysOption:iu,doubleQuoteForInvisibles:au,doubleQuoteWhitespaceOnly:ou,applyForceQuotesOption:su,tryLongOrMultilineAsBlock:cu,quoteInvalidPlain:lu,fallbackToDoubleQuoted:uu};function ru(e){return e.presenterOptions.quoteStyle===`single`&&tu(e.allowedStylesMask,G.SINGLE_QUOTED)?G.SINGLE_QUOTED:G.DOUBLE_QUOTED}function iu(e){e.presenterOptions.quoteFlowKeys&&e.isKey&&e.flowOnly&&e.style===G.PLAIN&&(e.style=G.DOUBLE_QUOTED)}function au(e){e.style===G.PLAIN&&/[\t\x7F-\xA0\u2028\u2029\uFEFF\uFFFE\uFFFF]/.test(e.node.value)&&(e.style=G.DOUBLE_QUOTED)}function ou(e){e.style===G.PLAIN&&/^\s+$/.test(e.node.value)&&(e.style=G.DOUBLE_QUOTED)}function su(e){e.presenterOptions.forceQuotes&&(e.isKey||e.style!==G.PLAIN||e.node.tag===e.presenterOptions.schema.defaultScalarTag.tagName&&(e.style=e.node.value.includes(`
69
- `)?G.DOUBLE_QUOTED:ru(e)))}function cu(e){if(e.style!==G.PLAIN||e.isKey)return;let t=e.node.value,n=t.indexOf(`
70
- `)!==-1;if(!tu(e.allowedStylesMask,G.LITERAL_BLOCK)){n&&(e.style=G.DOUBLE_QUOTED);return}let r=e.presenterOptions.lineWidth;if(r===-1){n&&(e.style=G.LITERAL_BLOCK);return}let i=Math.max(Math.min(r,40),r-e.shiftOfContent),a=0,o=!1;for(;a<=t.length;){let e=t.length,n=t.indexOf(`
71
- `,a);n!==-1&&(e=n);let r=t.slice(a,e);if(r.length>i&&r[0]!==` `&&/ [^ \t]/.test(r)&&(o=!0),n===-1)break;a=n+1}o?e.style=G.FOLDED_BLOCK:n&&(e.style=G.LITERAL_BLOCK)}function lu(e){e.style===G.PLAIN&&!tu(e.allowedStylesMask,G.PLAIN)&&(e.style=ru(e))}function uu(e){tu(e.allowedStylesMask,e.style)||(e.style=G.DOUBLE_QUOTED)}var du=`[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]`,fu=`[\\n\\r]`,pu=`\\uFEFF`,mu=`[ \\t]`,hu=`(?:(?!(?:${fu}|${pu}))${du})`,gu=`(?:(?!${mu})${hu})`,_u=`[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]`,vu=`[-?:,\\[\\]{}#&*!|>'"%@\`]`,yu=`[,\\[\\]{}]`,bu=gu,xu=`(?:(?!${yu})${gu})`,Su=`(?:(?:(?!${vu})${gu})|[?:-](?=${bu}))`,Cu=`(?:(?:(?!${vu})${gu})|[?:-](?=${xu}))`,wu=`(?:(?:(?![:#])${bu})|:(?=${bu}))#*`,Tu=`(?:(?:(?![:#])${xu})|:(?=${xu}))#*`,Eu=`(?:${mu}*${wu})*`,Du=`(?:${mu}*${Tu})*`,Ou=`${Su}#*${Eu}`,ku=`${Cu}#*${Du}`,Au=Ou,ju=ku,Mu=`\\n+${wu}${Eu}`,Nu=`\\n+${Tu}${Du}`,Pu=`${Ou}(?:${Mu})*`,Fu=`${ku}(?:${Nu})*`;RegExp(`^(?:${Pu})$`,`u`),RegExp(`^(?:${Fu})$`,`u`),RegExp(`^(?:${Au})$`,`u`),RegExp(`^(?:${ju})$`,`u`),RegExp(`^(?:${_u})*$`,`u`),RegExp(`^(?:${_u}|\\n)*$`,`u`),RegExp(`^(?:${hu}|\\n)*$`,`u`),Object.keys(nu).map(e=>Reflect.get(nu,e)),fc.DOCUMENT,fc.SEQUENCE,fc.MAPPING,fc.SCALAR,fc.ALIAS,fc.POP,G.PLAIN,G.SINGLE_QUOTED,G.DOUBLE_QUOTED,G.LITERAL_BLOCK,G.FOLDED_BLOCK,pc.BLOCK,pc.FLOW,mc.CLIP,mc.STRIP,mc.KEEP;function Iu(e){let t=eu(e,{schema:rc});if(t.length>1)throw new dc(`expected a single document in the stream, but found more`);return t[0]}var Lu=[`javascript:`,`data:text/html`,`vbscript:`,`data:text/javascript`,`data:text/vbscript`,`data:text/css`,`data:text/plain`,`data:text/xml`],Ru={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,colon:`:`,sol:`/`,bsol:`\\`,Tab:` `,NewLine:`
72
- `};function zu(e){let t=e;for(let e=0;e<10;e++){let e=t.replace(/&#x([0-9a-f]+);?/gi,(e,t)=>{let n=Number.parseInt(t,16);return n<=1114111?String.fromCodePoint(n):e}).replace(/&#(\d+);?/g,(e,t)=>{let n=Number.parseInt(t,10);return n<=1114111?String.fromCodePoint(n):e}).replace(/&([a-z]+);?/gi,(e,t)=>Ru[t]??e);if(e===t)break;t=e}return t}function Bu(e){let t=e;try{t=decodeURIComponent(e)}catch{}let n=zu(t),r;try{r=new URL(n)}catch{return!1}return Lu.some(e=>r.href.toLowerCase().startsWith(e))}var Vu=new Set([`innerhtml`,`dangerouslysetinnerhtml`,`textcontent`]);function Hu(e,t,n={}){let r={};for(let i in e){if(i===`$`)continue;let a=e[i],o=i.charCodeAt(0)===58,s=o?i.slice(1):i;if(Vu.has(s.toLowerCase()))continue;let c,l=i;if(n.parseJson&&o){if(typeof a==`string`)try{c=JSON.parse(a)}catch{c=Xu(t,a)}else c=a;l=s}else if(o&&typeof a==`string`){let e=Xu(t,a);e===void 0?c=a:(c=e,l=s)}else c=a;let u=s.toLowerCase();(!o||u!==`href`&&u!==`src`&&u!==`xlink:href`||typeof c!=`string`||!Bu(c))&&(r[l]=c)}return r}function Uu(e){return!!e&&typeof e==`object`&&Array.isArray(e.nodes)}function Wu(e,t={}){if(typeof e==`string`)return t.decodeUnicodeEntities?Bo(e):e;let n=``,r=e.length;for(let i=2;i<r;i++)n+=Wu(e[i],t);return n}function*Gu(e,t){function*n(e,r,i){let a=e;if(t(e)){let t=yield e;if(t===!1)return r.splice(i,1),!0;t!==void 0&&(r[i]=t,a=t)}if(Array.isArray(a)&&a.length>2){let e=2;for(;e<a.length;)(yield*n(a[e],a,e))||(e+=1)}return!1}let r=0;for(;r<e.nodes.length;)(yield*n(e.nodes[r],e.nodes,r))||(r+=1)}function Ku(e,t,n){let r=Gu(e,t),i=r.next();for(;!i.done;){let e=n(i.value);i=r.next(e)}}function qu(e){return e?Yu(e).map(e=>e?e[0].toUpperCase()+e.slice(1):``).join(``):``}function Ju(e){return e?Yu(e).map(e=>e.toLowerCase()).join(`-`):``}function Yu(e){let t=[];if(!e)return t;let n=``,r,i;for(let a=0;a<e.length;a++){let o=e[a],s=o===`-`||o===`_`||o===`/`||o===`.`;if(s===!0){t.push(n),n=``,r=void 0;continue}let c=o.charCodeAt(0),l=c>=48&&c<=57?void 0:c>=65&&c<=90;if(i===!1){if(r===!1&&l===!0){t.push(n),n=o,r=l;continue}if(r===!0&&l===!1&&n.length>1){let e=n[n.length-1];t.push(n.slice(0,n.length-1)),n=e+o,r=l;continue}}n+=o,r=l,i=s}return t.push(n),t}function Xu(e,t){let n=t.split(`.`),r=e;for(let e of n)if(r&&typeof r==`object`&&e in r)r=r[e];else return;return r}var Zu={"[":`]`,"{":`}`,"(":`)`},Qu={"'":`'`,'"':`"`,"`":"`"};function $u(e,t=0){if(e[t]!==`{`)throw Error(`Invalid props, expected \`{\` but got '${e[t]}'`);let n=[];if(e[t+1]===`{`)return;for(t+=1;t<e.length;)if(e[t]===`\\`)t+=2;else if(e[t]===`}`){t+=1;break}else if(e[t]===` `)t+=1;else if(e[t]===`.`)t+=1,n.push([`class`,r(` #.}`)]);else if(e[t]===`#`)t+=1,n.push([`id`,r(` #.}`)]);else{let r=t;for(;t<e.length&&(t+=1,!` }=`.includes(e[t])););let a=e[t];if(r!==t){let o=e.slice(r,t).trim(),s=``;a===`=`?(t+=1,s=i()):(o=o[0]===`:`?o:`:${o}`,s=`true`),o.match(/^:?[a-z_][a-z0-9_-]*$/gi)&&n.push([o,s])}}function r(n){let r=t;for(;t<e.length&&(t+=1,e[t]===`\\`&&(t+=2),!n.includes(e[t])););return e.slice(r,t)}function i(){let n=t;return e[t]in Zu?(a(Zu[e[t]]),t+=1,e.slice(n,t)):e[t]in Qu?(o(Qu[e[t]]),t+=1,e.slice(n,t)):r(` }`)}function a(n){for(;t<e.length;)if(t++,e[t]in Qu)o(Qu[e[t]]);else if(e[t]in Zu)a(Zu[e[t]]);else if(e[t]===n)return}function o(e){return r(e)}return n.forEach(e=>{/^(['"`]).*\1$/.test(e[1])&&(e[1]=e[1].slice(1,-1))}),{props:n,index:t}}var ed=/^[a-z$][$\w.-]*/i;function td(e){if(e=e.trim(),!e)return{name:``};let t=e.match(ed)?.[0];if(!t)throw Error(`Invalid block params: ${e}`);let n=e.slice(t.length).trim(),r,i,a;if(n.startsWith(`[`)){let e=uo(n,0);e&&(r=e.content,n=n.slice(e.endIndex).trim())}if(n.startsWith(`{`)){let e=$u(n,0);if(e){i=e.props;let t=n.slice(e.index).trim();t&&(a=t)}}else n&&(a=n);let o={name:Ju(t)};return r!==void 0&&(o.content=r),i!==void 0&&(o.props=i),a&&(o.remaining=a),o}function nd(e,t,n){let r=e.bMarks[t],i=e.eMarks[t],a=r,o=0;for(;a<i&&o<n;){let r=e.src.charCodeAt(a);if(r===32)o++;else if(r===9){let r=4-(o+e.bsCount[t])%4;if(o+r>n)return!1;o+=r}else break;a++}return o>0&&(e.bMarks[t]=a,e.bsCount[t]+=o,e.sCount[t]-=o,e.tShift[t]-=a-r),!0}function rd(e,t,n,r){let i=[],a=[],o=[],s=[];for(let c=t;c<n;c++)if(i.push(e.bMarks[c]),a.push(e.bsCount[c]),o.push(e.sCount[c]),s.push(e.tShift[c]),!nd(e,c,r[c-t]))return id(e,t,i,a,o,s),!1;let c=e.blkIndent;return e.blkIndent=0,e.md.block.tokenize(e,t,n),e.blkIndent=c,id(e,t,i,a,o,s),!0}function id(e,t,n,r,i,a){for(let o=0;o<n.length;o++){let s=t+o;e.bMarks[s]=n[o],e.bsCount[s]=r[o],e.sCount[s]=i[o],e.tShift[s]=a[o]}}var ad=/^[a-z$][\w$-]*/i;function od(e){return ad.test(e)}var sd={"---":`---`,"```yaml [props]":"```","~~~yaml [props]":`~~~`,"```yml [props]":"```","~~~yml [props]":`~~~`},cd=e=>{e.block.ruler.before(`fence`,`comark_block_shorthand`,function(e,t,n,r){let i=e.src.slice(e.bMarks[t]+e.tShift[t],e.eMarks[t]);if(i[0]!==`:`||!od(i.slice(1)))return!1;let{name:a,content:o,props:s,remaining:c}=td(i.slice(1));if(c)return!1;if(!r){if(o!==void 0){let n=e.push(`mdc_block_shorthand`,a,1);s?.forEach(([e,t])=>{e===`class`?n.attrJoin(e,t):n.attrSet(e,t)}),n.map=[t,t+1];let r=e.push(`inline`,``,0);r.content=o,r.children=[];let i=e.push(`mdc_block_shorthand`,a,-1);i.map=[t,t+1]}else{let n=e.push(`mdc_block_shorthand`,a,0);n.map=[t,t+1],s?.forEach(([e,t])=>{e===`class`?n.attrJoin(e,t):n.attrSet(e,t)})}}return e.line=t+1,!0}),e.block.ruler.before(`fence`,`comark_block`,function(e,t,n,r){let i,a,o=!1,s=e.bMarks[t]+e.tShift[t],c=e.eMarks[t],l=e.sCount[t],u=!1,d=0,f=0,p=0;if(e.src[s]!==`:`)return!1;for(i=s+1;i<=c&&e.src[i]===`:`;i++);let m=Math.floor(i-s);if(m<2)return!1;let h=e.src.slice(s,i),g=e.skipSpaces(i);if(g<c&&!od(e.src.slice(g,c)))return!1;let _=td(e.src.slice(i,c));if(!_.name)return!1;if(r)return!0;let v=[],y=0,b=!1;for(a=t;a++,!(a>=n||(s=e.bMarks[a]+e.tShift[a],c=e.eMarks[a],s<c&&e.sCount[a]<e.blkIndent));){let t=s>=c?l:e.sCount[a];t<l&&(b=!0),v.push(s>=c?0:u?y:Math.min(l,t));let n=e.src.charCodeAt(s);if(u){if(n===d){let t=s+1;for(;t<c&&e.src.charCodeAt(t)===d;)t++;t-s>=f&&e.skipSpaces(t)>=c&&(u=!1)}continue}if(n===96||n===126){let t=s+1;for(;t<c&&e.src.charCodeAt(t)===n;)t++;if(t-s>=3){u=!0,d=n,f=t-s,y=v[v.length-1];continue}}if(n===58){for(i=s+1;i<=c&&e.src[i]===`:`;i++);if(i-s===m){if(i=e.skipSpaces(i),i<c){p++;continue}if(p>0){p--;continue}o=!0;break}}}let x=e.parentType,S=e.lineMax;e.parentType=`comark_block`,e.lineMax=a;let C=e.push(`mdc_block_open`,_.name,1);if(C.markup=h,C.block=!0,C.info=_.name,C.map=[t,a],_.props?.forEach(([e,t])=>{e===`class`?C.attrJoin(e,t):C.attrSet(e,t)}),_.content!==void 0){let n=e.push(`paragraph_open`,`p`,1);n.map=[t,t+1];let r=e.push(`inline`,``,0);r.content=_.content,r.children=[],e.push(`paragraph_close`,`p`,-1)}if(e.env.comarkBlockTokens||=[],e.env.comarkBlockTokens.unshift(C),!b||!rd(e,t+1,a,v)){let n=e.blkIndent;e.blkIndent=l,e.md.block.tokenize(e,t+1,a),e.blkIndent=n}e.env.comarkBlockTokens.shift();let w=e.push(`mdc_block_close`,_.name,-1);return w.map=[t,a],w.markup=e.src.slice(s,i),w.block=!0,e.tokens.slice(e.tokens.indexOf(C)+1,e.tokens.indexOf(w)).filter(e=>e.level===C.level+1).forEach((e,t,n)=>{n.length<=2&&e.tag===`p`&&(e.hidden=!0)}),e.parentType=x,e.lineMax=S,e.line=a+ +!!o,!0},{alt:[`paragraph`,`reference`,`blockquote`,`list`]}),e.block.ruler.after(`code`,`comark_block_yaml`,function(e,t,n,r){if(!e.env.comarkBlockTokens?.length)return!1;let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.src.slice(i,a),s=sd[o]||``;if(!s)return!1;if(o===`---`){let n=e.env.comarkBlockTokens[0].map?.[0];if(n===void 0||t!==n+1)return!1}let c=t+1,l=!1;for(;c<n;){if(e.src.slice(e.bMarks[c]+e.tShift[t],e.eMarks[c])===s){l=!0;break}c+=1}if(!l)return!1;if(!r){let n=Iu(e.getLines(t+1,c,e.blkIndent,!1)),r=e.env.comarkBlockTokens[0];Object.entries(n||{}).forEach(([e,t])=>{if(e===`class`){r.attrJoin(e,t);return}typeof t==`string`?r.attrSet(e,t):r.attrSet(`:${e}`,JSON.stringify(t))})}return e.line=c+1,!0}),e.block.ruler.after(`code`,`comark_block_slots`,function(e,t,n,r){if(!e.env.comarkBlockTokens?.length)return!1;let i=e.bMarks[t]+e.tShift[t];if(e.src[i]!==`#`||e.src[i+1]===` `||e.src[i+1]===`#`)return!1;let{name:a,props:o}=td(e.src.slice(i,e.eMarks[t]).slice(1)),s=t+1,c=!1,l=``,u=0;for(;s<n;){let n=e.src.slice(e.bMarks[s]+e.tShift[t],e.eMarks[s]);if(c){if(n[0]===l){let e=1;for(;e<n.length&&n[e]===l;)e++;e>=u&&n.slice(e).trim()===``&&(c=!1)}s+=1;continue}if(n[0]==="`"||n[0]===`~`){let e=n[0],t=1;for(;t<n.length&&n[t]===e;)t++;if(t>=3){c=!0,l=e,u=t,s+=1;continue}}if(/^#\w+/.test(n)||n.startsWith(`::`))break;s+=1}if(r)return e.line=s,!0;let d=e.lineMax,f=e.push(`mdc_block_slot`,`template`,1);return f.attrSet(`#${a}`,``),o?.forEach(([e,t])=>{e===`class`?f.attrJoin(e,t):f.attrSet(e,t)}),e.line=t+1,e.lineMax=s,e.md.block.tokenize(e,t+1,s),e.push(`mdc_block_slot`,`template`,-1),e.line=s,e.lineMax=d,!0})},ld=new Set([` `,` `,`
73
- `,`*`,`_`,`[`]),ud=e=>{e.inline.ruler.after(`entity`,`comark_inline_component`,(e,t)=>{let n=e.pos;if(e.src[n]!==`:`)return!1;let r=e.src[n-1];if(n>0&&!ld.has(r))return!1;let i=n+1,a=-1,o=-1,s=-1;for(;i<e.src.length;){let t=e.src[i];if(t===`[`){a=i;let t=uo(e.src,i);t&&(o=i+1,s=t.endIndex-1,i=t.endIndex);break}if(!/[\w$-]/.test(t))break;i+=1}if(a===-1&&(a=i),a<=n+1)return!1;let c=e.src.slice(n+1,a);if(!od(c))return!1;if(e.pos=i,t)return!0;if(o!==-1){e.push(`mdc_inline_component`,c,1);let t=e.pos,n=e.posMax;e.pos=o,e.posMax=s,e.md.inline.tokenize(e),e.pos=t,e.posMax=n,e.push(`mdc_inline_component`,c,-1)}else e.push(`mdc_inline_component`,c,0);return!0})},dd=e=>{e.inline.ruler.before(`link`,`comark_inline_span`,(e,t)=>{let n=e.pos;if(e.src[n]!==`[`)return!1;let r=lo(e.src,n),i=r===-1?e.src.length:r,a=e.src[i+1];if(a===`(`||a===`[`||e.linkLevel>0&&a!==`{`||t)return!1;e.push(`mdc_inline_span`,`span`,1);let o=e.pos,s=e.posMax;return e.pos=n+1,e.posMax=i,e.md.inline.tokenize(e),e.pos=o,e.posMax=s,e.push(`mdc_inline_span`,`span`,-1),e.pos=i+1,!0})},fd=e=>{e.use(cd),e.use(dd),e.use(ud)},pd=co(()=>({name:`components`,markdownItPlugins:[fd]})),md=e=>{e.inline.ruler.after(`entity`,`comark_inline_props`,(e,t)=>{let n=e.pos;if(e.src[n]!==`{`||e.src[n+1]===`{`||e.src[n-1]===`{`||e.src[n-1]===`$`)return!1;let r=$u(e.src,n);if(!r)return!1;let{props:i,index:a}=r;if(a===n)return!1;if(e.pos=a,t)return!0;let o=e.push(`mdc_inline_props`,`span`,0);return o.attrs=i,o.hidden=!0,!0}),e.renderer.rules.mdc_inline_props=()=>``;let t=e.parse;e.parse=function(e,n){let r=t.call(this,e,n);return r.forEach((e,t)=>{let n=r[t-1],i=r[t+1];if(!n||![`heading_open`,`paragraph_open`,`list_item_open`].includes(n.type)||n.hidden||(e.hidden&&i?.type===`inline`&&(e=i),e.type!==`inline`||!e.children?.length))return;let a=e.children[e.children.length-1];if(a.type!==`mdc_inline_props`)return;let o=e.children.length-2;for(;o>=0;){let t=e.children[o];if(t.type===`text`&&!t.content){o--;continue}break}let s=o>=0?e.children[o]:void 0;if(!s||s.type!==`text`)return;typeof s.content==`string`&&(s.content=s.content.replace(/[ \t]+$/,``));let c=a.attrs;e.children.length=s.content?o+1:o,c?.forEach(([e,t])=>{e===`class`?n.attrJoin(`class`,t):n.attrSet(e,t)})}),r},e.renderer.renderInline=hd(e.renderer.renderInline),`renderInlineAsync`in e.renderer&&(e.renderer.renderInlineAsync=hd(e.renderer.renderInlineAsync))};function hd(e){return function(t,n,r){return t=[...t],t.forEach((e,n)=>{if(e.type!==`mdc_inline_props`)return;let r=n-1,i=t[r];for(;r>=0&&i.type===`text`&&!i.content.trim();)r--,i=t[r];if(!i.tag&&i.type===`text`){i=new ri(`mdc_inline_span`,`span`,1),t.splice(n-1,0,i);let e=new ri(`mdc_inline_span`,`span`,-1);t.splice(n+2,0,e)}else if(i.nesting===-1){let e=n-1;for(;e>=0;){let n=t[e];if(n.nesting===1&&n.tag===i.tag&&n.level===i.level){i=n;break}e--}}if(i.nesting===-1)throw Error(`No matching opening tag found for ${JSON.stringify(i)}`);e.attrs?.forEach(([e,t])=>{e===`class`?i.attrJoin(`class`,t):i.attrSet(e,t)})}),e.call(this,t,n,r)}}var gd=md,_d=co(()=>({name:`attributes`,markdownItPlugins:[gd]}));function vd(e,t,n){let r=e.attrIndex(t),i=[t,n];r<0?(e.attrs||=[],e.attrs.push(i)):e.attrs[r]=i}function yd(e,t){let n=!(t?.enabled??!1);e.core.ruler.before(`inline`,`task-lists-mdc`,e=>{let t=e.tokens,n=[],r=[],i=[];for(let e=0;e<t.length;e++){let a=t[e];if(a.type===`bullet_list_open`||a.type===`ordered_list_open`){i.push(e);continue}if(a.type===`bullet_list_close`||a.type===`ordered_list_close`){i.pop();continue}if(a.type===`list_item_open`){n.push(e),r.push(i.length>0?i[i.length-1]:-1);continue}if(a.type===`list_item_close`){n.pop(),r.pop();continue}if(a.type===`inline`&&a.content&&n.length>0){let e=a.content.match(/^(\[[ x]\])\s+/i);if(e){let i=e[1].toLowerCase()===`[x]`;vd(t[n[n.length-1]],`class`,`task-list-item`);let o=r[r.length-1];o>=0&&vd(t[o],`class`,`contains-task-list`);let s=`TASK_CHECKBOX_${i?`CHECKED`:`UNCHECKED`} `;a.content=a.content.replace(/^\[[ x]\]\s+/i,s)}}}}),e.core.ruler.after(`inline`,`task-lists-mdc-post`,e=>{let t=e.tokens;for(let r=0;r<t.length;r++){let i=t[r];if(i.type===`inline`&&i.children)for(let t=0;t<i.children.length;t++){let r=i.children[t];if(r.type===`text`&&r.content){let a=r.content.match(/^TASK_CHECKBOX_CHECKED/),o=r.content.match(/^TASK_CHECKBOX_UNCHECKED/);if(a||o){let o=!!a,s=new e.Token(`mdc_inline_component`,`input`,0);s.attrs=[[`class`,`task-list-item-checkbox`],[`type`,`checkbox`]],n&&s.attrs.push([`:disabled`,`true`]),o&&s.attrs.push([`:checked`,`true`]),r.content=r.content.replace(/^TASK_CHECKBOX_(CHECKED|UNCHECKED)/,``),i.children.splice(t,0,s),t++}}}}})}var bd=co(()=>({name:`task-list`,markdownItPlugins:[yd]})),xd={"!TIP":{type:`tip`,title:`Tip`,color:`#238636`},"!NOTE":{type:`note`,title:`Note`,color:`#1f6feb`},"!IMPORTANT":{type:`important`,title:`Important`,color:`#8957e5`},"!WARNING":{type:`warning`,title:`Warning`,color:`#9e6a03`},"!CAUTION":{type:`caution`,title:`Caution`,color:`#da3633`}},Sd=co(()=>({name:`alert`,post(e){Ku(e.tree,e=>Array.isArray(e)&&e[0]===`blockquote`,e=>{let t=e;if(e[2]?.[0]===`span`){let n=xd[String(e[2][2]).toUpperCase()];n&&(typeof e[3]==`string`&&(t[3]=String(t[3]).trimStart()),t.splice(2,1),t[1].as=n.type)}else if(e[2]?.[0]===`p`){let n=e[2];if(n[2]?.[0]===`span`){let e=xd[String(n[2][2]).toUpperCase()];e&&(typeof n[3]==`string`&&(n[3]=String(n[3]).trimStart()),n.splice(2,1),t[1].as=e.type)}}})}})),Cd=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),wd=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Td=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,Ed=RegExp(`^(?:${wd}|${Td}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Dd=RegExp(`^(?:${wd}|${Td})`),Od=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(${Cd.join(`|`)})(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(`${Dd.source}\\s*$`),/^$/,!1]];function kd(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<Od.length&&!Od[s][0].test(o);s++);if(s===Od.length)return!1;if(r)return Od[s][2];let c=t+1;if(!Od[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),Od[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,1);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function Ad(e){return/^<a[>\s]/i.test(e)}function jd(e){return/^<\/a\s*>/i.test(e)}function Md(e){let t=e|32;return t>=97&&t<=122}function Nd(e,t){let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Md(i))return!1;let a=e.src.slice(r).match(Ed);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],Ad(t.content)&&e.linkLevel++,jd(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}function Pd(e){e.set({html:!0}),e.inline.ruler.before(`text`,`comark_html_inline`,Nd),e.block.ruler.before(`html_block`,`comark_html_block`,kd,{alt:[`paragraph`,`reference`,`blockquote`]})}var Fd=co(()=>({name:`html`,markdownItPlugins:[Pd]})),Id=`---`,Ld=`\r`;function Rd(e){let t={},n=``;if(e.startsWith(Id)){let r=e.indexOf(`
74
- ---`);if(r!==-1){let i=e[r-1]===Ld;n=e.slice(4,r-+!!i),n&&(t=Iu(n)??{},e=e.slice(r+4+ +!!i))}}return{content:e,data:t,frontmatterText:n}}var zd=co(()=>({name:`frontmatter`,pre(e){let{content:t,data:n,frontmatterText:r}=Rd(e.markdown);e.markdown=t,e.frontmatter=n,e.frontmatterText=r,t&&r&&(e.parsedLines=(e.parsedLines??0)+r.split(`
75
- `).length+1)}}));function Bd(e){return e?e===!0?[`p`]:typeof e==`string`?e.split(/[,\s]/).map(e=>e.trim()).filter(Boolean):e.filter(Boolean):[]}function Vd(e){return Array.isArray(e)&&typeof e[0]==`string`}function Hd(e,t){return Vd(e)&&(t===`*`||e[0]===t)}function Ud(e,t){if(t.length===0)return e;let[n,...r]=t,i=[];for(let t of e){let e=Hd(t,n)?t.slice(2):[t];for(let t of Ud(e,r))i.push(t)}return i.filter(e=>typeof e!=`string`||e.trim()!==``)}function Wd(e,t){if(t.length===0)return e;let n=Ud(e,t),r=[];for(let e of n)typeof e==`string`&&typeof r[r.length-1]==`string`?r[r.length-1]=r[r.length-1]+e:r.push(e);return r}var q;(function(e){e[e.Tab=9]=`Tab`,e[e.NewLine=10]=`NewLine`,e[e.FormFeed=12]=`FormFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationMark=33]=`ExclamationMark`,e[e.Number=35]=`Number`,e[e.Amp=38]=`Amp`,e[e.SingleQuote=39]=`SingleQuote`,e[e.DoubleQuote=34]=`DoubleQuote`,e[e.Dash=45]=`Dash`,e[e.Slash=47]=`Slash`,e[e.Zero=48]=`Zero`,e[e.Nine=57]=`Nine`,e[e.Semi=59]=`Semi`,e[e.Lt=60]=`Lt`,e[e.Eq=61]=`Eq`,e[e.Gt=62]=`Gt`,e[e.Questionmark=63]=`Questionmark`,e[e.UpperA=65]=`UpperA`,e[e.LowerA=97]=`LowerA`,e[e.UpperF=70]=`UpperF`,e[e.LowerF=102]=`LowerF`,e[e.UpperZ=90]=`UpperZ`,e[e.LowerZ=122]=`LowerZ`,e[e.LowerX=120]=`LowerX`,e[e.OpeningSquareBracket=91]=`OpeningSquareBracket`})(q||={});var J;(function(e){e[e.Text=1]=`Text`,e[e.BeforeTagName=2]=`BeforeTagName`,e[e.InTagName=3]=`InTagName`,e[e.InSelfClosingTag=4]=`InSelfClosingTag`,e[e.BeforeClosingTagName=5]=`BeforeClosingTagName`,e[e.InClosingTagName=6]=`InClosingTagName`,e[e.AfterClosingTagName=7]=`AfterClosingTagName`,e[e.BeforeAttributeName=8]=`BeforeAttributeName`,e[e.InAttributeName=9]=`InAttributeName`,e[e.AfterAttributeName=10]=`AfterAttributeName`,e[e.BeforeAttributeValue=11]=`BeforeAttributeValue`,e[e.InAttributeValueDq=12]=`InAttributeValueDq`,e[e.InAttributeValueSq=13]=`InAttributeValueSq`,e[e.InAttributeValueNq=14]=`InAttributeValueNq`,e[e.BeforeDeclaration=15]=`BeforeDeclaration`,e[e.InDeclaration=16]=`InDeclaration`,e[e.InProcessingInstruction=17]=`InProcessingInstruction`,e[e.BeforeComment=18]=`BeforeComment`,e[e.CDATASequence=19]=`CDATASequence`,e[e.DeclarationSequence=20]=`DeclarationSequence`,e[e.InSpecialComment=21]=`InSpecialComment`,e[e.InCommentLike=22]=`InCommentLike`,e[e.SpecialStartSequence=23]=`SpecialStartSequence`,e[e.InSpecialTag=24]=`InSpecialTag`,e[e.InPlainText=25]=`InPlainText`,e[e.InEntity=26]=`InEntity`})(J||={});function Gd(e){return e===q.Space||e===q.NewLine||e===q.Tab||e===q.FormFeed||e===q.CarriageReturn}function Kd(e){return e===q.Slash||e===q.Gt||Gd(e)}function qd(e){return e>=q.LowerA&&e<=q.LowerZ||e>=q.UpperA&&e<=q.UpperZ}var Jd;(function(e){e[e.NoValue=0]=`NoValue`,e[e.Unquoted=1]=`Unquoted`,e[e.Single=2]=`Single`,e[e.Double=3]=`Double`})(Jd||={});var Y={Empty:new Uint8Array,Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,33,62]),Doctype:new Uint8Array([100,111,99,116,121,112,101]),IframeEnd:new Uint8Array([60,47,105,102,114,97,109,101]),NoembedEnd:new Uint8Array([60,47,110,111,101,109,98,101,100]),NoframesEnd:new Uint8Array([60,47,110,111,102,114,97,109,101,115]),Plaintext:new Uint8Array([60,47,112,108,97,105,110,116,101,120,116]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])},Yd=new Map([[Y.IframeEnd[2],Y.IframeEnd],[Y.NoembedEnd[2],Y.NoembedEnd],[Y.Plaintext[2],Y.Plaintext],[Y.ScriptEnd[2],Y.ScriptEnd],[Y.TitleEnd[2],Y.TitleEnd],[Y.XmpEnd[2],Y.XmpEnd]]),Xd=class{cbs;state=J.Text;buffer=``;sectionStart=0;index=0;entityStart=0;baseState=J.Text;isSpecial=!1;running=!0;offset=0;xmlMode;decodeEntities;recognizeSelfClosing;entityDecoder;constructor({xmlMode:e=!1,decodeEntities:t=!0,recognizeSelfClosing:n=e},r){this.cbs=r,this.xmlMode=e,this.decodeEntities=t,this.recognizeSelfClosing=n,this.entityDecoder=new Fo(e?bo:yo,(e,t)=>this.emitCodePoint(e,t))}reset(){this.state=J.Text,this.buffer=``,this.sectionStart=0,this.index=0,this.baseState=J.Text,this.isSpecial=!1,this.currentSequence=Y.Empty,this.sequenceIndex=0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===q.Lt||!this.decodeEntities&&this.fastForwardTo(q.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=J.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===q.Amp&&this.startEntity()}currentSequence=Y.Empty;sequenceIndex=0;enterTagBody(){this.currentSequence===Y.Plaintext?(this.currentSequence=Y.Empty,this.state=J.InPlainText):this.isSpecial?(this.state=J.InSpecialTag,this.sequenceIndex=0):this.state=J.Text}stateSpecialStartSequence(e){let t=e|32;if(this.sequenceIndex<this.currentSequence.length){if(t===this.currentSequence[this.sequenceIndex]){this.sequenceIndex++;return}if(this.sequenceIndex===3){if(this.currentSequence===Y.ScriptEnd&&t===Y.StyleEnd[3]){this.currentSequence=Y.StyleEnd,this.sequenceIndex=4;return}if(this.currentSequence===Y.TitleEnd&&t===Y.TextareaEnd[3]){this.currentSequence=Y.TextareaEnd,this.sequenceIndex=4;return}}else if(this.sequenceIndex===4&&this.currentSequence===Y.NoembedEnd&&t===Y.NoframesEnd[4]){this.currentSequence=Y.NoframesEnd,this.sequenceIndex=5;return}}else if(Kd(e)){this.sequenceIndex=0,this.state=J.InTagName,this.stateInTagName(e);return}this.isSpecial=!1,this.currentSequence=Y.Empty,this.sequenceIndex=0,this.state=J.InTagName,this.stateInTagName(e)}stateCDATASequence(e){e===Y.Cdata[this.sequenceIndex]?++this.sequenceIndex===Y.Cdata.length&&(this.state=J.InCommentLike,this.currentSequence=Y.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.xmlMode?(this.state=J.InDeclaration,this.stateInDeclaration(e)):(this.state=J.InSpecialComment,this.stateInSpecialComment(e)))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}emitComment(e){this.cbs.oncomment(this.sectionStart,this.index,e),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=J.Text}stateInCommentLike(e){!this.xmlMode&&this.currentSequence===Y.CommentEnd&&this.sequenceIndex<=1&&this.index===this.sectionStart+this.sequenceIndex&&e===q.Gt?this.emitComment(this.sequenceIndex):this.currentSequence===Y.CommentEnd&&this.sequenceIndex===2&&e===q.Gt?this.emitComment(2):this.currentSequence===Y.CommentEnd&&this.sequenceIndex===this.currentSequence.length-1&&e!==q.Gt?this.sequenceIndex=Number(e===q.Dash):e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===Y.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,3),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=J.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Kd(e):qd(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(Kd(e)){let t=this.index-this.currentSequence.length;if(this.sectionStart<t){let e=this.index;this.index=t,this.cbs.ontext(this.sectionStart,t),this.index=e}this.isSpecial=!1,this.sectionStart=t+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===Y.TitleEnd||this.currentSequence===Y.TextareaEnd?this.decodeEntities&&e===q.Amp&&this.startEntity():this.fastForwardTo(q.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=Number(e===q.Lt)}stateBeforeTagName(e){if(e===q.ExclamationMark)this.state=J.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===q.Questionmark)this.xmlMode?(this.state=J.InProcessingInstruction,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.state=J.InSpecialComment,this.sectionStart=this.index);else if(this.isTagStartChar(e)){this.sectionStart=this.index;let t=this.xmlMode||this.cbs.isInForeignContext?.()?void 0:Yd.get(e|32);t===void 0?this.state=J.InTagName:(this.isSpecial=!0,this.currentSequence=t,this.sequenceIndex=3,this.state=J.SpecialStartSequence)}else e===q.Slash?this.state=J.BeforeClosingTagName:(this.state=J.Text,this.stateText(e))}stateInTagName(e){Kd(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=J.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Gd(e)?this.xmlMode||(this.state=J.InSpecialComment,this.sectionStart=this.index):e===q.Gt?(this.state=J.Text,this.xmlMode||(this.sectionStart=this.index+1)):(this.state=this.isTagStartChar(e)?J.InClosingTagName:J.InSpecialComment,this.sectionStart=this.index)}stateInClosingTagName(e){Kd(e)&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=J.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===q.Gt||this.fastForwardTo(q.Gt))&&(this.state=J.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===q.Gt?(this.cbs.onopentagend(this.index),this.enterTagBody(),this.sectionStart=this.index+1):e===q.Slash?this.state=J.InSelfClosingTag:Gd(e)||(this.state=J.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){if(e===q.Gt){if(this.cbs.onselfclosingtag(this.index),this.sectionStart=this.index+1,!this.recognizeSelfClosing){this.enterTagBody();return}this.state=J.Text,this.isSpecial=!1,this.currentSequence=Y.Empty}else Gd(e)||(this.state=J.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===q.Eq||Kd(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=J.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===q.Eq?this.state=J.BeforeAttributeValue:e===q.Slash||e===q.Gt?(this.cbs.onattribend(Jd.NoValue,this.sectionStart),this.sectionStart=-1,this.state=J.BeforeAttributeName,this.stateBeforeAttributeName(e)):Gd(e)||(this.cbs.onattribend(Jd.NoValue,this.sectionStart),this.state=J.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===q.DoubleQuote?(this.state=J.InAttributeValueDq,this.sectionStart=this.index+1):e===q.SingleQuote?(this.state=J.InAttributeValueSq,this.sectionStart=this.index+1):Gd(e)||(this.sectionStart=this.index,this.state=J.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,t){e===t||!this.decodeEntities&&this.fastForwardTo(t)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(t===q.DoubleQuote?Jd.Double:Jd.Single,this.index+1),this.state=J.BeforeAttributeName):this.decodeEntities&&e===q.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,q.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,q.SingleQuote)}stateInAttributeValueNoQuotes(e){Gd(e)||e===q.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(Jd.Unquoted,this.index),this.state=J.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===q.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===q.OpeningSquareBracket?(this.state=J.CDATASequence,this.sequenceIndex=0):this.xmlMode?this.state=e===q.Dash?J.BeforeComment:J.InDeclaration:(e|32)===Y.Doctype[0]?(this.state=J.DeclarationSequence,this.currentSequence=Y.Doctype,this.sequenceIndex=1):e===q.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=J.Text,this.sectionStart=this.index+1):this.state=e===q.Dash?J.BeforeComment:J.InSpecialComment}stateDeclarationSequence(e){this.sequenceIndex===this.currentSequence.length?(this.state=J.InDeclaration,this.stateInDeclaration(e)):(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:e===q.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=J.Text,this.sectionStart=this.index+1):this.state=J.InSpecialComment}stateInDeclaration(e){(e===q.Gt||this.fastForwardTo(q.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=J.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){e===q.Questionmark?this.sequenceIndex=1:e===q.Gt&&this.sequenceIndex===1?(this.cbs.onprocessinginstruction(this.sectionStart,this.index-1),this.sequenceIndex=0,this.state=J.Text,this.sectionStart=this.index+1):this.sequenceIndex=Number(this.fastForwardTo(q.Questionmark))}stateBeforeComment(e){e===q.Dash?(this.state=J.InCommentLike,this.currentSequence=Y.CommentEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):this.xmlMode?this.state=J.InDeclaration:e===q.Gt?(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=J.Text,this.sectionStart=this.index+1):this.state=J.InSpecialComment}stateInSpecialComment(e){(e===q.Gt||this.fastForwardTo(q.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=J.Text,this.sectionStart=this.index+1)}startEntity(){this.baseState=this.state,this.state=J.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?Po.Strict:this.baseState===J.Text||this.baseState===J.InSpecialTag?Po.Legacy:Po.Attribute)}stateInEntity(){let e=this.index-this.offset,t=this.entityDecoder.write(this.buffer,e);if(t>=0)this.state=this.baseState,t===0&&--this.index;else{if(e<this.buffer.length&&this.buffer.charCodeAt(e)===q.Amp){this.state=this.baseState,--this.index;return}this.index=this.offset+this.buffer.length-1}}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===J.Text||this.state===J.InPlainText||this.state===J.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===J.InAttributeValueDq||this.state===J.InAttributeValueSq||this.state===J.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){let e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case J.Text:this.stateText(e);break;case J.InPlainText:this.index=this.buffer.length+this.offset-1;break;case J.SpecialStartSequence:this.stateSpecialStartSequence(e);break;case J.InSpecialTag:this.stateInSpecialTag(e);break;case J.CDATASequence:this.stateCDATASequence(e);break;case J.DeclarationSequence:this.stateDeclarationSequence(e);break;case J.InAttributeValueDq:this.stateInAttributeValueDoubleQuotes(e);break;case J.InAttributeName:this.stateInAttributeName(e);break;case J.InCommentLike:this.stateInCommentLike(e);break;case J.InSpecialComment:this.stateInSpecialComment(e);break;case J.BeforeAttributeName:this.stateBeforeAttributeName(e);break;case J.InTagName:this.stateInTagName(e);break;case J.InClosingTagName:this.stateInClosingTagName(e);break;case J.BeforeTagName:this.stateBeforeTagName(e);break;case J.AfterAttributeName:this.stateAfterAttributeName(e);break;case J.InAttributeValueSq:this.stateInAttributeValueSingleQuotes(e);break;case J.BeforeAttributeValue:this.stateBeforeAttributeValue(e);break;case J.BeforeClosingTagName:this.stateBeforeClosingTagName(e);break;case J.AfterClosingTagName:this.stateAfterClosingTagName(e);break;case J.InAttributeValueNq:this.stateInAttributeValueNoQuotes(e);break;case J.InSelfClosingTag:this.stateInSelfClosingTag(e);break;case J.InDeclaration:this.stateInDeclaration(e);break;case J.BeforeDeclaration:this.stateBeforeDeclaration(e);break;case J.BeforeComment:this.stateBeforeComment(e);break;case J.InProcessingInstruction:this.stateInProcessingInstruction(e);break;case J.InEntity:this.stateInEntity()}this.index++}this.cleanup()}finish(){this.state===J.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingCommentLikeData(e){if(this.state!==J.InCommentLike)return!1;if(this.currentSequence===Y.CdataEnd){if(this.xmlMode)this.sectionStart<e&&this.cbs.oncdata(this.sectionStart,e,0);else{let t=this.sectionStart-Y.Cdata.length-1;this.cbs.oncomment(t,e,0)}}else{let t=this.xmlMode?0:Math.min(this.sequenceIndex,Y.CommentEnd.length-1);this.cbs.oncomment(this.sectionStart,e,t)}return!0}handleTrailingMarkupDeclaration(e){if(this.xmlMode)switch(this.state){case J.InSpecialComment:case J.BeforeComment:case J.CDATASequence:case J.DeclarationSequence:case J.InDeclaration:return this.cbs.ontext(this.sectionStart,e),!0;default:return!1}switch(this.state){case J.BeforeDeclaration:case J.InSpecialComment:case J.BeforeComment:case J.CDATASequence:return this.cbs.oncomment(this.sectionStart,e,0),!0;case J.DeclarationSequence:return this.sequenceIndex!==Y.Doctype.length&&this.cbs.oncomment(this.sectionStart,e,0),!0;case J.InDeclaration:return!0;default:return!1}}handleTrailingData(){let e=this.buffer.length+this.offset;if(!(this.handleTrailingCommentLikeData(e)||this.handleTrailingMarkupDeclaration(e))&&!(this.sectionStart>=e))switch(this.state){case J.InTagName:case J.BeforeAttributeName:case J.BeforeAttributeValue:case J.AfterAttributeName:case J.InAttributeName:case J.InAttributeValueSq:case J.InAttributeValueDq:case J.InAttributeValueNq:case J.InClosingTagName:break;default:this.cbs.ontext(this.sectionStart,e)}}emitCodePoint(e,t){this.baseState!==J.Text&&this.baseState!==J.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+t,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}},{fromCodePoint:Zd}=String,Qd=new Set([`input`,`option`,`optgroup`,`select`,`button`,`datalist`,`textarea`]),$d=new Set([`p`]),ef=new Set([`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`p`]),tf=new Set([`thead`,`tbody`]),nf=new Set([`dd`,`dt`]),rf=new Set([`rt`,`rp`]),af=new Map([[`tr`,new Set([`tr`,`th`,`td`])],[`th`,new Set([`th`])],[`td`,new Set([`thead`,`th`,`td`])],[`body`,new Set([`head`,`link`,`script`])],[`a`,new Set([`a`])],[`li`,new Set([`li`])],[`p`,$d],[`h1`,ef],[`h2`,ef],[`h3`,ef],[`h4`,ef],[`h5`,ef],[`h6`,ef],[`select`,Qd],[`input`,Qd],[`output`,Qd],[`button`,Qd],[`datalist`,Qd],[`textarea`,Qd],[`option`,new Set([`option`])],[`optgroup`,new Set([`optgroup`,`option`])],[`dd`,nf],[`dt`,nf],[`address`,$d],[`article`,$d],[`aside`,$d],[`blockquote`,$d],[`details`,$d],[`div`,$d],[`dl`,$d],[`fieldset`,$d],[`figcaption`,$d],[`figure`,$d],[`footer`,$d],[`form`,$d],[`header`,$d],[`hr`,$d],[`main`,$d],[`nav`,$d],[`ol`,$d],[`pre`,$d],[`section`,$d],[`table`,$d],[`ul`,$d],[`rt`,rf],[`rp`,rf],[`tbody`,tf],[`tfoot`,tf]]),of=`doctype`,sf=new Set([`area`,`base`,`basefont`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`img`,`input`,`isindex`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]),cf=new Set([`math`,`svg`]),lf=new Set([`mi`,`mo`,`mn`,`ms`,`mtext`,`annotation-xml`,`foreignObject`,`desc`,`title`]),uf=new Map([[`altglyph`,`altGlyph`],[`altglyphdef`,`altGlyphDef`],[`altglyphitem`,`altGlyphItem`],[`animatecolor`,`animateColor`],[`animatemotion`,`animateMotion`],[`animatetransform`,`animateTransform`],[`clippath`,`clipPath`],[`feblend`,`feBlend`],[`fecolormatrix`,`feColorMatrix`],[`fecomponenttransfer`,`feComponentTransfer`],[`fecomposite`,`feComposite`],[`feconvolvematrix`,`feConvolveMatrix`],[`fediffuselighting`,`feDiffuseLighting`],[`fedisplacementmap`,`feDisplacementMap`],[`fedistantlight`,`feDistantLight`],[`fedropshadow`,`feDropShadow`],[`feflood`,`feFlood`],[`fefunca`,`feFuncA`],[`fefuncb`,`feFuncB`],[`fefuncg`,`feFuncG`],[`fefuncr`,`feFuncR`],[`fegaussianblur`,`feGaussianBlur`],[`feimage`,`feImage`],[`femerge`,`feMerge`],[`femergenode`,`feMergeNode`],[`femorphology`,`feMorphology`],[`feoffset`,`feOffset`],[`fepointlight`,`fePointLight`],[`fespecularlighting`,`feSpecularLighting`],[`fespotlight`,`feSpotLight`],[`fetile`,`feTile`],[`feturbulence`,`feTurbulence`],[`foreignobject`,`foreignObject`],[`glyphref`,`glyphRef`],[`lineargradient`,`linearGradient`],[`radialgradient`,`radialGradient`],[`textpath`,`textPath`]]),df;(function(e){e[e.None=0]=`None`,e[e.Svg=1]=`Svg`,e[e.MathML=2]=`MathML`})(df||={});var ff=/\s|\//,pf=class{options;startIndex=0;endIndex=0;openTagStart=0;tagname=``;attribname=``;attribvalue=``;attribs=null;stack=[];foreignContext;cbs;lowerCaseTagNames;lowerCaseAttributeNames;recognizeSelfClosing;htmlMode;tokenizer;buffers=[];bufferOffset=0;writeIndex=0;ended=!1;constructor(e,t={}){this.options=t,this.cbs=e??{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=t.lowerCaseTags??this.htmlMode,this.lowerCaseAttributeNames=t.lowerCaseAttributeNames??this.htmlMode,this.recognizeSelfClosing=t.recognizeSelfClosing??!this.htmlMode,this.tokenizer=new(t.Tokenizer??Xd)(this.options,this),this.foreignContext=[df.None],this.cbs.onparserinit?.(this)}ontext(e,t){let n=this.getSlice(e,t);this.endIndex=t-1,this.cbs.ontext?.(n),this.startIndex=t}ontextentity(e,t){this.endIndex=t-1,this.cbs.ontext?.(Zd(e)),this.startIndex=t}isInForeignContext(){return this.foreignContext[0]!==df.None}isVoidElement(e){return this.htmlMode&&sf.has(e)}readTagName(e,t){let n=this.lowerCaseTagNames?this.getSlice(e,t).toLowerCase():this.getSlice(e,t);if(!(this.lowerCaseTagNames&&this.htmlMode))return n;if(this.foreignContext[0]===df.Svg)return uf.get(n)??n;if(this.foreignContext.length>1){let e=uf.get(n);if(e!==void 0&&this.stack.includes(e))return e}return this.isInForeignContext()?n:n===`image`?`img`:n}onopentagname(e,t){this.endIndex=t,this.emitOpenTag(this.readTagName(e,t))}emitOpenTag(e){if(this.openTagStart=this.startIndex,this.tagname=e,this.htmlMode&&e===`form`&&this.stack.includes(`form`)){this.tagname=``;return}let t=this.htmlMode&&af.get(e);if(t)for(;this.stack.length>0&&t.has(this.stack[0]);)this.popElement(!0);this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(e===`svg`?this.foreignContext.unshift(df.Svg):e===`math`?this.foreignContext.unshift(df.MathML):lf.has(e)&&this.foreignContext.unshift(df.None))),this.cbs.onopentagname?.(e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){this.startIndex=this.openTagStart,this.attribs&&=(this.cbs.onopentag?.(this.tagname,this.attribs,e),null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=``}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,t){this.endIndex=t;let n=this.readTagName(e,t);if(this.isVoidElement(n))this.htmlMode&&n===`br`&&(this.cbs.onopentagname?.(`br`),this.cbs.onopentag?.(`br`,{},!0),this.cbs.onclosetag?.(`br`,!1));else{let e=this.stack.indexOf(n);if(e!==-1){for(let t=0;t<e;t++)this.popElement(!0);this.popElement(!1)}else this.htmlMode&&n===`p`&&(this.emitOpenTag(`p`),this.closeCurrentTag(!0))}this.startIndex=t+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.isInForeignContext()?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}popElement(e){let t=this.stack.shift();this.htmlMode&&(cf.has(t)||lf.has(t))&&this.foreignContext.shift(),this.cbs.onclosetag?.(t,e)}closeCurrentTag(e){let t=this.tagname;this.endOpenTag(e),this.stack[0]===t&&this.popElement(!e)}onattribname(e,t){this.startIndex=e;let n=this.getSlice(e,t);this.attribname=this.lowerCaseAttributeNames?n.toLowerCase():n}onattribdata(e,t){this.attribvalue+=this.getSlice(e,t)}onattribentity(e){this.attribvalue+=Zd(e)}onattribend(e,t){this.endIndex=t,this.cbs.onattribute?.(this.attribname,this.attribvalue,e===Jd.Double?`"`:e===Jd.Single?`'`:e===Jd.NoValue?void 0:null),this.attribs&&!Object.hasOwn(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=``}getInstructionName(e){let t=e.search(ff),n=t<0?e:e.substr(0,t);return this.lowerCaseTagNames&&(n=n.toLowerCase()),n}ondeclaration(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.htmlMode?this.lowerCaseTagNames?of:n.slice(0,7):this.getInstructionName(n);this.cbs.onprocessinginstruction(`!${e}`,`!${n}`)}this.startIndex=t+1}onprocessinginstruction(e,t){this.endIndex=t;let n=this.getSlice(e,t);if(this.cbs.onprocessinginstruction){let e=this.getInstructionName(n);this.cbs.onprocessinginstruction(`?${e}`,`?${n}`)}this.startIndex=t+1}oncomment(e,t,n){this.endIndex=t,this.cbs.oncomment?.(this.getSlice(e,t-n)),this.cbs.oncommentend?.(),this.startIndex=t+1}oncdata(e,t,n){this.endIndex=t;let r=this.getSlice(e,t-n);!this.htmlMode||this.options.recognizeCDATA?(this.cbs.oncdatastart?.(),this.cbs.ontext?.(r),this.cbs.oncdataend?.()):this.isInForeignContext()?this.cbs.ontext?.(r):(this.cbs.oncomment?.(`[CDATA[${r}]]`),this.cbs.oncommentend?.()),this.startIndex=t+1}onend(){if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let e=0;e<this.stack.length;e++)this.cbs.onclosetag(this.stack[e],!0)}this.cbs.onend?.()}reset(){this.cbs.onreset?.(),this.tokenizer.reset(),this.tagname=``,this.attribname=``,this.attribvalue=``,this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,this.cbs.onparserinit?.(this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(df.None),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,t){if(e===t)return``;for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let n=this.buffers[0].slice(e-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){if(this.ended){this.cbs.onerror?.(Error(`.write() after done!`));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){if(this.ended){this.cbs.onerror?.(Error(`.end() after done!`));return}e&&this.write(e),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}},mf=new Set([`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function hf(e,t=!1){let n={$:{html:1,block:+!t}};for(let t in e){let r=e[t];r===``?n[`:${t}`]=`true`:n[t]=r}return n}function gf(e){let t=e.trim();if(!t.startsWith(`<`))return null;let n=t.match(/^<\/([a-z][a-z0-9]*)\s*>/i);if(n)return{tag:n[1].toLowerCase(),attrs:{},isVoid:!1,isClose:!0};let r=null,i=new pf({onopentag(e,t){r={tag:e,attrs:hf(t,!0),isVoid:mf.has(e),isClose:!1}}},{decodeEntities:!1});return i.write(t),i.end(),r}function _f(e){let t=[],n=[],r=new pf({onopentag(e,r){let i=hf(r);if(mf.has(e)){let r=[e,i];n.length>0?n[n.length-1].children.push(r):t.push(r);return}n.push({tag:e,attrs:i,children:[]})},ontext(e){let r=e.trim();r&&(n.length>0?n[n.length-1].children.push(r):t.push(r))},onclosetag(e){if(mf.has(e))return;let r=n.length-1;for(;r>=0&&n[r].tag!==e;)r--;if(r>=0)for(;n.length>r;){let e=n.pop(),r=e.children.length>0?[e.tag,e.attrs,...e.children]:[e.tag,e.attrs];n.length>0?n[n.length-1].children.push(r):t.push(r)}},oncomment(e){let r=[null,{},e];n.length>0?n[n.length-1].children.push(r):t.push(r)}},{decodeEntities:!0});return r.write(e.trim()),r.end(),t}var vf=new Set([`ul`,`ol`,`table`,`blockquote`,`pre`]),yf={blockquote_open:`blockquote`,ordered_list_open:`ol`,bullet_list_open:`ul`,list_item_open:`li`,paragraph_open:`p`,table_open:`table`,thead_open:`thead`,tbody_open:`tbody`,tr_open:`tr`,th_open:`th`,td_open:`td`},bf={strong_open:`strong`,em_open:`em`,s_open:`del`,sub_open:`sub`,sup_open:`sup`};function xf(e,t){let n={startLine:0,preservePositions:!1,headingIds:!0,...t},r={headingSlugCounts:new Map,headingStack:[],preservePositions:n.preservePositions,headingIds:n.headingIds??!0},i=[],a=0,o=n.startLine;for(;a<e.length;){if(e[a].type===`html_block`){let t=Sf(e,a);i.push(...t.nodes),a=t.nextIndex;continue}let t=Df(e,a,!1,r);if(t.node){if(n.preservePositions){for(let r=a;r<t.nextIndex;r++)e[r].map&&e[r].map[1]&&(o=e[r].map[1]+n.startLine+ +!!e[r].type?.endsWith(`_close`));t.node[1].$||(t.node[1].$={}),t.node[1].$.line=o}i.push(t.node)}a=t.nextIndex}return i}function Sf(e,t){return{nodes:_f(typeof e[t]?.content==`string`?e[t].content:``),nextIndex:t+1}}function Cf(e,t={}){let{handleJSON:n=!0,filterEmpty:r=!1}=t,i={};if(!e||!Array.isArray(e))return i;for(let t of e)if(Array.isArray(t)&&t.length>=2){let[e]=t,a=t[1];if(r&&(a===``||a==null))continue;if(n&&typeof a==`string`){if(a.startsWith(`{`)&&a.endsWith(`}`))try{a=JSON.parse(a)}catch{}else if(a.startsWith(`[`)&&a.endsWith(`]`))try{a=JSON.parse(a)}catch{}}i[e]=e===`class`&&typeof i[e]==`string`?`${i[e]} ${a}`:a}return i}var wf=1e3;function Tf(e){if(!e)return{};let t={},n=e.trim(),r=n.match(/^([^\s[{}"'<>`]+)/);for(r&&(t.language=r[1],n=n.slice(r[1].length).trim());n&&(n.startsWith(`{`)||n.startsWith(`[`));)if(n.startsWith(`{`)){let e=n.match(/^\{([^}]+)\}/);if(e){let r=e[1];n=n.slice(e[0].length).trim();let i=[],a=r.split(`,`);for(let e of a){let t=e.trim();if(t.includes(`-`)){let[e,n]=t.split(`-`).map(e=>Number.parseInt(e.trim(),10));if(!Number.isNaN(e)&&!Number.isNaN(n)&&n-e<=wf)for(let t=e;t<=n&&i.length<wf;t++)i.push(t)}else{let e=Number.parseInt(t,10);!Number.isNaN(e)&&i.length<wf&&i.push(e)}}i.length>0&&(t.highlights=i)}else break}else if(n.startsWith(`[`)){let e=0,r=0;for(;r<n.length;r++)if(n[r]===`[`)e++;else if(n[r]===`]`&&(e--,e===0)){t.filename=n.slice(1,r).replace(/\\\\/g,``),n=n.slice(r+1).trim();break}if(e!==0)break}return n&&(t.meta=n),t}function Ef(e,t,n=!0){let r=t;if(n)for(;r<e.length&&e[r].type===`text`&&!e[r].content?.trim();)r++;if(r<e.length&&e[r].type===`mdc_inline_props`){let t=e[r];return{attrs:Cf(t.attrs),nextIndex:r+1}}return{attrs:{},nextIndex:t}}function Df(e,t,n=!1,r){let i=e[t];if(i.type===`hr`)return{node:[`hr`,{}],nextIndex:t+1};if(i.type===`html_block`){let n=Sf(e,t);return{node:n.nodes[0]??null,nextIndex:n.nextIndex}}if(i.type===`mdc_block_open`){let n=i.tag||`component`,a=Cf(i.attrs),o=Of(e,t+1,`mdc_block_close`,r);if(vf.has(n)&&o.nodes.length===1&&Array.isArray(o.nodes[0])&&o.nodes[0][0]===n){let e=o.nodes[0],t=e[1],r=e.slice(2);return{node:[n,{...t,...a},...r],nextIndex:o.nextIndex+1}}return{node:[n,a,...o.nodes],nextIndex:o.nextIndex+1}}if(i.type===`mdc_block_shorthand`){let n=t+1,r=i.tag||`component`,a=Cf(i.attrs,{handleJSON:!1}),o=[];if(i.nesting===1)for(;n<e.length;){let t=e[n];if(n++,t.type===`mdc_block_shorthand`&&t.nesting===-1)break;if(t.type===`inline`){let e=Nf(t.children||[],!1);o.push(...e)}}return{node:[r,a,...o],nextIndex:n}}if(i.type===`math_block`)return{node:[`math`,{class:`math block`,content:i.content},i.content],nextIndex:t+1};if(i.type===`fence`||i.type===`fenced_code_block`||i.type===`code_block`){let e=i.content||``,n=Tf(i.info||i.params||``),r=n,a={};return n.language&&n.language.trim()&&(r.language=n.language,a.class=`language-${n.language}`),{node:[`pre`,r,[`code`,a,e.endsWith(`
76
- `)?e.slice(0,-1):e]],nextIndex:t+1}}if(i.type===`heading_open`){let a=Number.parseInt(i.tag.replace(`h`,``),10),o=`h${a}`,s=Cf(i.attrs,{handleJSON:!1}),c=kf(e,t+1,`heading_close`,!0,!0,n,r);if(c.nodes.length>0){let e;return e=r?.headingIds?{id:Mf(jf(c.nodes.map(e=>Wu(e)).join(``)),a,r),...s}:s,{node:[o,e,...c.nodes],nextIndex:c.nextIndex+1}}return{node:null,nextIndex:c.nextIndex+1}}if(i.type===`list_item_open`){let n=Cf(i.attrs,{handleJSON:!1}),a=kf(e,t+1,`list_item_close`,!1,!1,!0,r);return a.nodes.length>0?{node:[`li`,n,...a.nodes],nextIndex:a.nextIndex+1}:{node:null,nextIndex:a.nextIndex+1}}let a=yf[i.type];if(a){let n=Cf(i.attrs,{handleJSON:!1}),o=i.type.replace(`_open`,`_close`),s=[`td`,`th`].includes(a),c=kf(e,t+1,o,!1,!1,s,r);return{node:[a,n,...c.nodes],nextIndex:c.nextIndex+1}}return{node:[i.tag||`component`,Cf(i.attrs,{handleJSON:!1})],nextIndex:t+1}}function Of(e,t,n,r){let i=[],a=t,o=null,s={},c=[];for(;a<e.length&&e[a].type!==n;){let t=e[a];if(t.type===`html_block`){let t=Sf(e,a);o===null?i.push(...t.nodes):c.push(...t.nodes),a=t.nextIndex;continue}if(t.type===`mdc_block_slot`){if(t.attrs&&Array.isArray(t.attrs)&&t.attrs.length>0){let e=t.attrs[0];if(Array.isArray(e)&&e.length>0){let n=e[0];if(n.startsWith(`#`)){let e=n.substring(1),r=Cf(t.attrs.slice(1));o!==null&&c.length>0&&(i.push([`template`,{name:o,...s},...c]),c=[]),o=e,s=r,a++;continue}}}a++;continue}let n=Df(e,a,!1,r);a=n.nextIndex,n.node&&(o===null?i.push(n.node):c.push(n.node))}return o!==null&&c.length>0&&i.push([`template`,{name:o,...s},...c]),{nodes:i,nextIndex:a}}function kf(e,t,n,r,i=!1,a=!1,o){let s=[],c=t;for(;c<e.length&&e[c].type!==n;){let t=e[c];if(t.type===`html_block`){let t=Sf(e,c);s.push(...t.nodes),c=t.nextIndex;continue}if(t.type===`inline`){let e=Nf(t.children||[],i);s.push(...e),c++}else if(t.type===`hardbreak`||t.type===`hard_break`)s.push([`br`,{}]),c++;else if(t.type===`softbreak`)s.push(`
77
- `),c++;else if(r&&(t.type===`text`||t.type===`code_inline`))t.content&&s.push(t.content),c++;else{let t=Df(e,c,a,o);c=t.nextIndex,t.node&&s.push(t.node)}}return{nodes:Af(s),nextIndex:c}}function Af(e){let t=[];for(let n of e){let e=t[t.length-1];typeof n==`string`&&typeof e==`string`?t[t.length-1]=e+n:t.push(n)}return t}function jf(e){let t=e.toLowerCase().trim().replace(/\s+/g,`-`).replace(/[^\w-]+/g,``).replace(/-{2,}/g,`-`).replace(/^-+|-+$/g,``);return/^\d/.test(t)&&(t=`_`+t),t}function Mf(e,t,n){if(!n)return e;for(;n.headingStack.length>0&&n.headingStack[n.headingStack.length-1].level>=t;)n.headingStack.pop();if(n.headingStack.length>0){let t=n.headingStack[n.headingStack.length-1];t.level>=2&&(e=t.id+`-`+e)}n.headingStack.push({level:t,id:e});let r=n.headingSlugCounts.get(e)??0;return n.headingSlugCounts.set(e,r+1),r===0?e:`${e}-${r}`}function Nf(e,t=!1){let n=[],r=0;for(;r<e.length;){let i=e[r];if(i.type===`mdc_inline_props`&&i.hidden){r++;continue}let a=Ff(e,r,t);r=a.nextIndex,a.node&&n.push(a.node)}return Af(n)}var Pf=100;function Ff(e,t,n=!1,r=0){let i=e[t];if(i.type===`text`||i.type===`emoji`)return{node:i.content||null,nextIndex:t+1};if(i.type===`html_inline`){let a=i.content||``,o=gf(a);if(!o)return{node:a||null,nextIndex:t+1};if(o.isClose)return{node:null,nextIndex:t+1};if(o.isVoid)return{node:[o.tag,o.attrs],nextIndex:t+1};if(r>=Pf)return{node:a||null,nextIndex:t+1};let s=[],c=t+1;for(;c<e.length;){let t=e[c];if(t.type===`html_inline`){let e=gf(t.content||``);if(e?.isClose&&e.tag===o.tag){c++;break}}let i=Ff(e,c,n,r+1);c=i.nextIndex,i.node&&s.push(i.node)}return{node:s.length>0?[o.tag,o.attrs,...s]:[o.tag,o.attrs],nextIndex:c}}if(i.type===`mdc_inline_span`&&i.nesting===1){let i={},a=t+1,o=[];for(;a<e.length;){let t=e[a];if(t.type===`mdc_inline_span`&&t.nesting===-1)break;if(t.type===`text`&&!t.content?.trim()){a++;continue}let i=Ff(e,a,n,r);a=i.nextIndex,i.node&&o.push(i.node)}let{attrs:s,nextIndex:c}=Ef(e,a+1);return Object.assign(i,s),o.length>0||Object.keys(i).length>0?{node:[`span`,i,...o],nextIndex:c}:{node:null,nextIndex:c}}if(i.type===`mdc_inline_span`&&i.nesting===-1)return{node:null,nextIndex:t+1};if(i.type===`code_inline`){let{attrs:n,nextIndex:r}=Ef(e,t+1);return i.content?{node:[`code`,n,i.content],nextIndex:r}:{node:null,nextIndex:r}}if(i.type===`hardbreak`||i.type===`hard_break`)return{node:[`br`,{}],nextIndex:t+1};if(i.type===`softbreak`)return{node:`
78
- `,nextIndex:t+1};if(i.type===`mdc_inline_component`){let a=i.tag||`component`;if(i.nesting===1){let i=[],o=t+1;for(;o<e.length;){let t=e[o];if(t.type===`mdc_inline_component`&&t.nesting===-1){let{attrs:t,nextIndex:n}=Ef(e,o+1,!1);return{node:[a,t,...i],nextIndex:n}}let s=Ff(e,o,n,r);o=s.nextIndex,s.node&&i.push(s.node)}return{node:[a,{},...i],nextIndex:o}}if(i.nesting===-1)return{node:null,nextIndex:t+1};{let n={},{attrs:r,nextIndex:o}=Ef(e,t+1,!1);Object.assign(n,r);let s=Cf(i.attrs,{handleBoolean:!1});Object.assign(n,s);let c=Object.keys(r).length>0?o:t+1;return{node:[a,n],nextIndex:c}}}if(i.type===`image`){let n=Cf(i.attrs,{handleJSON:!1,filterEmpty:!0});i.content&&(n.alt=i.content);let{attrs:r,nextIndex:a}=Ef(e,t+1);return Object.assign(n,r),{node:[`img`,n],nextIndex:a}}if(i.type===`link_open`){let r=Cf(i.attrs,{handleJSON:!1}),a=If(e,t+1,`link_close`,n),{attrs:o,nextIndex:s}=Ef(e,a.nextIndex+1);return Object.assign(r,o),a.nodes.length>0?{node:[`a`,r,...a.nodes],nextIndex:s}:{node:null,nextIndex:s}}if(i.type===`math_inline`)return{node:[`math`,{class:`math inline`,content:i.content},i.content],nextIndex:t+1};let a=bf[i.type];if(a){let r=i.type.replace(`_open`,`_close`),o=If(e,t+1,r,n),{attrs:s,nextIndex:c}=Ef(e,o.nextIndex+1);return o.nodes.length>0?{node:[a,s,...o.nodes],nextIndex:c}:{node:null,nextIndex:c}}if(i.children){let e=Nf(i.children,n);return{node:e.length===1?e[0]:null,nextIndex:t+1}}return{node:null,nextIndex:t+1}}function If(e,t,n,r=!1){let i=[],a=t;for(;a<e.length;){let t=e[a];if(t.type===n&&(n===`mdc_inline_span`&&t.nesting===-1||n!==`mdc_inline_span`))break;if(t.type===`mdc_inline_props`&&t.hidden){a++;continue}if(t.type===`mdc_inline_component`&&r){let n=t.tag||`component`,r={},{attrs:o,nextIndex:s}=Ef(e,a+1,!1);Object.assign(r,o),Object.keys(o).length>0?a=s:a++,i.push([n,r]);continue}let o=Ff(e,a,r);a=o.nextIndex,o.node&&i.push(o.node)}return{nodes:Af(i),nextIndex:a}}function Lf(e,t){let n=-1,r=t.nodes.length-1,i=!1;for(;r>=0;){let e=t.nodes[r];if(e[1]&&e[1].$?.line){if(i){n=r;break}i=!0}r--}let a=n===-1?null:t.nodes[n];if(a){let r=a[1].$?.line??0;return{remainingMarkdownStartLine:r,reusedNodes:t.nodes.slice(0,n+1),remainingMarkdown:e.split(`
79
- `).slice(r).join(`
80
- `)||``}}return{remainingMarkdownStartLine:0,remainingMarkdown:e,reusedNodes:[]}}var Rf={end:()=>{}},zf={startSpan:()=>Rf,startActiveSpan:(e,t,n)=>(typeof t==`function`?t:n)(Rf)};function Bf(e,t,n,r){return e.startActiveSpan(t,r??{},e=>{try{let t=n();return t instanceof Promise?t.finally(()=>e.end()):(e.end(),t)}catch(t){throw e.end(),t}})}function Vf(e={}){let{autoUnwrap:t=!0,autoClose:n=!0,tracer:r=zf}=e,i=Bd(e.unwrap),a=e.plugins??[];e.html!==void 0&&console.warn("[comark] `ParserOptions.html` is deprecated and will be removed in a future major version. Use `registerDefaultPlugins: false` and register `html()` from `comark/plugins/html` only when needed.");let o=so(e.registerDefaultPlugins===!1?[]:[zd(),...e.html===!1?[]:[Fd()],Sd(),bd(),pd(),_d()],a),s=e=>o.some(t=>t.name===e),c=new ao({linkify:e.linkify??!0}).enable([`table`,`strikethrough`]);for(let e of o)for(let t of e.markdownItPlugins||[])c.use(t);let l=null,u=null;return async(a,d={})=>await Bf(r,`comark:parse`,async()=>{let f={options:e,tokens:[],markdown:a,tree:null,parsedLines:0,reusableNodes:[],frontmatterText:``,frontmatter:{}},p=l,m=a.startsWith(u??``);if(d.streaming&&p&&m){let{remainingMarkdownStartLine:e,reusedNodes:t,remainingMarkdown:n}=Lf(a,p);if(!n)return p;f.parsedLines=e,f.markdown=n,f.reusableNodes=t}typeof n==`function`?f.markdown=Bf(r,`comark:autoclose`,()=>n(f.markdown)):n&&(f.markdown=Bf(r,`comark:autoclose`,()=>St(f.markdown,{frontmatter:s(`frontmatter`)&&d.streaming,syntax:s(`components`),attributes:s(`components`)||s(`attributes`),math:s(`math`),dropTrailingOpeners:d.streaming===!0})));for(let e of o)e.pre&&await Bf(r,`comark:pre:${e.name}`,()=>e.pre(f));try{f.tokens=Bf(r,`comark:tokenize`,()=>c.parse(f.markdown,{}))}catch(e){if(d.streaming&&p)return p;throw e}let h=r.startSpan(`comark:nodes`),g=xf(f.tokens,{startLine:f.parsedLines,preservePositions:d.streaming??!1,headingIds:e.headingIds??!0});t&&(g=g.map(e=>Rt(e))),i.length>0&&(g=Wd(g,i)),h.end();let _=f.frontmatter??{},v=f.frontmatterText??``;d.streaming?(f.tree={frontmatter:v?_:p?.frontmatter??_,meta:{},nodes:[...f.reusableNodes,...g]},l=f.tree,u=a):(f.tree={frontmatter:_,meta:{},nodes:g},l=null,u=null);for(let e of o)e.post&&await Bf(r,`comark:post:${e.name}`,()=>e.post(f));return f.tree})}function Hf(e={}){return oo(Vf(e))}var Uf=` `,Wf=`background-color: currentColor; display: inline-block; margin-left: 0.25rem; margin-right: 0.25rem; animation: pulse 0.75s cubic-bezier(0.4,0,0.6,1) infinite;`;function Gf(e){if(e===!0)return[`span`,{key:`stream-caret`,style:Wf},Uf];if(typeof e==`object`){let t=e?.class||``;return[`span`,{key:`stream-caret`,style:Wf,...t?{class:t}:{}},Uf]}return null}function Kf(e,t){for(let n=e.length-1;n>=2;n--){let r=e[n];if(typeof r==`string`&&e[1]?.key!==`stream-caret`)return e.push(t),!0;if(Array.isArray(r)&&Kf(r,t))return!0}return!1}var qf=new Map;function Jf(e){return!!e&&typeof e.then==`function`}function Yf(e){return e&&typeof e==`object`&&`default`in e?e.default:e}function Xf(e){return Array.isArray(e)&&e.length>=1?e[0]:null}function Zf(e){return Array.isArray(e)&&e.length>=2&&e[1]||{}}function Qf(e){return Array.isArray(e)&&e.length>2?e.slice(2):[]}function $f(e,t,n){let r=Se()?.appContext?.components,i=qu(e),a=`Prose${i}`,o=t[a]||t[i]||t[e]||r?.[a]||r?.[i];if(!o&&n){let t=e;if(!qf.has(t)){let r=n(e);Jf(r)?qf.set(t,we(()=>r)):r&&qf.set(t,Yf(r))}o=qf.get(t)}return o}function ep(e,t={},n,r,i,a={frontmatter:{},meta:{},data:{},props:{}}){if(typeof e==`string`)return e;if(Array.isArray(e)){let o=Xf(e);if(!o)return null;let s=Zf(e),c=Qf(e),l;i?.[0]!==`pre`&&(s.as&&(l=$f(s.as,t,r)),l||=$f(o,t,r));let u=l||o,d=Hu(s,a,{parseJson:!0}),f={};for(let e in d)e===`className`?f.class=d[e]:f[e]=d[e];if((u?.props?.__node||u?.__asyncResolved?.props?.__node)&&(f.__node=e),n!==void 0&&(f.key=n),e.length===2)return _e(u,f);let p=Object.keys(d).length>0?{...a,props:f}:a,m={},h=[];for(let n=0;n<c.length;n++){let i=c[n];if(i==null)continue;let a=Xf(i),o=Zf(i);if(a===`template`&&o){let n;if(o.name)n=o.name;else for(let e in o)if(e.startsWith(`v-slot:`)){n=e.substring(7);break}if(n){let a=Qf(i);m[n]=()=>a.map((n,i)=>ep(n,t,i,r,e,p)).filter(e=>e!==null);continue}}let s=ep(i,t,n,r,e,p);s!==null&&h.push(s)}return l?(h.length>0&&(m.default=()=>h),_e(u,f,m)):_e(u,f,h)}return null}var tp=L({name:`MarkdownDocument`,props:{value:{type:Object,default:void 0},components:{type:Object,default:()=>({})},componentsManifest:{type:Function,default:void 0},streaming:{type:Boolean,default:!1},caret:{type:[Boolean,Object],default:!1},data:{type:Object,default:()=>({})},documentKey:{type:String,default:void 0}},async setup(e){let t=I(()=>e.value??{nodes:[],frontmatter:{},meta:{}}),n=H(new Set),r=We(null),i=t.value.meta?.key||e.documentKey;if(i&&globalThis.comarkContext){let e=globalThis.comarkContext.get(i,ve(t.value)).listen(e=>{r.value=e});Pe(()=>e(!0))}Ve((e,t,r)=>{let i=t?.$?.type?.name||t?.type?.name||`unknown`;return n.value.add(i),!1});let a=xe(`comark`,{components:{},componentManifest:()=>null}),o=I(()=>({...a?.components,...e.components})),s=t=>{let n=e.componentsManifest?.(t);return n||=a?.componentManifest(t),n||null},c=I(()=>Gf(e.caret||!1));return()=>{let n=ve(r.value??t.value),i=[...n.nodes||[]];e.streaming&&c.value&&i.length>0&&(Kf(i[i.length-1],c.value)||i.push(c.value));let a={frontmatter:n.frontmatter||n.data||{},meta:n.meta||{},data:e.data||{},props:{}},l=i.map((e,t)=>ep(e,o.value,t,s,void 0,a)).filter(e=>e!==null);return _e(`div`,{class:`comark-content`},l)}}}),np=L({name:`Markdown`,props:{value:{type:[String,Object],default:void 0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},unwrap:{type:[Boolean,String,Array],default:!1},components:{type:Object,default:()=>({})},componentsManifest:{type:Function,default:void 0},streaming:{type:Boolean,default:!1},summary:{type:Boolean,default:!1},caret:{type:[Boolean,Object],default:!1},data:{type:Object,default:()=>({})},documentKey:{type:String,default:void 0}},async setup(e,t){let n=I(()=>{if(Uu(e.value))return``;let n=e.value,r=t.slots.default?.();return r&&r.length>0&&typeof r[0].children==`string`&&(n=r[0].children),e.summary&&(n=n?.split(`<!-- more -->`)[0]),(n||``).trim()}),r=We(null),i=Hf({...e.options,...e.unwrap?{unwrap:e.unwrap}:{},plugins:e.plugins});return be(()=>[n.value,e.streaming],()=>{Uu(e.value)||i(n.value,{streaming:e.streaming}).then(e=>r.value=e)}),Uu(e.value)||await i(n.value,{streaming:e.streaming}).then(e=>r.value=e),()=>Uu(e.value)?_e(tp,{value:e.value,components:e.components,streaming:e.streaming,componentsManifest:e.componentsManifest,class:e.streaming?`comark-stream`:``,caret:e.caret,data:e.data,documentKey:e.documentKey}):_e(tp,{value:r.value||{nodes:[],frontmatter:{},meta:{}},components:e.components,streaming:e.streaming,componentsManifest:e.componentsManifest,class:e.streaming?`comark-stream`:``,caret:e.caret,data:e.data,documentKey:e.documentKey})}}),rp={class:`px-6 py-10 text-center op-fade flex flex-col gap-2 items-center justify-center`},ip={key:0,class:`text-sm color-base font-medium`},ap={key:1,class:`text-xs op-mute max-w-prose`},op={key:2,class:`mt-2 flex gap-2 items-center`},sp=L({__name:`FeedbackEmptyState`,props:{title:{},icon:{}},setup(e){return(t,n)=>(R(),F(`div`,rp,[Ge(t.$slots,`icon`,{},()=>[e.icon?(R(),F(`span`,{key:0,class:Oe([e.icon,`text-3xl op-mute`]),"aria-hidden":`true`},null,2)):U(``,!0)]),e.title||t.$slots.default?(R(),F(`div`,ip,[Ge(t.$slots,`default`,{},()=>[j(B(e.title),1)])])):U(``,!0),t.$slots.hint?(R(),F(`div`,ap,[Ge(t.$slots,`hint`)])):U(``,!0),t.$slots.actions?(R(),F(`div`,op,[Ge(t.$slots,`actions`)])):U(``,!0)]))}}),cp={key:0,class:`text-sm`},lp=L({__name:`FeedbackLoading`,props:{text:{},panel:{type:Boolean}},setup(e){return(t,n)=>(R(),F(`div`,{class:Oe([`op-fade flex gap-2 items-center justify-center`,e.panel?`h-full w-full py-12`:`py-4`])},[A(y),e.text||t.$slots.default?(R(),F(`span`,cp,[Ge(t.$slots,`default`,{},()=>[j(B(e.text),1)])])):U(``,!0)],2))}}),up=`diffs-container`,dp=/(?=^diff --git)/gm,fp=/(?<=\n)/,pp=/^(---|\+\+\+)\s+([^\t\r\n]+)/,mp=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,hp=`header-prefix`,gp=`header-filename-suffix`,_p=`header-metadata`,vp=`header-custom`,yp={dark:`pierre-dark`,light:`pierre-light`},bp=`data-theme-css`,xp=`data-unsafe-css`,Sp=`data-diffs-scrollbar-measure`,Cp=`--diffs-scrollbar-gutter-measured`,wp=1e5,Tp={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...Tp});var Ep=Object.freeze({fromStart:0,fromEnd:0}),Dp={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},Op={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0},kp=new Map,Ap=new Map,jp=new Map,Mp=new Set;function Np(e){for(let t of Array.isArray(e)?e:[e])if(t!==`text`&&t!==`ansi`&&!Mp.has(t))return!1;return!0}function Pp(e,t){e=Array.isArray(e)?e:[e];for(let n of e){if(Mp.has(n.name))continue;let e=kp.get(n.name);e??(e=n,kp.set(n.name,e));let r=e.data.find(t=>t.name===e.name||t.aliases?.includes(e.name)===!0);if(r==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${e.name}" as its name or an alias.`);t.loadLanguageSync(e.data);try{t.getLanguage(e.name)}catch{throw Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${e.name}". Load the alias first or give the grammar a unique name.`)}Mp.add(e.name)}}function Fp(){return typeof WorkerGlobalScope<`u`&&typeof self<`u`&&self instanceof WorkerGlobalScope}var Ip=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function Lp(e){return Rp(e)}function Rp(e){return Array.isArray(e)?zp(e):e instanceof RegExp?e:typeof e==`object`?Bp(e):e}function zp(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Rp(e[n]);return t}function Bp(e){let t={};for(let n in e)t[n]=Rp(e[n]);return t}function Vp(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function Hp(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?Hp(e.substring(0,e.length-1)):e.substr(~t+1)}var Up=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Wp=class{static hasCaptures(e){return e!==null&&(Up.lastIndex=0,Up.test(e))}static replaceCaptures(e,t,n){return e.replace(Up,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function Gp(e,t){return e<t?-1:+(e>t)}function Kp(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=Gp(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function qp(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Jp(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var Yp=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Xp=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(tm(e),t)}static createFromParsedTheme(e,t){return im(e,t)}_cachedMatchRoot=new Yp(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>Qp(e.parent,t.parentScopes));return n?new em(n.fontStyle,n.foreground,n.background):null}},Zp=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function Qp(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!$p(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function $p(e,t){return t===e||e.startsWith(t)&&e[t.length]===`.`}var em=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function tm(e){if(!e||!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let e=0,i=t.length;e<i;e++){let i=t[e];if(!i.settings)continue;let a;if(typeof i.scope==`string`){let e=i.scope;e=e.replace(/^[,]+/,``),e=e.replace(/[,]+$/,``),a=e.split(`,`)}else a=Array.isArray(i.scope)?i.scope:[``];let o=-1;if(typeof i.settings.fontStyle==`string`){o=0;let e=i.settings.fontStyle.split(` `);for(let t=0,n=e.length;t<n;t++)switch(e[t]){case`italic`:o|=1;break;case`bold`:o|=2;break;case`underline`:o|=4;break;case`strikethrough`:o|=8}}let s=null;typeof i.settings.foreground==`string`&&qp(i.settings.foreground)&&(s=i.settings.foreground);let c=null;typeof i.settings.background==`string`&&qp(i.settings.background)&&(c=i.settings.background);for(let t=0,i=a.length;t<i;t++){let i=a[t].trim().split(` `),l=i[i.length-1],u=null;i.length>1&&(u=i.slice(0,i.length-1),u.reverse()),n[r++]=new nm(l,u,e,o,s,c)}}return n}var nm=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},rm=(e=>(e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`,e))(rm||{});function im(e,t){e.sort((e,t)=>{let n=Gp(e.scope,t.scope);return n!==0||(n=Kp(e.parentScopes,t.parentScopes),n!==0)?n:e.index-t.index});let n=0,r=`#000000`,i=`#ffffff`;for(;e.length>=1&&e[0].scope===``;){let t=e.shift();t.fontStyle!==-1&&(n=t.fontStyle),t.foreground!==null&&(r=t.foreground),t.background!==null&&(i=t.background)}let a=new am(t),o=new em(n,a.getId(r),a.getId(i)),s=new cm(new sm(0,null,-1,0,0),[]);for(let t=0,n=e.length;t<n;t++){let n=e[t];s.insert(0,n.scope,n.parentScopes,n.fontStyle,a.getId(n.foreground),a.getId(n.background))}return new Xp(a,o,s)}var am=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},om=Object.freeze([]),sm=class e{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t||om,this.fontStyle=n,this.foreground=r,this.background=i}clone(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t}acceptOverwrite(e,t,n,r){this.scopeDepth>e?console.log(`how did this happen?`):this.scopeDepth=e,t!==-1&&(this.fontStyle=t),n!==0&&(this.foreground=n),r!==0&&(this.background=r)}},cm=class e{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}_rulesWithParentScopes;static _cmpBySpecificity(e,t){if(e.scopeDepth!==t.scopeDepth)return t.scopeDepth-e.scopeDepth;let n=0,r=0;for(;e.parentScopes[n]===`>`&&n++,t.parentScopes[r]===`>`&&r++,!(n>=e.parentScopes.length||r>=t.parentScopes.length);){let i=t.parentScopes[r].length-e.parentScopes[n].length;if(i!==0)return i;n++,r++}return t.parentScopes.length-e.parentScopes.length}match(t){if(t!==``){let e=t.indexOf(`.`),n,r;if(e===-1?(n=t,r=``):(n=t.substring(0,e),r=t.substring(e+1)),this._children.hasOwnProperty(n))return this._children[n].match(r)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(e._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===``){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf(`.`),c,l;s===-1?(c=n,l=``):(c=n.substring(0,s),l=n.substring(s+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new e(this._mainRule.clone(),sm.cloneArr(this._rulesWithParentScopes)),this._children[c]=u),u.insert(t+1,l,r,i,a,o)}_doInsertHere(e,t,n,r,i){if(t===null){this._mainRule.acceptOverwrite(e,n,r,i);return}for(let a=0,o=this._rulesWithParentScopes.length;a<o;a++){let o=this._rulesWithParentScopes[a];if(Kp(o.parentScopes,t)===0){o.acceptOverwrite(e,n,r,i);return}}n===-1&&(n=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new sm(e,t,n,r,i))}},lm=class e{static toBinaryStr(e){return e.toString(2).padStart(32,`0`)}static print(t){let n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),a=e.getForeground(t),o=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return!!(e&1024)}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(t,n,r,i,a,o,s){let c=e.getLanguageId(t),l=e.getTokenType(t),u=+!!e.containsBalancedBrackets(t),d=e.getFontStyle(t),f=e.getForeground(t),p=e.getBackground(t);return n!==0&&(c=n),r!==8&&(l=dm(r)),i!==null&&(u=+!!i),a!==-1&&(d=a),o!==0&&(f=o),s!==0&&(p=s),(c<<0|l<<8|u<<10|d<<11|f<<15|p<<24)>>>0}};function um(e){return e}function dm(e){return e}function fm(e,t){let n=[],r=mm(e),i=r.next();for(;i!==null;){let e=0;if(i.length===2&&i.charAt(1)===`:`){switch(i.charAt(0)){case`R`:e=1;break;case`L`:e=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let t=o();if(n.push({matcher:t,priority:e}),i!==`,`)break;i=r.next()}return n;function a(){if(i===`-`){i=r.next();let e=a();return t=>!!e&&!e(t)}if(i===`(`){i=r.next();let e=s();return i===`)`&&(i=r.next()),e}if(pm(i)){let e=[];do e.push(i),i=r.next();while(pm(i));return n=>t(e,n)}return null}function o(){let e=[],t=a();for(;t;)e.push(t),t=a();return t=>e.every(e=>e(t))}function s(){let e=[],t=o();for(;t&&(e.push(t),i===`|`||i===`,`);){do i=r.next();while(i===`|`||i===`,`);t=o()}return t=>e.some(e=>e(t))}}function pm(e){return!!e&&!!e.match(/[\w\.:]+/)}function mm(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function hm(e){typeof e.dispose==`function`&&e.dispose()}var gm=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},_m=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},vm=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ym=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new gm(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new vm;for(let n of e)bm(n,this.initialScopeName,this.repo,t);for(let e of t.references)if(e instanceof gm){if(this.seenFullScopeRequests.has(e.scopeName))continue;this.seenFullScopeRequests.add(e.scopeName),this.Q.push(e)}else{if(this.seenFullScopeRequests.has(e.scopeName)||this.seenPartialScopeRequests.has(e.toKey()))continue;this.seenPartialScopeRequests.add(e.toKey()),this.Q.push(e)}}};function bm(e,t,n,r){let i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw Error(`No grammar provided for <${t}>`);return}let a=n.lookup(t);e instanceof gm?Sm({baseGrammar:a,selfGrammar:i},r):xm(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);let o=n.injections(e.scopeName);if(o)for(let e of o)r.add(new gm(e))}function xm(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Cm([r],t,n)}}function Sm(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Cm(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Cm(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Cm(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let e=r.repository?Vp({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Cm(r.patterns,{...t,repository:e},n);let i=r.include;if(!i)continue;let a=km(i);switch(a.kind){case 0:Sm({...t,selfGrammar:t.baseGrammar},n);break;case 1:Sm(t,n);break;case 2:xm(a.ruleName,{...t,repository:e},n);break;case 3:case 4:let r=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){let i={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};a.kind===4?xm(a.ruleName,i,n):Sm(i,n)}else a.kind===4?n.add(new _m(a.scopeName,a.ruleName)):n.add(new gm(a.scopeName))}}}var wm=class{kind=0},Tm=class{kind=1},Em=class{constructor(e){this.ruleName=e}kind=2},Dm=class{constructor(e){this.scopeName=e}kind=3},Om=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function km(e){if(e===`$base`)return new wm;if(e===`$self`)return new Tm;let t=e.indexOf(`#`);return t===-1?new Dm(e):t===0?new Em(e.substring(1)):new Om(e.substring(0,t),e.substring(t+1))}var Am=/\\(\d+)/,jm=/\\(\d+)/g,Mm=-1,Nm=-2;function Pm(e){return e}function Fm(e){return e}var Im=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Wp.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Wp.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Hp(this.$location.filename)}:${this.$location.line}`:`unknown`;return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Wp.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Wp.replaceCaptures(this._contentName,e,t)}},Lm=class extends Im{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw Error(`Not supported!`)}compile(e,t){throw Error(`Not supported!`)}compileAG(e,t,n,r){throw Error(`Not supported!`)}},Rm=class extends Im{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new Um(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Wm,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},zm=class extends Im{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Wm,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Bm=class extends Im{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r),this._begin=new Um(i,this.id),this.beginCaptures=a,this._end=new Um(o||`￿`,-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Wm;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Vm=class extends Im{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,c){super(e,t,n,r),this._begin=new Um(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new Um(o,Nm),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&=(this._cachedCompiledPatterns.dispose(),null),this._cachedCompiledWhilePatterns&&=(this._cachedCompiledWhilePatterns.dispose(),null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Wm;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Wm,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||`￿`),this._cachedCompiledWhilePatterns}},Hm=class e{static createCaptureRule(e,t,n,r,i){return e.registerRule(e=>new Lm(t,e,n,r,i))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new Rm(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(t.begin===void 0){t.repository&&(r=Vp({},r,t.repository));let i=t.patterns;return i===void 0&&t.include&&(i=[{include:t.include}]),new zm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(i,n,r))}return t.while?new Vm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new Bm(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(let e in t){if(e===`$vscodeTextmateLocation`)continue;let t=parseInt(e,10);t>a&&(a=t)}for(let e=0;e<=a;e++)i[e]=null;for(let a in t){if(a===`$vscodeTextmateLocation`)continue;let o=parseInt(a,10),s=0;t[a].patterns&&(s=e.getCompiledRuleId(t[a],n,r)),i[o]=e.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,s)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){let o=t[a],s=-1;if(o.include){let t=km(o.include);switch(t.kind){case 0:case 1:s=e.getCompiledRuleId(r[o.include],n,r);break;case 2:let i=r[t.ruleName];i&&(s=e.getCompiledRuleId(i,n,r));break;case 3:case 4:let a=t.scopeName,c=t.kind===4?t.ruleName:null,l=n.getExternalGrammar(a,r);if(l){if(c){let t=l.repository[c];t&&(s=e.getCompiledRuleId(t,n,l.repository))}else s=e.getCompiledRuleId(l.repository.$self,n,l.repository)}}}else s=e.getCompiledRuleId(o,n,r);if(s!==-1){let e=n.getRule(s),t=!1;if((e instanceof zm||e instanceof Bm||e instanceof Vm)&&e.hasMissingPatterns&&e.patterns.length===0&&(t=!0),t)continue;i.push(s)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},Um=class e{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,t){if(e&&typeof e==`string`){let t=e.length,n=0,r=[],i=!1;for(let a=0;a<t;a++)if(e.charAt(a)===`\\`&&a+1<t){let t=e.charAt(a+1);t===`z`?(r.push(e.substring(n,a)),r.push(`$(?!\\n)(?<!\\n)`),n=a+2):(t===`A`||t===`G`)&&(i=!0),a++}this.hasAnchor=i,n===0?this.source=e:(r.push(e.substring(n,t)),this.source=r.join(``))}else this.hasAnchor=!1,this.source=e;this._anchorCache=this.hasAnchor?this._buildAnchorCache():null,this.ruleId=t,this.hasBackReferences=typeof this.source==`string`&&Am.test(this.source)}clone(){return new e(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,t){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let n=t.map(t=>e.substring(t.start,t.end));return jm.lastIndex=0,this.source.replace(jm,(e,t)=>Jp(n[parseInt(t,10)]||``))}_buildAnchorCache(){if(typeof this.source!=`string`)throw Error(`This method should only be called if the source is a string`);let e=[],t=[],n=[],r=[],i,a,o,s;for(i=0,a=this.source.length;i<a;i++)o=this.source.charAt(i),e[i]=o,t[i]=o,n[i]=o,r[i]=o,o===`\\`&&i+1<a&&(s=this.source.charAt(i+1),s===`A`?(e[i+1]=`￿`,t[i+1]=`￿`,n[i+1]=`A`,r[i+1]=`A`):s===`G`?(e[i+1]=`￿`,t[i+1]=`G`,n[i+1]=`￿`,r[i+1]=`G`):(e[i+1]=s,t[i+1]=s,n[i+1]=s,r[i+1]=s),i++);return{A0_G0:e.join(``),A0_G1:t.join(``),A1_G0:n.join(``),A1_G1:r.join(``)}}resolveAnchors(e,t){return!this.hasAnchor||!this._anchorCache||typeof this.source!=`string`?this.source:e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Wm=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&=(this._cached.dispose(),null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(e=>e.source);this._cached=new Gm(e,t,this._items.map(e=>e.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){return new Gm(e,this._items.map(e=>e.resolveAnchors(t,n)),this._items.map(e=>e.ruleId))}},Gm=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose==`function`&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(` - `+this.rules[t]+`: `+this.regExps[t]);return e.join(`
81
- `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Km=class{constructor(e,t){this.languageId=e,this.tokenType=t}},qm=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new Km(e,8),this._embeddedLanguagesMatcher=new Jm(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Km(0,0);_getBasicScopeAttributes=new Yp(e=>new Km(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Jm=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>Jp(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var Ym=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function Xm(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=Zm(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new Ym(i,!0);f()}return new Ym(i,!1);function f(){let o=Qm(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Mm){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),rh(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof Bm){let r=o;rh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof Vm){let r=o;rh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(rh(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function Zm(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof Vm&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=nh(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Nm){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),rh(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function Qm(e,t,n,r,i,a){let o=$m(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=eh(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function $m(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=th(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function eh(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=th(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function th(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function nh(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function rh(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a.length,o.length),l=[],u=o[0].end;for(let t=0;t<c;t++){let c=a[t];if(c===null)continue;let d=o[t];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.start;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?i.produceFromScopes(l[l.length-1].scopes,d.start):i.produce(r,d.start),c.retokenizeCapturedWithRuleId){let t=c.getName(s,o),a=r.contentNameScopesList.pushAttributed(t,e),l=c.getContentName(s,o),u=a.pushAttributed(l,e),f=r.push(c.retokenizeCapturedWithRuleId,d.start,-1,!1,null,a,u),p=e.createOnigString(s.substring(0,d.end));Xm(e,p,n&&d.start===0,d.start,f,i,!1,0),hm(p);continue}let f=c.getName(s,o);if(f!==null){let t=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(f,e);l.push(new ih(t,d.end))}}for(;l.length>0;)i.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var ih=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ah(e,t,n,r,i,a,o,s){return new lh(e,t,n,r,i,a,o,s)}function oh(e,t,n,r,i){let a=fm(t,sh),o=Hm.getCompiledRuleId(n,r,i.repository);for(let n of a)e.push({debugSelector:t,matcher:n.matcher,ruleId:o,grammar:i,priority:n.priority})}function sh(e,t){if(t.length<e.length)return!1;let n=0;return e.every(e=>{for(let r=n;r<t.length;r++)if(ch(t[r],e))return n=r+1,!0;return!1})}function ch(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]===`.`}var lh=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new qm(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=uh(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(let e of Object.keys(i)){let t=fm(e,sh);for(let n of t)this._tokenTypeMatchers.push({matcher:n.matcher,type:i[e]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e),injections:e=>this._grammarRepository.injections(e)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let e=r.injections;if(e)for(let n in e)oh(t,n,e[n],this,r);let i=this._grammarRepository.injections(n);i&&i.forEach(e=>{let n=this.getExternalGrammar(e);if(n){let e=n.injectionSelector;e&&oh(t,e,n,this,n)}})}return t.sort((e,t)=>e.priority-t.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(Pm(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[Fm(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=uh(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Hm.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===fh.NULL){i=!0;let e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=lm.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),a=this.getRule(this._rootId).getName(null,null),o;o=a?dh.createRootAndLookUpScopeName(a,r,this):dh.createRoot(`unknown`,r),t=new fh(null,this._rootId,-1,-1,!1,null,o,o)}else i=!1,t.reset();e+=`
82
- `;let a=this.createOnigString(e),o=a.content.length,s=new mh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=Xm(this,a,i,0,t,s,!0,r);return hm(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function uh(e,t){return e=Lp(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var dh=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=Zp.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new Zp(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new Zp(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),lm.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},fh=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?dh.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Fm(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=dh.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Pm(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,dh.fromExtension(r,n.contentNameScopesList))}},ph=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):fm(e,sh).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>fm(e,sh).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},mh=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let n=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let t=e?.getScopeNames()??[];for(let e of this._tokenTypeOverrides)e.matcher(t)&&(n=lm.set(n,0,um(e.type),null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(t))}if(r&&(n=lm.set(n,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let e=0,t=this._binaryTokens.length;e<t;e++)n[e]=this._binaryTokens[e];return n}},hh=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,i){if(!this._grammars.has(e)){let a=this._rawGrammars.get(e);if(!a)return null;this._grammars.set(e,ah(e,a,t,n,r,i,this,this._onigLib))}return this._grammars.get(e)}},gh=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new hh(Xp.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Xp.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new ph(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,i){let a=new ym(this._syncRegistry,e);for(;a.Q.length>0;)a.Q.map(e=>this._loadSingleGrammar(e.scopeName)),a.processQueue();return this._grammarForScopeName(e,t,n,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections==`function`?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,i)}},_h=fh.NULL;function vh(e,t){let n=typeof e==`string`?{}:{...e.colorReplacements},r=typeof e==`string`?e:e.name;for(let[e,i]of Object.entries(t?.colorReplacements||{}))typeof i==`string`?n[e]=i:e===r&&Object.assign(n,i);return n}function yh(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function bh(e){return Array.isArray(e)?e:[e]}async function xh(e){return Promise.resolve(typeof e==`function`?e():e).then(e=>e.default||e)}function Sh(e){return!e||[`plaintext`,`txt`,`text`,`plain`].includes(e)}function Ch(e){return e===`ansi`||Sh(e)}function wh(e){return e===`none`}function Th(e){return wh(e)}var Eh=/(\r?\n)/g;function Dh(e,t=!1){if(e.length===0)return[[``,0]];let n=e.split(Eh),r=0,i=[];for(let e=0;e<n.length;e+=2){let a=t?n[e]+(n[e+1]||``):n[e];i.push([a,r]),r+=n[e].length,r+=n[e+1]?.length||0}return i}var Oh={light:`#333333`,dark:`#bbbbbb`},kh={light:`#fffffe`,dark:`#1e1e1e`},Ah=`__shiki_resolved`;function jh(e){if(e?.[Ah])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||=`dark`,t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let e=t.settings?t.settings.find(e=>!e.name&&!e.scope):void 0;e?.settings?.foreground&&(r=e.settings.foreground),e?.settings?.background&&(n=e.settings.background),!r&&t?.colors?.[`editor.foreground`]&&(r=t.colors[`editor.foreground`]),!n&&t?.colors?.[`editor.background`]&&(n=t.colors[`editor.background`]),r||=t.type===`light`?Oh.light:Oh.dark,n||=t.type===`light`?kh.light:kh.dark,t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let i=0,a=new Map;function o(e){if(a.has(e))return a.get(e);i+=1;let n=`#${i.toString(16).padStart(8,`0`).toLowerCase()}`;return t.colorReplacements?.[`#${n}`]?o(e):(a.set(e,n),n)}t.settings=t.settings.map(e=>{let n=e.settings?.foreground&&!e.settings.foreground.startsWith(`#`),r=e.settings?.background&&!e.settings.background.startsWith(`#`);if(!n&&!r)return e;let i={...e,settings:{...e.settings}};if(n){let n=o(e.settings.foreground);t.colorReplacements[n]=e.settings.foreground,i.settings.foreground=n}if(r){let n=o(e.settings.background);t.colorReplacements[n]=e.settings.background,i.settings.background=n}return i});for(let e of Object.keys(t.colors||{}))if((e===`editor.foreground`||e===`editor.background`||e.startsWith(`terminal.ansi`))&&!t.colors[e]?.startsWith(`#`)){let n=o(t.colors[e]);t.colorReplacements[n]=t.colors[e],t.colors[e]=n}return Object.defineProperty(t,Ah,{enumerable:!1,writable:!1,value:!0}),t}async function Mh(e){return[...new Set((await Promise.all(e.filter(e=>!Ch(e)).map(async e=>await xh(e).then(e=>Array.isArray(e)?e:[e])))).flat())]}async function Nh(e){return(await Promise.all(e.map(async e=>Th(e)?null:jh(await xh(e))))).filter(e=>!!e)}function Ph(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new Ip(`Circular alias \`${[...n].join(` -> `)} -> ${e}\``);n.add(e)}}return e}var Fh=class extends gh{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(e=>this.loadTheme(e)),this.loadLanguages(this._langs)}getTheme(e){return typeof e==`string`?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=jh(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||=[...this._resolvedThemes.keys()],this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Xp.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Ph(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(t=>t.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||[`*`],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(t=>{this._alias[t]=e.name}),this._loadedLanguagesCache=null,t.size)for(let e of t)this._resolvedGrammars.delete(e.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(e.scopeName),this._syncRegistry?._grammars?.delete(e.scopeName),this.loadLanguage(this._langMap.get(e.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(let t of e)this.resolveEmbeddedLanguages(t);let t=[...this._langGraph.entries()],n=t.filter(([e,t])=>!t);if(n.length){let e=t.filter(([e,t])=>t?(t.embeddedLanguages||t.embeddedLangs)?.some(e=>n.map(([e])=>e).includes(e)):!1).filter(e=>!n.includes(e));throw new Ip(`Missing languages ${n.map(([e])=>`\`${e}\``).join(`, `)}, required by ${e.map(([e])=>`\`${e}\``).join(`, `)}`)}for(let[e,n]of t)this._resolver.addLanguage(n);for(let[e,n]of t)this.loadLanguage(n)}getLoadedLanguages(){return this._loadedLanguagesCache||=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])],this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let e of t)this._langGraph.set(e,this._langMap.get(e))}},Ih=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:t=>e.createScanner(t),createOnigString:t=>e.createString(t)},t.forEach(e=>this.addLanguage(e))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split(`.`),n=[];for(let e=1;e<=t.length;e++){let r=t.slice(0,e).join(`.`);n=[...n,...this._injections.get(r)||[]]}return n}},Lh=0;function Rh(e){Lh+=1,e.warnings!==!1&&Lh>=10&&Lh%10==0&&console.warn(`[Shiki] ${Lh} 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 Ip("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(jh),i=new Fh(new Ih(e.engine,n),r,n,e.langAlias),a;function o(t){return Ph(t,e.langAlias)}function s(e){g();let t=i.getGrammar(typeof e==`string`?e:e.name);if(!t)throw new Ip(`Language \`${e}\` not found, you may need to load it first`);return t}function c(e){if(e===`none`)return{bg:``,fg:``,name:`none`,settings:[],type:`dark`};g();let t=i.getTheme(e);if(!t)throw new Ip(`Theme \`${e}\` not found, you may need to load it first`);return t}function l(e){g();let t=c(e);return a!==e&&(i.setTheme(t),a=e),{theme:t,colorMap:i.getColorMap()}}function u(){return g(),i.getLoadedThemes()}function d(){return g(),i.getLoadedLanguages()}function f(...e){g(),i.loadLanguages(e.flat(1))}async function p(...e){return f(await Mh(e))}function m(...e){g();for(let t of e.flat(1))i.loadTheme(t)}async function h(...e){return g(),m(await Nh(e))}function g(){if(t)throw new Ip(`Shiki instance has been disposed`)}function _(){t||(t=!0,i.dispose(),--Lh)}return{setTheme:l,getTheme:c,getLanguage:s,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:o,loadLanguage:p,loadLanguageSync:f,loadTheme:h,loadThemeSync:m,dispose:_,[Symbol.dispose]:_}}async function zh(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([Nh(e.themes||[]),Mh(e.langs||[]),e.engine]);return Rh({...e,themes:t,langs:n,engine:r})}var Bh=new WeakMap;function Vh(e,t){Bh.set(e,t)}function Hh(e){return Bh.get(e)}var Uh=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(bh(n).map(e=>[e,_h])),t)}constructor(...e){if(e.length===2){let[t,n]=e;this.lang=n,this._stacks=t}else{let[t,n,r]=e;this.lang=n,this._stacks={[r]:t}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Wh(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Wh(e){let t=[],n=new Set;function r(e){if(n.has(e))return;n.add(e);let i=e?.nameScopesList?.scopeName;i&&t.push(i),e.parent&&r(e.parent)}return r(e),t}function Gh(e,t){if(!(e instanceof Uh))throw new Ip(`Invalid grammar state`);return e.getInternalStack(t)}var Kh=/,/,qh=/ /;function Jh(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Sh(e.resolveLangAlias(n.lang||`text`))||wh(r))return Dh(t).map(e=>[{content:e[0],offset:e[1]}]);let{theme:i,colorMap:a}=e.setTheme(r),o=e.getLanguage(n.lang||`text`);if(n.grammarState){if(n.grammarState.lang!==o.name)throw new Ip(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(i.name))throw new Ip(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Xh(t,o,i,a,n)}function Yh(...e){if(e.length===2)return Hh(e[1]);let[t,n,r={}]=e,{lang:i=`text`,theme:a=t.getLoadedThemes()[0]}=r;if(Sh(i)||wh(a))throw new Ip(`Plain language does not have grammar state`);if(i===`ansi`)throw new Ip(`ANSI language does not have grammar state`);let{theme:o,colorMap:s}=t.setTheme(a),c=t.getLanguage(i);return new Uh(Zh(n,c,o,s,r).stateStack,c.name,o.name)}function Xh(e,t,n,r,i){let a=Zh(e,t,n,r,i),o=new Uh(a.stateStack,t.name,n.name);return Vh(a.tokens,o),a.tokens}function Zh(e,t,n,r,i){let a=vh(n,i),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:s=500,includeExplanation:c=!1}=i,l=Dh(e),u=i.grammarState?Gh(i.grammarState,n.name)??_h:i.grammarContextCode==null?_h:Zh(i.grammarContextCode,t,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack,d=[],f=[];for(let e=0,i=l.length;e<i;e++){let[i,p]=l[e];if(i===``){d=[],f.push([]);continue}if(o>0&&i.length>=o){d=[],f.push([{content:i,offset:p,color:``,fontStyle:0}]);continue}let m,h,g;c&&c!==`tokenType`&&(m=t.tokenizeLine(i,u,s),h=m.tokens,g=0);let _=t.tokenizeLine2(i,u,s),v=_.tokens.length/2;for(let e=0;e<v;e++){let t=_.tokens[2*e],o=e+1<v?_.tokens[2*e+2]:i.length;if(t===o)continue;let s=_.tokens[2*e+1],l=yh(r[lm.getForeground(s)],a),u=lm.getFontStyle(s),f={content:i.substring(t,o),offset:p+t,color:l,fontStyle:u};if(c===`tokenType`)f.type=lm.getTokenType(s);else if(c){let e=[];if(c!==`scopeName`)for(let t of n.settings){let n;switch(typeof t.scope){case`string`:n=t.scope.split(Kh).map(e=>e.trim());break;case`object`:n=t.scope;break;default:continue}e.push({settings:t,selectors:n.map(e=>e.split(qh))})}f.explanation=[];let r=0;for(;t+r<o;){let t=h[g],n=i.substring(t.startIndex,t.endIndex);r+=n.length,f.explanation.push({content:n,scopes:c===`scopeName`?Qh(t.scopes):$h(e,t.scopes)}),g+=1}}d.push(f)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Qh(e){return e.map(e=>({scopeName:e}))}function $h(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r];n[r]={scopeName:i,themeMatches:ng(e,i,t.slice(0,r))}}return n}function eg(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]===`.`}function tg(e,t,n){if(!eg(e.at(-1),t))return!1;let r=e.length-2,i=n.length-1;for(;r>=0&&i>=0;)eg(e[r],n[i])&&--r,--i;return r===-1}function ng(e,t,n){let r=[];for(let{selectors:i,settings:a}of e)for(let e of i)if(tg(e,t,n)){r.push(a);break}return r}function rg(e,t,n,r=Jh){let i=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})),a=i.map(i=>{let a=r(e,t,{...n,theme:i.theme});return{tokens:a,state:Hh(a),theme:typeof i.theme==`string`?i.theme:i.theme.name}}),o=ig(...a.map(e=>e.tokens)),s=o[0].map((e,t)=>e.map((e,r)=>{let a={content:e.content,variants:{},offset:e.offset};return`includeExplanation`in n&&n.includeExplanation&&(a.explanation=e.explanation),o.forEach((e,n)=>{let{content:o,explanation:s,offset:c,...l}=e[t][r];a.variants[i[n].color]=l}),a})),c=a[0].state?new Uh(Object.fromEntries(a.map(e=>[e.theme,e.state?.getInternalStack(e.theme)])),a[0].state.lang):void 0;return c&&Vh(s,c),s}function ig(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let i=e.map(e=>e[r]),a=t.map(()=>[]);t.forEach((e,t)=>e.push(a[t]));let o=i.map(()=>0),s=i.map(e=>e[0]);for(;s.every(e=>e);){let e=Math.min(...s.map(e=>e.content.length));for(let t=0;t<n;t++){let n=s[t];n.content.length===e?(a[t].push(n),o[t]+=1,s[t]=i[t][o[t]]):(a[t].push({...n,content:n.content.slice(0,e)}),s[t]={...n,content:n.content.slice(e),offset:n.offset+e})}}}return t}var ag=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],og=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};og.prototype.normal={},og.prototype.property={},og.prototype.space=void 0;function sg(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new og(n,r,t)}function cg(e){return e.toLowerCase()}var lg=class{constructor(e,t){this.attribute=t,this.property=e}};lg.prototype.attribute=``,lg.prototype.booleanish=!1,lg.prototype.boolean=!1,lg.prototype.commaOrSpaceSeparated=!1,lg.prototype.commaSeparated=!1,lg.prototype.defined=!1,lg.prototype.mustUseProperty=!1,lg.prototype.number=!1,lg.prototype.overloadedBoolean=!1,lg.prototype.property=``,lg.prototype.spaceSeparated=!1,lg.prototype.space=void 0;var ug=ae({boolean:()=>X,booleanish:()=>fg,commaOrSpaceSeparated:()=>gg,commaSeparated:()=>hg,number:()=>Z,overloadedBoolean:()=>pg,spaceSeparated:()=>mg}),dg=0,X=_g(),fg=_g(),pg=_g(),Z=_g(),mg=_g(),hg=_g(),gg=_g();function _g(){return 2**++dg}var vg=Object.keys(ug),yg=class extends lg{constructor(e,t,n,r){let i=-1;if(super(e,t),bg(this,`space`,r),typeof n==`number`)for(;++i<vg.length;){let e=vg[i];bg(this,vg[i],(n&ug[e])===ug[e])}}};yg.prototype.defined=!0;function bg(e,t,n){n&&(e[t]=n)}function xg(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new yg(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[cg(r)]=r,n[cg(a.attribute)]=r}return new og(t,n,e.space)}var Sg=xg({properties:{ariaActiveDescendant:null,ariaAtomic:fg,ariaAutoComplete:null,ariaBusy:fg,ariaChecked:fg,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:mg,ariaCurrent:null,ariaDescribedBy:mg,ariaDetails:null,ariaDisabled:fg,ariaDropEffect:mg,ariaErrorMessage:null,ariaExpanded:fg,ariaFlowTo:mg,ariaGrabbed:fg,ariaHasPopup:null,ariaHidden:fg,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:mg,ariaLevel:Z,ariaLive:null,ariaModal:fg,ariaMultiLine:fg,ariaMultiSelectable:fg,ariaOrientation:null,ariaOwns:mg,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:fg,ariaReadOnly:fg,ariaRelevant:null,ariaRequired:fg,ariaRoleDescription:mg,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:fg,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Cg(e,t){return t in e?e[t]:t}function wg(e,t){return Cg(e,t.toLowerCase())}var Tg=xg({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:hg,acceptCharset:mg,accessKey:mg,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alpha:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:mg,autoFocus:X,autoPlay:X,blocking:mg,capture:null,charSet:null,checked:X,cite:null,className:mg,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:fg,controls:X,controlsList:mg,coords:Z|hg,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:pg,draggable:fg,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:mg,height:Z,hidden:pg,high:Z,href:null,hrefLang:null,htmlFor:mg,httpEquiv:mg,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:mg,itemRef:mg,itemScope:X,itemType:mg,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,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:X,optimum:Z,pattern:null,ping:mg,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:mg,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:mg,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootCustomElementRegistry:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shadowRootSerializable:X,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:fg,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:fg,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:mg,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:fg,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:X,disablePictureInPicture:X,disableRemotePlayback:X,exportParts:hg,part:mg,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:wg}),Eg=xg({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:gg,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:mg,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:hg,g2:hg,glyphName:hg,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:gg,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,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:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:mg,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:gg,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:gg,rev:gg,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:gg,requiredFeatures:gg,requiredFonts:gg,requiredFormats:gg,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:gg,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:gg,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:gg,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Cg}),Dg=xg({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()}}),Og=xg({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:wg}),kg=xg({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Ag=/[A-Z]/g,jg=/-[a-z]/g,Mg=/^data[-\w.:]+$/i;function Ng(e,t){let n=cg(t),r=t,i=lg;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Mg.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(jg,Fg);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!jg.test(e)){let n=e.replace(Ag,Pg);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=yg}return new i(r,t)}function Pg(e){return`-`+e.toLowerCase()}function Fg(e){return e.charAt(1).toUpperCase()}var Ig=sg([Sg,Tg,Dg,Og,kg],`html`),Lg=sg([Sg,Eg,Dg,Og,kg],`svg`),Rg={}.hasOwnProperty;function zg(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&Rg.call(t,e)){let n=String(t[e]);i=Rg.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Bg=/["&'<>`]/g,Vg=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Hg=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ug=/[|\\{}()[\]^$+*?.]/g,Wg=new WeakMap;function Gg(e,t){return e=e.replace(t.subset?Kg(t.subset):Bg,r),t.subset||t.escapeOnly?e:e.replace(Vg,n).replace(Hg,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function Kg(e){let t=Wg.get(e);return t||(t=qg(e),Wg.set(e,t)),t}function qg(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(Ug,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var Jg=/[\dA-Fa-f]/;function Yg(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!Jg.test(String.fromCharCode(t))?r:r+`;`}var Xg=/\d/;function Zg(e,t,n){let r=`&#`+String(e);return n&&t&&!Xg.test(String.fromCharCode(t))?r:r+`;`}var Qg=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),$g={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},e_=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],t_={}.hasOwnProperty,n_={},r_;for(r_ in $g)t_.call($g,r_)&&(n_[$g[r_]]=r_);var i_=/[^\dA-Za-z]/;function a_(e,t,n,r){let i=String.fromCharCode(e);if(t_.call(n_,i)){let e=n_[i],a=`&`+e;return n&&Qg.includes(e)&&!e_.includes(e)&&(!r||t&&t!==61&&i_.test(String.fromCharCode(t)))?a:a+`;`}return``}function o_(e,t,n){let r=Yg(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=a_(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=Zg(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function s_(e,t){return Gg(e,Object.assign({format:o_},t))}var c_=/^>|^->|<!--|-->|--!>|<!-$/g,l_=[`>`],u_=[`<`,`>`];function d_(e,t,n,r){return r.settings.bogusComments?`<?`+s_(e.value,Object.assign({},r.settings.characterReferences,{subset:l_}))+`>`:`<!--`+e.value.replace(c_,i)+`-->`;function i(e){return s_(e,Object.assign({},r.settings.characterReferences,{subset:u_}))}}function f_(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}function p_(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function m_(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function h_(e){return e.join(` `).trim()}var g_=/[ \t\n\f\r]/g;function __(e){return typeof e==`object`?e.type===`text`&&v_(e.value):v_(e)}function v_(e){return e.replace(g_,``)===``}var y_=S_(1),b_=S_(-1),x_=[];function S_(e){return t;function t(t,n,r){let i=t?t.children:x_,a=(n||0)+e,o=i[a];if(!r)for(;o&&__(o);)a+=e,o=i[a];return o}}var C_={}.hasOwnProperty;function w_(e){return t;function t(t,n,r){return C_.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var T_=w_({body:O_,caption:E_,colgroup:E_,dd:M_,dt:j_,head:E_,html:D_,li:A_,optgroup:P_,option:F_,p:k_,rp:N_,rt:N_,tbody:L_,td:B_,tfoot:R_,th:B_,thead:I_,tr:z_});function E_(e,t,n){let r=y_(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&__(r.value.charAt(0)))}function D_(e,t,n){let r=y_(n,t);return!r||r.type!==`comment`}function O_(e,t,n){let r=y_(n,t);return!r||r.type!==`comment`}function k_(e,t,n){let r=y_(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||n.type!==`element`||n.tagName!==`a`&&n.tagName!==`audio`&&n.tagName!==`del`&&n.tagName!==`ins`&&n.tagName!==`map`&&n.tagName!==`noscript`&&n.tagName!==`video`}function A_(e,t,n){let r=y_(n,t);return!r||r.type===`element`&&r.tagName===`li`}function j_(e,t,n){let r=y_(n,t);return!(!r||r.type!==`element`||r.tagName!==`dt`&&r.tagName!==`dd`)}function M_(e,t,n){let r=y_(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function N_(e,t,n){let r=y_(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function P_(e,t,n){let r=y_(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function F_(e,t,n){let r=y_(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function I_(e,t,n){let r=y_(n,t);return!(!r||r.type!==`element`||r.tagName!==`tbody`&&r.tagName!==`tfoot`)}function L_(e,t,n){let r=y_(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function R_(e,t,n){return!y_(n,t)}function z_(e,t,n){let r=y_(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function B_(e,t,n){let r=y_(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var V_=w_({body:W_,colgroup:G_,head:U_,html:H_,tbody:K_});function H_(e){let t=y_(e,-1);return!t||t.type!==`comment`}function U_(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function W_(e){let t=y_(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&__(t.value.charAt(0)))&&(t.type!==`element`||t.tagName!==`meta`&&t.tagName!==`link`&&t.tagName!==`script`&&t.tagName!==`style`&&t.tagName!==`template`)}function G_(e,t,n){let r=b_(n,t),i=y_(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&T_(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function K_(e,t,n){let r=b_(n,t),i=y_(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&T_(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var q_={name:[[`
83
- \f\r &/=>`.split(``),`
84
- \f\r "&'/=>\``.split(``)],[`\0
85
- \f\r "&'/<=>`.split(``),`\0
86
- \f\r "&'/<=>\``.split(``)]],unquoted:[[`
87
- \f\r &>`.split(``),`\0
88
- \f\r "&'<=>\``.split(``)],[`\0
89
- \f\r "&'<=>\``.split(``),`\0
90
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function J_(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=Lg);let l=Y_(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!V_(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!T_(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function Y_(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=X_(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function X_(e,t,n){let r=Ng(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=s_(r.attribute,Object.assign({},e.settings.characterReferences,{subset:q_.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?m_:h_)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=s_(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:q_.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&p_(n,o)>p_(n,e.alternative)&&(o=e.alternative),s=o+s_(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?q_.single:q_.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var Z_=[`<`,`&`];function Q_(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:s_(e.value,Object.assign({},r.settings.characterReferences,{subset:Z_}))}function $_(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Q_(e,t,n,r)}function ev(e,t,n,r){return r.all(e)}var tv=zg(`type`,{invalid:nv,unknown:rv,handlers:{comment:d_,doctype:f_,element:J_,raw:$_,root:ev,text:Q_}});function nv(e){throw Error("Expected node, not `"+e+"`")}function rv(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var iv={},av={},ov=[];function sv(e,t){let n=t||iv,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:cv,all:lv,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||ag,characterReferences:n.characterReferences||av,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?Lg:Ig,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function cv(e,t,n){return tv(e,t,n,this)}function lv(e){let t=[],n=e&&e.children||ov,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var uv=/\s+/g;function dv(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(uv)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(uv);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function fv(e){let t=Dh(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var pv=[`color`,`background-color`];function mv(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function hv(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function gv(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=hv(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(r,i);for(let t=0;t<a.length;t++)a[t]-=e.offset;return mv(e,a)})):e}function _v(e,t,n,r,i=`css-vars`){let a={content:e.content,explanation:e.explanation,offset:e.offset},o=t.map(t=>vv(e.variants[t])),s=new Set(o.flatMap(e=>Object.keys(e))),c={},l=(e,r)=>{let i=r===`color`?``:r===`background-color`?`-bg`:`-${r}`;return n+t[e]+(r===`color`?``:i)};return o.forEach((e,n)=>{for(let a of s){let s=e[a]||`inherit`;if(n===0&&r&&pv.includes(a)){if(r===`light-dark()`&&o.length>1){let e=t.findIndex(e=>e===`light`),r=t.findIndex(e=>e===`dark`);if(e===-1||r===-1)throw new Ip('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let u=o[e][a]||`inherit`,d=o[r][a]||`inherit`;c[a]=`light-dark(${u}, ${d})`,i===`css-vars`&&(c[l(n,a)]=s)}else c[a]=s}else i===`css-vars`&&(c[l(n,a)]=s)}}),a.htmlStyle=c,a}function vv(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t[`background-color`]=e.bgColor),e.fontStyle){e.fontStyle&rm.Italic&&(t[`font-style`]=`italic`),e.fontStyle&rm.Bold&&(t[`font-weight`]=`bold`);let n=[];e.fontStyle&rm.Underline&&n.push(`underline`),e.fontStyle&rm.Strikethrough&&n.push(`line-through`),n.length&&(t[`text-decoration`]=n.join(` `))}return t}function yv(e){return typeof e==`string`?e:Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function bv(){let e=new WeakMap;function t(t){if(!e.has(t.meta)){let n=fv(t.source);function r(e){if(typeof e==`number`){if(e<0||e>t.source.length)throw new Ip(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);return{...n.indexToPos(e),offset:e}}{let t=n.lines[e.line];if(t===void 0)throw new Ip(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);let r=e.character;if(r<0&&(r=t.length+r),r<0||r>t.length)throw new Ip(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);return{...e,character:r,offset:n.posToIndex(e.line,r)}}}let i=(t.options.decorations||[]).map(e=>({...e,start:r(e.start),end:r(e.end)}));xv(i),e.set(t.meta,{decorations:i,converter:n,source:t.source})}return e.get(t.meta)}return{name:`shiki:decorations`,tokens(e){if(this.options.decorations?.length)return gv(e,t(this).decorations.flatMap(e=>[e.start.offset,e.end.offset]))},code(e){if(!this.options.decorations?.length)return;let n=t(this),r=[...e.children].filter(e=>e.type===`element`&&e.tagName===`span`);if(r.length!==n.converter.lines.length)throw new Ip(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function i(e,t,n,i){let a=r[e],s=``,c=-1,l=-1;if(t===0&&(c=0),n===0&&(l=0),n===1/0&&(l=a.children.length),c===-1||l===-1)for(let e=0;e<a.children.length;e++)s+=Sv(a.children[e]),c===-1&&s.length===t&&(c=e+1),l===-1&&s.length===n&&(l=e+1);if(c===-1)throw new Ip(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);if(l===-1)throw new Ip(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);let u=a.children.slice(c,l);if(!i.alwaysWrap&&u.length===a.children.length)o(a,i,`line`);else if(!i.alwaysWrap&&u.length===1&&u[0].type===`element`)o(u[0],i,`token`);else{let e={type:`element`,tagName:`span`,properties:{},children:u};o(e,i,`wrapper`),a.children.splice(c,u.length,e)}}function a(e,t){r[e]=o(r[e],t,`line`)}function o(e,t,n){let r=t.properties||{},i=t.transform||(e=>e);return e.tagName=t.tagName||`span`,e.properties={...e.properties,...r,class:e.properties.class},t.properties?.class&&dv(e,t.properties.class),e=i(e,n)||e,e}let s=[],c=n.decorations.sort((e,t)=>t.start.offset-e.start.offset||e.end.offset-t.end.offset);for(let e of c){let{start:t,end:n}=e;if(t.line===n.line)i(t.line,t.character,n.character,e);else if(t.line<n.line){i(t.line,t.character,1/0,e);for(let r=t.line+1;r<n.line;r++)s.unshift(()=>a(r,e));i(n.line,0,n.character,e)}}s.forEach(e=>e())}}}function xv(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new Ip(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let t=e[r],i=n.start.offset<=t.start.offset&&t.start.offset<n.end.offset,a=n.start.offset<t.end.offset&&t.end.offset<=n.end.offset,o=t.start.offset<=n.start.offset&&n.start.offset<t.end.offset,s=t.start.offset<n.end.offset&&n.end.offset<=t.end.offset;if(i||a||o||s){if(i&&a||o&&s||o&&n.start.offset===n.end.offset||a&&t.start.offset===t.end.offset)continue;throw new Ip(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`)}}}}function Sv(e){return e.type===`text`?e.value:e.type===`element`?e.children.map(Sv).join(``):``}var Cv=[bv()];function wv(e){let t=Tv(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Cv]}function Tv(e){let t=[],n=[],r=[];for(let i of e)switch(i.enforce){case`pre`:t.push(i);break;case`post`:n.push(i);break;default:r.push(i)}return{pre:t,post:n,normal:r}}var Ev=[`black`,`red`,`green`,`yellow`,`blue`,`magenta`,`cyan`,`white`,`brightBlack`,`brightRed`,`brightGreen`,`brightYellow`,`brightBlue`,`brightMagenta`,`brightCyan`,`brightWhite`],Dv={1:`bold`,2:`dim`,3:`italic`,4:`underline`,7:`reverse`,8:`hidden`,9:`strikethrough`};function Ov(e,t){let n=e.indexOf(`\x1B`,t);if(n!==-1&&e[n+1]===`[`){let t=e.indexOf(`m`,n);if(t!==-1)return{sequence:e.substring(n+2,t).split(`;`),startPosition:n,position:t+1}}return{position:e.length}}function kv(e){let t=e.shift();if(t===`2`){let t=e.splice(0,3).map(e=>Number.parseInt(e));return t.length!==3||t.some(e=>Number.isNaN(e))?void 0:{type:`rgb`,rgb:t}}if(t===`5`){let t=e.shift();if(t)return{type:`table`,index:Number(t)}}}function Av(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r)){if(r===0)t.push({type:`resetAll`});else if(r<=9)Dv[r]&&t.push({type:`setDecoration`,value:Dv[r]});else if(r<=29){let e=Dv[r-20];e&&(t.push({type:`resetDecoration`,value:e}),e===`dim`&&t.push({type:`resetDecoration`,value:`bold`}))}else if(r<=37)t.push({type:`setForegroundColor`,value:{type:`named`,name:Ev[r-30]}});else if(r===38){let n=kv(e);n&&t.push({type:`setForegroundColor`,value:n})}else if(r===39)t.push({type:`resetForegroundColor`});else if(r<=47)t.push({type:`setBackgroundColor`,value:{type:`named`,name:Ev[r-40]}});else if(r===48){let n=kv(e);n&&t.push({type:`setBackgroundColor`,value:n})}else r===49?t.push({type:`resetBackgroundColor`}):r===53?t.push({type:`setDecoration`,value:`overline`}):r===55?t.push({type:`resetDecoration`,value:`overline`}):r>=90&&r<=97?t.push({type:`setForegroundColor`,value:{type:`named`,name:Ev[r-90+8]}}):r>=100&&r<=107&&t.push({type:`setBackgroundColor`,value:{type:`named`,name:Ev[r-100+8]}})}}return t}function jv(){let e=null,t=null,n=new Set;return{parse(r){let i=[],a=0;do{let o=Ov(r,a),s=o.sequence?r.substring(a,o.startPosition):r.substring(a);if(s.length>0&&i.push({value:s,foreground:e,background:t,decorations:new Set(n)}),o.sequence){let r=Av(o.sequence);for(let i of r)i.type===`resetAll`?(e=null,t=null,n.clear()):i.type===`resetForegroundColor`?e=null:i.type===`resetBackgroundColor`?t=null:i.type===`resetDecoration`&&n.delete(i.value);for(let i of r)i.type===`setForegroundColor`?e=i.value:i.type===`setBackgroundColor`?t=i.value:i.type===`setDecoration`&&n.add(i.value)}a=o.position}while(a<r.length);return i}}}var Mv={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 Nv(e=Mv){function t(t){return e[t]}function n(e){return`#${e.map(e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,`0`)).join(``)}`}let r;function i(){if(r)return r;r=[];for(let e=0;e<Ev.length;e++)r.push(t(Ev[e]));let e=[0,95,135,175,215,255];for(let t=0;t<6;t++)for(let i=0;i<6;i++)for(let a=0;a<6;a++)r.push(n([e[t],e[i],e[a]]));let i=8;for(let e=0;e<24;e++,i+=10)r.push(n([i,i,i]));return r}function a(e){return i()[e]}function o(e){switch(e.type){case`named`:return t(e.name);case`rgb`:return n(e.rgb);case`table`:return a(e.index)}}return{value:o}}var Pv=/#([0-9a-f]{3,8})/i,Fv=/var\((--[\w-]+-ansi-[\w-]+)\)/,Iv={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 Lv(e,t,n){let r=vh(e,n),i=Dh(t),a=Nv(Object.fromEntries(Ev.map(t=>{let n=`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;return[t,e.colors?.[n]||Iv[t]]}))),o=jv();return i.map(t=>o.parse(t[0]).map(n=>{let i,o;n.decorations.has(`reverse`)?(i=n.background?a.value(n.background):e.bg,o=n.foreground?a.value(n.foreground):e.fg):(i=n.foreground?a.value(n.foreground):e.fg,o=n.background?a.value(n.background):void 0),i=yh(i,r),o=yh(o,r),n.decorations.has(`dim`)&&(i=Rv(i));let s=rm.None;return n.decorations.has(`bold`)&&(s|=rm.Bold),n.decorations.has(`italic`)&&(s|=rm.Italic),n.decorations.has(`underline`)&&(s|=rm.Underline),n.decorations.has(`strikethrough`)&&(s|=rm.Strikethrough),{content:n.value,offset:t[1],color:i,bgColor:o,fontStyle:s}}))}function Rv(e){let t=e.match(Pv);if(t){let e=t[1];if(e.length===8){let t=Math.round(Number.parseInt(e.slice(6,8),16)/2).toString(16).padStart(2,`0`);return`#${e.slice(0,6)}${t}`}if(e.length===6)return`#${e}80`;if(e.length===4){let t=e[0],n=e[1],r=e[2],i=e[3];return`#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,`0`)}`}if(e.length===3){let t=e[0],n=e[1],r=e[2];return`#${t}${t}${n}${n}${r}${r}80`}}let n=e.match(Fv);return n?`var(${n[1]}-dim)`:e}function zv(e,t,n={}){let r=e.resolveLangAlias(n.lang||`text`),{theme:i=e.getLoadedThemes()[0]}=n;if(!Sh(r)&&!wh(i)&&r===`ansi`){let{theme:r}=e.setTheme(i);return Lv(r,t,n)}return Jh(e,t,n)}function Bv(e,t,n){let r,i,a,o,s,c;if(`themes`in n){let{defaultColor:l=`light`,cssVariablePrefix:u=`--shiki-`,colorsRendering:d=`css-vars`}=n,f=Object.entries(n.themes).filter(e=>e[1]).map(e=>({color:e[0],theme:e[1]})).sort((e,t)=>e.color===l?-1:+(t.color===l));if(f.length===0)throw new Ip("`themes` option must not be empty");let p=rg(e,t,n,zv);if(c=Hh(p),l&&l!==`light-dark()`&&!f.some(e=>e.color===l))throw new Ip(`\`themes\` option must contain the defaultColor key \`${l}\``);let m=f.map(t=>e.getTheme(t.theme)),h=f.map(e=>e.color);a=p.map(e=>e.map(e=>_v(e,h,u,l,d))),c&&Vh(a,c);let g=f.map(e=>vh(e.theme,n));i=Vv(f,m,g,u,l,`fg`,d),r=Vv(f,m,g,u,l,`bg`,d),o=`shiki-themes ${m.map(e=>e.name).join(` `)}`,s=l?void 0:[i,r].join(`;`)}else if(`theme`in n){let s=vh(n.theme,n);a=zv(e,t,n);let l=e.getTheme(n.theme);r=yh(l.bg,s),i=yh(l.fg,s),o=l.name,c=Hh(a)}else throw new Ip("Invalid options, either `theme` or `themes` must be provided");return{tokens:a,fg:i,bg:r,themeName:o,rootStyle:s,grammarState:c}}function Vv(e,t,n,r,i,a,o){return e.map((s,c)=>{let l=yh(t[c][a],n[c])||`inherit`,u=`${r+s.color}${a===`bg`?`-bg`:``}:${l}`;if(c===0&&i){if(i===`light-dark()`&&e.length>1){let r=e.findIndex(e=>e.color===`light`),i=e.findIndex(e=>e.color===`dark`);if(r===-1||i===-1)throw new Ip('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${yh(t[r][a],n[r])||`inherit`}, ${yh(t[i][a],n[i])||`inherit`});${u}`}return l}return o===`css-vars`?u:null}).filter(e=>!!e).join(`;`)}var Hv=/^\s+$/,Uv=/^(\s*)(.*?)(\s*)$/;function Wv(e,t,n,r={meta:{},options:n,codeToHast:(t,n)=>Wv(e,t,n),codeToTokens:(t,n)=>Bv(e,t,n)}){let i=t;for(let e of wv(n))i=e.preprocess?.call(r,i,n)||i;let{tokens:a,fg:o,bg:s,themeName:c,rootStyle:l,grammarState:u}=Bv(e,i,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?a=Kv(a):d===`never`&&(a=qv(a)),f&&(a=Jv(a));let p={...r,get source(){return i}};for(let e of wv(n))a=e.tokens?.call(p,a)||a;return Gv(a,{...n,fg:o,bg:s,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},p,u)}function Gv(e,t,n,r=Hh(e)){let i=wv(t),a=[],o={type:`root`,children:[]},{structure:s=`classic`,tabindex:c=`0`}=t,l={class:`shiki ${t.themeName||``}`};t.rootStyle!==!1&&(l.style=t.rootStyle==null?`background-color:${t.bg};color:${t.fg}`:t.rootStyle),c!==!1&&c!=null&&(l.tabindex=c.toString());for(let[e,n]of Object.entries(t.meta||{}))e.startsWith(`_`)||(l[e]=n);let u={type:`element`,tagName:`pre`,properties:l,children:[],data:t.data},d={type:`element`,tagName:`code`,properties:{},children:a},f=[],p={...n,structure:s,addClassToHast:dv,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return o},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((e,t)=>{t&&(s===`inline`?o.children.push({type:`element`,tagName:`br`,properties:{},children:[]}):s===`classic`&&a.push({type:`text`,value:`
91
- `}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=yv(a.htmlStyle||vv(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&Vh(m,r),m}function Kv(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&rm.Underline||i.fontStyle&rm.Strikethrough));o&&Hv.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function qv(e){return e.map(e=>e.flatMap(e=>{if(Hv.test(e.content))return e;let t=e.content.match(Uv);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function Jv(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=yv(e.htmlStyle||vv(e)),i=yv(n.htmlStyle||vv(n)),a=e.fontStyle&&(e.fontStyle&rm.Underline||e.fontStyle&rm.Strikethrough),o=n.fontStyle&&(n.fontStyle&rm.Underline||n.fontStyle&rm.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var Yv=sv;function Xv(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>Wv(e,t,n),codeToTokens:(t,n)=>Bv(e,t,n)},i=Yv(Wv(e,t,n,r));for(let e of wv(n))i=e.postprocess?.call(r,i,n)||i;return i}async function Zv(e){let t=await zh(e);return{getLastGrammarState:(...e)=>Yh(t,...e),codeToTokensBase:(e,n)=>zv(t,e,n),codeToTokensWithThemes:(e,n)=>rg(t,e,n),codeToTokens:(e,n)=>Bv(t,e,n),codeToHast:(e,n)=>Wv(t,e,n),codeToHtml:(e,n)=>Xv(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Qv(e){let t=e.langs,n=e.themes,r=e.engine;async function i(e){function i(n){if(typeof n==`string`){if(n=e.langAlias?.[n]||n,Ch(n))return[];let r=t[n];if(!r)throw new Ip(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);return r}return n}function a(e){if(Th(e))return`none`;if(typeof e==`string`){let t=n[e];if(!t)throw new Ip(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);return t}return e}let o=(e.themes??[]).map(e=>a(e)),s=(e.langs??[]).map(e=>i(e)),c=await Zv({engine:e.engine??r(),...e,themes:o,langs:s});return{...c,loadLanguage(...e){return c.loadLanguage(...e.map(i))},loadTheme(...e){return c.loadTheme(...e.map(a))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return i}var $v=4294967295,ey=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}})}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=[];function a(e,t,n=0){return{index:e,captureIndices:t.indices.map(e=>e==null?{start:$v,end:$v,length:0}:{start:e[0]+n,end:e[1]+n,length:e[1]-e[0]})}}for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{n.lastIndex=t;let o=n.exec(r);if(!o)continue;if(o.index===t)return a(e,o,0);i.push([e,o,0])}catch(e){if(this.options.forgiving)continue;throw e}}if(i.length){let e=Math.min(...i.map(e=>e[1].index));for(let[t,n,r]of i)if(n.index===e)return a(t,n,r)}return null}};function ty(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function ny(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var ry=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),iy=String.raw;function ay(e,t){if(e==null)throw Error(t??`Value expected`);return e}var oy=iy`\[\^?`,sy=`c.? | C(?:-.?)?|${iy`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${iy`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${iy`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${iy`o\{[^\}]*\}?`}|${iy`\d{1,3}`}`,cy=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,ly=new RegExp(iy`
92
- \\ (?:
93
- ${sy}
94
- | [gk]<[^>]*>?
95
- | [gk]'[^']*'?
96
- | .
97
- )
98
- | \( (?:
99
- \? (?:
100
- [:=!>({]
101
- | <[=!]
102
- | <[^>]*>
103
- | '[^']*'
104
- | ~\|?
105
- | #(?:[^)\\]|\\.?)*
106
- | [^:)]*[:)]
107
- )?
108
- | \*[^\)]*\)?
109
- )?
110
- | (?:${cy.source})+
111
- | ${oy}
112
- | .
113
- `.replace(/\s+/g,``),`gsu`),uy=new RegExp(iy`
114
- \\ (?:
115
- ${sy}
116
- | .
117
- )
118
- | \[:(?:\^?\p{Alpha}+|\^):\]
119
- | ${oy}
120
- | &&
121
- | .
122
- `.replace(/\s+/g,``),`gsu`);function dy(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=Vy(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(ly.lastIndex=0;s=ly.exec(e);){let t=fy(a,e,s[0],ly.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(ly.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?Uy(e,u):e).flat(),flags:r}}function fy(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=py(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:_y(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:jy(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:vy(n)}}if(a===`K`)return{token:Ty(`keep`,n)};if(a===`N`||a===`R`)return{token:wy(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:wy(`any`,n)};if(a===`X`)return{token:wy(`text_segment`,n)};let e=hy(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:Iy(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Fy(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Oy(`group`,n)};if(n===`(?>`)return{token:Oy(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Oy(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Oy(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Oy(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:Dy(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
123
- `,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:wy(`dot`,n)}:n===`^`||n===`$`?{token:_y(e.singleline?{"^":iy`\A`,$:iy`\Z`}[n]:n,n)}:n===`|`?{token:gy(n)}:cy.test(n)?{tokens:Wy(n)}:{token:yy(ty(n),n)}}function py(e,t,n){let r=[Cy(t[1]===`^`,t)],i=1,a;for(uy.lastIndex=n;a=uy.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Cy(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(yy(93,e));else if(i--,r.push(by(e)),!i)break}else{let t=my(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:uy.lastIndex||e.length}}function my(e){if(e[0]===`\\`)return hy(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!ry.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return wy(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?xy(e):e===`&&`?Sy(e):yy(ty(e),e)}function hy(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return Py(e);if(`dDhHsSwW`.includes(n))return Ry(e);if(e.startsWith(iy`\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 zy(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return yy(ty(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return yy(Hy(e),e);if(Ny.has(n))return yy(Ny.get(n),e);if(/\d/.test(n))return Ey(t,e);if(e===`\\`)throw Error(iy`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return yy(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function gy(e){return{type:`Alternator`,raw:e}}function _y(e,t){return{type:`Assertion`,kind:e,raw:t}}function vy(e){return{type:`Backreference`,raw:e}}function yy(e,t){return{type:`Character`,value:e,raw:t}}function by(e){return{type:`CharacterClassClose`,raw:e}}function xy(e){return{type:`CharacterClassHyphen`,raw:e}}function Sy(e){return{type:`CharacterClassIntersector`,raw:e}}function Cy(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function wy(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Ty(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:ay(n.flags),raw:t}}function Ey(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Dy(e){return{type:`GroupClose`,raw:e}}function Oy(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function ky(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Ay(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function jy(e){return{type:`Subroutine`,raw:e}}var My=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),Ny=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function Py(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return yy(ty(t.toUpperCase())-64,e)}function Fy(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=By(n),o=By(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Ty(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Oy(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function Iy(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=My.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(a.length===1&&(typeof o==`number`||!/^[<>X]$/.test(o)))throw Error(`Named callout optional argument must be '<', '>', or 'X' "${o}"`);break;case`cmp`:if(a.length!==3)throw Error(`Named callout must have three arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(typeof s==`number`||!/^(?:[<>!=]=|[<>])$/.test(s))throw Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${s}"`);if(typeof c==`string`&&!/^[A-Za-z_]\w*$/.test(c))throw Error(`Named callout argument three must be a tag or number "${c}"`);break;case`custom`:throw Error(`Undefined callout name "${n}"`);default:throw Error(`Unexpected named callout kind "${l}"`)}return ky(l,r??null,i?.split(`,`)??null,e)}function Ly(e){let t=null,n,r;if(e[0]===`{`){let{minStr:i,maxStr:a}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,o=1e5;if(+i>o||a&&+a>o)throw Error(`Quantifier value unsupported in Oniguruma`);if(n=+i,r=a===void 0?+i:a===``?1/0:+a,n>r&&(t=`possessive`,[n,r]=[r,n]),e.endsWith(`?`)){if(t===`possessive`)throw Error(`Unsupported possessive interval quantifier chain with "?"`);t=`lazy`}else t||=`greedy`}else n=+(e[0]===`+`),r=e[0]===`?`?1:1/0,t=e[1]===`+`?`possessive`:e[1]===`?`?`lazy`:`greedy`;return Ay(t,n,r,e)}function Ry(e){let t=e[1].toLowerCase();return wy({d:`digit`,h:`hex`,s:`space`,w:`word`}[t],e,{negate:e[1]!==t})}function zy(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return wy(`property`,e,{value:r,negate:t===`P`&&!n||t===`p`&&!!n})}function By(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 Vy(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!`imxDPSWy`.includes(r))throw Error(`Invalid flag "${r}"`);if(r===`y`){if(!/^y{[gw]}/.test(e.slice(n)))throw Error(`Invalid or unspecified flag "y" mode`);t.textSegmentMode=e[n+2]===`g`?`grapheme`:`word`,n+=3;continue}t[{i:`ignoreCase`,m:`dotAll`,x:`extended`,D:`digitIsAscii`,P:`posixIsAscii`,S:`spaceIsAscii`,W:`wordIsAscii`}[r]]=!0}return t}function Hy(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 Uy(e,t){let{raw:n,inCharClass:r}=e,i=n.slice(1);if(!r&&(i!==`0`&&i.length===1||i[0]!==`0`&&+i<=t))return[vy(n)];let a=[],o=i.match(/^[0-7]+|\d/g);for(let e=0;e<o.length;e++){let t=o[e],r;if(e===0&&t!==`8`&&t!==`9`){if(r=parseInt(t,8),r>127)throw Error(iy`Octal encoded byte above 177 unsupported "${n}"`)}else r=ty(t);a.push(yy(r,(e===0?`\\`:``)+t))}return a}function Wy(e){let t=[],n=new RegExp(cy,`gy`),r;for(;r=n.exec(e);){let e=r[0];if(e[0]===`{`){let r=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(e);if(r){let{min:i,max:a}=r.groups;if(+i>+a&&e.endsWith(`?`)){n.lastIndex--,t.push(Ly(e.slice(0,-1)));continue}}}t.push(Ly(e))}return t}function Gy(e,t){if(!Array.isArray(e.body))throw Error(`Expected node with body array`);if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(e=>t[e]===n[e])}function Ky(e){return qy.has(e.type)}var qy=new Set([`AbsenceFunction`,`Backreference`,`CapturingGroup`,`Character`,`CharacterClass`,`CharacterSet`,`Group`,`Quantifier`,`Subroutine`]);function Jy(e,t={}){let n={flags:``,normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=dy(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),i=(e,t)=>{let n=r.tokens[a.nextIndex];switch(a.parent=e,a.nextIndex++,n.type){case`Alternator`:return ib();case`Assertion`:return Yy(n);case`Backreference`:return Xy(n,a);case`Character`:return cb(n.value,{useLastValid:!!t.isCheckingRangeEnd});case`CharacterClassHyphen`:return Zy(n,a,t);case`CharacterClassOpen`:return Qy(n,a,t);case`CharacterSet`:return $y(n,a);case`Directive`:return fb(n.kind,{flags:n.flags});case`GroupOpen`:return eb(n,a,t);case`NamedCallout`:return gb(n.kind,n.tag,n.arguments);case`Quantifier`:return tb(n,a);case`Subroutine`:return nb(n,a);default:throw Error(`Unexpected token type "${n.type}"`)}},a={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:i},o=yb(pb(r.flags)),s=o.body[0];for(;a.nextIndex<r.tokens.length;){let e=i(s,{});e.type===`Alternative`?(o.body.push(e),s=e):s.body.push(e)}let{capturingGroups:c,hasNumberedRef:l,namedGroupsByName:u,subroutines:d}=a;if(l&&u.size&&!n.rules.captureGroup)throw Error(`Numbered backref/subroutine not allowed when using named capture`);for(let{ref:e}of d)if(typeof e==`number`){if(e>c.length)throw Error(`Subroutine uses a group number that's not defined`);e&&(c[e-1].isSubroutined=!0)}else if(u.has(e)){if(u.get(e).length>1)throw Error(iy`Subroutine uses a duplicate group name "\g<${e}>"`);u.get(e)[0].isSubroutined=!0}else throw Error(iy`Subroutine uses a group name that's not defined "\g<${e}>"`);return o}function Yy({kind:e}){return ab(ay({"^":`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===iy`\B`||e===iy`\Y`})}function Xy({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),i=(n,r=!1)=>{let i=t.capturingGroups.length,a=!1;if(n>i){if(t.skipBackrefValidation)a=!0;else throw Error(`Not enough capturing groups defined to the left "${e}"`)}return t.hasNumberedRef=!0,ob(r?i+1-n:n,{orphan:a})};if(n){let n=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(n)return i(+n.groups.num,!!n.groups.sign);if(/[-+]/.test(r))throw Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw Error(`Group name not defined to the left "${e}"`);return ob(r)}return i(+r)}function Zy(e,t,n){let{tokens:r,walk:i}=t,a=t.parent,o=a.body.at(-1),s=r[t.nextIndex];if(!n.isCheckingRangeEnd&&o&&o.type!==`CharacterClass`&&o.type!==`CharacterClassRange`&&s&&s.type!==`CharacterClassOpen`&&s.type!==`CharacterClassClose`&&s.type!==`CharacterClassIntersector`){let e=i(a,{...n,isCheckingRangeEnd:!0});if(o.type===`Character`&&e.type===`Character`)return a.body.pop(),ub(o,e);throw Error(`Invalid character class range`)}return cb(ty(`-`))}function Qy({negate:e},t,n){let{tokens:r,walk:i}=t,a=[lb()],o=r[t.nextIndex],s=Ab(o);for(;s.type!==`CharacterClassClose`;){if(s.type===`CharacterClassIntersector`)a.push(lb()),t.nextIndex++;else{let e=a.at(-1);e.body.push(i(e,n))}s=Ab(r[t.nextIndex],o)}let c=lb({negate:e});return a.length===1?c.body=a[0].body:(c.kind=`intersection`,c.body=a.map(e=>e.body.length===1?e.body[0]:e)),t.nextIndex++,c}function $y({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o}=r;if(e===`property`){let r=kb(n);if(ry.has(r)&&!o?.has(r))e=`posix`,n=r;else return xb(n,{negate:t,normalizeUnknownPropertyNames:i,skipPropertyNameValidation:a,unicodePropertyMap:o})}return e===`posix`?_b(n,{negate:t}):db(e,{negate:t})}function eb(e,t,n){let{tokens:r,capturingGroups:i,namedGroupsByName:a,skipLookbehindValidation:o,walk:s}=t,c=Sb(e),l=c.type===`AbsenceFunction`,u=Eb(c),d=u&&c.negate;if(c.type===`CapturingGroup`&&(i.push(c),c.name&&ny(a,c.name,[]).push(c)),l&&n.isInAbsenceFunction)throw Error(`Nested absence function not supported by Oniguruma`);let f=jb(r[t.nextIndex]);for(;f.type!==`GroupClose`;){if(f.type===`Alternator`)c.body.push(ib()),t.nextIndex++;else{let e=c.body.at(-1),t=s(e,{...n,isInAbsenceFunction:n.isInAbsenceFunction||l,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(e.body.push(t),(u||n.isInLookbehind)&&!o){let e=`Lookbehind includes a pattern not allowed by Oniguruma`;if(d||n.isInNegLookbehind){if(Tb(t)||t.type===`CapturingGroup`)throw Error(e)}else if(Tb(t)||Eb(t)&&t.negate)throw Error(e)}}f=jb(r[t.nextIndex])}return t.nextIndex++,c}function tb({kind:e,min:t,max:n},r){let i=r.parent,a=i.body.at(-1);if(!a||!Ky(a))throw Error(`Quantifier requires a repeatable token`);let o=vb(e,t,n,a);return i.body.pop(),o}function nb({raw:e},t){let{capturingGroups:n,subroutines:r}=t,i=e.slice(3,-1),a=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(i);if(a){let e=+a.groups.num,r=n.length;if(t.hasNumberedRef=!0,i={"":e,"+":r+e,"-":r+1-e}[a.groups.sign],i<1)throw Error(`Invalid subroutine number`)}else i===`0`&&(i=0);let o=bb(i);return r.push(o),o}function rb(e,t){if(e!==`repeater`)throw Error(`Unexpected absence function kind "${e}"`);return{type:`AbsenceFunction`,kind:e,body:Cb(t?.body)}}function ib(e){return{type:`Alternative`,body:wb(e?.body)}}function ab(e,t){let n={type:`Assertion`,kind:e};return(e===`word_boundary`||e===`text_segment_boundary`)&&(n.negate=!!t?.negate),n}function ob(e,t){let n=!!t?.orphan;return{type:`Backreference`,ref:e,...n&&{orphan:n}}}function sb(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!Db(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:Cb(t?.body)}}function cb(e,t){let n={useLastValid:!1,...t};if(e>1114111){let t=e.toString(16);if(n.useLastValid)e=1114111;else throw Error(e>1310719?`Invalid code point out of range "\\x{${t}}"`:`Invalid code point out of range in JS "\\x{${t}}"`)}return{type:`Character`,value:e}}function lb(e){let t={kind:`union`,negate:!1,...e};return{type:`CharacterClass`,kind:t.kind,negate:t.negate,body:wb(e?.body)}}function ub(e,t){if(t.value<e.value)throw Error(`Character class range out of order`);return{type:`CharacterClassRange`,min:e,max:t}}function db(e,t){let n=!!t?.negate,r={type:`CharacterSet`,kind:e};return(e===`digit`||e===`hex`||e===`newline`||e===`space`||e===`word`)&&(r.negate=n),(e===`text_segment`||e===`newline`&&!n)&&(r.variableLength=!0),r}function fb(e,t={}){if(e===`keep`)return{type:`Directive`,kind:e};if(e===`flags`)return{type:`Directive`,kind:e,flags:ay(t.flags)};throw Error(`Unexpected directive kind "${e}"`)}function pb(e){return{type:`Flags`,...e}}function mb(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:Cb(e?.body)}}function hb(e){let t={behind:!1,negate:!1,...e};return{type:`LookaroundAssertion`,kind:t.behind?`lookbehind`:`lookahead`,negate:t.negate,body:Cb(e?.body)}}function gb(e,t,n){return{type:`NamedCallout`,kind:e,tag:t,arguments:n}}function _b(e,t){let n=!!t?.negate;if(!ry.has(e))throw Error(`Invalid POSIX class "${e}"`);return{type:`CharacterSet`,kind:`posix`,value:e,negate:n}}function vb(e,t,n,r){if(t>n)throw Error(`Invalid reversed quantifier range`);return{type:`Quantifier`,kind:e,min:t,max:n,body:r}}function yb(e,t){return{type:`Regex`,body:Cb(t?.body),flags:e}}function bb(e){return{type:`Subroutine`,ref:e}}function xb(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(kb(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Ob(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw Error(iy`Invalid Unicode property "\p{${e}}"`)}return{type:`CharacterSet`,kind:`property`,value:r??e,negate:n.negate}}function Sb({flags:e,kind:t,name:n,negate:r,number:i}){switch(t){case`absence_repeater`:return rb(`repeater`);case`atomic`:return mb({atomic:!0});case`capturing`:return sb(i,{name:n});case`group`:return mb({flags:e});case`lookahead`:case`lookbehind`:return hb({behind:t===`lookbehind`,negate:r});default:throw Error(`Unexpected group kind "${t}"`)}}function Cb(e){if(e===void 0)e=[ib()];else if(!Array.isArray(e)||!e.length||!e.every(e=>e.type===`Alternative`))throw Error(`Invalid body; expected array of one or more Alternative nodes`);return e}function wb(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(e=>!!e.type))throw Error(`Invalid body; expected array of nodes`);return e}function Tb(e){return e.type===`LookaroundAssertion`&&e.kind===`lookahead`}function Eb(e){return e.type===`LookaroundAssertion`&&e.kind===`lookbehind`}function Db(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Ob(e){return e.trim().replace(/[- _]+/g,`_`).replace(/[A-Z][a-z]+(?=[A-Z])/g,`$&_`).replace(/[A-Za-z]+/g,e=>e[0].toUpperCase()+e.slice(1).toLowerCase())}function kb(e){return e.replace(/[- _]+/g,``).toLowerCase()}function Ab(e,t){let n=t;return ay(e,`Unclosed character class${n?.type===`Character`&&n.value===93&&n.raw===`]`?` (started with "]")`:``}`)}function jb(e){return ay(e,`Unclosed group`)}function Mb(e,t,n=null){function r(e,t){for(let n=0;n<e.length;n++){let r=i(e[n],t,n,e);n=Math.max(-1,n+r)}}function i(a,o=null,s=null,c=null){let l=0,u=!1,d={node:a,parent:o,key:s,container:c,root:e,remove(){Nb(c).splice(Math.max(0,Pb(s)+l),1),l--,u=!0},removeAllNextSiblings(){return Nb(c).splice(Pb(s)+1)},removeAllPrevSiblings(){let e=Pb(s)+l;return l-=e,Nb(c).splice(0,Math.max(0,e))},replaceWith(e,t={}){let n=!!t.traverse;c?c[Math.max(0,Pb(s)+l)]=e:ay(o,`Can't replace root node`)[s]=e,n&&i(e,o,s,c),u=!0},replaceWithMultiple(e,t={}){let n=!!t.traverse;if(Nb(c).splice(Math.max(0,Pb(s)+l),1,...e),l+=e.length-1,n){let t=0;for(let n=0;n<e.length;n++)t+=i(e[n],o,Pb(s)+n+t,c)}u=!0},skip(){u=!0}},{type:f}=a,p=t[`*`],m=t[f],h=typeof p==`function`?p:p?.enter,g=typeof m==`function`?m:m?.enter;if(h?.(d,n),g?.(d,n),!u)switch(f){case`AbsenceFunction`:case`Alternative`:case`CapturingGroup`:case`CharacterClass`:case`Group`:case`LookaroundAssertion`:r(a.body,a);break;case`Assertion`:case`Backreference`:case`Character`:case`CharacterSet`:case`Directive`:case`Flags`:case`NamedCallout`:case`Subroutine`:break;case`CharacterClassRange`:i(a.min,a,`min`),i(a.max,a,`max`);break;case`Quantifier`:i(a.body,a,`body`);break;case`Regex`:r(a.body,a),i(a.flags,a,`flags`);break;default:throw Error(`Unexpected node type "${f}"`)}return m?.exit?.(d,n),p?.exit?.(d,n),l}return i(e),e}function Nb(e){if(!Array.isArray(e))throw Error(`Container expected`);return e}function Pb(e){if(typeof e!=`number`)throw Error(`Numeric key expected`);return e}var Fb=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function Ib(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Lb(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var Rb=Object.freeze({DEFAULT:`DEFAULT`,CHAR_CLASS:`CHAR_CLASS`});function zb(e,t,n,r){let i=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,`gsu`),a=[!1],o=0,s=``;for(let t of e.matchAll(i)){let{0:e,groups:{$skip:i}}=t;if(!i&&(!r||r===Rb.DEFAULT==!o)){n instanceof Function?s+=n(t,{context:o?Rb.CHAR_CLASS:Rb.DEFAULT,negated:a[a.length-1]}):s+=n;continue}e[0]===`[`?(o++,a.push(e[1]===`^`)):e===`]`&&o&&(o--,a.pop()),s+=e}return s}function Bb(e,t,n,r){zb(e,t,n,r)}function Vb(e,t,n=0,r){if(!new RegExp(t,`su`).test(e))return null;let i=RegExp(`${t}|(?<$skip>\\\\?.)`,`gsu`);i.lastIndex=n;let a=0,o;for(;o=i.exec(e);){let{0:e,groups:{$skip:t}}=o;if(!t&&(!r||r===Rb.DEFAULT==!a))return o;e===`[`?a++:e===`]`&&a&&a--,i.lastIndex==o.index&&i.lastIndex++}return null}function Hb(e,t,n){return!!Vb(e,t,0,n)}function Ub(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,i=0,a=1,o;for(;o=n.exec(e);){let[e]=o;if(e===`[`)i++;else if(i)e===`]`&&i--;else if(e===`(`)a++;else if(e===`)`&&(a--,!a)){r=o.index;break}}return e.slice(t,r)}var Wb=new RegExp(String.raw`(?<noncapturingStart>${Fb})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,`gsu`);function Gb(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let i=[0],a=[],o=0,s=0,c=NaN,l;do{l=!1;let t=0,u=0,d=!1,f;for(Wb.lastIndex=Number.isNaN(c)?0:c+7;f=Wb.exec(e);){let{0:p,index:m,groups:{capturingStart:h,noncapturingStart:g}}=f;if(p===`[`)t++;else if(t)p===`]`&&t--;else if(p===`(?>`&&!d)c=m,d=!0;else if(d&&g)u++;else if(h)d?u++:(o++,i.push(o+s));else if(p===`)`&&d){if(!u){s++;let t=o+s;if(e=`${e.slice(0,c)}(?:(?=(${e.slice(c+3,m)}))<$$${t}>)${e.slice(m+1)}`,l=!0,a.push(t),Ib(n,t),r.size){let e=new Map;r.forEach((n,r)=>{e.set(r>=t?r+1:r,n.map(e=>e>=t?e+1:e))}),r=e}break}u--}}}while(l);return n.push(...a),e=zb(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:e,groups:{backrefNum:t,wrappedBackrefNum:n}})=>{if(t){let n=+t;if(n>i.length-1)throw Error(`Backref "${e}" greater than number of captures`);return`\\${i[n]}`}return`\\${n}`},Rb.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Kb=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,qb=new RegExp(String.raw`
124
- \\(?: \d+
125
- | c[A-Za-z]
126
- | [gk]<[^>]+>
127
- | [pPu]\{[^\}]+\}
128
- | u[A-Fa-f\d]{4}
129
- | x[A-Fa-f\d]{2}
130
- )
131
- | \((?: \? (?: [:=!>]
132
- | <(?:[=!]|[^>]+>)
133
- | [A-Za-z\-]+:
134
- | \(DEFINE\)
135
- ))?
136
- | (?<qBase>${Kb})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
137
- | \\?.
138
- `.replace(/\s+/g,``),`gsu`);function Jb(e){if(!RegExp(`${Kb}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(qb.lastIndex=0;o=qb.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=Lb(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}qb.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var Yb=String.raw,Xb=Yb`\(\?R=(?<rDepth>[^\)]+)\)|${Yb`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,Zb=Yb`\(\?<(?![=!])(?<captureName>[^>]+)>`,Qb=Yb`${Zb}|(?<unnamed>\()(?!\?)`,$b=new RegExp(Yb`${Zb}|${Xb}|\(\?|\\?.`,`gsu`),ex=`Cannot use multiple overlapping recursions`;function tx(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(Xb,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&Hb(e,Yb`\(\?\(DEFINE\)`,Rb.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=Hb(e,Yb`\\[1-9]`,Rb.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for($b.lastIndex=0;f=$b.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(nx(m),l)throw Error(ex);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice($b.lastIndex);if(Hb(s,Xb,Rb.DEFAULT))throw Error(ex);let c=m-1;e=rx(t,s,c,!1,n,a,d),i=ox(i,t,c,a.length,0,d);break}if(h){nx(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(ex);break}if(!u)throw Error(Yb`Recursive \g cannot be used outside the referenced group "${r===`external`?h:Yb`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=Ub(e,p);if(o&&Hb(m,Yb`${Zb}|\((?!\?)`,Rb.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=rx(_,v,b,!0,n,a,d);i=ox(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,$b.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),$b.lastIndex),s.set(p,$b.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),$b.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function nx(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function rx(e,t,n,r,i,a,o){let s=new Set;r&&Bb(e+t,Zb,({groups:{captureName:e}})=>{s.add(e)},Rb.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${ix(`(?:${e}`,`forward`,...c)}(?:)${ix(`${t})`,`backward`,...c)}${t}`}function ix(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=zb(e,Yb`${Qb}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),ax(i,n),s?e:`(?<${t}${l}>`}return Yb`\k<${c}${l}>`},Rb.DEFAULT)}return c}function ax(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function ox(e,t,n,r,i,a){if(e.size&&r){let o=0;Bb(t,Qb,()=>o++,Rb.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var sx=String.fromCodePoint,Q=String.raw,cx={},lx=globalThis.RegExp;cx.flagGroups=(()=>{try{new lx(`(?i:)`)}catch{return!1}return!0})(),cx.unicodeSets=(()=>{try{new lx(`[[]]`,`v`)}catch{return!1}return!0})(),cx.bugFlagVLiteralHyphenIsRange=cx.unicodeSets?(()=>{try{new lx(Q`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,cx.bugNestedClassIgnoresNegation=cx.unicodeSets&&new lx(`[[^a]]`,`v`).test(`a`);function ux(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function dx(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function fx(e,t){return mx[e]>=mx[t]}function px(e,t){if(e==null)throw Error(t??`Value expected`);return e}var mx={ES2025:2025,ES2024:2024,ES2018:2018},hx={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function gx(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!hx[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`auto`,verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target===`auto`&&(t.target=cx.flagGroups?`ES2025`:cx.unicodeSets?`ES2024`:`ES2018`),t}var _x=`[ -\r ]`,vx=new Set([sx(304),sx(305)]),yx=Q`[\p{L}\p{M}\p{N}\p{Pc}]`;function bx(e){if(vx.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),i=wx.get(n),a=Sx.get(n),o=Cx.get(n);return[...r].length===1&&t.add(r),o&&t.add(o),i&&t.add(i),t.add(n),a&&t.add(a),[...t]}var xx=new Map(`C Other
139
- Cc Control cntrl
140
- Cf Format
141
- Cn Unassigned
142
- Co Private_Use
143
- Cs Surrogate
144
- L Letter
145
- LC Cased_Letter
146
- Ll Lowercase_Letter
147
- Lm Modifier_Letter
148
- Lo Other_Letter
149
- Lt Titlecase_Letter
150
- Lu Uppercase_Letter
151
- M Mark Combining_Mark
152
- Mc Spacing_Mark
153
- Me Enclosing_Mark
154
- Mn Nonspacing_Mark
155
- N Number
156
- Nd Decimal_Number digit
157
- Nl Letter_Number
158
- No Other_Number
159
- P Punctuation punct
160
- Pc Connector_Punctuation
161
- Pd Dash_Punctuation
162
- Pe Close_Punctuation
163
- Pf Final_Punctuation
164
- Pi Initial_Punctuation
165
- Po Other_Punctuation
166
- Ps Open_Punctuation
167
- S Symbol
168
- Sc Currency_Symbol
169
- Sk Modifier_Symbol
170
- Sm Math_Symbol
171
- So Other_Symbol
172
- Z Separator
173
- Zl Line_Separator
174
- Zp Paragraph_Separator
175
- Zs Space_Separator
176
- ASCII
177
- ASCII_Hex_Digit AHex
178
- Alphabetic Alpha
179
- Any
180
- Assigned
181
- Bidi_Control Bidi_C
182
- Bidi_Mirrored Bidi_M
183
- Case_Ignorable CI
184
- Cased
185
- Changes_When_Casefolded CWCF
186
- Changes_When_Casemapped CWCM
187
- Changes_When_Lowercased CWL
188
- Changes_When_NFKC_Casefolded CWKCF
189
- Changes_When_Titlecased CWT
190
- Changes_When_Uppercased CWU
191
- Dash
192
- Default_Ignorable_Code_Point DI
193
- Deprecated Dep
194
- Diacritic Dia
195
- Emoji
196
- Emoji_Component EComp
197
- Emoji_Modifier EMod
198
- Emoji_Modifier_Base EBase
199
- Emoji_Presentation EPres
200
- Extended_Pictographic ExtPict
201
- Extender Ext
202
- Grapheme_Base Gr_Base
203
- Grapheme_Extend Gr_Ext
204
- Hex_Digit Hex
205
- IDS_Binary_Operator IDSB
206
- IDS_Trinary_Operator IDST
207
- ID_Continue IDC
208
- ID_Start IDS
209
- Ideographic Ideo
210
- Join_Control Join_C
211
- Logical_Order_Exception LOE
212
- Lowercase Lower
213
- Math
214
- Noncharacter_Code_Point NChar
215
- Pattern_Syntax Pat_Syn
216
- Pattern_White_Space Pat_WS
217
- Quotation_Mark QMark
218
- Radical
219
- Regional_Indicator RI
220
- Sentence_Terminal STerm
221
- Soft_Dotted SD
222
- Terminal_Punctuation Term
223
- Unified_Ideograph UIdeo
224
- Uppercase Upper
225
- Variation_Selector VS
226
- White_Space space
227
- XID_Continue XIDC
228
- XID_Start XIDS`.split(/\s/).map(e=>[kb(e),e])),Sx=new Map([[`s`,sx(383)],[sx(383),`s`]]),Cx=new Map([[sx(223),sx(7838)],[sx(107),sx(8490)],[sx(229),sx(8491)],[sx(969),sx(8486)]]),wx=new Map([Dx(453),Dx(456),Dx(459),Dx(498),...Ox(8072,8079),...Ox(8088,8095),...Ox(8104,8111),Dx(8124),Dx(8140),Dx(8188)]),Tx=new Map([[`alnum`,Q`[\p{Alpha}\p{Nd}]`],[`alpha`,Q`\p{Alpha}`],[`ascii`,Q`\p{ASCII}`],[`blank`,Q`[\p{Zs}\t]`],[`cntrl`,Q`\p{Cc}`],[`digit`,Q`\p{Nd}`],[`graph`,Q`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Q`\p{Lower}`],[`print`,Q`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Q`[\p{P}\p{S}]`],[`space`,Q`\p{space}`],[`upper`,Q`\p{Upper}`],[`word`,Q`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Q`\p{AHex}`]]);function Ex(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Dx(e){let t=sx(e);return[t.toLowerCase(),t]}function Ox(e,t){return Ex(e,t).map(e=>Dx(e))}var kx=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Ax(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};Px(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:fx(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};Mb(e,jx,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return Mb(e,Mx,a),Mb(e,Nx,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var jx={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=mb();e.body[0].body.push(hb({negate:!0,body:r}),xb(`Any`));let i=mb();i.body[0].body.push(vb(`greedy`,0,1/0,e)),n($x(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];dx(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Vx(t.get(e));if(n){let t=mb({flags:n});t.body[0].body=e.body,e.body=[$x(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o($x(hb({body:[ib({body:[ab(`string_end`)]}),ib({body:[cb(10)]})]}),t));else if(c===`line_start`)o($x(Xx(Q`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&qx(e))o($x(hb({negate:!0}),t));else if(d)throw Error(Q`Uses "\G" in a way that requires a subclass`);else o(Qx(ab(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o($x(Xx(Q`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${yx})(?!${yx})|(?<!${yx})(?=${yx}))`,n=`(?:(?<=${yx})(?=${yx})|(?<!${yx})(?!${yx}))`;o($x(Xx(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Yx(n)&&(n=Bx(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Yx(r)&&(r=Bx(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n($x(lb({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`)){n(Qx(db(`digit`,{negate:l}),t));return}if(o&&(c===`space`||u===`space`)){n($x(Zx(Xx(_x),l),t));return}if(s&&(c===`word`||u===`word`)){n(Qx(db(`word`,{negate:l}),t));return}if(c===`any`)n(Qx(xb(`Any`),t));else if(c===`digit`)n(Qx(xb(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Q`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Q`\p{RI}{2}|${e}(?:\u200D${e})*`;n($x(Xx(Q`(?>\r\n|${i?Q`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(Qx(xb(`AHex`,{negate:l}),t));else if(c===`newline`)n($x(Xx(l?`[^
229
- ]`:`(?>\r
230
- ?|[
231
- \v\f…\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${sx(e.codePointAt(0)-1)}${sx(e.codePointAt(2)+1)}-\u{10FFFF}`),n($x(Xx(`[${e}]`),t))}else n($x(Zx(Xx(Tx.get(u)),l),t))}else if(c===`property`)xx.has(kb(u))||(e.key=`sc`);else if(c===`space`)n(Qx(xb(`space`,{negate:l}),t));else if(c===`word`)n($x(Zx(Xx(yx),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=mb({flags:c});e.body[0].body=o(),i($x(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&Gy(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Q`Uses "\K" in a way that's unsupported`);let o=hb({behind:!0});o.body[0].body=a(),i($x(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n($x(hb({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=mb();t.body[0].body.push(e.body),e.body=$x(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=Wx(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Q`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!Yx(n)&&(n=Bx(n,t),e.ref=n)}},Mx={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=Qx(Rx(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&dx(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=dx(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=ux(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?Rx(0):Lx(o,r.groupOriginByCopy,null),l=c;if(!s){let e=Vx(zx(o,e=>e.type===`Group`&&!!e.flags)),t=e?ux(r.globalFlags,e):r.globalFlags;Fx(t,r.currentFlags)||(l=mb({flags:Hx(t)}),l.body[0].body.push(c))}n($x(l,t),{traverse:!s})}},Nx={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>Ix(t,e));i.length?i.length>1?n($x(mb({atomic:!0,body:i.reverse().map(e=>ib({body:[ob(e.number)]}))}),t)):e.ref=i[0].number:n($x(hb({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=sb();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Px(e){Mb(e,{"*"({node:e,parent:t}){e.parent=t}})}function Fx(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Ix(e,t){let n=t;do{if(n.type===`Regex`)return!1;if(n.type===`Alternative`)continue;if(n===e)return!1;let t=Ux(n.parent);for(let r of t){if(r===n)break;if(r===e||Gx(r,e))return!0}}while(n=n.parent);throw Error(`Unexpected path`)}function Lx(e,t,n,r){let i=Array.isArray(e)?[]:{};for(let[a,o]of Object.entries(e))a===`parent`?i.parent=Array.isArray(n)?r:n:o&&typeof o==`object`?i[a]=Lx(o,t,i,n):(a===`type`&&o===`CapturingGroup`&&t.set(i,t.get(e)??e),i[a]=o);return i}function Rx(e){let t=bb(e);return t.isRecursive=!0,t}function zx(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Bx(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/gu,`_`)}`;return t.set(e,n),n}function Vx(e){let t=[`dotAll`,`ignoreCase`],n={enable:{},disable:{}};return e.forEach(({flags:e})=>{t.forEach(t=>{e.enable?.[t]&&(delete n.disable[t],n.enable[t]=!0),e.disable?.[t]&&(n.disable[t]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Hx({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Ux(e){if(!e)throw Error(`Node expected`);let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Wx(e){let t=e.find(e=>e.kind===`search_start`||Jx(e,{negate:!1})||!Kx(e));if(!t)return null;if(t.kind===`search_start`)return t;if(t.type===`LookaroundAssertion`)return t.body[0].body[0];if(t.type===`CapturingGroup`||t.type===`Group`){let e=[];for(let n of t.body){let t=Wx(n.body);if(!t)return null;Array.isArray(t)?e.push(...t):e.push(t)}return e}return null}function Gx(e,t){let n=Ux(e)??[];for(let e of n)if(e===t||Gx(e,t))return!0;return!1}function Kx({type:e}){return e===`Assertion`||e===`Directive`||e===`LookaroundAssertion`}function qx(e){let t=[`Character`,`CharacterClass`,`CharacterSet`];return t.includes(e.type)||e.type===`Quantifier`&&e.min&&t.includes(e.body.type)}function Jx(e,t){let n={negate:null,...t};return e.type===`LookaroundAssertion`&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Gy(e.body[0],{type:`Assertion`,kind:`search_start`})}function Yx(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Xx(e,t){let n=Jy(e,{...t,unicodePropertyMap:xx}).body;return n.length>1||n[0].body.length>1?mb({body:n}):n[0].body[0]}function Zx(e,t){return e.negate=t,e}function Qx(e,t){return e.parent=t,e}function $x(e,t){return Px(e),e.parent=t,e}function eS(e,t){let n=gx(t),r=fx(n.target,`ES2024`),i=fx(n.target,`ES2025`),a=n.rules.recursionLimit;if(!Number.isInteger(a)||a<2||a>20)throw Error(`Invalid recursionLimit; use 2-20`);let o=null,s=null;if(!i){let t=[e.flags.ignoreCase];Mb(e,tS,{getCurrentModI:()=>t.at(-1),popModI(){t.pop()},pushModI(e){t.push(e)},setHasCasedChar(){t.at(-1)?o=!0:s=!0}})}let c={dotAll:e.flags.dotAll,ignoreCase:!(!e.flags.ignoreCase&&!o||s)},l=e,u={accuracy:n.accuracy,appliedGlobalFlags:c,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:l,originMap:e._originMap,recursionLimit:a,useAppliedIgnoreCase:!!(!i&&o&&s),useFlagMods:i,useFlagV:r,verbose:n.verbose};function d(e){return u.lastNode=l,l=e,px(nS[e.type],`Unexpected node type "${e.type}"`)(e,u,d)}let f={pattern:e.body.map(d).join(`|`),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((e,t)=>{e.hidden&&f._hiddenCaptures.push(t),e.transferTo&&dx(f._captureTransfers,e.transferTo,[]).push(t)}),f}var tS={"*":{enter({node:e},t){if(mS(e)){let n=t.getCurrentModI();t.pushModI(e.flags?ux({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){mS(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){cS(sx(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),lS(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind===`property`&&kx.has(e.value)&&t.setHasCasedChar()}},nS={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?Q`\B`:Q`\b`;throw Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!=`number`)throw Error(`Unexpected named backref in transformed AST`);if(!t.useFlagMods&&t.accuracy===`strict`&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw Error(`Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy`);return`\\`+e},CapturingGroup(e,t,n){let{body:r,name:i,number:a}=e,o={ignoreCase:t.currentFlags.ignoreCase},s=t.originMap.get(e);return s&&(o.hidden=!0,a>s.number&&(o.transferTo=s.number)),t.captureMap.set(a,o),`(${i?`?<${i}>`:``}${r.map(n).join(`|`)})`},Character({value:e},t){let n=sx(e),r=uS(e,{escDigit:t.lastNode.type===`Backreference`,inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&cS(n)){let e=bx(n);return t.inCharClass?e.join(``):e.length>1?`[${e.join(``)}]`:e[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:i,parent:a}=e,{body:o}=e;if(r===`intersection`&&!t.useFlagV)throw Error(`Use of character class intersection requires min target ES2024`);cx.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&o.some(gS)&&(o=[cb(45),...o.filter(e=>!gS(e))]);let s=()=>`[${i?`^`:``}${o.map(n).join(r===`intersection`?`&&`:``)}]`;if(!t.inCharClass){if((!t.useFlagV||cx.bugNestedClassIgnoresNegation)&&!i){let t=o.filter(e=>e.type===`CharacterClass`&&e.kind===`union`&&e.negate);if(t.length){let r=mb(),i=r.body[0];return r.parent=a,i.parent=r,o=o.filter(e=>!t.includes(e)),e.body=o,o.length?(e.parent=i,i.body.push(e)):r.body.pop(),t.forEach(e=>{let t=ib({body:[e]});e.parent=t,t.parent=r,r.body.push(t)}),n(r)}}t.inCharClass=!0;let r=s();return t.inCharClass=!1,r}let c=o[0];if(r===`union`&&!i&&c&&((!t.useFlagV||!t.verbose)&&a.kind===`union`&&!(cx.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&a.kind===`intersection`&&o.length===1&&c.type!==`CharacterClassRange`))return o.map(n).join(``);if(!t.useFlagV&&a.type===`CharacterClass`)throw Error(`Uses nested character class in a way that requires min target ES2024`);return s()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,i={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},a=uS(n,i),o=uS(r,i),s=new Set;return t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&dS(lS(e)).forEach(e=>{s.add(Array.isArray(e)?`${uS(e[0],i)}-${uS(e[1],i)}`:uS(e,i))}),`${a}-${o}${[...s].join(``)}`},CharacterSet({kind:e,negate:t,value:n,key:r},i){if(e===`dot`)return i.currentFlags.dotAll?i.appliedGlobalFlags.dotAll||i.useFlagMods?`.`:`[^]`:Q`[^\n]`;if(e===`digit`)return t?Q`\D`:Q`\d`;if(e===`property`){if(i.useAppliedIgnoreCase&&i.currentFlags.ignoreCase&&kx.has(n))throw Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Q`\P`:Q`\p`}{${r?`${r}=`:``}${n}}`}if(e===`word`)return t?Q`\W`:Q`\w`;throw Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?`i`:``)+(e.dotAll?`s`:``)+(e.sticky?`y`:``)},Group({atomic:e,body:t,flags:n,parent:r},i,a){let o=i.currentFlags;n&&(i.currentFlags=ux(o,n));let s=t.map(a).join(`|`),c=!i.verbose&&t.length===1&&r.type!==`Quantifier`&&!e&&(!i.useFlagMods||!n)?s:`(?${fS(e,n,i.useFlagMods)}${s})`;return i.currentFlags=o,c},LookaroundAssertion({body:e,kind:t,negate:n},r,i){return`(?${`${t===`lookahead`?``:`<`}${n?`!`:`=`}`}${e.map(i).join(`|`)})`},Quantifier(e,t,n){return n(e.body)+pS(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw Error(`Unexpected non-recursive subroutine in transformed AST`);let r=n.recursionLimit;return t===0?`(?R=${r})`:Q`\g<${t}&R=${r}>`}},rS=new Set([`$`,`(`,`)`,`*`,`+`,`.`,`?`,`[`,`\\`,`]`,`^`,`{`,`|`,`}`]),iS=new Set([`-`,`\\`,`]`,`^`,`[`]),aS=new Set("()-/[\\]^{|}!#$%&*+,.:;<=>?@`~".split(``)),oS=new Map([[9,Q`\t`],[10,Q`\n`],[11,Q`\v`],[12,Q`\f`],[13,Q`\r`],[8232,Q`\u2028`],[8233,Q`\u2029`],[65279,Q`\uFEFF`]]),sS=/^\p{Cased}$/u;function cS(e){return sS.test(e)}function lS(e,t){let n=!!t?.firstOnly,r=e.min.value,i=e.max.value,a=[];if(r<65&&(i===65535||i>=131071)||r===65536&&i>=131071)return a;for(let e=r;e<=i;e++){let t=sx(e);if(!cS(t))continue;let o=bx(t).filter(e=>{let t=e.codePointAt(0);return t<r||t>i});if(o.length&&(a.push(...o),n))break}return a}function uS(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(oS.has(e))return oS.get(e);if(e<32||e>126&&e<160||e>262143||t&&hS(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,`0`)}`;let i=n?r?aS:iS:rS,a=sx(e);return(i.has(a)?`\\`:``)+a}function dS(e){let t=e.map(e=>e.codePointAt(0)).sort((e,t)=>e-t),n=[],r=null;for(let e=0;e<t.length;e++)t[e+1]===t[e]+1?r??=t[e]:r===null?n.push(t[e]):(n.push([r,t[e]]),r=null);return n}function fS(e,t,n){if(e)return`>`;let r=``;if(t&&n){let{enable:e,disable:n}=t;r=(e?.ignoreCase?`i`:``)+(e?.dotAll?`s`:``)+(n?`-`:``)+(n?.ignoreCase?`i`:``)+(n?.dotAll?`s`:``)}return`${r}:`}function pS({kind:e,max:t,min:n}){let r;return r=!n&&t===1?`?`:!n&&t===1/0?`*`:n===1&&t===1/0?`+`:n===t?`{${n}}`:`{${n},${t===1/0?``:t}}`,r+{greedy:``,lazy:`?`,possessive:`+`}[e]}function mS({type:e}){return e===`CapturingGroup`||e===`Group`||e===`LookaroundAssertion`}function hS(e){return e>47&&e<58}function gS({type:e,value:t}){return e===`Character`&&t===45}var _S=class e extends RegExp{#e=new Map;#t=null;#n;#r=null;#i=null;rawOptions={};get source(){return this.#n||`(?:)`}constructor(t,n,r){let i=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw Error(`Cannot provide options when copying a regexp`);let i=t;super(i,n),this.#n=i.source,i instanceof e&&(this.#e=i.#e,this.#r=i.#r,this.#i=i.#i,this.rawOptions=i.rawOptions)}else{let e={hiddenCaptures:[],strategy:null,transfers:[],...r};super(i?``:t,n),this.#n=t,this.#e=yS(e.hiddenCaptures,e.transfers),this.#i=e.strategy,this.rawOptions=r??{}}i||(this.#t=this)}exec(t){if(!this.#t){let{lazyCompile:t,...n}=this.rawOptions;this.#t=new e(this.#n,this.flags,n)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#i===`clip_search`&&n&&r){this.lastIndex=0;let e=this.#a(t.slice(r));return e&&(vS(e,r,t,this.hasIndices),this.lastIndex+=r),e}return this.#a(t)}#a(e){this.#t.lastIndex=this.lastIndex;let t=super.exec.call(this.#t,e);if(this.lastIndex=this.#t.lastIndex,!t||!this.#e.size)return t;let n=[...t];t.length=1;let r;this.hasIndices&&(r=[...t.indices],t.indices.length=1);let i=[0];for(let e=1;e<n.length;e++){let{hidden:a,transferTo:o}=this.#e.get(e)??{};if(a?i.push(null):(i.push(t.length),t.push(n[e]),this.hasIndices&&t.indices.push(r[e])),o&&n[e]!==void 0){let a=i[o];if(!a)throw Error(`Invalid capture transfer to "${a}"`);if(t[a]=n[e],this.hasIndices&&(t.indices[a]=r[e]),t.groups){this.#r||=bS(this.source);let i=this.#r.get(o);i&&(t.groups[i]=n[e],this.hasIndices&&(t.indices.groups[i]=r[e]))}}}return t}};function vS(e,t,n,r){if(e.index+=t,e.input=n,r){let n=e.indices;for(let e=0;e<n.length;e++){let r=n[e];r&&(n[e]=[r[0]+t,r[1]+t])}let r=n.groups;r&&Object.keys(r).forEach(e=>{let n=r[e];n&&(r[e]=[n[0]+t,n[1]+t])})}}function yS(e,t){let n=new Map;for(let t of e)n.set(t,{hidden:!0});for(let[e,r]of t)for(let t of r)dx(n,t,{}).transferTo=e;return n}function bS(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,i=0,a;for(;a=t.exec(e);){let{0:e,groups:{capture:t,name:o}}=a;e===`[`?r++:r?e===`]`&&r--:t&&(i++,o&&n.set(i,o))}return n}function xS(e,t){let n=SS(e,t);return n.options?new _S(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function SS(e,t){let n=gx(t),r=Ax(Jy(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:xx}),{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=eS(r,n),a=tx(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:`external`}),o=Gb(Jb(a.pattern).pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),s={pattern:o.pattern,flags:`${n.hasIndices?`d`:``}${n.global?`g`:``}${i.flags}${i.options.disable.v?`u`:`v`}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw Error(`Lazy compilation requires subclass`)}else{let e=o.hiddenCaptures.sort((e,t)=>e-t),t=Array.from(o.captureTransfers),i=r._strategy,a=s.pattern.length>=n.lazyCompileLength;(e.length||t.length||i||a)&&(s.options={...e.length&&{hiddenCaptures:e},...t.length&&{transfers:t},...i&&{strategy:i},...a&&{lazyCompile:a}})}return s}function CS(e,t){return xS(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function wS(e={}){let t={target:`auto`,cache:new Map,...e};return t.regexConstructor||=e=>CS(e,{target:t.target}),{createScanner(e){return new ey(e,t)},createString(e){return{content:e}}}}var TS={typescript:()=>W(()=>import(`./typescript-CttGnwgr.js`).then(e=>e.n),__vite__mapDeps([6,1,2,3,4,5])),javascript:()=>W(()=>import(`./javascript-UWfzLVwt.js`).then(e=>e.n),__vite__mapDeps([7,1,2,3,4,5])),jsx:()=>W(()=>import(`./jsx-B85L4NBR.js`).then(e=>e.n),__vite__mapDeps([8,1,2,3,4,5])),tsx:()=>W(()=>import(`./tsx-CssvfOw5.js`).then(e=>e.n),__vite__mapDeps([9,1,2,3,4,5])),vue:()=>W(()=>import(`./vue-BeqRp0z0.js`),__vite__mapDeps([10,11,1,2,3,4,5,7,12,6,13])),"vue-html":()=>W(()=>import(`./vue-html-E9GYf_6s.js`),__vite__mapDeps([14,7,1,2,3,4,5])),json:()=>W(()=>import(`./json-qhed-kSA.js`),[]),jsonc:()=>W(()=>import(`./jsonc-CYpm1nAK.js`),[]),yaml:()=>W(()=>import(`./yaml-rwi0_p6S.js`),[]),toml:()=>W(()=>import(`./toml-CcmNWLt0.js`),[]),markdown:()=>W(()=>import(`./markdown-BYOwaDjH.js`),[]),mdx:()=>W(()=>import(`./mdx-DQZ5AkYe.js`),[]),css:()=>W(()=>import(`./css-dNRduEa-.js`).then(e=>e.n),__vite__mapDeps([11,1,2,3,4,5])),scss:()=>W(()=>import(`./scss-Dl-NjxyA.js`),__vite__mapDeps([15,11,1,2,3,4,5])),less:()=>W(()=>import(`./less-DVTAwKKz.js`),[]),html:()=>W(()=>import(`./html-9bR0RcZU.js`),__vite__mapDeps([12,11,1,2,3,4,5,7])),xml:()=>W(()=>import(`./xml-Dz7PSrBs.js`),__vite__mapDeps([16,17,1,2,3,4,5])),python:()=>W(()=>import(`./python-gzcpVVnB.js`),[]),go:()=>W(()=>import(`./go-rLFTqkRN.js`),[]),rust:()=>W(()=>import(`./rust-Cfkwpbl8.js`),[]),java:()=>W(()=>import(`./java-C0DRq53f.js`).then(e=>e.n),__vite__mapDeps([17,1,2,3,4,5])),kotlin:()=>W(()=>import(`./kotlin-DhhofPvG.js`),[]),c:()=>W(()=>import(`./c-BWgYNV7i.js`).then(e=>e.n),__vite__mapDeps([18,1,2,3,4,5])),cpp:()=>W(()=>import(`./cpp-BBcYm61y.js`),__vite__mapDeps([19,18,1,2,3,4,5])),csharp:()=>W(()=>import(`./csharp-oqKa8noW.js`),[]),ruby:()=>W(()=>import(`./ruby-Cf2R6w0b.js`),__vite__mapDeps([20,18,1,2,3,4,5,19,11,7,12,21,6,8,9,22,16,17,23,24,25])),php:()=>W(()=>import(`./php-CwqKKdmW.js`),__vite__mapDeps([26,11,1,2,3,4,5,7,12,13,16,17,23])),swift:()=>W(()=>import(`./swift-CyEgAFGc.js`),[]),shellscript:()=>W(()=>import(`./shellscript-CLZ0U2zV.js`),[]),sql:()=>W(()=>import(`./sql-BsFa4tDR.js`),[]),docker:()=>W(()=>import(`./docker-IyjqRm3v.js`),[]),make:()=>W(()=>import(`./make-Dixweg8N.js`),[]),graphql:()=>W(()=>import(`./graphql-DC6gMr7C.js`),__vite__mapDeps([21,7,1,2,3,4,5,6,8,9])),diff:()=>W(()=>import(`./diff-woXpYk--.js`),[]),ini:()=>W(()=>import(`./ini-B5eOa1yu.js`),[]),perl:()=>W(()=>import(`./perl-Bk6ijEF5.js`),__vite__mapDeps([27,11,1,2,3,4,5,7,12,16,17,23])),lua:()=>W(()=>import(`./lua-ByOrBoZ-.js`),__vite__mapDeps([22,18,1,2,3,4,5])),r:()=>W(()=>import(`./r-C5FwQflr.js`),[]),scala:()=>W(()=>import(`./scala-BiFt_7mu.js`),[]),elixir:()=>W(()=>import(`./elixir-BMAS0SZ2.js`),__vite__mapDeps([28,12,11,1,2,3,4,5,7])),haskell:()=>W(()=>import(`./haskell-D8IpX4py.js`),[]),clojure:()=>W(()=>import(`./clojure-DqKBuwfJ.js`),[]),groovy:()=>W(()=>import(`./groovy-CacY0gHj.js`),[]),"objective-c":()=>W(()=>import(`./objective-c-D1A_Heim.js`),[]),"objective-cpp":()=>W(()=>import(`./objective-cpp-BsSzOQcm.js`),[]),proto:()=>W(()=>import(`./proto-DB4EqR-F.js`),[]),terraform:()=>W(()=>import(`./terraform-DswuEJGm.js`),[]),nginx:()=>W(()=>import(`./nginx-DBTb8aIg.js`),__vite__mapDeps([29,22,18,1,2,3,4,5]))},ES={ts:TS.typescript,cts:TS.typescript,mts:TS.typescript,js:TS.javascript,cjs:TS.javascript,mjs:TS.javascript,yml:TS.yaml,md:TS.markdown,py:TS.python,rs:TS.rust,kt:TS.kotlin,kts:TS.kotlin,"c++":TS.cpp,"c#":TS.csharp,cs:TS.csharp,rb:TS.ruby,bash:TS.shellscript,sh:TS.shellscript,shell:TS.shellscript,zsh:TS.shellscript,dockerfile:TS.docker,makefile:TS.make,gql:TS.graphql,properties:TS.ini,hs:TS.haskell,clj:TS.clojure,objc:TS[`objective-c`],protobuf:TS.proto,tf:TS.terraform,tfvars:TS.terraform},DS={...TS,...ES},OS={};function kS(){throw Error(`Oniguruma engine is not available in this build.`)}var AS=Qv({langs:DS,themes:OS,engine:()=>wS()});async function jS(e){if(Fp())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=Ap.get(e);if(t!=null)return t;try{let t=jp.get(e);if(t==null&&Object.prototype.hasOwnProperty.call(DS,e)&&(t=DS[e]),t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let n=t().then(({default:t})=>{let n={name:e,data:t};return kp.has(e)||kp.set(e,n),n});return Ap.set(e,n),await n}finally{Ap.delete(e)}}function MS(e){return kp.get(e)??jS(e)}function NS(e=yp){let t=[];return typeof e==`string`?t.push(e):(t.push(e.dark),t.push(e.light)),t}var PS=new Set;function FS(e){for(let t of NS(e))if(!PS.has(t))return!1;return!0}function IS(e){let t=[],n=new Set;for(let r of LS(e.themes)){let e=BS(r)?r.getThemes():[r];for(let r of e){if(n.has(r.name))throw Error(`Theme collection already contains theme "${r.name}"`);n.add(r.name),t.push(r)}}let r=Object.freeze([...t]),i=Object.freeze(r.filter(e=>e.colorScheme===`light`)),a=Object.freeze(r.filter(e=>e.colorScheme===`dark`)),o=new Map(r.map(e=>[e.name,e])),s=Object.freeze(r.map(e=>e.name)),c=Object.freeze(i.map(e=>e.name)),l=Object.freeze(a.map(e=>e.name));function u(e){if(e==null)return r;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?i:t===`dark`?a:r:r.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return o.get(e)},getThemes(e){return u(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?c:e?.colorScheme===`dark`?l:s:u(e).map(e=>e.name)},hasTheme(e){return o.has(e)},orderBy(e){return IS({themes:r.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],n=new Set;for(let r of e){if(n.has(r))throw Error(`Theme collection pick already includes theme "${r}"`);n.add(r);let e=o.get(r);if(e==null)throw Error(`Theme collection does not contain theme "${r}"`);t.push(e)}return IS({themes:t})},registerInto(e){for(let t of r)e.registerThemeIfAbsent(t.name,t.load)}}}function LS(e){return RS(e)?[e]:e}function RS(e){return BS(e)||zS(e)}function zS(e){return typeof e.name==`string`&&typeof e.load==`function`}function BS(e){return typeof e.getThemes==`function`}function VS(e){return typeof e==`object`&&e&&`default`in e?e.default:e}var HS=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name=`DuplicateThemeError`}},US=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name=`UnregisteredThemeError`}},WS=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name=`UnresolvedThemeError`}};function GS(){let e=new Map,t=new Map,n=new Map,r=0;function i(t,n){if(e.has(t))throw new HS(t);e.set(t,n)}function a(t,n){return!e.has(t)&&(e.set(t,n),!0)}function o(t){return e.has(t)}function s(i){let a=t.get(i);if(a!==void 0)return Promise.resolve(a);let o=n.get(i);if(o!==void 0)return o;let s=e.get(i);if(s===void 0)return Promise.reject(new US(i));let c=r,l=s().then(e=>{let a=VS(e);return c===r&&t.set(i,a),n.get(i)===l&&n.delete(i),a}).catch(e=>{throw n.get(i)===l&&n.delete(i),e});return n.set(i,l),l}function c(e){return Promise.all(e.map(e=>s(e)))}function l(e,n){t.set(e,n)}function u(e){for(let[t,n]of e)l(t,n)}function d(e){return t.get(e)}function f(e){let n=[];for(let r of e){let e=t.get(r);if(e===void 0)throw new WS(r);n.push(e)}return n}function p(e){return t.has(e)}function m(e){for(let n of e)if(!t.has(n))return!1;return!0}function h(e){let n=t.get(e);return n===void 0?s(e):n}function g(){r++,t.clear(),n.clear()}return{clearResolvedThemes:g,getResolvedOrResolveTheme:h,getResolvedTheme:d,getResolvedThemes:f,hasRegisteredTheme:o,hasResolvedTheme:p,hasResolvedThemes:m,registerTheme:i,registerThemeIfAbsent:a,resolveTheme:s,resolveThemes:c,seedResolvedTheme:l,seedResolvedThemes:u}}var KS=GS();function qS(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let e;if(typeof n==`string`){if(e=KS.getResolvedTheme(n),e==null)throw Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else e=n,n=n.name,KS.getResolvedTheme(n)??KS.seedResolvedTheme(n,e);PS.has(n)||(PS.add(n),t.loadThemeSync(e))}}function JS({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:YS(t)}}function YS(e){return async()=>jh(VS(await e()))}var XS=`pierre`,ZS=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],QS=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],$S=[...QS,...ZS],eC=new Set(QS);function tC(e){return eC.has(e)?`light`:`dark`}var nC={"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`},rC={"pierre-dark":()=>W(()=>import(`./pierre-dark-CpLgRqie.js`),[]),"pierre-dark-soft":()=>W(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[]),"pierre-dark-vibrant":()=>W(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[]),"pierre-dark-protanopia-deuteranopia":()=>W(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[]),"pierre-dark-tritanopia":()=>W(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[]),"pierre-light":()=>W(()=>import(`./pierre-light-CoaEpmwp.js`),[]),"pierre-light-soft":()=>W(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[]),"pierre-light-vibrant":()=>W(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[]),"pierre-light-protanopia-deuteranopia":()=>W(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[]),"pierre-light-tritanopia":()=>W(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[])};function iC(e){return JS({name:e,collection:XS,colorScheme:tC(e),displayName:nC[e],load:rC[e]})}var aC=IS({themes:$S.map(e=>iC(e))}),oC=`shiki`,sC=[`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`],cC=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),lC=new Set(sC);function uC(e){return lC.has(e)?`light`:`dark`}var dC={andromeeda:()=>W(()=>import(`./andromeeda-vGVdxbeo.js`),[]),"aurora-x":()=>W(()=>import(`./aurora-x-CDeNXAV0.js`),[]),"ayu-dark":()=>W(()=>import(`./ayu-dark-DluEY0Gj.js`),[]),"ayu-light":()=>W(()=>import(`./ayu-light-C3h-C4tm.js`),[]),"ayu-mirage":()=>W(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[]),"catppuccin-frappe":()=>W(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[]),"catppuccin-latte":()=>W(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[]),"catppuccin-macchiato":()=>W(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[]),"catppuccin-mocha":()=>W(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[]),"dark-plus":()=>W(()=>import(`./dark-plus-Cs2F2srj.js`),[]),dracula:()=>W(()=>import(`./dracula-BHWKrbxM.js`),[]),"dracula-soft":()=>W(()=>import(`./dracula-soft-5eyTD99u.js`),[]),"everforest-dark":()=>W(()=>import(`./everforest-dark-sB-x3p7T.js`),[]),"everforest-light":()=>W(()=>import(`./everforest-light-Df2xbC6M.js`),[]),"github-dark":()=>W(()=>import(`./github-dark-C-LZuMrd.js`),[]),"github-dark-default":()=>W(()=>import(`./github-dark-default-DXG-b-1a.js`),[]),"github-dark-dimmed":()=>W(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[]),"github-dark-high-contrast":()=>W(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[]),"github-light":()=>W(()=>import(`./github-light-EUqPIrTm.js`),[]),"github-light-default":()=>W(()=>import(`./github-light-default-BXViO-2h.js`),[]),"github-light-high-contrast":()=>W(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[]),"gruvbox-dark-hard":()=>W(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[]),"gruvbox-dark-medium":()=>W(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[]),"gruvbox-dark-soft":()=>W(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[]),"gruvbox-light-hard":()=>W(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[]),"gruvbox-light-medium":()=>W(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[]),"gruvbox-light-soft":()=>W(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[]),horizon:()=>W(()=>import(`./horizon-CE9ld1lL.js`),[]),"horizon-bright":()=>W(()=>import(`./horizon-bright-DSNQnXHK.js`),[]),houston:()=>W(()=>import(`./houston-CsvMBhTu.js`),[]),"kanagawa-dragon":()=>W(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[]),"kanagawa-lotus":()=>W(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[]),"kanagawa-wave":()=>W(()=>import(`./kanagawa-wave-BML5mF2J.js`),[]),laserwave:()=>W(()=>import(`./laserwave-C_8bwKvT.js`),[]),"light-plus":()=>W(()=>import(`./light-plus-DVQuIRkW.js`),[]),"material-theme":()=>W(()=>import(`./material-theme-Bm3Qr25_.js`),[]),"material-theme-darker":()=>W(()=>import(`./material-theme-darker-2IIEA8gg.js`),[]),"material-theme-lighter":()=>W(()=>import(`./material-theme-lighter-uhdI0v04.js`),[]),"material-theme-ocean":()=>W(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[]),"material-theme-palenight":()=>W(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[]),"min-dark":()=>W(()=>import(`./min-dark-BSWPekZh.js`),[]),"min-light":()=>W(()=>import(`./min-light-DDpmG2fV.js`),[]),monokai:()=>W(()=>import(`./monokai-B_bV9PQ9.js`),[]),"night-owl":()=>W(()=>import(`./night-owl-DhmEMT88.js`),[]),"night-owl-light":()=>W(()=>import(`./night-owl-light-eJ-hLW7d.js`),[]),nord:()=>W(()=>import(`./nord-Cb4Vim4T.js`),[]),"one-dark-pro":()=>W(()=>import(`./one-dark-pro-CLwyXe_n.js`),[]),"one-light":()=>W(()=>import(`./one-light-D7Lr4KcI.js`),[]),plastic:()=>W(()=>import(`./plastic-DQwYfKfQ.js`),[]),poimandres:()=>W(()=>import(`./poimandres-DRFjx7u4.js`),[]),red:()=>W(()=>import(`./red-DX1BQOs8.js`),[]),"rose-pine":()=>W(()=>import(`./rose-pine-aMsaMD1D.js`),[]),"rose-pine-dawn":()=>W(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[]),"rose-pine-moon":()=>W(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[]),"slack-dark":()=>W(()=>import(`./slack-dark-DnToyrRv.js`),[]),"slack-ochin":()=>W(()=>import(`./slack-ochin-B2OO5cIa.js`),[]),"snazzy-light":()=>W(()=>import(`./snazzy-light-4G7pJPwS.js`),[]),"solarized-dark":()=>W(()=>import(`./solarized-dark-UdsmMDCL.js`),[]),"solarized-light":()=>W(()=>import(`./solarized-light-C1IUL_tW.js`),[]),"synthwave-84":()=>W(()=>import(`./synthwave-84-nFMaYfgc.js`),[]),"tokyo-night":()=>W(()=>import(`./tokyo-night-oM2G3aXe.js`),[]),vesper:()=>W(()=>import(`./vesper-DdrHHSXu.js`),[]),"vitesse-black":()=>W(()=>import(`./vitesse-black-fwtXNY1n.js`),[]),"vitesse-dark":()=>W(()=>import(`./vitesse-dark-BZCL-v6S.js`),[]),"vitesse-light":()=>W(()=>import(`./vitesse-light-VbXTXTou.js`),[])};function fC(e){return JS({name:e,collection:oC,colorScheme:uC(e),load:dC[e]})}var pC=IS({themes:Object.freeze([...sC.map(e=>fC(e)),...cC.map(e=>fC(e))])});function mC(e){if(Fp())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(KS.hasRegisteredTheme(e))return;let t=pC.getTheme(e);if(t!=null){KS.registerThemeIfAbsent(t.name,t.load);return}throw Error(`No valid theme loader registered for "${e}"`)}function hC(e,t){if(t.name!==e)throw Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function gC(e){mC(e);let t=await KS.resolveTheme(e);return hC(e,t),t}function _C(e){return KS.getResolvedTheme(e)??gC(e)}var vC;async function yC({themes:e,langs:t,preferredHighlighter:n=`shiki-js`}){vC??=AS({themes:[],langs:[`text`],engine:n===`shiki-wasm`?kS(W(()=>import(`./shiki-wasm-noop-Gxv9UHE7.js`),[])):wS()});let r=xC(vC)?await vC:vC;vC=r;let i=[];for(let e of Array.from(new Set(t))){if(e===`text`||e===`ansi`)continue;let t=MS(e);`then`in t?i.push(t):Pp(t,r)}let a=[];for(let t of e){let e=_C(t);`then`in e?a.push(e):qS(e,vC)}return(i.length>0||a.length>0)&&await Promise.all([Promise.all(i).then(e=>{Pp(e,r)}),Promise.all(a).then(e=>{qS(e,r)})]),r}function bC(e){if(!(vC==null||`then`in vC)&&(e==null||FS(e.theme)&&Np(e.lang)))return vC}function xC(e=vC){return e!=null&&`then`in e}for(let e of aC.getThemes())KS.registerThemeIfAbsent(e.name,e.load);var SC=new Set,CC=null;function wC(e){SC.add(e),CC??=requestAnimationFrame(EC)}function TC(e){SC.delete(e)&&SC.size===0&&CC!=null&&(cancelAnimationFrame(CC),CC=null)}function EC(e){let t=new Set(SC);SC.clear();for(let n of t)try{n(e)}catch(e){console.error(e)}CC=SC.size>0?requestAnimationFrame(EC):null}function DC(e,t,n){if(e===t||e==null||t==null)return e===t;let r=new Set(n),i=Object.keys(e),a=new Set(Object.keys(t));for(let n of i)if(a.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(a))if(!r.has(e))return!1;return!0}function OC(e,t){return e==null||t==null||typeof e==`string`||typeof t==`string`?e===t:e.dark===t.dark&&e.light===t.light}function kC(e,t){let n=e?.theme??yp,r=t?.theme??yp,i=AC(e),a=AC(t);return OC(n,r)&&DC(e,t,[`theme`,`parseDiffOptions`])&&DC(i,a)}function AC(e){if(e!=null&&`parseDiffOptions`in e)return e.parseDiffOptions}function jC(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function MC({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:a}){let o=n+a*2,s=r?n+i*2:o;if(t=Math.max(t,s),o>=t||r){let n=Math.max(e-i,0),r=Math.min(e+s,t);return{top:n,bottom:Math.max(r,n)}}let c=e+n/2-o/2,l=c+o;return c<0&&(c=0),l>t&&(l=t),c=Math.floor(Math.max(c,0)),{top:c,bottom:Math.ceil(Math.max(Math.min(l,t),c))}}function NC(e){return{type:`text`,value:e}}function $({tagName:e,children:t=[],properties:n={}}){return{type:`element`,tagName:e,properties:n,children:t}}function PC({name:e,width:t=16,height:n=16,properties:r}){return $({tagName:`svg`,properties:{width:t,height:n,viewBox:`0 0 16 16`,...r},children:[$({tagName:`use`,properties:{href:`#${e.replace(/^#/,``)}`}})]})}function FC(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t;t=`children`in t?t.children[0]:null}}function IC(e){return $({tagName:`div`,properties:{"data-gutter":``},children:e})}function LC(e,t,n,r={}){return $({tagName:`div`,properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...r},children:t==null?void 0:[$({tagName:`span`,properties:{"data-line-number-content":``},children:[NC(`${t}`)]})]})}function RC(e,t,n){return $({tagName:`div`,properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t===`annotation`?void 0:e,style:t===`annotation`?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function zC(){return $({tagName:`button`,properties:{"data-utility-button":``,type:`button`},children:[PC({name:`diffs-icon-plus`,properties:{"data-icon":``}})]})}function BC(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function VC(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute(`data-utility-button`)||t.hasAttribute(`data-gutter-utility-slot`)||t.getAttribute(`slot`)===`gutter-utility-slot`||t.getAttribute(`name`)===`gutter-utility-slot`))return!0;return!1}var HC=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(),TC(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;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode===`gutterSelecting`&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.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||jC(e??void 0,this.selectedRange??void 0)),r=t?.lineNumberOnly??!1,i=t?.activeLineSide!==this.selectedRangeHighlightSide||r!==this.selectedRangeLineNumberOnly;(this.isSelectionDirty()||n||i)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=r,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:n}={}){let r=e!==this.editorActiveLine,i=n!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;(this.isSelectionDirty()||r||i)&&(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:r,onTokenClick:i,onMergeConflictActionClick:a}=this.options;(t!=null||n!=null||r!=null||a!=null||i!=null)&&(this.options.onGutterUtilityClick!=null&&VC(e.composedPath())||(cw(this.options.__debugPointerEvents,`click`,`FileDiff.DEBUG.handlePointerClick:`,e),this.handlePointerEvent({eventType:`click`,event:e})))};handlePointerMove=e=>{if(e.pointerType!==`mouse`)return;let{lineHoverHighlight:t=`disabled`,onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:a,enableGutterUtility:o=!1}=this.options;(t!==`disabled`||o||n!=null||r!=null||i!=null||a!=null)&&(cw(this.options.__debugPointerEvents,`move`,`FileDiff.DEBUG.handlePointerMove:`,e),this.handlePointerEvent({eventType:`move`,event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;if(cw(t,`move`,`FileDiff.DEBUG.handlePointerLeave: no event`),this.hoveredLine==null&&this.hoveredToken==null){cw(t,`move`,`FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token`);return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();cw(n,e,`FileDiff.DEBUG.handlePointerEvent:`,{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);cw(n,e,`FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:`,i);let{onLineClick:a,onLineNumberClick:o,onLineEnter:s,onLineLeave:c,onTokenClick:l,onTokenEnter:u,onTokenLeave:d,onHunkExpand:f,onMergeConflictActionClick:p}=this.options;switch(e){case`move`:{let e=qC(i)&&this.hoveredLine?.lineElement===i.lineElement;KC(i)&&this.hoveredToken?.tokenElement===i.tokenElement||(this.hoveredToken!=null&&(d?.(this.hoveredToken,t),this.clearHoveredToken()),KC(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(this.hoveredLine!=null&&(c?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),qC(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case`click`:{if(i==null)break;if(YC(i)&&p!=null){p(i);break}if(JC(i)&&f!=null){f(i.hunkIndex,i.all||t.shiftKey?`both`:i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!qC(i))break;KC(i)&&l!=null&&l(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);o!=null&&i.numberColumn?o({...e,event:t}):a?.({...e,event:t});break}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n=`disabled`,onLineClick:r,onLineNumberClick:i,onLineEnter:a,onLineLeave:o,onTokenClick:s,onTokenEnter:c,onTokenLeave:l,onHunkExpand:u,onMergeConflictActionClick:d,enableGutterUtility:f=!1,enableLineSelection:p=!1,onGutterUtilityClick:m}=this.options,h=m!=null,g=n!==`disabled`||r!=null||i!=null||a!=null||o!=null||s!=null||c!=null||l!=null||u!=null||d!=null||f||p||h;g&&!this.hasPointerListeners?(e.addEventListener(`click`,this.handlePointerClick),e.addEventListener(`pointerdown`,this.handlePointerDown),e.addEventListener(`pointermove`,this.handlePointerMove),e.addEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!0,cw(t,`click`,`FileDiff.DEBUG.attachEventListeners: Attaching click events for:`,(()=>{let e=[];return(t===`both`||t===`click`)&&(r!=null&&e.push(`onLineClick`),i!=null&&e.push(`onLineNumberClick`),u!=null&&e.push(`expandable hunk separators`),d!=null&&e.push(`merge conflict actions`)),e})()),cw(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer move event`),cw(t,`move`,`FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event`)):!g&&this.hasPointerListeners&&(e.removeEventListener(`click`,this.handlePointerClick),e.removeEventListener(`pointerdown`,this.handlePointerDown),e.removeEventListener(`pointermove`,this.handlePointerMove),e.removeEventListener(`pointerleave`,this.handlePointerLeave),this.hasPointerListeners=!1);let _=this.pointerSession.mode===`selecting`||this.pointerSession.mode===`pendingSingleLineUnselect`,v=this.pointerSession.mode===`gutterSelecting`;(!p&&_||!h&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=e!=null,i=t!=null||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute(`data-interactive-lines`,``),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute(`data-interactive-lines`),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute(`data-interactive-line-numbers`,``),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute(`data-interactive-line-numbers`),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType===`mouse`&&e.button!==0||this.pre==null||this.pointerSession.mode!==`idle`)return;let t=e.composedPath();VC(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!==`mouse`&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:`event-path`,requireNumberColumn:!0});if(n==null)return;let{pre:r}=this;if(r==null)return;let{lineNumber:i,eventSide:a,lineIndex:o}=n;if(e.shiftKey&&this.selectedRange!=null){let t=this.getIndexesFromSelection(this.selectedRange,r.getAttribute(`data-diff-type`)===`split`);if(t==null)return;let n=t.start<=t.end?o>=t.start:o<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:a};this.selectionAnchor=t,this.pointerSession={mode:`pendingSingleLineUnselect`,pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:a},this.updateSelection(i,a,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:`selecting`,pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{onGutterUtilityClick:t}=this.options;if(t==null)return;let n=this.currentSelectionEnds(),r=n?.bottom??this.resolveSelectionPoint(e,{source:`event-path`,excludeUtility:!1}),i=n?.top??r;r!=null&&i!=null&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:`gutterSelecting`,pointerId:e.pointerId,anchor:i,current:r},this.selectionAnchor={lineNumber:i.lineNumber,side:i.side},this.updateSelection(r.lineNumber,r.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(BC(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 r=this.resolveSelectionPoint(e,{source:`coordinates-first`});r!=null&&(n.current=r,this.updateSelection(r.lineNumber,r.side));let i=this.buildSelectedLineRange(n.anchor,n.current);t?.({...i}),this.selectionAnchor=void 0,this.notifySelectionEnd(i),this.notifySelectionCommitted(i),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&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute(`data-hovered`),this.hoveredLine.numberElement.removeAttribute(`data-hovered`),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t=`disabled`}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!==`disabled`&&((t===`both`||t===`line`)&&this.hoveredLine.lineElement.setAttribute(`data-hovered`,``),(t===`both`||t===`number`)&&this.hoveredLine.numberElement.setAttribute(`data-hovered`,``))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer??(this.gutterUtilityContainer=document.createElement(`div`),this.gutterUtilityContainer.setAttribute(`data-gutter-utility-slot`,``)),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot??(this.gutterUtilitySlot=document.createElement(`slot`),this.gutterUtilitySlot.name=`gutter-utility-slot`),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){let e=document.createElement(`div`);e.innerHTML=sv(zC());let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error(`InteractionManager.ensureGutterUtilityNode: Node element should be a button`);t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);GC(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(e==null)return!1;let t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(r!=null&&i!=null)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;let t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;let n=this.mode===`diff`?`${t[0]},${t[1]}`:`${t[0]}`,r=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(let t of r){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(QC(t));if(GC(n)&&(this.mode!==`diff`||e.side==null||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||=(document.addEventListener(`pointermove`,this.handleDocumentPointerMove),document.addEventListener(`pointerup`,this.handleDocumentPointerUp),document.addEventListener(`pointercancel`,this.handleDocumentPointerCancel),!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&=(document.removeEventListener(`pointermove`,this.handleDocumentPointerMove),document.removeEventListener(`pointerup`,this.handleDocumentPointerUp),document.removeEventListener(`pointercancel`,this.handleDocumentPointerCancel),!1)}clearPointerSession(){this.pointerSession={mode:`idle`}}clearPendingSingleLineState(){this.pointerSession.mode===`pendingSingleLineUnselect`&&(this.pointerSession={mode:`idle`})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(GC(n)&&(!t||n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode===`diff`?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionInfoFromPath(n,t.requireNumberColumn)}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(GC(t))return{lineNumber:t.lineNumber,side:this.mode===`diff`?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return n==null?void 0:this.selectionPointFromPath(n)}resolveSelectionPath(e,t){let n=t.excludeUtility!==!1;switch(t.source){case`event-path`:return this.pathFromEventPath(e.composedPath(),n);case`coordinates-first`:{let t=this.pathFromCoordinates(e,n);return t===void 0?this.pathFromEventPath(e.composedPath(),n):t??void 0}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&VC(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=QC(e);if(t&&VC(n))return;let r=$C(e);return r==null?this.pathFromAnnotationSlot(e):QC(r)}pathFromAnnotationSlot(e){let t=ew(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute(`data-line`)||t.hasAttribute(`data-column-number`)))return QC(t);let n=nw(tw(e));if(n==null)return;let r=this.targetForSelectionPoint(n);return r==null?void 0:QC(r.lineElement)}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=rw(t)?t:rw(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return n==null?[e-1,e-1]:n(e,t)}getCurrentSelectionRange(){return this.proposedSelectedRange===void 0?this.selectedRange:this.proposedSelectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r=this.getCurrentSelectionRange(),i;if(e==null)i=null;else{let n=this.selectionAnchor?.side??t,r=this.selectionAnchor?.lineNumber??e;i=this.buildSelectionRange(r,e,n,t)}jC(r??void 0,i??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=i:(this.selectedRange=i,wC(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&r!=null?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}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 r=this.getIndexesFromSelection(e.range,t);if(r==null)throw console.error({rowRange:r,range:e.range}),Error(`InteractionManager.renderSelection: No valid ${n} rowRange`);return r}getLineRenderColumns(e,t,n,r){if(this.pre==null||t==null&&r==null)return[];let{children:i}=this.pre;if(i.length>2)throw console.error(i),Error(`InteractionManager.renderSelection: Somehow there are more than 2 code elements...`);let a=[];for(let o of i){let i=o.hasAttribute(`data-deletions`)?`deletions`:o.hasAttribute(`data-additions`)?`additions`:void 0,s=e!=null&&t!=null&&(e.highlightSide==null||i==null||e.highlightSide===i),c=n!=null&&r!=null&&(n.highlightSide==null||i==null||n.highlightSide===i);if(!s&&!c)continue;let[l,u]=o.children;if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))throw Error(`InteractionManager.renderSelection: missing gutter or content element`);if(u.children.length!==l.children.length)throw Error(`InteractionManager.renderSelection: gutter and content children dont match, something is wrong`);a.push({content:u,gutter:l,renderEditorActiveLine:c,renderSelectedLines:s})}return a}renderSelection=()=>{TC(this.renderSelection);let e=this.getSelectionRenderState();if(this.pre==null)return;let{editorActiveLine:t,selectedLines:n}=e,r=!aw(this.renderedSelectedLinesState,n),i=!aw(this.renderedEditorActiveLineState,t);if(!r&&!i)return;r&&(this.renderedSelectedLinesState=void 0),i&&(this.renderedEditorActiveLineState=void 0);let a=this.pre.getAttribute(`data-diff-type`)===`split`,o=r?this.resolveLineRenderRange(n,a,`selected-lines`):void 0,s=i?this.resolveLineRenderRange(t,a,`editor-active-line`):void 0,c=this.getLineRenderColumns(r?n:void 0,o,i?t:void 0,s),l=n.range==null||c.some(e=>e.renderSelectedLines),u=t.range==null||c.some(e=>e.renderEditorActiveLine);if(r)for(let e of this.pre.querySelectorAll(`[data-selected-line]`))e.removeAttribute(`data-selected-line`);if(i)for(let e of this.pre.querySelectorAll(`[data-editor-active-line]`))e.removeAttribute(`data-editor-active-line`);let d=o==null?void 0:Math.min(o.start,o.end),f=o==null?void 0:Math.max(o.start,o.end),p=d===f,m=s?.start;for(let e of c){let{content:r,gutter:i,renderEditorActiveLine:o,renderSelectedLines:s}=e,c=Math.max(s?f??-1/0:-1/0,o?m??-1/0:-1/0),l=r.children.length;for(let e=0;e<l;e++){let l=r.children[e],u=i.children[e];if(!(l instanceof HTMLElement)||!(u instanceof HTMLElement))continue;let h=this.parseLineIndex(l,a);if((h??0)>c)break;if(h!=null){if(s&&d!=null&&f!=null&&h>=d&&h<=f){let e=p?`single`:h===d?`first`:h===f?`last`:``;u.setAttribute(`data-selected-line`,e),n.lineNumberOnly||(l.setAttribute(`data-selected-line`,e),u.nextSibling instanceof HTMLElement&&l.nextSibling instanceof HTMLElement&&(l.nextSibling.hasAttribute(`data-line-annotation`)||l.nextSibling.hasAttribute(`data-merge-conflict-actions`))&&(p?(e=`last`,l.setAttribute(`data-selected-line`,`first`)):h===d?e=``:h===f&&l.setAttribute(`data-selected-line`,``),l.nextSibling.setAttribute(`data-selected-line`,e),u.nextSibling.setAttribute(`data-selected-line`,e)))}o&&h===m&&(u.setAttribute(`data-editor-active-line`,``),t.lineNumberOnly||l.setAttribute(`data-editor-active-line`,``))}}}r&&l&&(this.renderedSelectedLinesState=n),i&&u&&(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){return this.mode===`file`?{type:`line`,lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:`diff-line`,annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}){return this.mode===`file`?{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:a}:{type:`token`,lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:a}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...n==null?{}:{side:n},...n!==r&&r!=null?{endSide:r}:{}}}resolvePointerTarget(e){let t=!1,n,r,i,a,o,s,c,l,u,d;for(let f of e){if(!(f instanceof HTMLElement))continue;if(d==null&&f.hasAttribute(`data-merge-conflict-action`)){let e=f.getAttribute(`data-merge-conflict-action`)??void 0,t=f.getAttribute(`data-merge-conflict-conflict-index`)??void 0,n=t==null?NaN:Number.parseInt(t,10);XC(e)&&Number.isFinite(n)&&(d={kind:`merge-conflict-action`,resolution:e,conflictIndex:n})}if(s==null&&f.hasAttribute(`data-char`)){s=f;let e=f.getAttribute(`data-char`);if(e!=null){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??``,n=t+e.length;(e.trim()!==``||this.options.enableTokenInteractionsOnWhitespace===!0)&&(c={tokenElement:s,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=o==null?f.getAttribute(`data-column-number`)??void 0:void 0;if(e!=null){o=f,u=Number.parseInt(e,10),t=!0,n=sw(f),a=f.getAttribute(`data-line-index`)??void 0;continue}let p=i==null?f.getAttribute(`data-line`)??void 0:void 0;if(p!=null){i=f,u=Number.parseInt(p,10),n=sw(f),a=f.getAttribute(`data-line-index`)??void 0;continue}if(l==null&&(f.hasAttribute(`data-expand-button`)||f.hasAttribute(`data-unmodified-lines`))){l={hunkIndex:void 0,direction:f.hasAttribute(`data-expand-up`)?`up`:f.hasAttribute(`data-expand-down`)?`down`:`both`,all:f.hasAttribute(`data-expand-all-button`)};continue}let m=l==null?void 0:f.getAttribute(`data-expand-index`)??void 0;if(l!=null&&m!=null){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(r==null&&f.hasAttribute(`data-code`)){r=f;break}}if(d!=null)return d;if(l?.hunkIndex!=null)return{type:`line-info`,hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(i??=a==null?void 0:ZC(r,`[data-line][data-line-index="${a}"]`),o??=a==null?void 0:ZC(r,`[data-column-number][data-line-index="${a}"]`),r==null||i==null||o==null||n==null||u==null||Number.isNaN(u))return;let f=this.parseLineIndex(i,this.isSplitDiff());return c==null?this.mode===`file`?{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f}:{kind:`line`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:ow(n,r),splitLineIndex:f}:this.mode===`file`?{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:void 0,splitLineIndex:f,...c}:{kind:`token`,lineType:n,lineElement:i,lineNumber:u,numberColumn:t,numberElement:o,side:ow(n,r),splitLineIndex:f,...c}}isSplitDiff(){return this.pre?.getAttribute(`data-diff-type`)===`split`}parseLineIndex(e,t){let n=(e.getAttribute(`data-line-index`)??``).split(`,`).map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function UC({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,renderGutterUtility:d,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v},y,b,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:WC({enableGutterUtility:t,renderGutterUtility:d,onGutterUtilityClick:r}),usesCustomGutterUtility:d!=null,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:a,onLineLeave:o,onLineNumberClick:s,onTokenClick:c,onTokenEnter:l,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:p,controlledSelection:m,onLineSelected:h,onLineSelectionStart:g,onLineSelectionChange:_,onLineSelectionEnd:v,getLineIndex:b}}function WC({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 GC(e){return e!=null&&`kind`in e&&e.kind===`line`}function KC(e){return e!=null&&`kind`in e&&e.kind===`token`}function qC(e){return GC(e)||KC(e)}function JC(e){return`type`in e&&e.type===`line-info`}function YC(e){return`kind`in e&&e.kind===`merge-conflict-action`}function XC(e){return e===`current`||e===`incoming`||e===`both`}function ZC(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function QC(e){let t=[],n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function $C(e){let t=e.closest(`[data-line], [data-column-number]`);if(t instanceof HTMLElement)return t;let n=e.closest(`[data-line-annotation], [data-gutter-buffer="annotation"]`);if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute(`data-line`)||r.hasAttribute(`data-column-number`))?r:void 0}function ew(e){let t=e.closest(`[slot^="annotation-"]`),n=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName===`SLOT`?e:void 0)?.closest(`[data-line-annotation]`);return n instanceof HTMLElement?n:void 0}function tw(e){let t=e.closest(`[slot^="annotation-"]`);if(t instanceof HTMLElement)return t.getAttribute(`slot`)??void 0;if(e instanceof HTMLElement){let t=e.getAttribute(`name`)??void 0;return t!=null&&t.startsWith(`annotation-`)?t:void 0}}function nw(e){if(e==null)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;let n=Number.parseInt(t[2],10);if(!(!Number.isFinite(n)||n<=0))return{lineNumber:n,side:t[1]}}function rw(e){return e!=null&&typeof e.elementFromPoint==`function`}function iw(e,t){return e===t||jC(e??void 0,t??void 0)}function aw(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&iw(e?.range??null,t.range)}function ow(e,t){switch(e){case`change-deletion`:return`deletions`;case`change-addition`:return`additions`;default:return t.hasAttribute(`data-deletions`)?`deletions`:`additions`}}function sw(e){let t=e.getAttribute(`data-line-type`);if(t!=null)switch(t){case`change-deletion`:case`change-addition`:case`context`:case`context-expanded`:return t;default:return}}function cw(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}console.log(...n)}var lw=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(t==null)continue;let i=n.get(t);i==null?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,{disableAnnotations:t,columnVariables:n=`apply`}){let r=new Set,i=n===`apply`,a=0,o=new Map(this.observedNodes);this.observedNodes.clear();for(let t of e.children){if(a===2)break;let e=(()=>{if(t instanceof HTMLElement&&t.tagName===`CODE`)return t})();if(e==null)continue;a++;let n=o.get(e);if(n!=null&&n.type!==`code`)throw Error(`ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible`);let r=e.firstElementChild;r instanceof HTMLElement||(r=null),n==null?(n={type:`code`,codeElement:e,numberElement:r,codeWidth:`auto`,numberWidth:0,applyColumnVariables:i},this.observedNodes.set(e,n),this.observe(e),r!=null&&(this.observedNodes.set(r,n),this.observe(r))):(this.observedNodes.set(e,n),o.delete(e),n.numberElement===r?n.numberElement==null?n.numberWidth=0:(o.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):(n.numberElement!=null&&(this.unobserve(n.numberElement),o.delete(n.numberElement)),r!=null&&(this.observe(r),o.delete(r),this.observedNodes.set(r,n)),n.numberElement=r,n.numberWidth=0),fw(n,i))}if(a>1&&!t){let t=e.querySelectorAll(`[data-line-annotation*=","]`),n=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute(`data-line-annotation`)??``;if(!/^-?\d+,-?\d+$/.test(t)){console.error(`DiffFileRenderer.setupResizeObserver: Invalid element or annotation`,{lineAnnotation:t,element:e});continue}let r=n.get(t);r??(r=[],n.set(t,r)),r.push(e)}for(let[e,t]of n){if(t.length!==2){console.error(`DiffFileRenderer.setupResizeObserver: Bad Pair`,e,t);continue}let[n,i]=t,a=n.firstElementChild,s=i.firstElementChild;if(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let c=o.get(a);if(c!=null){this.observedNodes.set(a,c),this.observedNodes.set(s,c),o.delete(a),o.delete(s);continue}let l=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;c={type:`annotations`,column1:{container:n,child:a,childHeight:l},column2:{container:i,child:s,childHeight:u},currentHeight:`auto`},r.add({child1:a,child2:s,item:c,newHeight:Math.max(l,u)})}for(let e of r)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);r.clear()}for(let[e,t]of o)this.unobserve(e),t.type===`code`?hw(t):gw(t);o.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(r!=null&&r!==this)throw Error(`ResizeManager.observe: element is already owned by another ResizeManager`);n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(i!=null){if(i!==this)throw Error(`ResizeManager.unobserve: element is owned by another ResizeManager`);n.delete(t),r?.unobserve(t),r!=null&&n.size===0&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:a}=r;if(!(e instanceof HTMLElement)){console.error(`ResizeManager.handleResizeEntries: Invalid element for ResizeObserver`,r);continue}let o=this.observedNodes.get(e);if(o==null){console.error(`ResizeManager.handleResizeEntries: Not a valid observed node`,r);continue}if(o.type===`annotations`){let t=(()=>{if(e===o.column1.child)return o.column1;if(e===o.column2.child)return o.column2})();if(t==null){console.error(`ResizeManager.handleResizeEntries: Couldn't find a column for`,{item:o,target:e});continue}t.childHeight=i[0].blockSize,n.add(o)}else if(o.type===`code`){let n=t.get(o)??{},r=a[0].inlineSize;e===o.codeElement?n.codeInlineSize=r:e===o.numberElement&&(n.numberInlineSize=r),t.set(o,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=n.codeInlineSize==null?t.codeWidth:uw(n.codeInlineSize),r=n.numberInlineSize==null?t.numberWidth:dw(n.numberInlineSize),i=e!==t.codeWidth,a=r!==t.numberWidth;(i||a)&&(t.codeWidth=e,t.numberWidth=r,t.applyColumnVariables&&pw(t,{codeWidthChanged:i,numberWidthChanged:a}))}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`),e.column2.container.style.setProperty(`--diffs-annotation-min-height`,`${e.currentHeight}px`))}};function uw(e){let t=Math.max(Math.floor(e),0);return t===0?`auto`:t}function dw(e){return Math.max(Math.ceil(e),0)}function fw(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?pw(e,{codeWidthChanged:!0,numberWidthChanged:!0}):mw(e))}function pw(e,{codeWidthChanged:t,numberWidthChanged:n}){let{codeElement:r,codeWidth:i,numberWidth:a}=e;if(t&&r.style.setProperty(`--diffs-column-width`,`${typeof i==`number`?`${i}px`:`auto`}`),n&&r.style.setProperty(`--diffs-column-number-width`,`${a===0?`auto`:`${a}px`}`),t||n&&i!==`auto`){let e=typeof i==`number`?Math.max(i-a,0):0;r.style.setProperty(`--diffs-column-content-width`,`${e>0?`${e}px`:`auto`}`)}}function mw(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 hw(e){e.codeElement.isConnected&&mw(e)}function gw(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty(`--diffs-annotation-min-height`),e.column2.container.isConnected&&e.column2.container.style.removeProperty(`--diffs-annotation-min-height`)}function _w(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function vw(e){return $({tagName:`div`,children:[$({tagName:`div`,children:e.annotations?.map(e=>$({tagName:`slot`,properties:{name:e}})),properties:{"data-annotation-content":``}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function yw(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 bw({fileOrDiff:e,mode:t,stickyHeader:n}){let r=`type`in e?e:void 0,i={"data-diffs-header":t,"data-change-type":r?.type,"data-sticky":n?``:void 0};return $({tagName:`div`,children:[t===`custom`?$({tagName:`slot`,properties:{name:vp}}):xw({name:e.name,prevName:`prevName`in e?e.prevName:void 0,iconType:r?.type??`file`}),...t===`custom`?[]:[Sw(r)]],properties:i})}function xw({name:e,prevName:t,iconType:n}){let r=[$({tagName:`slot`,properties:{name:hp}}),PC({name:yw(n),properties:{"data-change-icon":n}})];return t!=null&&(r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[NC(t)]})],properties:{"data-prev-name":``}})),r.push(PC({name:`diffs-icon-arrow-right-short`,properties:{"data-rename-icon":``}}))),r.push($({tagName:`div`,children:[$({tagName:`bdi`,children:[NC(e)]})],properties:{"data-title":``}})),r.push($({tagName:`slot`,properties:{name:gp}})),$({tagName:`div`,children:r,properties:{"data-header-content":``}})}function Sw(e){let t=[];if(e!=null){let n=0,r=0;for(let t of e.hunks)n+=t.additionLines,r+=t.deletionLines;(r>0||n===0)&&t.push($({tagName:`span`,children:[NC(`-${r}`)],properties:{"data-deletions-count":``}})),(n>0||r===0)&&t.push($({tagName:`span`,children:[NC(`+${n}`)],properties:{"data-additions-count":``}}))}return t.push($({tagName:`slot`,properties:{name:_p}})),$({tagName:`div`,children:t,properties:{"data-metadata":``}})}function Cw(e){return $({tagName:`pre`,properties:ww(e)})}function ww({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:r,split:i,totalLines:a,type:o,customProperties:s}){return{...s,"data-diff":o===`diff`?``:void 0,"data-file":o===`file`?``:void 0,"data-diff-type":o===`diff`?i?`split`:`single`:void 0,"data-overflow":r,"data-disable-line-numbers":n?``:void 0,"data-background":t?void 0:``,"data-indicators":e===`bars`||e===`classic`?e:void 0,style:`--diffs-min-number-column-width-default:${`${a}`.length}ch;`}}var Tw=new Map,Ew={"1c":`1c`,abap:`abap`,as:`actionscript-3`,ada:`ada`,adb:`ada`,ads:`ada`,adoc:`asciidoc`,asciidoc:`asciidoc`,"component.html":`angular-html`,"component.ts":`angular-ts`,conf:`nginx`,htaccess:`apache`,cls:`tex`,trigger:`apex`,apl:`apl`,applescript:`applescript`,scpt:`applescript`,ara:`ara`,asm:`asm`,s:`riscv`,astro:`astro`,awk:`awk`,bal:`ballerina`,sh:`zsh`,bash:`zsh`,bat:`cmd`,cmd:`cmd`,be:`berry`,beancount:`beancount`,bib:`bibtex`,bicep:`bicep`,"blade.php":`blade`,bsl:`bsl`,c:`c`,h:`objective-cpp`,cs:`csharp`,cpp:`cpp`,hpp:`cpp`,cc:`cpp`,cxx:`cpp`,hh:`cpp`,cdc:`cdc`,cairo:`cairo`,clar:`clarity`,clj:`clojure`,cljs:`clojure`,cljc:`clojure`,soy:`soy`,cmake:`cmake`,"CMakeLists.txt":`cmake`,cob:`cobol`,cbl:`cobol`,cobol:`cobol`,CODEOWNERS:`codeowners`,ql:`ql`,coffee:`coffeescript`,lisp:`lisp`,cl:`lisp`,lsp:`lisp`,log:`log`,v:`verilog`,cql:`cql`,cr:`crystal`,css:`css`,csv:`csv`,cue:`cue`,cypher:`cypher`,cyp:`cypher`,d:`d`,dart:`dart`,dax:`dax`,desktop:`desktop`,diff:`diff`,patch:`diff`,Dockerfile:`dockerfile`,dockerfile:`dockerfile`,env:`dotenv`,dm:`dream-maker`,edge:`edge`,el:`emacs-lisp`,ex:`elixir`,exs:`elixir`,elm:`elm`,erb:`erb`,erl:`erlang`,hrl:`erlang`,f:`fortran-fixed-form`,for:`fortran-fixed-form`,fs:`fsharp`,fsi:`fsharp`,fsx:`fsharp`,f03:`f03`,f08:`f08`,f18:`f18`,f77:`f77`,f90:`fortran-free-form`,f95:`fortran-free-form`,fnl:`fennel`,fish:`fish`,ftl:`ftl`,tres:`gdresource`,res:`gdresource`,gd:`gdscript`,gdshader:`gdshader`,gs:`genie`,feature:`gherkin`,COMMIT_EDITMSG:`git-commit`,"git-rebase-todo":`git-rebase`,gjs:`glimmer-js`,gleam:`gleam`,gts:`glimmer-ts`,glsl:`glsl`,vert:`glsl`,frag:`glsl`,shader:`shaderlab`,gp:`gnuplot`,plt:`gnuplot`,gnuplot:`gnuplot`,go:`go`,graphql:`graphql`,gql:`graphql`,groovy:`groovy`,gvy:`groovy`,hack:`hack`,haml:`haml`,hbs:`handlebars`,handlebars:`handlebars`,hs:`haskell`,lhs:`haskell`,hx:`haxe`,hcl:`hcl`,hjson:`hjson`,hlsl:`hlsl`,fx:`hlsl`,html:`html`,htm:`html`,http:`http`,rest:`http`,hxml:`hxml`,hy:`hy`,imba:`imba`,ini:`ini`,cfg:`ini`,jade:`pug`,pug:`pug`,java:`java`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jinja:`jinja`,jinja2:`jinja`,j2:`jinja`,jison:`jison`,jl:`julia`,json:`json`,json5:`json5`,jsonc:`jsonc`,jsonl:`jsonl`,jsonnet:`jsonnet`,libsonnet:`jsonnet`,jssm:`jssm`,jsx:`jsx`,kt:`kotlin`,kts:`kts`,kql:`kusto`,tex:`tex`,ltx:`tex`,lean:`lean4`,less:`less`,liquid:`liquid`,lit:`lit`,ll:`llvm`,logo:`logo`,lua:`lua`,luau:`luau`,Makefile:`makefile`,mk:`makefile`,makefile:`makefile`,md:`markdown`,markdown:`markdown`,marko:`marko`,m:`wolfram`,mat:`matlab`,mdc:`mdc`,mdx:`mdx`,wiki:`wikitext`,mediawiki:`wikitext`,mmd:`mermaid`,mermaid:`mermaid`,mips:`mipsasm`,mojo:`mojo`,"🔥":`mojo`,move:`move`,nar:`narrat`,nf:`nextflow`,nim:`nim`,nims:`nim`,nimble:`nim`,nix:`nix`,nu:`nushell`,mm:`objective-cpp`,ml:`ocaml`,mli:`ocaml`,mll:`ocaml`,mly:`ocaml`,pas:`pascal`,p:`pascal`,pl:`prolog`,pm:`perl`,t:`perl`,raku:`raku`,p6:`raku`,pl6:`raku`,php:`php`,phtml:`php`,pls:`plsql`,sql:`sql`,po:`po`,polar:`polar`,pcss:`postcss`,pot:`pot`,potx:`potx`,pq:`powerquery`,pqm:`powerquery`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,prisma:`prisma`,pro:`prolog`,P:`prolog`,properties:`properties`,proto:`protobuf`,pp:`puppet`,purs:`purescript`,py:`python`,pyw:`python`,pyi:`python`,qml:`qml`,qmldir:`qmldir`,qss:`qss`,r:`r`,R:`r`,rkt:`racket`,rktl:`racket`,razor:`razor`,cshtml:`razor`,rb:`ruby`,rbw:`ruby`,reg:`reg`,regex:`regexp`,rel:`rel`,rs:`rust`,rst:`rst`,rake:`ruby`,gemspec:`ruby`,jbuilder:`ruby`,builder:`ruby`,rabl:`ruby`,arb:`ruby`,ru:`ruby`,podspec:`ruby`,Gemfile:`ruby`,Rakefile:`ruby`,Guardfile:`ruby`,Capfile:`ruby`,Berksfile:`ruby`,Brewfile:`ruby`,Vagrantfile:`ruby`,Thorfile:`ruby`,Appraisals:`ruby`,Dangerfile:`ruby`,sas:`sas`,sass:`sass`,scala:`scala`,sc:`scala`,scm:`scheme`,ss:`scheme`,sld:`scheme`,scss:`scss`,sdbl:`sdbl`,shadergraph:`shader`,st:`smalltalk`,sol:`solidity`,sparql:`sparql`,rq:`sparql`,spl:`splunk`,config:`ssh-config`,do:`stata`,ado:`stata`,dta:`stata`,styl:`stylus`,stylus:`stylus`,svelte:`svelte`,swift:`swift`,sv:`system-verilog`,svh:`system-verilog`,service:`systemd`,socket:`systemd`,device:`systemd`,timer:`systemd`,talon:`talonscript`,tasl:`tasl`,tcl:`tcl`,templ:`templ`,tf:`tf`,tfvars:`tfvars`,toml:`toml`,ts:`typescript`,mts:`typescript`,cts:`typescript`,tsp:`typespec`,tsv:`tsv`,tsx:`tsx`,ttl:`turtle`,twig:`twig`,typ:`typst`,vv:`v`,vala:`vala`,vapi:`vala`,vb:`vb`,vbs:`vb`,bas:`vb`,vh:`verilog`,vhd:`vhdl`,vhdl:`vhdl`,vim:`vimscript`,vue:`vue`,"vine.ts":`vue-vine`,vy:`vyper`,wasm:`wasm`,wat:`wasm`,wy:`文言`,wgsl:`wgsl`,wit:`wit`,wl:`wolfram`,nb:`wolfram`,xml:`xml`,xsl:`xsl`,xslt:`xsl`,yaml:`yaml`,yml:`yml`,zs:`zenscript`,zig:`zig`,zsh:`zsh`,sty:`tex`};function Dw(e){if(Tw.has(e))return Tw.get(e)??`text`;if(Ew[e]!=null)return Ew[e];let t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(Tw.has(t[1]))return Tw.get(t[1])??`text`;if(Ew[t[1]]!=null)return Ew[t[1]]??`text`}let n=e.match(/\.([^.]+)$/)?.[1]??``;return Tw.has(n)?Tw.get(n)??`text`:Ew[n]??`text`}function Ow(e,{theme:t,preferredHighlighter:n=`shiki-js`}){return{langs:Array.isArray(e)?e:[e??`text`],themes:NS(t),preferredHighlighter:n}}function kw(e){return`annotation-${`side`in e?`${e.side}-`:``}${e.lineNumber}`}function Aw(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function jw(e,t,n){let r=typeof n.lineInfo==`function`?n.lineInfo(t):n.lineInfo[t-1];if(r==null){let r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),Error(r)}return e.tagName=`div`,e.properties[`data-line`]=r.lineNumber,e.properties[`data-alt-line`]=r.altLineNumber,e.properties[`data-line-type`]=r.type,e.properties[`data-line-index`]=r.lineIndex,e.children.length===0&&e.children.push(NC(`
232
- `)),e}var Mw=Symbol(`no-token`),Nw=Symbol(`multiple-tokens`);function Pw(e){let t=Fw(e);if(t!=null)return t;let n=Mw,r=[],i=[],a,o=()=>{if(i.length===0||a==null){i=[],a=void 0;return}if(i.length===1){let e=i[0];if(e?.type===`element`){Lw(e,a);for(let t of e.children)Iw(t)}else Iw(e);r.push(e),i=[],a=void 0;return}for(let e of i)Iw(e);r.push($({tagName:`span`,properties:{"data-char":a},children:i})),i=[],a=void 0},s=e=>{if(e!==Mw){if(e===Nw){n=Nw;return}if(n===Mw){n=e;return}n!==e&&(n=Nw)}};for(let t of e.children){let e=t.type===`element`?Pw(t):Mw;if(s(e),typeof e!=`number`){o(),r.push(t);continue}a!=null&&a!==e&&o(),a??=e,i.push(t)}return o(),e.children=r,n}function Fw(e){let t=e.properties[`data-char`];if(typeof t==`number`)return t}function Iw(e){if(e.type===`element`){e.properties[`data-char`]=void 0;for(let t of e.children)Iw(t)}}function Lw(e,t){e.properties[`data-char`]=t}function Rw(e={}){let{classPrefix:t=`__shiki_`,classSuffix:n=``,classReplacer:r=e=>e}=e,i=new Map;function a(e){return Object.entries(e).map(([e,t])=>`${e}:${t}`).join(`;`)}function o(e){let o=typeof e==`string`?e:a(e),s=t+zw(o)+n;return s=r(s),i.has(s)||i.set(s,typeof e==`string`?e:{...e}),s}return{name:`@shikijs/transformers:style-to-class`,pre(e){if(!e.properties.style)return;let t=o(e.properties.style);delete e.properties.style,this.addClassToHast(e,t)},tokens(e){for(let t of e)for(let e of t){if(!e.htmlStyle)continue;let t=o(e.htmlStyle);e.htmlStyle={},e.htmlAttrs||={},e.htmlAttrs.class?e.htmlAttrs.class+=` ${t}`:e.htmlAttrs.class=t}},getClassRegistry(){return i},getCSS(){let e=``;for(let[t,n]of i.entries())e+=`.${t}{${typeof n==`string`?n:a(n)}}`;return e},clearRegistry(){i.clear()}}}function zw(e,t=0){let n=3735928559^t,r=1103547991^t;for(let t=0,i;t<e.length;t++)i=e.charCodeAt(t),n=Math.imul(n^i,2654435761),r=Math.imul(r^i,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36).slice(0,6)}function Bw(e=!1,t=!1){let n={lineInfo:[]},r=[{line(e){return delete e.properties.class,e},pre(t){let r=FC(t),i=[];if(r!=null){let t=1;for(let a of r.children)a.type===`element`&&(e&&Pw(a),i.push(jw(a,t,n)),t++);r.children=i}return t},...e?{tokens(e){for(let t of e){let e=0;for(let n of t){let t=n;t.__lineChar??=e,e+=n.content.length}}},preprocess(e,t){t.mergeWhitespaces=`never`},span(e,t,n,r,i){if(i?.offset!=null&&i.content!=null){let t=i.__lineChar;return t!=null&&(e.properties[`data-char`]=t),e}return e}}:null}];return t&&r.push(Hw,Vw),e&&r.push({line:e=>(e.type===`element`&&e.children.length===0&&e.children.push({type:`element`,tagName:`br`,properties:{},children:[]}),e)}),{state:n,transformers:r,toClass:Vw}}var Vw=Rw({classPrefix:`hl-`}),Hw={name:`token-style-normalizer`,tokens(e){for(let t of e)for(let e of t){if(e.htmlStyle!=null)continue;let t={};e.color!=null&&(t.color=e.color),e.bgColor!=null&&(t[`background-color`]=e.bgColor),e.fontStyle!=null&&e.fontStyle!==0&&(e.fontStyle&1&&(t[`font-style`]=`italic`),e.fontStyle&2&&(t[`font-weight`]=`bold`),e.fontStyle&4&&(t[`text-decoration`]=`underline`)),Object.keys(t).length>0&&(e.htmlStyle=t)}}};function Uw(e){return`--${e===`token`?`diffs-token`:`diffs`}-`}var Ww=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Gw=/^0(?:\.0+)?%?$/;function Kw(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function qw(e){let t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;let n=t[1],r,i=1;return n.length===3?r=n.split(``).map(e=>e+e).join(``):n.length===6?r=n:(r=n.slice(0,6),i=parseInt(n.slice(6,8),16)/255),[parseInt(r.slice(0,2),16),parseInt(r.slice(2,4),16),parseInt(r.slice(4,6),16),i]}function Jw(e){if(e==null)return null;let t=qw(e);if(t==null)return null;let n=t[0]/255,r=t[1]/255,i=t[2]/255,a=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4;return .2126*a(n)+.7152*a(r)+.0722*a(i)}function Yw(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||Ww.test(t))return!0;let n=Kw(t);return n!=null&&Gw.test(n)}function Xw(e,t,n){if(t==null||n==null)return!1;let r=Jw(e),i=Jw(t),a=Jw(n);return r==null||i==null||a==null?!1:Math.abs(r-a)<Math.abs(r-i)}var Zw=new WeakMap;function Qw(e){let t=Zw.get(e);if(t!=null)return t;let n=e.colors??{},r={...n},i=n[`editor.background`]??e.bg,a=n[`editor.foreground`]??e.fg,o=n[`sideBar.background`]??i,s=n[`sideBar.foreground`]??a;$w(r,`editor.background`,i),$w(r,`editor.foreground`,a),$w(r,`sideBar.background`,o),$w(r,`sideBar.foreground`,s),$w(r,`input.background`,n[`input.background`]??o),$w(r,`sideBarSectionHeader.foreground`,n[`sideBarSectionHeader.foreground`]??s),$w(r,`list.activeSelectionForeground`,n[`list.activeSelectionForeground`]??s),$w(r,`gitDecoration.addedResourceForeground`,eT(n[`gitDecoration.addedResourceForeground`],n[`terminal.ansiGreen`],n[`editorGutter.addedBackground`])),$w(r,`gitDecoration.modifiedResourceForeground`,eT(n[`gitDecoration.modifiedResourceForeground`],n[`terminal.ansiBlue`],n[`editorGutter.modifiedBackground`])),$w(r,`gitDecoration.deletedResourceForeground`,eT(n[`gitDecoration.deletedResourceForeground`],n[`terminal.ansiRed`],n[`editorGutter.deletedBackground`]));let c=(Yw(n[`list.focusOutline`])?void 0:n[`list.focusOutline`])??(Yw(n.focusBorder)?void 0:n.focusBorder);c==null?delete r[`list.focusOutline`]:r[`list.focusOutline`]=c;let l=n[`list.hoverBackground`];l!=null&&(tT(l,o)||Xw(l,o,s))&&delete r[`list.hoverBackground`];let u=Object.freeze({...e,colors:Object.freeze(r)});return Zw.set(e,u),u}function $w(e,t,n){n!=null&&n!==``&&(e[t]=n)}function eT(...e){for(let t of e)if(t!=null&&t!==``)return t}function tT(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function nT({theme:e=yp,highlighter:t,prefix:n}){let r=``;if(typeof e==`string`){let i=t.getTheme(e),a=Qw(i);r+=`color:${a.fg};`,r+=`background-color:${a.bg};`,r+=`${Uw(`global`)}fg:${a.fg};`,r+=`${Uw(`global`)}bg:${a.bg};`,r+=rT(i,n)}else{let n=t.getTheme(e.dark),i=Qw(n);r+=`${Uw(`global`)}dark:${i.fg};`,r+=`${Uw(`global`)}dark-bg:${i.bg};`,r+=rT(n,`dark`),n=t.getTheme(e.light),i=Qw(n),r+=`${Uw(`global`)}light:${i.fg};`,r+=`${Uw(`global`)}light-bg:${i.bg};`,r+=rT(n,`light`)}return r}function rT(e,t){t=t==null?``:`${t}-`;let n=``,r=e.colors?.[`gitDecoration.addedResourceForeground`]??e.colors?.[`terminal.ansiGreen`];r!=null&&(n+=`${Uw(`global`)}${t}addition-color:${r};`);let i=e.colors?.[`gitDecoration.deletedResourceForeground`]??e.colors?.[`terminal.ansiRed`];i!=null&&(n+=`${Uw(`global`)}${t}deletion-color:${i};`);let a=e.colors?.[`gitDecoration.modifiedResourceForeground`]??e.colors?.[`terminal.ansiBlue`];return a!=null&&(n+=`${Uw(`global`)}${t}modified-color:${a};`),n}function iT(e){let t=e.children[0];for(;t!=null;){if(t.type===`element`&&t.tagName===`code`)return t.children;t=`children`in t?t.children[0]:null}throw console.error(e),Error(`getLineNodes: Unable to find children`)}function aT(e,t){for(let n of t)e.push(n)}var oT=`-1,-1`;function sT(e){return e?.some(e=>e.lineNumber===0)??!1}function cT(e){let t=e[0];return t!=null&&t.length>0?t:void 0}function lT(e){return e.startingLine===0&&e.totalLines>0}function uT(e,t){return e.endsWith(`\r
233
- `)?t+`\r
234
- `:e.endsWith(`\r`)?t+`\r`:e.endsWith(`
235
- `)?t+`
236
- `:t}function dT(e,t){return $({tagName:`div`,children:e,properties:{"data-content":``,style:`grid-row: span ${t}`}})}var fT=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
237
- <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
238
- <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"/>
239
- </symbol>
240
- <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
241
- <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"/>
242
- </symbol>
243
- <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
244
- <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"/>
245
- </symbol>
246
- <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
247
- <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"/>
248
- </symbol>
249
- <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
250
- <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"/>
251
- </symbol>
252
- <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
253
- <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"/>
254
- </symbol>
255
- <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
256
- <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"/>
257
- </symbol>
258
- <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
259
- <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"/>
260
- </symbol>
261
- <symbol id="diffs-icon-eye-slash" viewBox="0 0 16 16">
262
- <path d="m13.47 1.47-12 12 1.06 1.06 12-12zM8 14c-.92 0-1.802-.208-2.624-.547l1.173-1.174c.476.142.963.221 1.451.221 1.66 0 3.307-.949 4.626-2.196a10.4 10.4 0 0 0 1.494-1.751A5 5 0 0 0 14.443 8a5 5 0 0 0-.323-.553 10 10 0 0 0-1.238-1.5l1.061-1.062C15.222 6.173 16 7.511 16 8c0 1.05-3.582 6-8 6"/><path d="M8 11q-.084 0-.167-.005l3.162-3.162q.006.083.005.167a3 3 0 0 1-3 3M5.005 8.167l3.162-3.162a3 3 0 0 0-3.162 3.162"/><path d="M8 3.5c.485 0 .97.081 1.445.227l1.168-1.169C9.794 2.212 8.915 2 8 2 3.582 2 0 6.8 0 8c0 .555.766 1.88 2.027 3.144l1.06-1.06a9.5 9.5 0 0 1-1.203-1.461 4.3 4.3 0 0 1-.345-.617L1.536 8l.003-.006c.064-.149.176-.359.345-.617a9.8 9.8 0 0 1 1.482-1.73C4.675 4.427 6.326 3.5 8 3.5"/>
263
- </symbol>
264
- <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
265
- <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"/>
266
- </symbol>
267
- <symbol id="diffs-icon-plus" viewBox="0 0 16 16">
268
- <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"/>
269
- </symbol>
270
- <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
271
- <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"/>
272
- </symbol>
273
- <symbol id="diffs-icon-symbol-added-duo" viewBox="0 0 16 16">
274
- <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><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"/>
275
- </symbol>
276
- <symbol id="diffs-icon-symbol-added-fill" viewBox="0 0 16 16">
277
- <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 4a.75.75 0 0 0-.75.75v2.5h-2.5a.75.75 0 0 0 0 1.5h2.5v2.5a.75.75 0 0 0 1.5 0v-2.5h2.5a.75.75 0 0 0 0-1.5h-2.5v-2.5A.75.75 0 0 0 8 4" clip-rule="evenodd"/>
278
- </symbol>
279
- <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
280
- <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"/>
281
- </symbol>
282
- <symbol id="diffs-icon-symbol-deleted-duo" viewBox="0 0 16 16">
283
- <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><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"/>
284
- </symbol>
285
- <symbol id="diffs-icon-symbol-deleted-fill" viewBox="0 0 16 16">
286
- <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M4.75 7.25a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/>
287
- </symbol>
288
- <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
289
- <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"/>
290
- </symbol>
291
- <symbol id="diffs-icon-symbol-diffstat-duo" viewBox="0 0 16 16">
292
- <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><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"/>
293
- </symbol>
294
- <symbol id="diffs-icon-symbol-diffstat-fill" viewBox="0 0 16 16">
295
- <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5zM8 3.546a.75.75 0 0 0-.75.75V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2V4.296a.75.75 0 0 0-.75-.75" clip-rule="evenodd"/>
296
- </symbol>
297
- <symbol id="diffs-icon-symbol-extracted" viewBox="0 0 16 16">
298
- <path d="M8.25 4.25a.75.75 0 0 1 0 1.5H6.81l3.302 3.302a1.5 1.5 0 1 1-1.06 1.06L5.75 6.811V8.25a.75.75 0 0 1-1.5 0V5A.75.75 0 0 1 5 4.25z"/><path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 1.5c-1.613 0-2.807.089-3.704.288-.88.196-1.382.477-1.706.802-.325.324-.606.826-.802 1.706C1.588 5.193 1.5 6.387 1.5 8s.089 2.807.288 3.704c.196.88.477 1.382.802 1.706.324.325.826.606 1.706.802.897.2 2.091.288 3.704.288s2.807-.089 3.704-.288c.88-.196 1.382-.477 1.706-.802.325-.324.606-.826.802-1.706.2-.897.288-2.091.288-3.704s-.089-2.807-.288-3.704c-.196-.88-.477-1.382-.802-1.706-.324-.325-.826-.606-1.706-.802C10.807 1.588 9.613 1.5 8 1.5" clip-rule="evenodd"/>
299
- </symbol>
300
- <symbol id="diffs-icon-symbol-extracted-duo" viewBox="0 0 16 16">
301
- <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8" clip-rule="evenodd" opacity=".2"/><path d="M8.25 4.25a.75.75 0 0 1 0 1.5H6.81l3.302 3.302a1.5 1.5 0 1 1-1.06 1.06L5.75 6.811V8.25a.75.75 0 0 1-1.5 0V5A.75.75 0 0 1 5 4.25z"/>
302
- </symbol>
303
- <symbol id="diffs-icon-symbol-extracted-fill" viewBox="0 0 16 16">
304
- <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5 4.25a.75.75 0 0 0-.75.75v3.25a.75.75 0 0 0 1.5 0V6.81l3.302 3.302a1.5 1.5 0 1 0 1.06-1.06L6.811 5.75H8.25a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/>
305
- </symbol>
306
- <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
307
- <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"/>
308
- </symbol>
309
- <symbol id="diffs-icon-symbol-ignored-duo" viewBox="0 0 16 16">
310
- <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M11.53 4.47a.75.75 0 0 1 0 1.06l-6 6a.75.75 0 0 1-1.06-1.06l6-6a.75.75 0 0 1 1.06 0"/>
311
- </symbol>
312
- <symbol id="diffs-icon-symbol-ignored-fill" viewBox="0 0 16 16">
313
- <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m3.53 4.47a.75.75 0 0 0-1.06 0l-6 6a.75.75 0 1 0 1.06 1.06l6-6a.75.75 0 0 0 0-1.06" clip-rule="evenodd"/>
314
- </symbol>
315
- <symbol id="diffs-icon-symbol-inlined" viewBox="0 0 16 16">
316
- <path d="M7.75 11.75a.75.75 0 0 1 0-1.5h1.44L5.887 6.948a1.5 1.5 0 1 1 1.06-1.06l3.302 3.301V7.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-.75.75z"/><path fill-rule="evenodd" d="M8 16c-6.588 0-8-1.412-8-8s1.412-8 8-8 8 1.412 8 8-1.412 8-8 8m0-1.5c1.613 0 2.807-.089 3.704-.288.88-.196 1.382-.477 1.706-.802.325-.324.606-.826.802-1.706.2-.897.288-2.091.288-3.704s-.089-2.807-.288-3.704c-.196-.88-.477-1.382-.802-1.706-.324-.325-.826-.606-1.706-.802C10.807 1.588 9.613 1.5 8 1.5s-2.807.089-3.704.288c-.88.196-1.382.477-1.706.802-.325.324-.606.826-.802 1.706C1.588 5.193 1.5 6.387 1.5 8s.089 2.807.288 3.704c.196.88.477 1.382.802 1.706.324.325.826.606 1.706.802.897.2 2.091.288 3.704.288" clip-rule="evenodd"/>
317
- </symbol>
318
- <symbol id="diffs-icon-symbol-inlined-duo" viewBox="0 0 16 16">
319
- <path fill-rule="evenodd" d="M8 16c-6.588 0-8-1.412-8-8s1.412-8 8-8 8 1.412 8 8-1.412 8-8 8" clip-rule="evenodd" opacity=".2"/><path d="M7.75 11.75a.75.75 0 0 1 0-1.5h1.44L5.887 6.948a1.5 1.5 0 1 1 1.06-1.06l3.302 3.301V7.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-.75.75z"/>
320
- </symbol>
321
- <symbol id="diffs-icon-symbol-inlined-fill" viewBox="0 0 16 16">
322
- <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5.5 4a1.5 1.5 0 1 0 .388 2.948l3.301 3.302H7.75a.75.75 0 0 0 0 1.5H11a.75.75 0 0 0 .75-.75V7.75a.75.75 0 0 0-1.5 0v1.44L6.948 5.887A1.5 1.5 0 0 0 5.5 4" clip-rule="evenodd"/>
323
- </symbol>
324
- <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
325
- <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"/>
326
- </symbol>
327
- <symbol id="diffs-icon-symbol-modified-duo" viewBox="0 0 16 16">
328
- <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0"/>
329
- </symbol>
330
- <symbol id="diffs-icon-symbol-modified-fill" viewBox="0 0 16 16">
331
- <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 5a3 3 0 1 0 0 6 3 3 0 0 0 0-6" clip-rule="evenodd"/>
332
- </symbol>
333
- <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
334
- <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"/>
335
- </symbol>
336
- <symbol id="diffs-icon-symbol-moved-duo" viewBox="0 0 16 16">
337
- <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8.496 4.695a.75.75 0 0 0-.051 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-.051 1.06L6.49 8.003 4.693 9.998a.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"/>
338
- </symbol>
339
- <symbol id="diffs-icon-symbol-moved-fill" viewBox="0 0 16 16">
340
- <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m1.555 4.745a.75.75 0 0 0-1.11 1.01L10.486 8l-2.04 2.245a.75.75 0 0 0 1.109 1.01l2.5-2.75a.75.75 0 0 0 0-1.01zm-4 0a.75.75 0 0 0-1.11 1.01l2.043 2.248-1.796 1.995a.75.75 0 0 0 1.116 1.004l2.25-2.5a.75.75 0 0 0-.003-1.007z" clip-rule="evenodd"/>
341
- </symbol>
342
- <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
343
- <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"/>
344
- </symbol>
345
- </svg>`;function pT(e,t){return e==null||t==null?e===t:hT(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 mT={};function hT(e=mT,t=mT){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}function gT(e){let t=document.createElement(`div`);return t.dataset.annotationSlot=``,t.slot=e,t.style.whiteSpace=`normal`,t}function _T(){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 vT(){let e=document.createElement(`style`);return e.setAttribute(xp,``),e}var yT=`@layer base,theme,rendered,unsafe;@layer base{:host{--diffs-font-fallback:"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace;--diffs-header-font-fallback:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;--diffs-mixer:light-dark(#000,#fff);--diffs-gap-fallback:8px;--diffs-scrollbar-gutter-fallback:6px;--diffs-scrollbar-gutter:var(--diffs-scrollbar-gutter-override,var(--diffs-scrollbar-gutter-measured,var(--diffs-scrollbar-gutter-fallback)));--diffs-added-light:#0dbe4e;--diffs-added-dark:#5ecc71;--diffs-modified-light:#009fff;--diffs-modified-dark:#69b1ff;--diffs-deleted-light:#ff2e3f;--diffs-deleted-dark:#ff6762;--diffs-warning-light:#d5a910;--diffs-warning-dark:#ffd452;color-scheme:light dark;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);font-feature-settings:var(--diffs-font-features);--diffs-bg:light-dark(var(--diffs-light-bg,#fff),var(--diffs-dark-bg,#000));--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))));--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))));--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))));--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))));--diffs-fg:light-dark(var(--diffs-light,#000),var(--diffs-dark,#fff));--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))));--diffs-fg-conflict-marker:var(--diffs-fg-conflict-marker-override,var(--diffs-fg-number));--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)))));--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)))));--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)))));--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))));--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)));--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))));--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)));--diffs-selection-base:var(--diffs-modified-base);--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)));background-color:var(--diffs-bg);color:var(--diffs-fg);display:block}pre,code,[data-error-wrapper]{isolation:isolate;font-family:var(--diffs-font-family,var(--diffs-font-fallback));outline:none;margin:0;padding:0;display:block}pre,code{background-color:var(--diffs-bg)}code{contain:content}input,button{font-family:inherit;font-size:inherit;line-height:inherit}*,:before,:after{box-sizing:border-box}[data-icon-sprite]{display:none}[data-diffs-header],[data-separator]{font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback))}[data-diffs-header][data-sticky]{z-index:1;background-color:var(--diffs-bg);position:sticky;top:0}[data-file-info]{color:var(--fg);background-color:color-mix(in lab, var(--bg) 98%, var(--fg));border-block:1px solid color-mix(in lab, var(--bg) 95%, var(--fg));padding:10px;font-weight:700}[data-diff],[data-file]{--diffs-grid-number-column-width:minmax(min-content, max-content);--diffs-code-grid:var(--diffs-grid-number-column-width) 1fr;&[data-dehydrated]{--diffs-code-grid:var(--diffs-grid-number-column-width) minmax(0, 1fr)}&:hover [data-code]::-webkit-scrollbar-thumb{background-color:var(--diffs-bg-context)}}@supports (-webkit-touch-callout:none){:host{--diffs-scrollbar-gutter-fallback:0px}}[data-line] span,[data-edit-prediction-suffix] span{color:light-dark(var(--diffs-token-light,var(--diffs-light)),var(--diffs-token-dark,var(--diffs-dark)));background-color:light-dark(var(--diffs-token-light-bg,inherit),var(--diffs-token-dark-bg,inherit));font-weight:light-dark(var(--diffs-token-light-font-weight,inherit),var(--diffs-token-dark-font-weight,inherit));font-style:light-dark(var(--diffs-token-light-font-style,inherit),var(--diffs-token-dark-font-style,inherit));text-decoration:light-dark(var(--diffs-token-light-text-decoration,inherit),var(--diffs-token-dark-text-decoration,inherit))}[data-line],[data-gutter-buffer],[data-column-number],[data-line-annotation],[data-no-newline],[data-merge-conflict],[data-merge-conflict-actions],[data-editor-overlay]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-computed-editor-active-line-bg:var(--diffs-computed-selected-line-bg);--diffs-computed-hovered-line-bg:var(--diffs-computed-editor-active-line-bg);--diffs-hover-mix-target:var(--diffs-bg-hover-override,var(--diffs-mixer));--diffs-line-bg:var(--diffs-computed-hovered-line-bg);color:var(--diffs-fg);background-color:var(--diffs-line-bg,var(--diffs-bg))}[data-line],[data-no-newline]{&[data-decoration-bg]{--mix-deco-light:92%;--mix-deco-dark:85%;&[data-decoration-bg-depth="2"]{--mix-deco-light:88%;--mix-deco-dark:80%}&[data-decoration-bg-depth="3"]{--mix-deco-light:85%;--mix-deco-dark:78%}--diffs-hover-mix-target:var(--diffs-decoration-bg);--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) var(--mix-deco-light), var(--diffs-decoration-bg)),color-mix(in lab, var(--diffs-bg) var(--mix-deco-dark), var(--diffs-decoration-bg)))}}[data-line-annotation],[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context);--diffs-computed-decoration-bg:var(--diffs-annotation-bg);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[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]{--diffs-computed-decoration-bg:var(--diffs-bg-context);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-gutter-buffer=merge-conflict-marker-start],[data-merge-conflict=marker-start]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))));--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-gutter-buffer=merge-conflict-marker-end],[data-merge-conflict=marker-end]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))));--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-has-merge-conflict] [data-line-annotation],[data-has-merge-conflict] [data-gutter-buffer=annotation]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}:where([data-background]){& [data-gutter-buffer],& [data-column-number]{--mix-light:91%;--mix-dark:85%}& [data-line],& [data-no-newline]{--mix-light:88%;--mix-dark:80%}& [data-gutter-buffer],& [data-column-number],& [data-line],& [data-no-newline]{--diffs-diff-line-mix-target:var(--diffs-bg);&[data-line-type=change-deletion]{--diffs-diff-line-mix-target:var(--diffs-bg-deletion-override,var(--diffs-deletion-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-deletion-override,var(--diffs-deletion-base));--diffs-diff-line-mix-target:var(--diffs-bg-deletion-number-override,var(--diffs-deletion-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}&[data-line-type=change-addition]{--diffs-diff-line-mix-target:var(--diffs-bg-addition-override,var(--diffs-addition-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--diffs-bg-addition-number-override,var(--diffs-addition-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}&[data-merge-conflict=current]{--diffs-diff-line-mix-target:var(--conflict-bg-current-override,var(--diffs-addition-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--conflict-bg-current-number-override,var(--diffs-addition-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}&[data-merge-conflict=incoming]{--diffs-diff-line-mix-target:var(--conflict-bg-incoming-override,var(--diffs-modified-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-modified-base);--diffs-diff-line-mix-target:var(--conflict-bg-incoming-number-override,var(--diffs-modified-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}}}[data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline],[data-editor-overlay]{--diffs-selection-mix-target:var(--diffs-bg-selection-override,var(--diffs-selection-base));--diffs-selection-emphasis-mix-target:var(--diffs-selection-mix-target);&:where([data-editor-overlay]),&:where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline])[data-selected-line]{--mix-selection-light:82%;--mix-selection-dark:75%;--diffs-hover-mix-target:var(--diffs-selection-mix-target)}&:where([data-gutter-buffer][data-selected-line],[data-column-number]:is([data-selected-line],[data-editor-active-line])){--mix-selection-light:75%;--mix-selection-dark:60%;--diffs-selection-mix-target:var(--diffs-bg-selection-number-override,var(--diffs-selection-base));--diffs-hover-mix-target:var(--diffs-selection-mix-target)}&:where([data-line][data-selected-line]):is([data-line-type=change-addition],[data-line-type=change-deletion]){--diffs-selection-emphasis-mix-target:light-dark(color-mix(in lab, var(--diffs-diff-line-mix-target,var(--diffs-selection-mix-target)) var(--mix-selection-light), var(--diffs-selection-mix-target)),var(--diffs-selection-mix-target))}&:where([data-editor-overlay]),&[data-selected-line]{--diffs-computed-selected-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-light), var(--diffs-selection-mix-target)),color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-dark), var(--diffs-selection-mix-target)))}}[data-line][data-editor-active-line],[data-column-number][data-editor-active-line]{--diffs-computed-editor-active-line-bg:color-mix(in lab, var(--diffs-computed-selected-line-bg) var(--diffs-editor-active-line-source-mix,100%), var(--diffs-selection-emphasis-mix-target))}@media (pointer:fine){[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]{--diffs-computed-hovered-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-editor-active-line-bg) 97%, var(--diffs-hover-mix-target)),color-mix(in lab, var(--diffs-computed-editor-active-line-bg) 91%, var(--diffs-hover-mix-target)))}}[data-gutter-buffer][data-selected-line],[data-column-number]:is([data-selected-line],[data-editor-active-line]){color:var(--diffs-selection-number-fg)}[data-no-newline]{user-select:none;& span{opacity:.6}}[data-diff-type=split][data-overflow=scroll]{grid-template-columns:1fr 1fr;display:grid;& [data-additions]{border-left:1px solid var(--diffs-bg)}& [data-deletions]{border-right:1px solid var(--diffs-bg)}}[data-code]{grid-auto-flow:dense;grid-template-columns:var(--diffs-code-grid);overflow:var(--diffs-overflow-override,scroll) clip;overscroll-behavior-x:none;tab-size:var(--diffs-tab-size,2);padding-top:var(--diffs-gap-block,var(--diffs-gap-fallback));padding-bottom:max(0px, calc(var(--diffs-gap-block,var(--diffs-gap-fallback)) - var(--diffs-scrollbar-gutter)));scrollbar-gutter:stable;align-self:flex-start;display:grid}[data-diffs-scrollbar-measure]{opacity:0;pointer-events:none;scrollbar-gutter:auto;grid-template-columns:none;width:100px;height:100px;padding:0;position:absolute;top:-200px;left:-200px}[data-container-size]{container-type:inline-size}[data-code]::-webkit-scrollbar{width:0;height:var(--diffs-scrollbar-gutter)}[data-code]::-webkit-scrollbar-track{background:0 0}[data-code]::-webkit-scrollbar-thumb{background-color:#0000;background-clip:content-box;border:1px solid #0000;border-radius:3px}[data-code]::-webkit-scrollbar-corner{background-color:#0000}@supports ((-moz-appearance:none)){[data-code]{scrollbar-width:thin;scrollbar-color:var(--diffs-bg-context) transparent;padding-bottom:var(--diffs-gap-block,var(--diffs-gap-fallback))}}[data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]{& [data-code],&[data-overflow=wrap],&[data-dehydrated][data-diff-type=split][data-overflow=scroll]{padding-top:0}}[data-gutter]{grid-template-rows:subgrid;grid-template-columns:subgrid;z-index:3;background-color:var(--diffs-bg);grid-column:1;display:grid;position:relative;& [data-gutter-buffer],& [data-column-number]{border-right:var(--diffs-gap-style,2px solid var(--diffs-bg))}}[data-content]{grid-template-rows:subgrid;grid-template-columns:subgrid;background-color:var(--diffs-bg);grid-column:2;min-width:0;display:grid}[data-diff-type=split][data-overflow=wrap],[data-dehydrated][data-diff-type=split][data-overflow=scroll]{grid-auto-flow:dense;grid-template-columns:repeat(2, var(--diffs-code-grid));padding-block:var(--diffs-gap-block,var(--diffs-gap-fallback));display:grid;& [data-code]{display:contents}& [data-deletions]{& [data-gutter]{grid-column:1}& [data-content]{border-right:1px solid var(--diffs-bg);grid-column:2}}& [data-additions]{& [data-gutter]{border-left:1px solid var(--diffs-bg);grid-column:3}& [data-content]{grid-column:4}}}[data-dehydrated][data-diff-type=split][data-overflow=scroll] [data-content]{overflow:clip}[data-overflow=scroll] [data-gutter]{position:sticky;left:0}[data-interactive-lines] [data-line]{cursor:pointer}[data-interactive-line-numbers] [data-column-number]{cursor:pointer;touch-action:none}[data-content-buffer],[data-gutter-buffer]{user-select:none;min-height:1lh;position:relative}[data-gutter-buffer]{padding-left:2ch;padding-right:1ch;&:before{content:"";min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));display:block}}[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context-gutter);min-height:0}[data-gutter-buffer=buffer]{--diffs-line-bg:var(--diffs-bg-context-gutter)}[data-content-buffer]{background-position:5px 0;background-size:8px 8px;background-origin:border-box;background-image:repeating-linear-gradient(-45deg, transparent, transparent calc(3px * 1.414), var(--diffs-bg-buffer) calc(3px * 1.414), var(--diffs-bg-buffer) calc(4px * 1.414));grid-column:1}[data-separator]{box-sizing:content-box;background-color:var(--diffs-bg)}[data-separator=simple]{min-height:4px}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata],[data-separator=simple]{background-color:var(--diffs-bg-separator)}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata]{height:32px;position:relative}[data-separator-wrapper]{user-select:none;fill:currentColor;background-color:var(--diffs-bg);align-items:center;height:100%;display:flex;position:absolute;inset-inline:0}[data-content] [data-separator-wrapper]{display:none}[data-separator=metadata] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;color:var(--diffs-fg-number);white-space:nowrap;text-overflow:ellipsis;min-width:min-content;padding-inline:1ch;inset-inline:100% auto;overflow:hidden}[data-separator=line-info]{margin-block:var(--diffs-gap-block,var(--diffs-gap-fallback));& [data-separator-wrapper]{min-width:16px}}[data-separator=line-info-basic],[data-separator=metadata]{margin-block:0}[data-separator=line-info][data-separator-first]{margin-top:0}[data-separator=line-info][data-separator-last]{margin-bottom:0}[data-expand-index] [data-separator-wrapper]{grid-template-columns:32px auto;display:grid}[data-expand-index] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:32px 32px auto}[data-expand-button],[data-separator-content]{background-color:var(--diffs-bg-separator);flex:none;align-items:center;display:flex}[data-expand-index] [data-separator-content]:hover{cursor:pointer;text-decoration:underline}[data-expand-button]{cursor:pointer;min-width:32px;color:var(--diffs-fg-number);border-right:2px solid var(--diffs-bg);flex-shrink:0;justify-content:center;align-self:stretch;&:hover{color:var(--diffs-fg)}&[data-expand-all-button]{display:none}}[data-expand-down] [data-icon]{transform:scaleY(-1)}[data-separator-content]{height:100%;color:var(--diffs-fg-number);flex:auto;justify-content:flex-start;padding:0 1ch;overflow:hidden}[data-separator=line-info],[data-separator=line-info-basic]{& [data-separator-content]{user-select:none;height:100%;overflow:clip}}[data-unmodified-lines]{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;display:block;overflow:hidden}@supports (width:1cqi){[data-unified]{& [data-separator=line-info] [data-separator-wrapper]{padding-inline:var(--diffs-gap-inline,var(--diffs-gap-fallback));width:100cqi;& [data-separator-content]{border-radius:6px}}& [data-separator=line-info][data-expand-index] [data-separator-wrapper] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}}[data-gutter]{& [data-separator=line-info] [data-separator-wrapper]{padding-left:var(--diffs-gap-inline,var(--diffs-gap-fallback))}& [data-separator=line-info] [data-separator-content]{border-top-left-radius:6px;border-bottom-left-radius:6px}& [data-separator=line-info][data-expand-index] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}}[data-additions]{& [data-content] [data-separator=line-info]{background-color:var(--diffs-bg);& [data-separator-wrapper]{display:none}}& [data-gutter] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);border-top-right-radius:6px;border-bottom-right-radius:6px;height:100%;display:block;& [data-separator-content],& [data-expand-button]{display:none}}}[data-overflow=scroll] [data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]{width:calc(100cqi - var(--diffs-gap-inline,var(--diffs-gap-fallback)))}[data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;margin-right:var(--diffs-gap-inline,var(--diffs-gap-fallback));border-top-right-radius:6px;border-bottom-right-radius:6px;display:block;& [data-separator-content],& [data-expand-button]{display:none}}[data-separator=line-info] [data-separator-wrapper]{& [data-expand-both],& [data-expand-down],& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}}@media (pointer:fine){[data-separator=line-info] [data-separator-wrapper]{&[data-separator-multi-button]{& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:unset}& [data-expand-down]{border-bottom-left-radius:6px;border-top-left-radius:unset}}}}}@media (pointer:coarse){[data-separator=line-info-basic] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px 34px auto;& [data-separator-content]{grid-column:unset;grid-row:unset}}@supports (width:1cqi){[data-separator=line-info] [data-separator-wrapper]{& [data-expand-both],& [data-expand-down],& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}&[data-separator-multi-button]{& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}& [data-expand-down]{border-bottom-left-radius:unset;border-top-left-radius:unset}}}}}@media (pointer:fine){[data-separator-wrapper][data-separator-multi-button]{grid-template-rows:50% 50%;display:grid;& [data-separator-content]{grid-area:1/2/-1;min-width:min-content}& [data-expand-button]{grid-column:1}}[data-separator=line-info] [data-separator-wrapper],[data-separator=line-info] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px auto}[data-separator=line-info-basic][data-expand-index] [data-separator-wrapper]{grid-template-columns:100% auto}[data-separator=line-info],[data-separator=line-info-basic]{& [data-separator-multi-button]{& [data-expand-up]{border-bottom:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}& [data-expand-down]{border-top:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}}}}[data-additions] [data-gutter] [data-separator-wrapper],[data-additions] [data-separator=line-info-basic] [data-separator-wrapper],[data-content] [data-separator-wrapper]{display:none}[data-line-annotation]{min-height:var(--diffs-annotation-min-height,0);z-index:2}[data-merge-conflict-actions]{z-index:2}[data-separator=custom]{grid-template-columns:subgrid;display:grid}[data-line],[data-column-number],[data-no-newline]{padding-inline:1ch;position:relative}[data-indicators=classic] [data-line]{padding-inline-start:2ch}[data-indicators=classic]{& [data-line-type=change-addition],& [data-line-type=change-deletion]{&[data-no-newline],&[data-line]{&:before{user-select:none;width:1ch;height:1lh;display:inline-block;position:absolute;top:0;left:0}}}& [data-line-type=change-addition]{&[data-line],&[data-no-newline]{&:before{content:"+";color:var(--diffs-addition-base)}}}& [data-line-type=change-deletion]{&[data-line],&[data-no-newline]{&:before{content:"-";color:var(--diffs-deletion-base)}}}}[data-indicators=bars]{& [data-line-type=change-deletion],& [data-line-type=change-addition]{&[data-column-number]{&:before{content:"";user-select:none;contain:strict;width:4px;height:100%;display:block;position:absolute;top:0;left:0}}}& [data-line-type=change-deletion]{&[data-column-number]{&:before{background-image:linear-gradient(0deg, var(--diffs-bg-deletion) 50%, var(--diffs-deletion-base) 50%);background-repeat:repeat;background-size:2px 2px;background-size:calc(1lh / round(1lh / 2px)) calc(1lh / round(1lh / 2px))}}}& [data-line-type=change-addition]{&[data-column-number]{&:before{background-color:var(--diffs-addition-base)}}}}[data-overflow=wrap]{& [data-line]{white-space:pre-wrap;word-break:break-word}& [data-annotation-content]{word-break:break-word}}[data-overflow=scroll] [data-line]{white-space:pre;min-height:1lh}[data-column-number]{box-sizing:content-box;text-align:right;user-select:none;color:var(--diffs-fg-number);padding-left:2ch}[data-line-number-content]{min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));z-index:1;display:inline-block;position:relative}[data-disable-line-numbers]{& [data-gutter-buffer],& [data-column-number]{min-width:4px;padding:0;&:before{min-width:0}}& [data-line-number-content]{display:none}& [data-gutter-utility-slot]{right:unset;justify-content:flex-start;left:0}&[data-indicators=bars] [data-gutter-utility-slot]{left:6px}}[data-file][data-disable-line-numbers]{& [data-gutter-buffer],& [data-column-number]{border-right:0;min-width:0}}[data-diff-span]{box-decoration-break:clone;border-radius:3px}[data-line-type=change-addition] [data-diff-span]{background-color:var(--diffs-bg-addition-emphasis)}[data-line-type=change-deletion] [data-diff-span]{background-color:var(--diffs-bg-deletion-emphasis)}[data-merge-conflict=marker-start],[data-merge-conflict=marker-base],[data-merge-conflict=marker-separator],[data-merge-conflict=marker-end]{color:var(--diffs-fg);padding-left:1ch}[data-merge-conflict=marker-start],[data-merge-conflict=marker-end]{align-items:center;display:flex;&:after{color:var(--diffs-fg-conflict-marker);font-size:.75rem;font-style:normal;line-height:1.25rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));padding-left:1ch}}[data-merge-conflict=marker-start]:after{content:"(Current Change)"}[data-merge-conflict=marker-end]:after{content:"(Incoming Change)"}[data-merge-conflict-actions-content]{min-height:1.75rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));color:var(--diffs-fg);align-items:center;gap:.25rem;padding-inline:.5rem;font-size:.75rem;line-height:1.2;display:flex}[data-merge-conflict-action]{appearance:none;color:var(--diffs-fg-number);font:inherit;cursor:pointer;background:0 0;border:0;padding:0;font-style:normal}[data-merge-conflict-action]:hover{color:var(--diffs-fg)}[data-merge-conflict-action=current]:hover{color:var(--diffs-addition-base)}[data-merge-conflict-action=incoming]:hover{color:var(--diffs-modified-base)}[data-merge-conflict-action-separator]{color:var(--diffs-fg-number);opacity:.6;user-select:none}[data-diffs-header=default]{background-color:var(--diffs-bg);justify-content:space-between;align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));min-height:calc(1lh + (var(--diffs-gap-block,var(--diffs-gap-fallback)) * 3));z-index:2;flex-direction:row;padding-inline:16px;display:flex;position:relative;top:0}[data-header-content]{align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));white-space:nowrap;flex-direction:row;min-width:0;display:flex}[data-header-content] [data-prev-name],[data-header-content] [data-title]{text-overflow:ellipsis;white-space:nowrap;direction:rtl;min-width:0;overflow:hidden}[data-prev-name]{opacity:.7}[data-rename-icon]{fill:currentColor;flex-grow:0;flex-shrink:0}[data-diffs-header=default] [data-metadata]{white-space:nowrap;align-items:center;gap:1ch;display:flex}[data-diffs-header=default] [data-additions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-addition-base)}[data-diffs-header=default] [data-deletions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-deletion-base)}[data-change-icon]{fill:currentColor;flex-shrink:0}[data-change-icon=change],[data-change-icon=rename-pure],[data-change-icon=rename-changed]{color:var(--diffs-modified-base)}[data-change-icon=new]{color:var(--diffs-addition-base)}[data-change-icon=deleted]{color:var(--diffs-deletion-base)}[data-change-icon=file]{opacity:.6}[data-annotation-content]{z-index:2;isolation:isolate;white-space:normal;align-self:flex-start;min-width:0;display:flow-root;position:relative}[data-overflow=scroll] [data-annotation-content],[data-overflow=scroll] [data-merge-conflict-actions-content]{width:var(--diffs-column-content-width,auto);left:var(--diffs-column-number-width,0);position:sticky}[data-annotation-slot]{text-wrap-mode:wrap;word-break:normal;white-space-collapse:collapse}[data-gutter-utility-slot]{touch-action:none;justify-content:flex-end;display:flex;position:absolute;top:0;bottom:0;right:0}[data-utility-button]{appearance:none;cursor:pointer;width:1lh;height:1lh;font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);background-color:var(--diffs-modified-base);color:var(--diffs-bg);fill:currentColor;z-index:4;touch-action:none;border:none;border-radius:4px;justify-content:center;align-items:center;margin-right:calc(-1lh + 1ch);padding:0;display:flex;position:relative;&:before{content:"";display:block;position:absolute;inset:0 0 0 -4px}}[data-decoration-bar-stack]{pointer-events:none;isolation:isolate;z-index:1;background-color:var(--diffs-decoration-bar-color,transparent);box-sizing:content-box;border-left:2px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg);width:6px;position:absolute;top:0;bottom:0;right:-2px;[data-decoration-bar-depth="1"] &{background-color:color-mix(in lab, var(--diffs-bg) 20%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="2"] &{background-color:color-mix(in lab, var(--diffs-bg) 45%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="3"] &{background-color:color-mix(in lab, var(--diffs-bg) 65%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-start] &{border-top-left-radius:5px;border-top-right-radius:5px}[data-decoration-bar-end] &{z-index:3;border-bottom-right-radius:5px;border-bottom-left-radius:5px}}[data-placeholder]{contain:strict}[data-error-wrapper]{padding:var(--diffs-gap-block,var(--diffs-gap-fallback)) var(--diffs-gap-inline,var(--diffs-gap-fallback));scrollbar-width:none;max-height:400px;overflow:auto;& [data-error-message]{color:var(--diffs-deletion-base);font-size:18px;font-weight:700}& [data-error-stack]{color:var(--diffs-fg-number)}}}@layer theme,rendered,unsafe;
346
- `,bT;function xT(e){if(bT!=null)return bT;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(Sp,`true`);let r=document.createElement(`div`);return r.style.position=`relative`,r.style.width=`200%`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n),bT=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),bT}function ST(e){return`${Cp}: ${e==null?`var(--diffs-scrollbar-gutter-fallback)`:`${e}px`};`}var CT=`@layer base, theme, rendered, unsafe;`,wT=RegExp(`${OT(Cp)}\\s*:\\s*[^;]+;`);function TT(e){return`${CT}
347
- @layer unsafe {
348
- ${e}
349
- }`}function ET(e,t=`system`,n){return`${CT}
350
- @layer rendered {
351
- :host {${t===`system`?``:`
352
- color-scheme: ${t};`}
353
- ${ST(n)}
354
- ${e}
355
- }
356
- }`}function DT(e,t){let n=ST(t);return e.replace(wT,n)}function OT(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var kT=new WeakMap;function AT(e){return kT.get(e)??e}function jT({code:e,pre:t,columnType:n,rowSpan:r,containerSize:i=!1}={}){return e??(e=document.createElement(`code`),e.setAttribute(`data-code`,``),n!=null&&e.setAttribute(`data-${n}`,``),t?.appendChild(e)),r==null?e.style.removeProperty(`grid-row`):e.style.setProperty(`grid-row`,`span ${r}`),i?e.setAttribute(`data-container-size`,``):e.removeAttribute(`data-container-size`),e}function MT(e,t){if(t==null)return;let n=e.shadowRoot??e.attachShadow({mode:`open`});n.innerHTML===``&&(n.innerHTML=t)}function NT(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:a,split:o,totalLines:s,customProperties:c}){if(c!=null)for(let t in c){let n=c[t];n!=null&&e.setAttribute(t,`${n}`)}switch(t===`diff`?(e.setAttribute(`data-diff`,``),e.removeAttribute(`data-file`)):(e.setAttribute(`data-file`,``),e.removeAttribute(`data-diff`)),n){case`bars`:case`classic`:e.setAttribute(`data-indicators`,n);break;case`none`:e.removeAttribute(`data-indicators`)}return i?e.setAttribute(`data-disable-line-numbers`,``):e.removeAttribute(`data-disable-line-numbers`),r?e.removeAttribute(`data-background`):e.setAttribute(`data-background`,``),t===`diff`?e.setAttribute(`data-diff-type`,o?`split`:`single`):e.removeAttribute(`data-diff-type`),e.setAttribute(`data-overflow`,a),e.style.setProperty(`--diffs-min-number-column-width-default`,`${`${s}`.length}ch`),e}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 FT(e,t,n){let r=new Map;for(let i of e){let e=AT(i);r.set(e,n?.slotNames.get(e)??t(i))}return{provided:e,current:e,slotNames:r}}function IT(e,t,n){for(let r of t){let t=AT(r);e.slotNames.has(t)||e.slotNames.set(t,n(r))}e.provided=t,e.current=t}function LT(e,t,n){if(e==null)return n(t);let r=AT(t),i=e.slotNames.get(r);return i??(i=n(t),e.slotNames.set(r,i)),i}function RT(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function zT(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 BT({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===``){t?.remove();return}return t??=VT(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function VT(){let e=document.createElement(`style`);return e.setAttribute(bp,``),e}var HT=void 0;function UT(){return HT??=`safari`in window&&`pushNotification`in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}if(typeof HTMLElement<`u`&&customElements.get(`diffs-container`)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;let t=this.attachShadow({mode:`open`});e??(e=new CSSStyleSheet,e.replaceSync(yT)),t.adoptedStyleSheets=[e]}connectedCallback(){xT(this.shadowRoot??this.attachShadow({mode:`open`}))}}customElements.define(up,t)}function WT(e){return{...Tp,...e}}function GT(e,t){let n=KT(e,t);return t?n:e.diffHeaderHeight+n}function KT(e,t){return e.paddingTop??(t?e.spacing:0)}function qT(e){return e.paddingBottom??e.spacing}function JT(e){switch(e){case`simple`:return 4;case`metadata`:case`line-info`:case`line-info-basic`:case`custom`:return 32}}function YT(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e===t}function XT(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function ZT(e){return e.map(e=>({...e,hunkContent:e.hunkContent.map(e=>({...e}))}))}function QT(e){return{...e,hunks:ZT(e.hunks),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}function $T(e,t){return e-(t===0?0:1)}function eE(e,t){return $T(e,t)+t}var tE=1;function nE(e,...t){return`ck${tE}:${JSON.stringify([e,...t])}`}function rE(e){return e===``?[]:e.split(fp)}function iE(e,t,n){let r=e===`clone`?QT(t):t;if(!r.isPartial)throw Error(`hydratePartialDiff: fileDiff must be partial`);switch(r.type){case`change`:case`rename-changed`:return aE(r,sE(r,n),cE(r,n));case`rename-pure`:{let e=cE(r,n);lE(r,n);let t=rE(e.contents);return r.isPartial=!1,r.deletionLines=t,r.additionLines=t,dE(r,null,e),r}}throw Error(`hydratePartialDiff: ${r.type} diffs cannot be hydrated from loaded files`)}function aE(e,t,n){let r=rE(t.contents),i=rE(n.contents),{hunks:a,splitLineCount:o,unifiedLineCount:s}=oE(e.hunks,i.length);return e.hunks=a,e.splitLineCount=o,e.unifiedLineCount=s,e.isPartial=!1,e.deletionLines=r,e.additionLines=i,dE(e,t,n),e}function oE(e,t){let n=0,r=0,i=0,a=[];for(let t of e){let e=Math.max(t.additionStart-1,0),o=Math.max(t.deletionStart-1,0),s=e,c=o,l=0,u=0,d=0,f=0,p=[];for(let e of t.hunkContent){if(e.type===`context`){p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.lines,c+=e.lines,d+=e.lines,f+=e.lines;continue}p.push({...e,additionLineIndex:s,deletionLineIndex:c}),s+=e.additions,c+=e.deletions,l+=e.additions,u+=e.deletions,d+=Math.max(e.additions,e.deletions),f+=e.additions+e.deletions}let m=Math.max($T(t.additionStart,t.additionCount)-i,0);a.push({...t,collapsedBefore:m,additionLineIndex:e,deletionLineIndex:o,additionLines:l,deletionLines:u,hunkContent:p,splitLineStart:n+m,unifiedLineStart:r+m,splitLineCount:d,unifiedLineCount:f}),n+=m+d,r+=m+f,i=eE(t.additionStart,t.additionCount)}if(a.length>0){let e=a[a.length-1],i=eE(e.additionStart,e.additionCount),o=Math.max(t-i,0);n+=o,r+=o}return{hunks:a,splitLineCount:n,unifiedLineCount:r}}function sE(e,t){if(t.oldFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function cE(e,t){if(t.newFile==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function lE(e,t){if(t.oldFile!==null)throw Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function uE(e,t,n){return e.cacheKey==null?fE(t,n):`${e.cacheKey}:hydrated`}function dE(e,t,n){let r=uE(e,t,n);if(r==null){delete e.cacheKey;return}e.cacheKey=r}function fE(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?nE(`hydrated-files`,e.cacheKey,t.cacheKey):void 0:e?.cacheKey??t?.cacheKey}function pE(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}var mE=new TextEncoder,hE=new TextDecoder(`utf-8`,{ignoreBOM:!0}),gE=/[\uD800-\uDFFF]/,_E=1024,vE=new Uint8Array(_E);function yE(){vE.length!==_E&&(vE=new Uint8Array(_E))}function bE(e){if(e.length===0)return e;if(gE.test(e))return JSON.parse(JSON.stringify(e));let t=e.length*3;vE.length<t&&(vE=new Uint8Array(t));let{written:n}=mE.encodeInto(e,vE);return hE.decode(vE.subarray(0,n))}var xE=new TextDecoder(`utf-8`,{ignoreBOM:!0}),SE={'"':`"`,"\\":`\\`,a:`\x07`,b:`\b`,t:` `,n:`
357
- `,v:`\v`,f:`\f`,r:`\r`};function CE(e){if(e[0]!==`"`)return;let t=``,n=1;for(;n<e.length;){let r=e[n];if(r===`"`)return{fileName:t,rawLength:n+1};if(r!==`\\`){t+=r,n++;continue}let i=SE[e[n+1]];if(i!=null){t+=i,n+=2;continue}let a=[];do{let t=wE(e,n+1);if(t==null)return;a.push(t),n+=4}while(e[n]===`\\`&&e[n+1]>=`0`&&e[n+1]<=`7`);t+=xE.decode(new Uint8Array(a))}}function wE(e,t){let n=e.charCodeAt(t)-48,r=e.charCodeAt(t+1)-48,i=e.charCodeAt(t+2)-48;if(n>=0&&n<=3&&r>=0&&r<=7&&i>=0&&i<=7)return n*64+r*8+i}var TE=4096,EE=.5;function DE(e){for(let t of e.hunks)for(let n=0;n<t.hunkContent.length;n++){let r=t.hunkContent[n];if(r.type!==`change`)continue;let i=kE(e,r);i!=null&&(t.hunkContent.splice(n,1,...i),n+=i.length-1)}}function OE(e,t,n){let{hunkContent:r}=e;for(let e=1;e<r.length;e++){let i=r[e],a=r[e-1];if(i.type!==`change`||i.additions>0&&i.deletions>0||a.type!==`context`)continue;let o=i.additions>0,s=o?t.additionLines:t.deletionLines,c=o?i.additionLineIndex:i.deletionLineIndex,l=o?i.additions:i.deletions,u=s[c]??``;if(u.trim()!==``)continue;let d=!0;for(let e=1;e<l;e++)if(s[c+e]!==u){d=!1;break}if(!d)continue;let f=0;for(;f<a.lines&&t.additionLines[a.additionLineIndex+a.lines-1-f]===u;)f++;if(f===0||e===1&&f===a.lines||n!=null&&(f=n(i,f),f===0))continue;i.additionLineIndex-=f,i.deletionLineIndex-=f;let p=i.additionLineIndex+i.additions,m=i.deletionLineIndex+i.deletions,h=r[e+1];h?.type===`context`?(h.lines+=f,h.additionLineIndex=p,h.deletionLineIndex=m):r.splice(e+1,0,{type:`context`,lines:f,additionLineIndex:p,deletionLineIndex:m}),a.lines-=f,a.lines===0&&(r.splice(e-1,1),e--)}}function kE(e,t){let{deletions:n,additions:r,deletionLineIndex:i,additionLineIndex:a}=t,o=Math.min(n,r),s=Math.abs(r-n);if(o===0||s===0||o*(s+1)>TE)return null;let c=[];for(let t=0;t<n;t++)c.push(jE(e.deletionLines[i+t]??``));let l=[];for(let t=0;t<r;t++)l.push(jE(e.additionLines[a+t]??``));let u=r>n,d=0,f=-1;for(let e=0;e<=s;e++){let t=0;for(let n=0;n<o;n++)t+=ME(c[n+(u?0:e)],l[n+(u?e:0)]);e===0?f=t+o*EE:t>f&&(f=t,d=e)}if(d===0)return null;let p=[],m=(e,t,n,r)=>{(e>0||t>0)&&p.push({type:`change`,deletions:e,additions:t,deletionLineIndex:n,additionLineIndex:r})};return u?(m(0,d,i,a),m(o,o,i,a+d),m(0,r-o-d,i+o,a+d+o)):(m(d,0,i,a),m(o,o,i+d,a),m(n-o-d,0,i+d+o,a+o)),p}var AE=/\s+/g;function jE(e){return e.replace(AE,``)}function ME(e,t){if(e===t)return 1;let n=Math.max(e.length,t.length),r=Math.min(e.length,t.length);if(r===0)return 0;let i=0;for(;i<r&&e[i]===t[i];)i++;let a=0;for(;a<r-i&&e[e.length-1-a]===t[t.length-1-a];)a++;return(i+a)/n}var NE=/^diff --git ("a\/(?:[^"\\]|\\.)*"|a\/.+?) ("b\/(?:[^"\\]|\\.)*"|b\/.+?)$/;function PE(e,t){try{return FE(e,t)}finally{yE()}}function FE(e,{cacheKey:t,isGitDiff:n=dp.test(e),oldFile:r,newFile:i,throwOnError:a=!1}={}){let o=0,s=WE(e,`@@ `),c,l=r==null||i==null,u=0,d=0;for(let e of s){let s=RE(e),f=s[0];if(f==null){if(a)throw Error(`parsePatchContent: invalid hunk`);console.error(`parsePatchContent: invalid hunk`,e);continue}let p=VE(f),m=0,h=0;if(p==null||c==null){if(c!=null){if(a)throw Error(`parsePatchContent: Invalid hunk`);console.error(`parsePatchContent: Invalid hunk`,e);continue}c={name:``,type:`change`,hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:l,additionLines:!l&&r!=null&&i!=null?LE(i.contents):[],deletionLines:!l&&r!=null&&i!=null?LE(r.contents):[],cacheKey:KE(t)},c.additionLines.length===1&&i?.contents===``&&(c.additionLines.length=0),c.deletionLines.length===1&&r?.contents===``&&(c.deletionLines.length=0);for(let e of s){if(e.startsWith(`diff --git`)){let t=e.trim().match(NE);if(t==null){if(a)throw Error(`parsePatchContent: invalid git diff header`);console.error(`parsePatchContent: invalid git diff header`,e);continue}let n=IE(t[1],!0),r=IE(t[2],!0);c.name=bE(r),n!==r&&(c.prevName=bE(n));continue}let t=e.startsWith(`---`)||e.startsWith(`+++`)?e.match(pp):null;if(t!=null){let[,e,r]=t,i=IE(r,n);if(e===`---`&&i!==`/dev/null`){let e=bE(i);c.prevName=e,c.name=e}else e===`+++`&&i!==`/dev/null`&&(c.name=bE(i))}else if(n){if(e.startsWith(`new mode `)&&(c.mode=bE(e.slice(8).trim())),e.startsWith(`old mode `)&&(c.prevMode=bE(e.slice(8).trim())),e.startsWith(`new file mode`)&&(c.type=`new`,c.mode=bE(e.slice(13).trim())),e.startsWith(`deleted file mode`)&&(c.type=`deleted`,c.mode=bE(e.slice(17).trim())),e.startsWith(`similarity index`)&&(e.startsWith(`similarity index 100%`)?c.type=`rename-pure`:c.type=`rename-changed`),e.startsWith(`index `)){let[,t,n,r]=e.trim().match(mp)??[];t!=null&&(c.prevObjectId=bE(t)),n!=null&&(c.newObjectId=bE(n)),r!=null&&(c.mode=bE(r))}(e.startsWith(`rename from `)||e.startsWith(`copy from `))&&(c.prevName=bE(IE(e.slice(e.startsWith(`rename`)?12:10)))),(e.startsWith(`rename to `)||e.startsWith(`copy to `))&&(c.name=bE(IE(e.slice(e.startsWith(`rename`)?10:8))))}}continue}let g,_;for(;s.length>0&&(s[s.length-1]===`
358
- `||s[s.length-1]===`\r`||s[s.length-1]===`\r
359
- `||s[s.length-1]===``);)s.pop();let{additionStart:v,deletionStart:y}=p;u=l?u:y-1,d=l?d:v-1;let b={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:p.additionCount,additionStart:v,additionLines:m,deletionCount:p.deletionCount,deletionStart:y,deletionLines:h,deletionLineIndex:u,additionLineIndex:d,hunkContent:[],hunkContext:KE(p.hunkContext),hunkSpecs:bE(f),noEOFCRAdditions:!1,noEOFCRDeletions:!1},x=0,S=0;for(let e=1;e<s.length;e++){let t=s[e];if(x>=b.additionCount&&S>=b.deletionCount&&!t.startsWith(`\\`)){if(!zE(t)||BE(t))break;if(a)throw Error(`parsePatchContent: hunk has more lines than expected`)}let n=t[0];if(n!==`+`&&n!==`-`&&n!==` `&&n!==`\\`){if(a)throw Error(`parsePatchContent: invalid hunk line`);console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error(`processFile: invalid rawLine:`,t);continue}let r=qE(n);if(r===`addition`){if(a&&x>=b.additionCount)throw Error(`parsePatchContent: hunk has too many addition lines`);let e=JE(t);(g==null||g.type!==`change`)&&(g=YE(`change`,u,d),b.hunkContent.push(g)),d++,x++,l&&c.additionLines.push(e),g.additions++,m++,_=`addition`}else if(r===`deletion`){if(a&&S>=b.deletionCount)throw Error(`parsePatchContent: hunk has too many deletion lines`);let e=JE(t);(g==null||g.type!==`change`)&&(g=YE(`change`,u,d),b.hunkContent.push(g)),u++,S++,l&&c.deletionLines.push(e),g.deletions++,h++,_=`deletion`}else if(r===`context`){if(a&&(S>=b.deletionCount||x>=b.additionCount))throw Error(`parsePatchContent: hunk has too many context lines`);let e=JE(t);(g==null||g.type!==`context`)&&(g=YE(`context`,u,d),b.hunkContent.push(g)),d++,u++,x++,S++,l&&(c.deletionLines.push(e),c.additionLines.push(e)),g.lines++,_=`context`}else if(r===`metadata`&&g!=null){if(g.type===`context`?(b.noEOFCRAdditions=!0,b.noEOFCRDeletions=!0):_===`deletion`?b.noEOFCRDeletions=!0:_===`addition`&&(b.noEOFCRAdditions=!0),l&&(_===`addition`||_===`context`)){let e=c.additionLines.length-1;e>=0&&(c.additionLines[e]=pE(c.additionLines[e]))}if(l&&(_===`deletion`||_===`context`)){let e=c.deletionLines.length-1;e>=0&&(c.deletionLines[e]=pE(c.deletionLines[e]))}}}if(x!==b.additionCount||S!==b.deletionCount){if(a)throw Error(`parsePatchContent: hunk line count mismatch`);console.error(`parsePatchContent: hunk line count mismatch: "${f.trimEnd()}", declared old/new ${b.deletionCount}/${b.additionCount}, parsed old/new ${S}/${x}`);let e=$T(b.additionStart,b.additionCount)+(x===0?0:1),t=$T(b.deletionStart,b.deletionCount)+(S===0?0:1);if(!l){let n=e-b.additionStart,r=t-b.deletionStart;b.additionLineIndex+=n,b.deletionLineIndex+=r;for(let e of b.hunkContent)e.additionLineIndex+=n,e.deletionLineIndex+=r}b.additionStart=e,b.deletionStart=t,b.additionCount=x,b.deletionCount=S}b.additionLines=m,b.deletionLines=h,b.collapsedBefore=Math.max($T(b.additionStart,b.additionCount)-o,0),c.hunks.push(b),o=eE(b.additionStart,b.additionCount);for(let e of b.hunkContent)e.type===`context`?(b.splitLineCount+=e.lines,b.unifiedLineCount+=e.lines):(b.splitLineCount+=Math.max(e.additions,e.deletions),b.unifiedLineCount+=e.deletions+e.additions);b.splitLineStart=c.splitLineCount+b.collapsedBefore,b.unifiedLineStart=c.unifiedLineCount+b.collapsedBefore,c.splitLineCount+=b.collapsedBefore+b.splitLineCount,c.unifiedLineCount+=b.collapsedBefore+b.unifiedLineCount}if(c!=null){if(a&&l&&!n&&c.hunks.length===0)throw Error(`parsePatchContent: unified file has no hunks`);if(c.hunks.length>0&&!l&&c.additionLines.length>0&&c.deletionLines.length>0){let e=c.hunks[c.hunks.length-1],t=eE(e.additionStart,e.additionCount),n=c.additionLines.length,r=Math.max(n-t,0);c.splitLineCount+=r,c.unifiedLineCount+=r}return n||(c.prevName!=null&&c.name!==c.prevName?c.hunks.length>0?c.type=`rename-changed`:c.type=`rename-pure`:(r==null||r.contents===``)&&i!=null&&i.contents!==``?c.type=`new`:r!=null&&r.contents!==``&&(i==null||i.contents===``)&&(c.type=`deleted`)),c.type!==`rename-pure`&&c.type!==`rename-changed`&&(c.prevName=void 0),DE(c),c}}function IE(e,t=!1){let n=e.trim(),r=n.startsWith(`"`)?CE(n)?.fileName??n:n;return t&&(r.startsWith(`a/`)||r.startsWith(`b/`))?r.slice(2):r}function LE(e){let t=RE(e);for(let e=0;e<t.length;e++)t[e]=bE(t[e]);return t}function RE(e){if(e.length===0)return[``];let t=[],n=0;for(;;){let r=e.indexOf(`
360
- `,n);if(r===-1)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function zE(e){let t=e[0];return t===`+`||t===`-`||t===` `}function BE(e){if(!e.startsWith(`--`))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `&&n!==`
361
- `&&n!==`\r`)return!1}return!0}function VE(e){if(!e.startsWith(`@@ -`))return;let t=4,n=HE(e,t);if(n==null)return;let r=n.value;t=n.endIndex;let i=1;if(e[t]===`,`){let n=HE(e,t+1);if(n==null)return;i=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`+`)return;t+=2;let a=HE(e,t);if(a==null)return;let o=a.value;t=a.endIndex;let s=1;if(e[t]===`,`){let n=HE(e,t+1);if(n==null)return;s=n.value,t=n.endIndex}if(e[t]!==` `||e[t+1]!==`@`||e[t+2]!==`@`)return;let c,l=t+3;return e[l]===` `&&(c=UE(e.slice(l+1))),{additionCount:s,additionStart:o,deletionCount:i,deletionStart:r,hunkContext:c}}function HE(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=r*10+t}if(n!==t)return{value:r,endIndex:n}}function UE(e){return e.endsWith(`\r
362
- `)?e.slice(0,-2):e.endsWith(`
363
- `)?e.slice(0,-1):e}function WE(e,t){if(e.length===0)return[``];let n=`\n${t}`,r=e.startsWith(t)?0:GE(e,n,0);if(r===-1)return[e];let i=[];r>0&&i.push(e.slice(0,r));let a=r;for(;;){let t=GE(e,n,a+1);if(t===-1)break;i.push(e.slice(a,t)),a=t}return i.push(e.slice(a)),i}function GE(e,t,n){let r=e.indexOf(t,n);return r===-1?-1:r+1}function KE(e){return e==null?e:bE(e)}function qE(e){return e===` `?`context`:e===`\\`?`metadata`:e===`+`?`addition`:`deletion`}function JE(e){let t=e.slice(1);return bE(t===``?`
364
- `:t)}function YE(e,t,n){return e===`change`?{type:`change`,additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:`context`,lines:0,additionLineIndex:n,deletionLineIndex:t}}var XE=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}},ZE=new class extends XE{};function QE(e,t,n){return ZE.diff(e,t,n)}function $E(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function eD(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 tD(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 nD(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 rD(e,t){return tD(e,t,``)}function iD(e,t){return nD(e,t,``)}function aD(e,t){return t.slice(0,oD(e,t))}function oD(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function sD(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function cD(e,t){if(t)return uD(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function lD(e,t){if(t)return uD(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function uD(e,t){if(!t)return[lD(e),cD(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=sD(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var dD=`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}`,fD=RegExp(`[${dD}]+|\\s+|[^${dD}]`,`ug`);new class extends XE{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=sD(e,r)}else n=e.match(fD)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&pD(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&pD(n,i,r,null,t.intlSegmenter),e}};function pD(e,t,n,r,i){if(t&&n){let[a,o]=uD(t.value,i),[s,c]=uD(n.value,i);if(e){let r=$E(a,s);e.value=nD(e.value,s,r),t.value=rD(t.value,r),n.value=rD(n.value,r)}if(r){let e=eD(o,c);r.value=tD(r.value,c,e),t.value=iD(t.value,e),n.value=iD(n.value,e)}}else if(n){if(e){let e=lD(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=lD(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=lD(r.value,i),[a,o]=uD(t.value,i),s=$E(n,a);t.value=rD(t.value,s);let c=eD(rD(n,s),o);t.value=iD(t.value,c),r.value=tD(r.value,n,c),e.value=nD(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=lD(r.value,i),n=aD(cD(t.value,i),e);t.value=iD(t.value,n)}else if(e){let n=aD(cD(e.value,i),lD(t.value,i));t.value=rD(t.value,n)}}var mD=new class extends XE{tokenize(e){let t=RegExp(`(\\r?\\n)|[${dD}]+|[^\\S\\n\\r]+|[^${dD}]`,`ug`);return e.match(t)||[]}};function hD(e,t,n){return mD.diff(e,t,n)}var gD=new class extends XE{constructor(){super(...arguments),this.tokenize=vD}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
365
- `))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
366
- `))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
367
- `)&&(e=e.slice(0,-1)),t.endsWith(`
368
- `)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function _D(e,t,n){return gD.diff(e,t,n)}function vD(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
369
- `));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function yD(e){return e==`.`||e==`!`||e==`?`}new class extends XE{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(yD(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends XE{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends XE{constructor(){super(...arguments),this.tokenize=vD}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(bD(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function bD(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=bD(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=bD(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends XE{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function xD(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function SD(e){if(!xD(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];t+=e===7?`\\a`:e===8?`\\b`:e===9?`\\t`:e===10?`\\n`:e===11?`\\v`:e===12?`\\f`:e===13?`\\r`:e===34?`\\"`:e===92?`\\\\`:e>=32&&e<=126?String.fromCharCode(e):`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var CD={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function wD(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;_D(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(_D(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||DD(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
370
- `)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function TD(e,t){if(t||=CD,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>TD(e,t)).join(`
371
- `)}let n=[];if(e.isGit){if(t=CD,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+SD(r)+` `+SD(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+SD((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+SD((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+SD((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+SD((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+SD(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+SD(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
372
- `)+`
373
- `}function ED(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;wD(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?TD(e,o.headerOptions):void 0)}}))}else{let s=wD(e,t,n,r,i,a,o);return s?TD(s,o?.headerOptions):void 0}}function DD(e){let t=e.endsWith(`
374
- `),n=e.split(`
375
- `).map(e=>e+`
376
- `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var OD=`/dev/null`;function kD(e,t,n,r=!1){if(e===null&&t===null)throw Error(`parseDiffFromFile: You must pass oldFile, newFile, or both`);let i=e??AD(),a=t??AD(),o=PE(ED(i.name,a.name,i.contents,a.contents,i.header,a.header,n),{cacheKey:(()=>{let n=e?.cacheKey,r=t?.cacheKey;return n!=null&&r!=null?nE(`diff`,n,r):void 0})(),oldFile:i,newFile:a,throwOnError:r});if(o==null)throw Error(`parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?`);e===null?(o.type=`new`,o.prevName=void 0):t===null&&(o.type=`deleted`,o.prevName=void 0);let s=t?.lang??(t===null?e?.lang:void 0);return s!=null&&(o.lang=s),o}function AD(){return{name:OD,contents:``}}var jD=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&=(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,!1)}setup(e,t,n){if(t==null||n==null)for(let r of e.children??[])r instanceof HTMLElement&&(`deletions`in r.dataset?t=r:`additions`in r.dataset&&(n=r));if(n==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener(`scroll`,this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener(`scroll`,this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==n&&(this.codeAdditions?.removeEventListener(`scroll`,this.handleAdditionsScroll),this.codeAdditions=n,n.addEventListener(`scroll`,this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function MD(e,t){return OC(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function ND(e){return $({tagName:`div`,properties:{"data-content-buffer":``,"data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function PD(e){return $({tagName:`div`,children:[$({tagName:`span`,children:[NC(`No newline at end of file`)]})],properties:{"data-no-newline":``,"data-line-type":e,"data-column-content":``}})}function FD(e){return $({tagName:`div`,children:[PC({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 ID({type:e,content:t,expandIndex:n,chunked:r=!1,slotName:i,isFirstHunk:a,isLastHunk:o}){let s=0,c=[];if(e===`metadata`&&t!=null&&c.push($({tagName:`div`,children:[NC(t)],properties:{"data-separator-wrapper":``}})),(e===`line-info`||e===`line-info-basic`)&&t!=null){let e=[];n!=null&&(r?(a||(e.push(FD(`up`)),s++),o||(e.push(FD(`down`)),s++)):(e.push(FD(!a&&!o?`both`:a?`down`:`up`)),s++)),e.push($({tagName:`div`,children:[$({tagName:`span`,children:[NC(t)],properties:{"data-unmodified-lines":``}})],properties:{"data-separator-content":``}})),r&&n!=null&&e.push($({tagName:`div`,children:[NC(`Expand all`)],properties:{role:`button`,"data-expand-button":``,"data-expand-all-button":``}})),c.push($({tagName:`div`,children:e,properties:{"data-separator-wrapper":``,"data-separator-multi-button":s>1?``:void 0}}))}return e===`custom`&&i!=null&&c.push($({tagName:`slot`,properties:{name:i}})),$({tagName:`div`,children:c,properties:{"data-separator":c.length===0?`simple`:e,"data-expand-index":n,"data-separator-first":a?``:void 0,"data-separator-last":o?``:void 0}})}function LD(e,t){return`hunk-separator-${e}-${t}`}function RD(e){let t=e.at(-1);return t==null?0:Math.max(eE(t.additionStart,t.additionCount),eE(t.deletionStart,t.deletionCount))}function zD({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 BD({item:e,arr:t,enableJoin:n,isNeutral:r=!1,isLastItem:i=!1}){let a=t[t.length-1];if(a==null||i||!n){t.push([+!r,e.value]);return}let o=a[0]===0;if(r===o||r&&e.value.length===1&&!o){a[1]+=e.value;return}t.push([+!r,e.value])}function VD(e){return[$T(e.additionStart,e.additionCount)+1,eE(e.additionStart,e.additionCount)+1]}function HD({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:r,collapsedContextThreshold:i}){let a=Math.max(t,0);if(a===0||e)return{fromStart:0,fromEnd:0,rangeSize:a,collapsedLines:a,renderAll:!1};if(n===!0||a<=i)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(r),s=Math.min(Math.max(o?.fromStart??0,0),a),c=Math.min(Math.max(o?.fromEnd??0,0),a),l=s+c,u=l>=a;return{fromStart:u?a:s,fromEnd:u?0:c,rangeSize:a,collapsedLines:Math.max(a-l,0),renderAll:u}}function UD(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),r=e.deletionLines.length-eE(t.deletionStart,t.deletionCount);return n<=0&&r<=0?!1:n!==r}function WD({fileDiff:e,errorPrefix:t}){let n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;let r=e.additionLines.length-eE(n.additionStart,n.additionCount),i=e.deletionLines.length-eE(n.deletionStart,n.deletionCount);if(r<=0&&i<=0)return 0;if(r!==i)throw Error(`${t}: trailing context mismatch (additions=${r}, deletions=${i}) for ${e.name}`);return Math.min(r,i)}function GD({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:i}){if(t!==e.hunks.length-1)return;let a=WD({fileDiff:e,errorPrefix:i});if(a<=0)return;if(n===!0||a<=r)return{fromStart:a,fromEnd:0,rangeSize:a,collapsedLines:0,renderAll:!0};let o=n?.get(e.hunks.length),s=Math.min(Math.max(o?.fromStart??0,0),a);return{fromStart:s,fromEnd:0,rangeSize:a,collapsedLines:a-s,renderAll:s>=a}}function KD({fileDiff:e,lineNumber:t,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return!0;for(let[i,a]of e.hunks.entries()){let[o,s]=VD(a);if(t<o){let s=HD({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}),c=o-s.rangeSize;return s.renderAll||t<c+s.fromStart||t>=o-s.fromEnd}if(t<s)return!0}let i=GD({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:`isAdditionLineRenderable`});if(i==null||i.renderAll)return!0;let a=e.hunks[e.hunks.length-1],[,o]=VD(a);return t<o+i.fromStart||t>=o+i.rangeSize}function qD({fileDiff:e,lineNumber:t,direction:n,expandedHunks:r,collapsedContextThreshold:i}){if(r===!0||e.isPartial)return t;let a=[],o=1;for(let[t,n]of e.hunks.entries()){let[s,c]=VD(n),l=HD({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:r,hunkIndex:t,collapsedContextThreshold:i}),u=s-l.rangeSize;l.renderAll?a.push([u,s]):(l.fromStart>0&&a.push([u,u+l.fromStart]),l.fromEnd>0&&a.push([s-l.fromEnd,s])),a.push([s,c]),o=c}let s=GD({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:r,collapsedContextThreshold:i,errorPrefix:`getNearestRenderableAdditionLine`});if(s!=null){let e=o;o=e+s.rangeSize,s.renderAll?a.push([e,o]):s.fromStart>0&&a.push([e,e+s.fromStart])}if(t>=o)return t;if(n===`down`){for(let[e,n]of a)if(n>t)return Math.max(e,t);return}for(let e=a.length-1;e>=0;e--){let[n,r]=a[e];if(n<=t)return Math.min(r-1,t)}}function JD({type:e,metrics:t}){return t.hunkSeparatorHeight??JT(e)}function YD({type:e,metrics:t}){return e===`simple`||e===`metadata`||e===`line-info-basic`?0:t.spacing}function XD({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 ZD(e){return e!==`simple`&&e!==`metadata`}function QD({type:e,metrics:t,hunkIndex:n,hunkSpecs:r}){if(!XD({type:e,hunkIndex:n,hunkSpecs:r}))return;let i=JD({type:e,metrics:t}),a=YD({type:e,metrics:t}),o=n>0?a:0,s=a;return{height:i,gapBefore:o,gapAfter:s,totalHeight:o+i+s}}function $D({type:e,metrics:t}){if(!ZD(e))return;let n=JD({type:e,metrics:t}),r=YD({type:e,metrics:t});return{height:n,gapBefore:r,gapAfter:0,totalHeight:r+n}}function eO({diff:e,diffStyle:t,startingLine:n=0,totalLines:r=1/0,expandedHunks:i,collapsedContextThreshold:a=1,callback:o}){let s=tO({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:a}),c={viewportStart:n,viewportEnd:n+r,isWindowedHighlight:n>0||r<1/0,splitCount:s.splitCount,unifiedCount:s.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!c.isWindowedHighlight)return!1;let e=c.unifiedCount>=n+r,i=c.splitCount>=n+r;return t===`unified`?e:(t===`split`||e)&&i},shouldSkip(e,r){if(!c.isWindowedHighlight)return!1;let i=e>0&&c.unifiedCount+e<=n,a=r>0&&c.splitCount+r<=n;return t===`unified`?i:(t===`split`||i)&&a},incrementCounts(e,n){(t===`unified`||t===`both`)&&(c.unifiedCount+=e),(t===`split`||t===`both`)&&(c.splitCount+=n)},isInWindow(e,n){if(!c.isWindowedHighlight)return!0;let r=c.isInUnifiedWindow(e),i=c.isInSplitWindow(n);return t===`unified`?r:t===`split`?i:r||i},isInUnifiedWindow(e){return!c.isWindowedHighlight||c.unifiedCount>=n-e&&c.unifiedCount<n+r},isInSplitWindow(e){return!c.isWindowedHighlight||c.splitCount>=n-e&&c.splitCount<n+r},emit(e,n=!1){return n||(t===`unified`?c.incrementCounts(1,0):t===`split`?c.incrementCounts(0,1):c.incrementCounts(1,1)),o(e)??!1}};hunkIterator:for(let n=s.hunkIndex;n<e.hunks.length;n++){let r=e.hunks[n];if(r==null)throw Error(`iterateOverDiff: invalid hunk index`);if(c.shouldBreak())break;let o=$T(r.deletionStart,r.deletionCount),s=$T(r.additionStart,r.additionCount),l=!e.isPartial&&r.deletionCount===0?o:r.deletionLineIndex,u=!e.isPartial&&r.additionCount===0?s:r.additionLineIndex,d=HD({isPartial:e.isPartial,rangeSize:r.collapsedBefore,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:a}),f=n===c.finalHunkIndex?GD({fileDiff:e,hunkIndex:n,expandedHunks:i,collapsedContextThreshold:a,errorPrefix:`iterateOverDiff`}):void 0,p=d.fromStart+d.fromEnd;function m(e,n){return f==null||f.collapsedLines<=0||f.fromStart+f.fromEnd>0?0:t===`unified`?e===r.unifiedLineStart+r.unifiedLineCount-1?f.collapsedLines:0:n===r.splitLineStart+r.splitLineCount-1?f.collapsedLines:0}let h=d.collapsedLines===0;function g(){return h?0:(h=!0,d.collapsedLines)}if(c.shouldSkip(p,p))c.incrementCounts(p,p),g();else{let e=r.unifiedLineStart-d.rangeSize,i=r.splitLineStart-d.rangeSize,a=l-d.rangeSize,f=u-d.rangeSize,p=o+1-d.rangeSize,m=s+1-d.rangeSize;if(iO(c,d.fromStart,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:0,collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}))||(e=r.unifiedLineStart-d.fromEnd,i=r.splitLineStart-d.fromEnd,a=l-d.fromEnd,f=u-d.fromEnd,p=o+1-d.fromEnd,m=s+1-d.fromEnd,iO(c,d.fromEnd,t,t=>c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:0,type:`context-expanded`,deletionLine:{lineNumber:p+t,lineIndex:a+t,noEOFCR:!1,unifiedLineIndex:e+t,splitLineIndex:i+t},additionLine:{unifiedLineIndex:e+t,splitLineIndex:i+t,lineIndex:f+t,lineNumber:m+t,noEOFCR:!1}}),()=>{g()})))break hunkIterator}let _=r.unifiedLineStart,v=r.splitLineStart,y=l,b=u,x=o+1,S=s+1,C=r.hunkContent.at(-1);for(let e of r.hunkContent){if(c.shouldBreak())break hunkIterator;let i=e===C;if(e.type===`context`){if(c.shouldSkip(e.lines,e.lines))c.incrementCounts(e.lines,e.lines),g();else if(iO(c,e.lines,t,t=>{let a=i&&t===e.lines-1,o=_+t,s=v+t;return c.emit({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:m(o,s),type:`context`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:a&&r.noEOFCRDeletions,unifiedLineIndex:o,splitLineIndex:s},additionLine:{unifiedLineIndex:o,splitLineIndex:s,lineIndex:b+t,lineNumber:S+t,noEOFCR:a&&r.noEOFCRAdditions}})},()=>{g()}))break hunkIterator;_+=e.lines,v+=e.lines,y+=e.lines,b+=e.lines,x+=e.lines,S+=e.lines}else{let a=Math.max(e.deletions,e.additions),o=e.deletions+e.additions;if(!c.shouldSkip(o,a)){let s=aO(c,e,t);(s[0]?.[0]??0)>0&&g();for(let[l,u]of s)for(let s=l;s<u;s++){let l=m(_+s,t===`unified`?v+(s<e.deletions?s:s-e.deletions):v+s);if(c.emit(oO({hunkIndex:n,hunk:r,collapsedBefore:g(),collapsedAfter:l,diffStyle:t,index:s,unifiedLineIndex:_,splitLineIndex:v,additionLineIndex:b,deletionLineIndex:y,additionLineNumber:S,deletionLineNumber:x,content:e,isLastContent:i,unifiedCount:o,splitCount:a}),!0))break hunkIterator}}g(),c.incrementCounts(o,a),_+=o,v+=a,y+=e.deletions,b+=e.additions,x+=e.deletions,S+=e.additions}}if(f!=null){let{collapsedLines:n,fromStart:r,fromEnd:i}=f,a=r+i;if(iO(c,a,t,t=>{let r=t===a-1;return c.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:r?n:0,type:`context-expanded`,deletionLine:{lineNumber:x+t,lineIndex:y+t,noEOFCR:!1,unifiedLineIndex:_+t,splitLineIndex:v+t},additionLine:{unifiedLineIndex:_+t,splitLineIndex:v+t,lineIndex:b+t,lineNumber:S+t,noEOFCR:!1}})},void 0,()=>c.shouldBreak()))break hunkIterator}}}function tO({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:i}){if(n<=0||t===`both`)return{hunkIndex:0,splitCount:0,unifiedCount:0};let a=nO({diff:e,expandedHunks:r,collapsedContextThreshold:i}),o=0,s=e.hunks.length-1,c=e.hunks.length;for(;o<=s;){let e=o+s>>1,r=a[e+1];if(r==null)throw Error(`iterateOverDiff: invalid hunk prefix index`);(t===`unified`?r.unifiedCount:r.splitCount)>n?(c=e,s=e-1):o=e+1}if(c>=e.hunks.length){let t=a[e.hunks.length];if(t==null)throw Error(`iterateOverDiff: invalid terminal hunk prefix index`);return{hunkIndex:e.hunks.length,splitCount:t.splitCount,unifiedCount:t.unifiedCount}}let l=a[c];if(l==null)throw Error(`iterateOverDiff: invalid selected hunk prefix index`);return{hunkIndex:c,splitCount:l.splitCount,unifiedCount:l.unifiedCount}}function nO({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let r=0,i=0,a=e.hunks.length-1,o=[{splitCount:0,unifiedCount:0}];for(let s=0;s<e.hunks.length;s++){let c=e.hunks[s];if(c==null)throw Error(`iterateOverDiff: invalid hunk summary index`);let l=HD({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:t,hunkIndex:s,collapsedContextThreshold:n}),u=l.fromStart+l.fromEnd;r+=u+c.splitLineCount,i+=u+c.unifiedLineCount;let d=s===a?GD({fileDiff:e,hunkIndex:s,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`iterateOverDiff`}):void 0;if(d!=null){let e=d.fromStart+d.fromEnd;r+=e,i+=e}o.push({splitCount:r,unifiedCount:i})}return o}function rO(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];let r=[];function i(n){let i=Math.max(0,e.viewportStart-n),a=Math.min(t,e.viewportEnd-n);a>i&&r.push([i,a])}if(n!==`split`&&i(e.unifiedCount),n!==`unified`&&i(e.splitCount),r.length===0)return[0,0];let a=r[0][0],o=r[0][1];for(let e=1;e<r.length;e++){let t=r[e];a=Math.min(a,t[0]),o=Math.max(o,t[1])}return[a,o]}function iO(e,t,n,r,i,a){let[o,s]=rO(e,t,n);o>0&&(e.incrementCounts(o,o),i?.());let c=o;for(;c<t;){if(a?.()===!0)return!0;if(c>=s){e.incrementCounts(t-c,t-c);break}if(e.isInWindow(0,0)){if(r(c)===!0)return!0}else e.incrementCounts(1,1);c++}return!1}function aO(e,t,n){if(!e.isWindowedHighlight)return[[0,n===`unified`?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];let r=n!==`split`,i=n!==`unified`,a=n===`unified`?`unified`:`split`,o=[];function s(t,n){if(t+n<=e.viewportStart||t>=e.viewportEnd)return;let r=Math.max(0,e.viewportStart-t),i=Math.min(n,e.viewportEnd-t);return i>r?[r,i]:void 0}function c(e,n){return a===`split`?e:n===`additions`?[e[0]+t.deletions,e[1]+t.deletions]:e}function l(e,t){if(e==null)return;let[n,r]=c(e,t);r>n&&o.push([n,r])}if(r&&(l(s(e.unifiedCount,t.deletions),`deletions`),l(s(e.unifiedCount+t.deletions,t.additions),`additions`)),i&&(l(s(e.splitCount,t.deletions),`deletions`),l(s(e.splitCount,t.additions),`additions`)),o.length===0)return o;o.sort((e,t)=>e[0]-t[0]);let u=[o[0]];for(let[e,t]of o.slice(1)){let n=u[u.length-1];e<=n[1]?n[1]=Math.max(n[1],t):u.push([e,t])}return u}function oO({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,diffStyle:i,index:a,unifiedLineIndex:o,splitLineIndex:s,additionLineIndex:c,deletionLineIndex:l,additionLineNumber:u,deletionLineNumber:d,content:f,isLastContent:p,unifiedCount:m,splitCount:h}){let g=a<f.deletions?o+a:void 0,_=i===`unified`?a>=f.deletions?o+a:void 0:a<f.additions?o+f.deletions+a:void 0,v=i===`unified`?s+(a<f.deletions?a:a-f.deletions):s+a,y=a<f.deletions?l+a:void 0,b=a<f.deletions?d+a:void 0,x=i===`unified`?a>=f.deletions?c+(a-f.deletions):void 0:a<f.additions?c+a:void 0,S=i===`unified`?a>=f.deletions?u+(a-f.deletions):void 0:a<f.additions?u+a:void 0,C=i===`unified`?p&&a===f.deletions-1&&t.noEOFCRDeletions:p&&a===h-1&&t.noEOFCRDeletions,w=i===`unified`?p&&a===m-1&&t.noEOFCRAdditions:p&&a===h-1&&t.noEOFCRAdditions,ee=y!=null&&b!=null&&g!=null?{lineNumber:b,lineIndex:y,noEOFCR:C,unifiedLineIndex:g,splitLineIndex:v}:void 0,T=x!=null&&S!=null&&_!=null?{unifiedLineIndex:_,splitLineIndex:v,lineIndex:x,lineNumber:S,noEOFCR:w}:void 0;if(ee==null&&T!=null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:void 0,additionLine:T};if(ee!=null&&T==null)return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:ee,additionLine:void 0};if(ee==null||T==null)throw Error(`iterateOverDiff: missing change line data`);return{type:`change`,hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:r,deletionLine:ee,additionLine:T}}var sO={forcePlainText:!1};function cO(e,t,n,{forcePlainText:r,startingLine:i,totalLines:a,expandedHunks:o,collapsedContextThreshold:s=1}=sO){r?(i??=0,a??=1/0):(i=0,a=1/0);let c=i>0||a<1/0,l=typeof n.theme==`string`?t.getTheme(n.theme).type:void 0,u=nT({theme:n.theme,highlighter:t}),d=r&&!c&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?`none`:n.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:p}=n,m=!r&&!e.isPartial,h=r?o:void 0,g=new Map;function _(e){let t=m?0:e,n=g.get(t)??dO();return g.set(t,n),n}function v(e,t,n,r){if(c){let e=n.at(-1);(e==null||e.targetIndex+e.count!==t)&&(e={targetIndex:t,originalOffset:r.length,count:0},n.push(e)),e.count++}r.push(e)}eO({diff:e,diffStyle:`both`,startingLine:i,totalLines:a,expandedHunks:!c||h,collapsedContextThreshold:s,callback:({hunkIndex:t,additionLine:n,deletionLine:r,type:i})=>{let a=_(t),o=n==null?r.splitLineIndex:n.splitLineIndex;i===`change`&&n!=null&&r!=null&&uO({additionLine:e.additionLines[n.lineIndex],deletionLine:e.deletionLines[r.lineIndex],deletionLineIndex:a.deletionContent.length,additionLineIndex:a.additionContent.length,deletionDecorations:a.deletionDecorations,additionDecorations:a.additionDecorations,lineDiffType:d,maxLineDiffLength:p}),r!=null&&(v(e.deletionLines[r.lineIndex],r.lineIndex,a.deletionSegments,a.deletionContent),a.deletionInfo.push({type:i===`change`?`change-deletion`:i,lineNumber:r.lineNumber,altLineNumber:i===`change`?void 0:n.lineNumber??void 0,lineIndex:`${r.unifiedLineIndex},${o}`})),n!=null&&(v(e.additionLines[n.lineIndex],n.lineIndex,a.additionSegments,a.additionContent),a.additionInfo.push({type:i===`change`?`change-addition`:i,lineNumber:n.lineNumber,altLineNumber:i===`change`?void 0:r.lineNumber??void 0,lineIndex:`${n.unifiedLineIndex},${o}`}))}});for(let i of g.values()){if(i.deletionContent.length===0&&i.additionContent.length===0)continue;let a={name:e.prevName??e.name,contents:i.deletionContent.value},o={name:e.name,contents:i.additionContent.value},{deletionLines:s,additionLines:c}=fO({deletionFile:a,deletionInfo:i.deletionInfo,deletionDecorations:i.deletionDecorations,additionFile:o,additionInfo:i.additionInfo,additionDecorations:i.additionDecorations,highlighter:t,options:n,languageOverride:r?`text`:e.lang});if(m){f.deletionLines=s,f.additionLines=c;continue}if(i.deletionSegments.length>0)for(let e of i.deletionSegments)for(let t=0;t<e.count;t++)f.deletionLines[e.targetIndex+t]=s[e.originalOffset+t];else aT(f.deletionLines,s);if(i.additionSegments.length>0)for(let e of i.additionSegments)for(let t=0;t<e.count;t++)f.additionLines[e.targetIndex+t]=c[e.originalOffset+t];else aT(f.additionLines,c)}return{code:f,themeStyles:u,baseThemeType:l}}function lO(e,{deletionLineIndex:t,additionLineIndex:n,deletionDecorations:r,additionDecorations:i}){let a=0,o=0,s=-1,c=0,l=-1,u=0;for(let{value:t,added:n,removed:r}of e)r?(s===-1&&(s=a),a+=t.length,c=a):n?(l===-1&&(l=o),o+=t.length,u=o):(a+=t.length,o+=t.length);s!==-1&&r.push(zD({line:t,spanStart:s,spanLength:c-s})),l!==-1&&i.push(zD({line:n,spanStart:l,spanLength:u-l}))}function uO({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a,lineDiffType:o,maxLineDiffLength:s}){if(e==null||t==null||o===`none`||(e=pE(e),t=pE(t),e.length>s||t.length>s))return;let c=o===`char`?QE(e,t):hD(e,t);if(o===`word-line`){lO(c,{deletionLineIndex:n,additionLineIndex:r,deletionDecorations:i,additionDecorations:a});return}let l=[],u=[],d=o===`word-alt`,f=c.at(-1);for(let e of c){let t=e===f;!e.added&&!e.removed?(BD({item:e,arr:l,enableJoin:d,isNeutral:!0,isLastItem:t}),BD({item:e,arr:u,enableJoin:d,isNeutral:!0,isLastItem:t})):e.removed?BD({item:e,arr:l,enableJoin:d,isLastItem:t}):BD({item:e,arr:u,enableJoin:d,isLastItem:t})}let p=0;for(let e of l)e[0]===1&&i.push(zD({line:n,spanStart:p,spanLength:e[1].length})),p+=e[1].length;p=0;for(let e of u)e[0]===1&&a.push(zD({line:r,spanStart:p,spanLength:e[1].length})),p+=e[1].length}function dO(){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 fO({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:r,highlighter:i,deletionDecorations:a,additionDecorations:o,languageOverride:s,options:{theme:c,...l}}){let u=s??Dw(e.name),d=s??Dw(t.name),{state:f,transformers:p}=Bw(l.useTokenTransformer),m=typeof c==`string`?{...l,lang:`text`,theme:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Uw(`token`),tokenizeTimeLimit:0}:{...l,lang:`text`,themes:c,transformers:p,decorations:void 0,defaultColor:!1,cssVariablePrefix:Uw(`token`),tokenizeTimeLimit:0};return{deletionLines:e.contents===``?[]:(m.lang=u,f.lineInfo=n,m.decorations=a,iT(i.codeToHast(pE(e.contents),m))),additionLines:t.contents===``?[]:(m.lang=d,m.decorations=o,f.lineInfo=r,iT(i.codeToHast(pE(t.contents),m)))}}function pO(e,t){let n=kD({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 mO(e,t){let n=Math.max(e,1),r=Array.from({length:n},(e,t)=>`${` `.repeat(t+1)}\n`).join(``);return r===t&&(r=Array.from({length:n},(e,t)=>`\u0000${` `.repeat(t)}\n`).join(``)),r}function hO(e){for(let t of e)if(t.trim().length>0)return!1;return!0}function gO(e,t){return t.length>0&&t.length<e.deletionLines.length&&hO(t)}function _O(e,t,n){let r=e.deletionLines.join(``),i=mO(t.length,r),a=kD({name:e.prevName??e.name,contents:r},{name:e.name,contents:i,lang:e.lang},n);return{hunks:a.hunks,splitLineCount:a.splitLineCount,unifiedLineCount:a.unifiedLineCount,additionLines:t,deletionLines:a.deletionLines,type:a.type}}function vO(e,t){return _O(e,[``],t)}function yO(e,t){if(e.additionLines.length===0)return vO(e,t);if(gO(e,e.additionLines))return _O(e,e.additionLines,t);let n=e.additionLines,r=pO(e,t);return xO(r,n),r}function bO(e){return e.length>1&&e.at(-1)===``}function xO(e,t){if(!bO(t))return;let n=t.length-e.additionLines.length;if(n<=0)return;let r=e.additionLines.length,i=e.hunks.at(-1);if(i!=null&&eE(i.additionStart,i.additionCount)===r){for(let a of i.hunkContent)if(a.type===`change`&&a.additions<a.deletions&&a.additionLineIndex+a.additions===r){e.additionLines=t,a.additions+=n,i.additionCount+=n,i.additionLines+=n,jO(e);return}}}function SO(e,t,n){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return CO(e,pO(e,n));let r=Array.from(t);if(r.length===0)return CO(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(let t of r){let r=e.additionLines[t],i=e.deletionLines[t];if(r==null||i==null||pE(r)===pE(i))return CO(e,pO(e,n))}let i=wO(e,r);if(i.size===0)return CO(e,pO(e,n));for(let t of i)if(!EO(e,t,n))return CO(e,pO(e,n));return jO(e),UD(e)?CO(e,pO(e,n)):CO(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function CO(e,t){return Object.assign(e,t),t}function wO(e,t){let n=new Set;for(let r of t){let t=TO(e,r);if(t==null)return new Set;n.add(t)}return n}function TO(e,t){for(let[n,r]of e.hunks.entries()){let e=r.additionLineIndex+r.additionCount;if(t>=r.additionLineIndex&&t<e)return n}}function EO(e,t,n){let r=e.hunks[t];if(r==null)return!1;let i=e.deletionLines.slice(r.deletionLineIndex,r.deletionLineIndex+r.deletionCount),a=e.additionLines.slice(r.additionLineIndex,r.additionLineIndex+r.additionCount),o=kD({name:e.prevName??e.name,contents:i.join(``)},{name:e.name,contents:a.join(``),lang:e.lang},{...n,context:0}),s=o.hunks[0];return s==null||o.hunks.length!==1?!1:(OO(r,s),DO(e,t),!0)}function DO(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 r=e.additionLines.at(-1),i=e.deletionLines.at(-1);n.noEOFCRAdditions=r!=null&&r!==``&&!r.endsWith(`
377
- `),n.noEOFCRDeletions=i!=null&&i!==``&&!i.endsWith(`
378
- `)}function OO(e,t){let n=e.additionLineIndex,r=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(e=>kO(e,n,r)),e.additionLineIndex=n+t.additionLineIndex,e.additionStart+=t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=r+t.deletionLineIndex,e.deletionStart+=t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,AO(e)}function kO(e,t,n){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+n}}function AO(e){let t=0,n=0;for(let r of e.hunkContent)r.type===`context`?(t+=r.lines,n+=r.lines):(t+=Math.max(r.additions,r.deletions),n+=r.additions+r.deletions);e.splitLineCount=t,e.unifiedLineCount=n}function jO(e){let t=0,n=0,r=0;for(let i of e.hunks)i.collapsedBefore=Math.max($T(i.additionStart,i.additionCount)-r,0),i.splitLineStart=t+i.collapsedBefore,i.unifiedLineStart=n+i.collapsedBefore,AO(i),t+=i.collapsedBefore+i.splitLineCount,n+=i.collapsedBefore+i.unifiedLineCount,r=eE(i.additionStart,i.additionCount);if(e.hunks.length>0){let r=e.hunks[e.hunks.length-1],i=Math.max(e.additionLines.length-eE(r.additionStart,r.additionCount),0);t+=i,n+=i}e.splitLineCount=t,e.unifiedLineCount=n}var MO=new WeakMap;function NO(e){return e.length>1&&e[e.length-1]===``?e.slice(0,-1):e}function PO(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let i=e.length,a=t.length;for(;i>r&&a>r&&e[i-1]===t[a-1];)i--,a--;if(r!==i||r!==a)return{start:r,deletionEnd:i,additionEnd:a}}function FO(e,t,n){let r=e.hunks,i=e.additionLines,a=NO(i),o=a===i?e:{...e,additionLines:a},s=KO(r,WO(o,t,n),e.deletionLines.length),c=YO(o,s);if(e.additionLines=a,e.hunks=c,e.editSessionDirty=!0,ak(e),xO(e,i),QO(r,e.hunks))return{regions:s.map(e=>e.previousSpan)}}function IO(e,t,n,r){let i=new Set(t),a=Array.from(i).filter(t=>t>=0&&t<e.additionLines.length).sort((e,t)=>e-t);if(a.length===0)return;let o=t=>i.has(t)?r?.get(t):e.additionLines[t],{hunks:s}=e,c,l=0;for(let t of a){for(;l<s.length;){let e=s[l];if(t<tk(e)+e.additionCount)break;l++}let r=s[l],i=r==null?void 0:tk(r);if(i==null||t<i||c!=null&&c!==l)return FO(e,n,o);c=l}if(c!=null){if(LO(e,a,c,r,n)){e.editSessionDirty=!0;return}return FO(e,n,o)}}function LO(e,t,n,r,i){if(r==null||i?.ignoreWhitespace===!0||i?.stripTrailingCr===!0)return!1;let a=RO(e),o=e.hunks[n];if(o.hunkContent.some(zO))return!1;for(let n of t){let t=r.get(n),i=e.additionLines[n];if(t==null||i==null||a.has(t)||a.has(i))return!1;let s=!1;for(let e of o.hunkContent)if(e.type===`change`&&e.additions===e.deletions&&n>=e.additionLineIndex&&n<e.additionLineIndex+e.additions){s=!0;break}if(!s)return!1}return!0}function RO(e){let t=MO.get(e);if(t?.lines===e.deletionLines)return t.set;let n=new Set(e.deletionLines);return MO.set(e,{lines:e.deletionLines,set:n}),n}function zO(e){return e?.type===`change`&&(e.additions===0||e.deletions===0)}function BO(e,t){let n=new Map,{regions:r}=t;for(let t=0;t<=r.length;t++){let i=r[t-1],a=r[t],o=t===0?e.get(0):i==null?void 0:e.get(i.lastIndex+1),s=a==null?void 0:e.get(a.firstIndex),c=o?.fromStart??0,l=s?.fromEnd??0;(c>0||l>0)&&n.set(t,{fromStart:c,fromEnd:l})}return n}function VO(e,t,n){let r=[];if(e.isPartial)return r;for(let[i,a]of e.hunks.entries()){let o=HD({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:i,collapsedContextThreshold:n});if(o.rangeSize<=n)continue;let s=nk(a),c=s-o.rangeSize;o.fromStart>0&&r.push([c,c+o.fromStart]),o.fromEnd>0&&r.push([s-o.fromEnd,s])}let i=GD({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:`captureExpansionAnchors`});if(i!=null&&i.fromStart>0&&i.rangeSize>n){let t=e.hunks[e.hunks.length-1],n=nk(t)+t.deletionCount;r.push([n,n+i.fromStart])}return r}function HO(e,t){let n=new Map;if(t.length===0)return n;let r=(e,r,i)=>{if(i<=r)return;let a=0,o=0;for(let[e,n]of t)n<=r||e>=i||(e<=r&&(a=Math.max(a,Math.min(n,i)-r)),n>=i&&(o=Math.max(o,i-Math.max(e,r))));(a>0||o>0)&&n.set(e,{fromStart:a,fromEnd:o})};for(let[t,n]of e.hunks.entries()){let e=nk(n);r(t,e-Math.max(n.collapsedBefore,0),e)}let i=e.hunks[e.hunks.length-1];return i!=null&&!e.isPartial&&e.deletionLines.length>0&&r(e.hunks.length,nk(i)+i.deletionCount,e.deletionLines.length),n}function UO(e,t){return e.editSessionDirty===!0&&(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join(``)===``?pO(e,t):yO(e,t)),!0)}function WO(e,t,n){if(PO(e.deletionLines,e.additionLines)==null)return[];let r=kD({name:e.prevName??e.name,contents:e.deletionLines.join(``)},{name:e.name,contents:e.additionLines.join(``),lang:e.lang},t),i,a=(t,a)=>{i??=GO(e.hunks);for(let e=0;e<=a;e++){let o=i.get(t.deletionLineIndex-e);if(o!=null&&o.additions===t.additions&&o.deletions===t.deletions){if(t.additions>0&&n!=null){for(let e=0;e<t.additions;e++)if(n(o.additionLineIndex+e)!==r.additionLines[t.additionLineIndex+e])return a}return e}}return a},o=[],s=0,c=0;for(let e of r.hunks){OE(e,r,a);let t=e.additionCount>0?e.additionLineIndex-s:e.deletionLineIndex-c;s+=t,c+=t;for(let t of e.hunkContent){if(t.type===`context`){s+=t.lines,c+=t.lines;continue}let e=kO(t,0,0);e.additions===0&&(e.additionLineIndex=s),e.deletions===0&&(e.deletionLineIndex=c),o.push(e),s+=e.additions,c+=e.deletions}}return o}function GO(e){let t=new Map;for(let n of e)for(let e of n.hunkContent)e.type===`change`&&(e.additions===0||e.deletions===0)&&t.set(e.deletionLineIndex,e);return t}function KO(e,t,n){let r=e.map((e,t)=>{let n=nk(e);return{deletionStart:n,deletionEnd:n+e.deletionCount,blocks:[],previousSpan:{firstIndex:t,lastIndex:t}}}),i=[],a=0;for(let e of t){let t=e.deletionLineIndex,o=t+e.deletions;for(;a<r.length&&r[a].deletionEnd<t;)i.push(r[a]),a++;let s=i.length>0&&qO(t,o,i[i.length-1])?i.pop():void 0;for(;a<r.length&&r[a].deletionStart<=o;)s=JO(s,r[a]),a++;if(s==null){let c=t,l=o;if((e.deletions===0||e.additions===0)&&n>e.deletions){let e=i[i.length-1]?.deletionEnd??0,s=r[a]?.deletionStart??n;t>e?c--:o<s&&l++}s={deletionStart:c,deletionEnd:l,blocks:[],previousSpan:void 0}}s.deletionStart=Math.min(s.deletionStart,t),s.deletionEnd=Math.max(s.deletionEnd,o),s.blocks.push(e),i.push(s)}for(;a<r.length;)i.push(r[a]),a++;return i}function qO(e,t,n){return e<=n.deletionEnd&&t>=n.deletionStart}function JO(e,t){return e==null?t:(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)),e)}function YO(e,t){let n=[],r=0,i=0;for(let a of t){let t=a.deletionStart-r;if(t<0)throw Error(`buildRegionHunks: overlapping old-side regions`);r+=t,i+=t;let o=i,s=[];for(let e of a.blocks){let t=e.deletionLineIndex-r,n=e.additionLineIndex-i;if(t<0||t!==n)throw Error(`buildRegionHunks: canonical block context mismatch`);ZO(s,t,i,r),r+=t,i+=n,s.push({...e}),r+=e.deletions,i+=e.additions}let c=a.deletionEnd-r;if(c<0)throw Error(`buildRegionHunks: block exceeds its old-side region`);ZO(s,c,i,r),r+=c,i+=c,n.push(XO(e,{additionStart:o,additionEnd:i,deletionStart:a.deletionStart,deletionEnd:a.deletionEnd},s))}if(e.deletionLines.length-r!==e.additionLines.length-i)throw Error(`buildRegionHunks: trailing context mismatch`);return n}function XO(e,t,n){let r=t.additionEnd-t.additionStart,i=t.deletionEnd-t.deletionStart,a=0,o=0;for(let e of n)e.type===`change`&&(a+=e.additions,o+=e.deletions);let s={collapsedBefore:0,additionStart:rk(t.additionStart,r),additionCount:r,additionLines:a,additionLineIndex:ik(t.additionStart,r),deletionStart:rk(t.deletionStart,i),deletionCount:i,deletionLines:o,deletionLineIndex:ik(t.deletionStart,i),hunkContent:n,hunkSpecs:`@@ -${rk(t.deletionStart,i)},${i} +${rk(t.additionStart,r)},${r} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return AO(s),s}function ZO(e,t,n,r){t>0&&e.push({type:`context`,lines:t,additionLineIndex:n,deletionLineIndex:r})}function QO(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(nk(r)!==nk(i)||r.deletionCount!==i.deletionCount||tk(r)!==tk(i)||r.additionCount!==i.additionCount||r.splitLineCount!==i.splitLineCount||!$O(r,i))return!0}return!1}function $O(e,t){let n=ek(e),r=ek(t);for(;;){let e=n.next(),t=r.next();if(e.done===!0||t.done===!0)return e.done===t.done;if(e.value[0]!==t.value[0]||e.value[1]!==t.value[1])return!1}}function*ek(e){for(let t of e.hunkContent){if(t.type===`context`){for(let e=0;e<t.lines;e++)yield[t.deletionLineIndex+e,t.additionLineIndex+e];continue}let e=Math.max(t.deletions,t.additions);for(let n=0;n<e;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function tk(e){return $T(e.additionStart,e.additionCount)}function nk(e){return $T(e.deletionStart,e.deletionCount)}function rk(e,t){return t===0?e:e+1}function ik(e,t){return t===0?e-1:e}function ak(e){jO(e);for(let t=0;t<e.hunks.length;t++)DO(e,t)}function ok(e){let t=e.lang??Dw(e.name),n=e.lang??(e.prevName==null?`text`:Dw(e.prevName));return t===`text`&&n===`text`}var sk=-1,ck=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++sk}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLangs=[`text`];renderCache;pendingHighlightResult;pendingStructuralRows;editSessionActive=!1;constructor(e={theme:yp},t=kw,n,r){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=n,this.workerManager=r,r?.isWorkingPool()!==!0&&(this.highlighter=FS(e.theme??yp)?bC():void 0)}cleanUp(){this.endEditSession(),this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.editSessionActive?(this.renderCache!=null&&(this.renderCache.renderRange=void 0),this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0):this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this)}beginEditSession(e,t){let{editSessionActive:n}=this;this.editSessionActive=!0,n||(this.pendingHighlightResult=void 0),this.diff=e,n&&this.renderCache!=null&&this.renderCache.diff!==e&&this.clearRenderCache();let{renderCache:r}=this;if(!e.isPartial&&e.additionLines.length===0){Object.assign(e,vO(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache();return}if(r==null||n&&r.diff===e)return;let{options:i}=this.getRenderOptions(e),a=r.diff===e,o=t!=null&&YT(r.diff,t),{result:s}=r;if(!r.highlighted||s==null||!MD(r.options,i)||!a&&!o){this.clearRenderCache();return}a||(this.renderCache={diff:e,options:i,highlighted:!0,result:{...s,code:{...s.code,additionLines:[...s.code.additionLines]}},renderRange:r.renderRange})}endEditSession(){this.editSessionActive=!1,this.pendingHighlightResult=void 0,this.diff??this.clearRenderCache()}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){let{diff:e,renderCache:t,workerManager:n}=this;return e==null||t==null||!YT(t.diff,e)||ok(e)||xk(e,this.getTokenizeMaxLength())?Promise.resolve():!this.editSessionActive&&n?.isWorkingPool()===!0&&e.cacheKey!=null?(n.evictDiffFromCache(e.cacheKey),n.primeDiffHighlightCache(e).then(()=>{this.applyRefreshedResult(e,n.getDiffResultCache(e))}).catch(e=>this.onHighlightError(e))):this.asyncHighlight(e).then(t=>this.applyRefreshedResult(e,t)).catch(e=>this.onHighlightError(e))}applyRefreshedResult(e,t){let{diff:n,renderCache:r}=this;if(t==null||n==null||r==null||!YT(n,e)||!YT(r.diff,e)||this.editSessionActive)return;let{options:i}=this.getRenderOptions(n);MD(i,t.options)&&(this.pendingHighlightResult={diff:n,options:t.options,highlighted:!0,result:t.result},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){this.renderCache=void 0,this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){let r={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t===`up`||t===`both`)&&(r.fromStart+=n),(t===`down`||t===`both`)&&(r.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,r)}getExpandedHunk(e){return this.expandedHunks.get(e)??Ep}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(let t of e){let e=(()=>{switch(t.side){case`deletions`:return this.deletionAnnotations;case`additions`:return this.additionAnnotations}})(),n=e[t.lineNumber]??[];e[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,n=!1){this.pendingStructuralRows=void 0;let{renderCache:r}=this;if(r==null)return!1;let{result:i,diff:a}=r;if(i==null)return!1;if(a.isPartial)throw Error(`Could not update render cache for partial diff`);let o=i.code.additionLines,s=this.pendingStructuralRows=n?new Map:void 0,c=[],l=new Map;for(let[t,n]of e){let e=o[t]?.properties??{},r=n.map(e=>e[2]).join(``),i=t<a.additionLines.length,u=i?a.additionLines[t]??``:``,d=pE(u);s==null&&i&&(a.additionLines[t]=uT(u,r),d!==r&&(c.push(t),l.set(t,u)));let f={type:`element`,tagName:`div`,properties:{"data-line":e[`data-line`]??t+1,"data-line-index":e[`data-line-index`]??t,"data-line-type":e[`data-line-type`]??`context`},children:n.map(([e,t,n])=>e===0&&t===``?n===``?{type:`element`,tagName:`br`,properties:{},children:[]}:{type:`text`,value:n}:{type:`element`,tagName:`span`,properties:{"data-char":e,style:`color:${t};`},children:[{type:`text`,value:n}]})};s==null?o[t]=f:s.set(t,f)}let u=!1;if(c.length>0){if(this.editSessionActive){if(a.additionLines.length<=1&&a.additionLines.join(``)===``)this.applyRecomputePreservingSessionType(a,vO(a,this.options.parseDiffOptions)),u=!0;else if(gO(a,a.additionLines))this.applyRecomputePreservingSessionType(a,_O(a,a.additionLines,this.options.parseDiffOptions)),u=!0;else{let e=IO(a,c,this.options.parseDiffOptions,l);this.applyExpansionRemap(e),u=e!=null}}else Object.assign(a,SO(a,c,this.options.parseDiffOptions))}return i.baseThemeType=t,r.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=BO(this.expandedHunks,e))}applyDocumentChange(e){let{pendingStructuralRows:t,renderCache:n}=this;this.pendingStructuralRows=void 0;let r=this.diff??n?.diff;if(r==null)return;let i=n?.result;if(r.isPartial)throw Error(`Could not apply document change for partial diff`);let{additionLines:a}=r;if(r.additionLines=yk(e),i!=null&&(i.code.additionLines=_k(a,r.additionLines,i.code.additionLines,e)),r.additionLines.length<=1&&r.additionLines.join(``)===``?(this.applyRecomputePreservingSessionType(r,vO(r,this.options.parseDiffOptions)),i!=null&&(i.code.additionLines[0]=vk(0,e.getLineText(0)))):this.editSessionActive?this.applySessionDocumentChange(r,a):Object.assign(r,yO(r,this.options.parseDiffOptions)),t!=null&&i!=null)for(let[e,n]of t)e<i.code.additionLines.length&&(i.code.additionLines[e]=n);n!=null&&(n.isDirty=!0)}applySessionDocumentChange(e,t){let{parseDiffOptions:n}=this.options,r=e.additionLines;if(gO(e,r)){this.applyRecomputePreservingSessionType(e,_O(e,r,n));return}this.applyExpansionRemap(FO(e,n,e=>t[e]))}applyRecomputePreservingSessionType(e,t){let n=this.editSessionActive?e.type:void 0;Object.assign(e,t),n!=null&&(e.type=n),this.markEditSessionPass(e)}markEditSessionPass(e){this.editSessionActive&&(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=>vw(e);getOptionsWithDefaults(){let{diffIndicators:e=`bars`,diffStyle:t=`split`,disableBackground:n=!1,disableFileHeader:r=!1,disableLineNumbers:i=!1,disableVirtualizationBuffers:a=!1,collapsed:o=!1,expandUnchanged:s=!1,collapsedContextThreshold:c=1,expansionLineCount:l=100,hunkSeparators:u=`line-info`,lineDiffType:d=`word-alt`,maxLineDiffLength:f=1e3,overflow:p=`scroll`,stickyHeader:m=!1,theme:h=yp,headerRenderMode:g=`default`,tokenizeMaxLineLength:_=1e3,tokenizeMaxLength:v=wp,useTokenTransformer:y=!1,useCSSClasses:b=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:r,disableLineNumbers:i,disableVirtualizationBuffers:a,collapsed:o,expandUnchanged:s,collapsedContextThreshold:c,expansionLineCount:l,hunkSeparators:u,lineDiffType:d,maxLineDiffLength:f,overflow:p,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??h,headerRenderMode:g,tokenizeMaxLineLength:_,tokenizeMaxLength:v,useTokenTransformer:y,useCSSClasses:b}}async initializeHighlighter(){return this.highlighter=await yC(Ow(this.computedLangs,{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=xk(e,this.getTokenizeMaxLength()),r=this.workerManager?.getDiffResultCache(e);r!=null&&!MD(t,r.options)&&(r=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!n&&!ok(e),options:t,result:n?void 0:r?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter??(this.computedLangs=bk(e),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??yp}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 e=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&e.useTokenTransformer!==!0?{...e,useTokenTransformer:!0}:e}let{theme:e,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}=this.getOptionsWithDefaults();return{theme:e,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:t,lineDiffType:n,maxLineDiffLength:r}})();this.getOptionsWithDefaults();let{renderCache:n}=this;return n?.result==null||!YT(e,n.diff)||!MD(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getDiffForNextRender(e){let{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null||this.renderCache==null)return e;if(YT(this.renderCache.diff,e))return this.renderCache.diff;let n=!(e.additionLines.length>0||e.deletionLines.length>0)||ok(e)||xk(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,n)?e:this.renderCache.diff}canRenderDiff(e,t,n){let{renderCache:r}=this;return r==null||YT(r.diff,e)?!0:n?r.result==null&&r.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&FS(t.theme):r.result==null&&r.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!r.highlighted:this.highlighter!=null&&FS(t.theme)}renderDiff(e=this.diff,t=Dp){if(this.diff=e,e==null){this.pendingHighlightResult=void 0;return}let{expandUnchanged:n,collapsedContextThreshold:r}=this.getOptionsWithDefaults(),{options:i,forceHighlight:a}=this.getRenderOptions(e),o=this.getReadyRenderResult(e,i);this.pendingHighlightResult=void 0,o!=null&&(this.renderCache={...o,diff:e,renderRange:void 0},a=!1),this.renderCache??={diff:e,highlighted:!1,options:i,result:void 0,renderRange:void 0};let s=e.additionLines.length>0||e.deletionLines.length>0,c=!s||ok(e)||xk(e,this.getTokenizeMaxLength()),l=this.canRenderDiff(e,i,c),u=!YT(e,this.renderCache.diff),d=!_w(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){let o=this.renderCache.result==null&&this.renderCache.highlighted&&!c&&!u&&Aw(t);l&&!o&&(c||this.renderCache.result==null||!this.renderCache.highlighted&&(u||d))&&(this.renderCache.diff=e,this.renderCache.options=i,this.renderCache.highlighted=!1,(this.renderCache.result==null||u||d||a)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,Aw(t)||n?!0:this.expandedHunks,r)),this.renderCache.renderRange=t),!c&&s&&(!this.renderCache.highlighted||a)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLangs=bk(e),this.highlighter??=bC();let t=this.highlighter!=null&&FS(i.theme),n=this.highlighter!=null&&Np(this.computedLangs),r=!c&&n;if(l&&this.highlighter!=null&&t&&(a||c||!this.renderCache.highlighted&&r||this.renderCache.result==null)){let{result:t,options:i}=this.renderDiffWithHighlighter(e,this.highlighter,c||!n);this.renderCache={diff:e,options:i,highlighted:r,result:t,renderRange:void 0}}(!t||!c&&!n)&&this.asyncHighlight(e).then(({result:t,options:n})=>{this.applyHighlightResult(e,t,n,!c)})}return this.renderCache.result==null?void 0:this.processDiffResult(this.renderCache.diff,t,this.renderCache.result)}async asyncRender(e,t=Dp){this.diff=e;let{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){let{diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o}=this.getOptionsWithDefaults();return Cw({type:`diff`,diffIndicators:r,disableBackground:i,disableLineNumbers:a,overflow:o,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){let t=xk(e,this.getTokenizeMaxLength());this.computedLangs=t?[`text`]:bk(e);let n=this.highlighter!=null&&FS(this.getLocalHighlightTheme()),r=t||this.highlighter!=null&&Np(this.computedLangs);return(this.highlighter==null||!n||!r)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){let{options:r}=this.getRenderOptions(e),{collapsedContextThreshold:i}=this.getOptionsWithDefaults(),a=cO(e,t,r,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:i});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===``&&a.code.additionLines[0]==null){let t;if(eO({diff:e,diffStyle:`both`,expandedHunks:n?!0:void 0,collapsedContextThreshold:i,callback:({additionLine:e})=>{if(e?.lineIndex===0)return t=e,!0}}),t==null)throw Error(`DiffHunksRenderer: missing empty addition line`);a.code.additionLines[0]=vk(0,``,t.unifiedLineIndex,t.splitLineIndex)}return{result:a,options:r}}onHighlightSuccess(e,t,n,r=!0){this.editSessionActive||this.applyHighlightResult(e,t,n,r)}applyHighlightResult(e,t,n,r=!0){let{diff:i,renderCache:a}=this;i!=null&&a!=null&&YT(i,e)&&MD(n,this.getRenderOptions(i).options)&&(a.result!=null&&a.highlighted&&MD(a.options,n)&&YT(a.diff,i)||(this.pendingHighlightResult={diff:i,options:n,highlighted:r,result:t},this.onRenderUpdate?.()))}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;let n=this.workerManager?.getDiffResultCache(e);if(n!=null&&MD(t,n.options))return n}getReadyRenderResult(e,t){let{pendingHighlightResult:n}=this;if(n!=null&&YT(n.diff,e)&&MD(n.options,t))return n;let r=this.getMatchingWorkerResultCache(e,t);if(!(r==null||this.hasHighlightedRenderCache(e,t)))return{diff:e,highlighted:!0,...r}}hasHighlightedRenderCache(e,t){let{renderCache:n}=this;return n?.result!=null&&n.highlighted&&YT(e,n.diff)&&MD(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:n,themeStyles:r,baseThemeType:i}){let{diffStyle:a,disableFileHeader:o,expandUnchanged:s,expansionLineCount:c,collapsedContextThreshold:l,hunkSeparators:u}=this.getOptionsWithDefaults(),d=this.renderCache?.isDirty??!1,f=a===`unified`,p=Sk(e,this.options.loadDiffFiles!=null),m=!e.isPartial||p,h=[],g=[],_=[],v=[],{additionLines:y,deletionLines:b}=n,x={rowCount:0,hunkSeparators:u,additionsContentAST:h,deletionsContentAST:g,unifiedContentAST:_,unifiedGutterAST:IC(),deletionsGutterAST:IC(),additionsGutterAST:IC(),expansionLineCount:c,hunkData:v,incrementRowCount(e=1){x.rowCount+=e},pushToGutter(e,t){switch(e){case`unified`:x.unifiedGutterAST.children.push(t);break;case`deletions`:x.deletionsGutterAST.children.push(t);break;case`additions`:x.additionsGutterAST.children.push(t)}}},S=WD({fileDiff:e,errorPrefix:`DiffHunksRenderer.processDiffResult`}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(a!==`unified`){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side===`additions`?(x.pushToGutter(`additions`,RC(void 0,`buffer`,this.size)),h?.push(ND(this.size))):(x.pushToGutter(`deletions`,RC(void 0,`buffer`,this.size)),g?.push(ND(this.size))),this.size=0,this.side=void 0}}},w=(e,t,n,r,i)=>{x.pushToGutter(e,LC(t,n,r,i))};function ee(e){C.flush(),a===`unified`?mk(`unified`,e,x):(mk(`deletions`,e,x),mk(`additions`,e,x))}this.pushFileLevelAnnotations(e,a,t,x),eO({diff:e,diffStyle:a,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:s?!0:this.expandedHunks,collapsedContextThreshold:l,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,additionLine:o,deletionLine:s,type:c})=>{let l=s==null?o.splitLineIndex:s.splitLineIndex,f=o==null?s.unifiedLineIndex:o.unifiedLineIndex;a===`split`&&c!==`change`&&C.flush(),r>0&&ee({hunkIndex:t,collapsedLines:r,rangeSize:Math.max(n?.collapsedBefore??0,0),hunkSpecs:n?.hunkSpecs,isFirstHunk:t===0,isLastHunk:!1,isExpandable:m});let h=a===`unified`?f:l,g={type:c,hunkIndex:t,lineIndex:h,unifiedLineIndex:f,splitLineIndex:l,deletionLine:s,additionLine:o};if(a===`unified`){let n=this.getUnifiedInjectedRowsForLine?.(g);n?.before!=null&&dk(n.before,x);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex];if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let a=c===`change`?o==null?`change-deletion`:`change-addition`:c,u=this.getUnifiedLineDecoration({type:c,lineType:a,additionLineIndex:o?.lineIndex,deletionLineIndex:s?.lineIndex});w(`unified`,u.gutterLineType,o==null?s.lineNumber:o.lineNumber,`${f},${l}`,u.gutterProperties),i==null?r!=null&&(r=hk(r,u.contentProperties,d&&s!=null?{"data-line":s.lineNumber,"data-line-index":`${f},${l}`}:void 0)):i=hk(i,u.contentProperties,d&&o!=null?{"data-line":o.lineNumber,"data-line-index":`${f},${l}`}:void 0),pk({diffStyle:`unified`,type:c,deletionLine:r,additionLine:i,unifiedSpan:this.getAnnotations(`unified`,s?.lineNumber,o?.lineNumber,t,h),createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&dk(n.after,x)}else{let n=this.getSplitInjectedRowsForLine?.(g);n?.before!=null&&fk(n.before,x,C);let r=s==null?void 0:b[s.lineIndex],i=o==null?void 0:y[o.lineIndex],a=this.getSplitLineDecoration({side:`deletions`,type:c,lineIndex:s?.lineIndex}),u=this.getSplitLineDecoration({side:`additions`,type:c,lineIndex:o?.lineIndex});if(r==null&&i==null){let t=`DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong`;throw console.error(t,{file:e.name}),Error(t)}let f=(()=>{if(c===`change`){if(i==null)return`additions`;if(r==null)return`deletions`}})();f==null?c===`change`&&C.flush():(C.side!=null&&C.side!==f&&C.flush(),C.side=f,C.increment());let p=this.getAnnotations(`split`,s?.lineNumber,o?.lineNumber,t,h);if(p!=null&&C.size>0&&C.flush(),s!=null){let e=hk(r,a.contentProperties,d?{"data-line":s.lineNumber,"data-line-index":`${s.unifiedLineIndex},${l}`}:void 0);w(`deletions`,a.gutterLineType,s.lineNumber,`${s.unifiedLineIndex},${l}`,a.gutterProperties),e!=null&&(r=e)}if(o!=null){let e=hk(i,u.contentProperties,d?{"data-line":o.lineNumber,"data-line-index":`${o.unifiedLineIndex},${l}`}:void 0);w(`additions`,u.gutterLineType,o.lineNumber,`${o.unifiedLineIndex},${l}`,u.gutterProperties),e!=null&&(i=e)}pk({diffStyle:`split`,type:c,additionLine:i,deletionLine:r,...p,createAnnotationElement:e=>this.createAnnotationElement(e),context:x}),n?.after!=null&&fk(n.after,x,C)}let _=a===`split`&&n!=null&&l===n.splitLineStart+n.splitLineCount-1,v=t===e.hunks.length-1&&n!=null&&(a===`split`?l===n.splitLineStart+n.splitLineCount-1:f===n.unifiedLineStart+n.unifiedLineCount-1),T=_?n.noEOFCRDeletions:!1,te=_?n.noEOFCRAdditions:!1,ne=(s?.noEOFCR??!1)||T,E=(o?.noEOFCR??!1)||te;if(E||ne){if(a===`split`&&C.flush(),ne){let e=c===`context`||c===`context-expanded`?c:`change-deletion`;a===`unified`?(x.unifiedContentAST.push(PD(e)),x.pushToGutter(`unified`,RC(e,`metadata`,1))):(x.deletionsContentAST.push(PD(e)),x.pushToGutter(`deletions`,RC(e,`metadata`,1)),E||(x.pushToGutter(`additions`,RC(void 0,`buffer`,1)),x.additionsContentAST.push(ND(1))))}if(E){let e=c===`context`||c===`context-expanded`?c:`change-addition`;a===`unified`?(x.unifiedContentAST.push(PD(e)),x.pushToGutter(`unified`,RC(e,`metadata`,1))):(x.additionsContentAST.push(PD(e)),x.pushToGutter(`additions`,RC(e,`metadata`,1)),ne||(x.pushToGutter(`deletions`,RC(void 0,`buffer`,1)),x.deletionsContentAST.push(ND(1))))}x.incrementRowCount(1)}u!==`simple`&&u!==`metadata`&&(i>0||v&&p)&&ee({hunkIndex:c===`context-expanded`?t:t+1,collapsedLines:v&&p?`unknown`:i,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),x.incrementRowCount(1)}}),a===`split`&&C.flush();let T=Math.max(RD(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),te=t.bufferBefore>0||t.bufferAfter>0,ne=!f&&e.type!==`deleted`,E=!f&&e.type!==`new`,re=x.rowCount>0||te;h=ne&&re?h:void 0,g=E&&re?g:void 0,_=f&&re?_:void 0;let ie=this.createPreElement(g!=null&&h!=null,T);return{fileDiff:e,unifiedGutterAST:f&&re?x.unifiedGutterAST.children:void 0,unifiedContentAST:_,deletionsGutterAST:E&&re?x.deletionsGutterAST.children:void 0,deletionsContentAST:g,additionsGutterAST:ne&&re?x.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:v,preNode:ie,themeStyles:r,baseThemeType:i,headerElement:o?void 0:this.renderHeader(e),totalLines:T,rowCount:x.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:``}}renderCodeAST(e,t){let n=e===`unified`?t.unifiedGutterAST:e===`deletions`?t.deletionsGutterAST:t.additionsGutterAST,r=e===`unified`?t.unifiedContentAST:e===`deletions`?t.deletionsContentAST:t.additionsContentAST;if(n==null||r==null)return;let i=IC(n);return i.properties.style=`grid-row: span ${t.rowCount}`,[i,dT(r,t.rowCount)]}renderFullAST(e,t=[]){let n=this.getOptionsWithDefaults().hunkSeparators===`line-info`,r=this.renderCodeAST(`unified`,e);if(r!=null)return t.push($({tagName:`code`,children:r,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-unified":``}})),{...e.preNode,children:t};let i=this.renderCodeAST(`deletions`,e);i!=null&&t.push($({tagName:`code`,children:i,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-deletions":``}}));let a=this.renderCodeAST(`additions`,e);return a!=null&&t.push($({tagName:`code`,children:a,properties:{"data-code":``,"data-container-size":n?``:void 0,"data-additions":``}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return sv(this.renderFullAST(e,t))}renderPartialHTML(e,t){return sv(t==null?e:$({tagName:`code`,children:e,properties:{"data-code":``,"data-container-size":this.getOptionsWithDefaults().hunkSeparators===`line-info`?``:void 0,[`data-${t}`]:``}}))}pushFileLevelAnnotations(e,t,n,r){if(!lT(n))return;let i=e.type===`new`?[]:this.getAnnotationNames(cT(this.deletionAnnotations)),a=e.type===`deleted`?[]:this.getAnnotationNames(cT(this.additionAnnotations));if(i.length===0&&a.length===0)return;let{createAnnotationElement:o}=this;if(t===`unified`){pk({diffStyle:t,type:`context`,unifiedSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i.concat(a)},createAnnotationElement:o,context:r});return}pk({diffStyle:t,type:`context`,deletionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:i},additionSpan:{type:`annotation`,hunkIndex:-1,lineIndex:-1,annotations:a},createAnnotationElement:o,context:r})}getAnnotations(e,t,n,r,i){let a={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(t!=null)for(let e of this.deletionAnnotations[t]??[])a.annotations.push(this.annotationSlotName(e));let o={type:`annotation`,hunkIndex:r,lineIndex:i,annotations:[]};if(n!=null)for(let t of this.additionAnnotations[n]??[])(e===`unified`?a:o).annotations.push(this.annotationSlotName(t));if(e===`unified`)return a.annotations.length>0?a:void 0;if(o.annotations.length!==0||a.annotations.length!==0)return{deletionSpan:a,additionSpan:o}}getAnnotationNames(e){return e?.map(e=>this.annotationSlotName(e))??[]}renderHeader(e){let{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return bw({fileOrDiff:e,mode:t,stickyHeader:n})}},lk=new Intl.PluralRules(`en-US`);function uk(e){return`${e} unmodified line${lk.select(e)===`one`?``:`s`}`}function dk(e,t){for(let n of e)t.unifiedContentAST.push(n.content),t.pushToGutter(`unified`,n.gutter),t.incrementRowCount(1)}function fk(e,t,n){for(let{deletion:r,addition:i}of e){if(r==null&&i==null)continue;let e=r!=null&&i!=null?void 0:r==null?`deletions`:`additions`;(e==null||n.side!==e)&&n.flush(),r!=null&&(t.deletionsContentAST.push(r.content),t.pushToGutter(`deletions`,r.gutter)),i!=null&&(t.additionsContentAST.push(i.content),t.pushToGutter(`additions`,i.gutter)),e!=null&&(n.side=e,n.increment()),t.incrementRowCount(1)}}function pk({diffStyle:e,type:t,deletionLine:n,additionLine:r,unifiedSpan:i,deletionSpan:a,additionSpan:o,createAnnotationElement:s,context:c}){let l=!1;if(e===`unified`){if(r==null?n!=null&&c.unifiedContentAST.push(n):c.unifiedContentAST.push(r),i!=null){let e=t===`change`?n==null?`change-addition`:`change-deletion`:t;c.unifiedContentAST.push(s(i)),c.pushToGutter(`unified`,RC(e,`annotation`,1)),l=!0}}else if(e===`split`){if(n!=null&&c.deletionsContentAST.push(n),r!=null&&c.additionsContentAST.push(r),a!=null){let e=t===`change`?n==null?`context`:`change-deletion`:t;c.deletionsContentAST.push(s(a)),c.pushToGutter(`deletions`,RC(e,`annotation`,1)),l=!0}if(o!=null){let e=t===`change`?r==null?`context`:`change-addition`:t;c.additionsContentAST.push(s(o)),c.pushToGutter(`additions`,RC(e,`annotation`,1)),l=!0}}l&&c.incrementRowCount(1)}function mk(e,{hunkIndex:t,collapsedLines:n,rangeSize:r,hunkSpecs:i,isFirstHunk:a,isLastHunk:o,isExpandable:s},c){if(typeof n==`number`&&n<=0)return;let l=e===`unified`?c.unifiedContentAST:e===`deletions`?c.deletionsContentAST:c.additionsContentAST;if(c.hunkSeparators===`metadata`){i!=null&&(c.pushToGutter(e,ID({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),l.push(ID({type:`metadata`,content:i,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1));return}if(c.hunkSeparators===`simple`){t>0&&(c.pushToGutter(e,ID({type:`simple`,isFirstHunk:a,isLastHunk:!1})),l.push(ID({type:`simple`,isFirstHunk:a,isLastHunk:!1})),e!==`additions`&&c.incrementRowCount(1));return}let u=LD(e,t),d=r>c.expansionLineCount,f=s?t:void 0,p=typeof n==`number`?uk(n):`More unchanged context may be available`;c.pushToGutter(e,ID({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),l.push(ID({type:c.hunkSeparators,content:p,expandIndex:f,chunked:d,slotName:u,isFirstHunk:a,isLastHunk:o})),e!==`additions`&&c.incrementRowCount(1),c.hunkData.push({slotName:u,hunkIndex:t,lines:typeof n==`number`?n:0,lineCountKnown:typeof n==`number`,type:e,expandable:s?{up:!a,down:!o,chunked:d}:void 0})}function hk(e,t,n){return e==null||e.type!==`element`||t==null&&n==null?e:{...e,properties:{...e.properties,...t,...n}}}function gk(e){return e.length>0&&e[e.length-1]===``?e.length-1:e.length}function _k(e,t,n,r){let i=gk(e),a=gk(t),o=Math.min(i,a),s=0;for(;s<o&&e[s]===t[s];)s++;let c=0;for(;c<o-s&&e[i-1-c]===t[a-1-c];)c++;let l=Array(t.length);for(let e=0;e<s;e++)l[e]=n[e];for(let e=0;e<c;e++)l[a-1-e]=n[i-1-e];i<e.length&&a<t.length&&(l[t.length-1]=n[e.length-1]);for(let e=s;e<t.length;e++)l[e]??=vk(e,r.getLineText(e));return l}function vk(e,t,n=e,r=e){return{type:`element`,tagName:`div`,properties:{"data-line":e+1,"data-line-index":`${n},${r}`,"data-line-type":`context`},children:[{type:`element`,tagName:`span`,properties:{"data-char":0},children:[{type:`text`,value:t}]}]}}function yk(e){let t=[];for(let n=0;n<e.lineCount;n++)t.push(e.getLineText(n,!0));return t}function bk(e){if(e.lang!=null)return[e.lang];let t=Dw(e.prevName??e.name),n=Dw(e.name);return t===n?[n]:[t,n]}function xk(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function Sk(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function Ck(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function wk(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}async function Tk(e,t=300){let n;try{await Promise.race([e(),new Promise(e=>{n=setTimeout(e,t)})])}finally{n!=null&&clearTimeout(n)}}function Ek({oldFile:e,newFile:t},n){if(e!==void 0||t!==void 0){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}}return{oldFile:e,newFile:t}}}function Dk(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:RT(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?`default`:`custom`}}function Ok(e){return e.isPartial&&(e.type===`change`||e.type===`rename-changed`||e.type===`rename-pure`)}function kk(e){let t={...e};return delete t.cacheKey,t}function Ak(e,t){if(e.isPartial||t.isPartial)throw Error(`FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated`);let n=e.lang??Dw(e.name),r=t.lang??Dw(t.name),i=e.type!==`new`,a=t.type!==`new`;return e.name!==t.name||n!==r||i!==a||e.deletionLines.length!==t.deletionLines.length||e.deletionLines.some((e,n)=>e!==t.deletionLines[n])}function jk(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Mk(e,t){let{oldFile:n}=e;return n==null?t.type===`new`:t.type!==`new`&&n.name===(t.prevName??t.name)&&jk(n.lines,t.deletionLines)}var Nk=-1,Pk=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++Nk}`;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;editSession;renderedDiff;renderRange;pendingFiles;appliedPreAttributes;headerCache={lastRenderedHTML:void 0,html:void 0,fileDiff:void 0};lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:yp},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new lw,this.scrollSyncManager=new jD,this.interactionManager=new HC(`diff`,UC(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()};getTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??yp}getHunksRendererOptions(e){return Dk(e)}createHunksRenderer(e){return new ck(this.getHunksRendererOptions(e),this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t=`additions`)=>this.getLineIndexForDiff(this.getDiffForLineIndex(),e,t);getDiffForLineIndex(){return this.getRenderedDiff()}getLineIndexForDiff(e,t,n){if(e==null)return;let r=e.hunks.at(-1),i,a;hunkIterator:for(let o of e.hunks){let e=n===`deletions`?o.deletionStart:o.additionStart,s=n===`deletions`?o.deletionCount:o.additionCount,c=$T(e,s)+1,l=o.splitLineStart,u=o.unifiedLineStart;if(t<c){let e=c-t;i=Math.max(u-e,0),a=Math.max(l-e,0);break hunkIterator}if(t>=c+s){if(o===r){let e=t-(c+s);i=u+o.unifiedLineCount+e,a=l+o.splitLineCount+e;break hunkIterator}continue}for(let e of o.hunkContent)if(e.type===`context`){if(t<c+e.lines){let e=t-c;a=l+e,i=u+e;break hunkIterator}c+=e.lines,l+=e.lines,u+=e.lines}else{let r=n===`deletions`?e.deletions:e.additions;if(t<c+r){let r=t-c;i=u+(n===`additions`?e.deletions:0)+r,a=l+r;break hunkIterator}c+=r,l+=Math.max(e.deletions,e.additions),u+=e.deletions+e.additions}break hunkIterator}if(i!=null&&a!=null)return[i,a]}setOptions(e){e!=null&&(this.options=e,this.clearReusableHeader(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(UC(this.options,typeof this.options.hunkSeparators==`function`||(this.options.hunkSeparators??`line-info`)===`line-info`||this.options.hunkSeparators===`line-info-basic`?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??`system`)!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme==`string`||this.fileContainer==null||this.appliedThemeCSS==null)return!1;let t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType!==t&&(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!OC(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();getAnnotationSlotName=e=>LT(this.editSession?.annotations,e,kw);getLatestAnnotations(){return this.editSession?.annotations?.current??this.lineAnnotations}isNewAnnotations(e){let t=this.editSession?.annotations;return e===this.lineAnnotations?!1:t==null||e!==t.provided&&e!==t.current}setLineAnnotations(e){let t=this.editSession?.annotations;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,IT(t,e,kw))}syncEditSessionAnnotationsFromEditor(e){let t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.hunksRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators==`function`)}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??`additions`})}flushDeferredLineState(){let{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),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;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):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators==`function`||e===`scroll`&&(this.getLatestAnnotations().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){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){let{editor:t}=this;TC(this.handleEditSessionRender),this.emitPostRender(!0),t?.cleanUp(e?`recycle`:`discard`),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,e||(this.pendingFiles=void 0),this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.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.headerCache.lastRenderedHTML=void 0,e||this.clearReusableHeader(),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():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.editSession=void 0,this.renderedDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),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:r,fileDiff:i,...a}){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 o=Ek(a,`FileDiff.hydrate`),s=o?.oldFile,c=o?.newFile;this.hydrateElements(e,t);let l=this.editor!=null;l||zk(this.pre,Lk({fileDiff:i,oldFile:s,newFile:c}),this.options.collapsed)||Bk(this.headerElement,Rk({fileDiff:i,oldFile:s,newFile:c}),this.options.disableFileHeader)?this.render({...a,fileContainer:e,lineAnnotations:r,fileDiff:i,forceRender:l||a.forceRender,preventEmit:!0}):this.hydrationSetup({fileDiff:i,lineAnnotations:r,...o}),n||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),MT(e,t);for(let t of e.shadowRoot?.children??[]){if(t instanceof SVGElement){this.spriteSVG=t;continue}if(t instanceof HTMLElement){if(t instanceof HTMLPreElement){this.pre=t;for(let e of t.children)e instanceof HTMLElement&&e.tagName.toLowerCase()===`code`&&(`deletions`in e.dataset&&(this.codeDeletions=e),`additions`in e.dataset&&(this.codeAdditions=e),`unified`in e.dataset&&(this.codeUnified=e));continue}if(`diffsHeader`in t.dataset){this.headerElement=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-theme-css`)){this.themeCSSStyle=t;continue}if(t instanceof HTMLStyleElement&&t.hasAttribute(`data-unsafe-css`)){this.unsafeCSSStyle=t,this.appliedUnsafeCSS=t.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute(`data-dehydrated`)),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:n,lineAnnotations:r}){this.lineAnnotations=r??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&n!==void 0?kD(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderedDiff=this.fileDiff,this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.loadFilesIfNecessary(),this.hunksRenderer.expandHunk(e,t,n),this.rerender()};loadFilesIfNecessary(){let{fileDiff:e,options:{loadDiffFiles:t}}=this;if(e==null||!Ok(e)||this.pendingFiles?.fileDiff===e)return;if(t==null)throw Error(`FileDiff: loadDiffFiles is required to load full files for a partial diff`);let n=this.loadFilesForDiff(e,t),r=this.pendingFiles={fileDiff:e,promise:n};r.promise=n.finally(()=>{this.pendingFiles===r&&(this.pendingFiles=void 0)})}__canAttachEditor(){return this.fileDiff!=null&&!this.fileDiff.isPartial}async prepareForEditing(){if(this.__canAttachEditor())return;let e=this.__prepareForEditing();if(e==null)throw this.fileDiff?.isPartial===!0&&!Ok(this.fileDiff)?Error(`FileDiff.prepareForEditing: this partial diff cannot be hydrated; provide a complete diff`):Error(`FileDiff.prepareForEditing: a partial diff requires loadDiffFiles`);if(await e,!this.__canAttachEditor())throw Error(`FileDiff.prepareForEditing: the diff did not finish loading`)}__prepareForEditing(){if(!this.__canAttachEditor()){if(this.fileDiff?.isPartial===!0&&!Ok(this.fileDiff))throw Error(`FileDiff: this partial diff cannot be hydrated; provide a complete diff to edit`);return this.loadFilesIfNecessary(),this.pendingFiles?.promise}}async loadFilesForDiff(e,t){try{let n=await t(e);if(this.fileDiff!==e)return;await this.handleFilesLoaded(e,n)}catch(e){if(this.options.disableErrorHandling===!0)throw e;console.error(e)}}async handleFilesLoaded(e,t){if(this.fileDiff===e&&e.isPartial){if(iE(`merge`,e,t),this.setHydratedState(t),this.installHydratedSessionDiff(e)){this.rerender();return}await Tk(()=>this.primeHighlightCache(e)),this.enabled&&this.fileDiff===e&&this.rerender()}}installHydratedSessionDiff(e){if(e.isPartial)throw Error(`FileDiff.installHydratedSessionDiff: diffs cannot be partial for editing`);return this.fileDiff===e&&this.editSession?.outgoingDiff!=null&&(this.installEditSession(e),!0)}updateExternalDiff(e,t){if(YT(this.fileDiff,e))return!1;let n=this.editSession?.outgoingDiff??this.editSession?.diff;return this.fileDiff=e,n!=null&&(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e),this.editSession!=null&&(this.editSession.outgoingDiff=n)),this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=FT(t,kw,this.editSession.annotations)),!0}installEditSession(e,t,n){let r=e.additionLines.join(``),i=t==null?void 0:rE(t.contents),a=n!=null&&Mk(n,e);if(n!=null&&!a)throw Error(`FileDiff: retained session cannot resume against a different old file`);if(t!=null&&t.contents!==r&&!a)throw Error(`FileDiff: retained edits are missing their diff session state`);let o=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===r,s=kk(e);t!=null&&i!=null&&!o&&(s.name=t.name,s.lang=t.lang),a&&n!=null&&i!=null&&(s.additionLines=i,s.type=n.type,s.hunks=n.hunks,s.editSessionDirty=!0,jO(s)),this.editSession={diff:s,annotations:this.editSession?.annotations??FT(this.lineAnnotations,kw),outgoingDiff:this.editSession?.outgoingDiff},this.hunksRenderer.beginEditSession(s,o&&!a?e:void 0)}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:r=!1,lineAnnotations:i,fileContainer:a,containerWrapper:o,renderRange:s,...c}){if(!this.enabled)throw Error(`FileDiff.render: attempting to call render after cleaned up`);let l=Ek(c,`FileDiff.render`),u=l?.oldFile,d=l?.newFile;this.editor?.__postponeBgTokenizeToNextFrame();let{collapsed:f=!1,themeType:p=`system`,expandUnchanged:m=!1}=this.options,h=f?void 0:s,g=this.hasThemeChanged(),_=l!=null,v=_&&(!Ik(u,this.deletionFile)||!Ik(d,this.additionFile)),y=e!=null&&!YT(e,this.fileDiff),b=i!=null&&(i.length>0||this.getLatestAnnotations().length>0)&&this.isNewAnnotations(i);if(!f&&_w(h,this.renderRange)&&!n&&!b&&!g&&(e!=null&&!y||e==null&&!v)){let e=this.applyCachedThemeState(p);return e&&this.finalizeRender(),e}let x;e==null&&_&&(v||this.fileDiff==null)&&(x=kD(l.oldFile,l.newFile,this.options.parseDiffOptions));let{renderRange:S}=this;this.renderRange=h,_?(this.deletionFile=u,this.additionFile=d):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null&&y?this.updateExternalDiff(e,i):x!=null&&(y=!0,this.updateExternalDiff(x,i)),y&&this.clearReusableHeader(),i!=null&&this.setLineAnnotations(i);let C=this.getLatestDiff();if(C==null)return!1;C.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(UO(C,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.getLatestAnnotations());let{disableErrorHandling:w=!1,disableFileHeader:ee=!1}=this.options;if(ee&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.headerCache.lastRenderedHTML=void 0),this.clearHeaderSlots()),a=this.getOrCreateFileContainer(a,o),this.applyCachedThemeState(p),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{let e=this.hunksRenderer.renderDiff(C,Op);e!=null&&this.applyThemeState(a,e.themeStyles,p,e.baseThemeType),e?.headerElement!=null&&this.applyHeaderToDOM(e.headerElement,a,e.fileDiff),this.renderSeparators([]),this.renderedDiff=e?.fileDiff??C,this.injectUnsafeCSS()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return this.finalizeRender(),r||this.emitPostRender(),!0}try{let e=this.getOrCreatePreNode(a);if(!(this.canPartiallyRender(n,b,v||y||g||!YT(this.renderedDiff,C))&&this.applyPartialRender({fileDiff:C,previousRenderRange:S,renderRange:h}))){let t=this.hunksRenderer.renderDiff(C,h);if(t==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(a,t.themeStyles,p,t.baseThemeType),t.headerElement!=null&&this.applyHeaderToDOM(t.headerElement,a,t.fileDiff),t.additionsContentAST!=null||t.deletionsContentAST!=null||t.unifiedContentAST!=null?this.applyHunksToDOM(e,t):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(t.hunkData),this.renderedDiff=t.fileDiff}this.applyBuffers(e,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(e){if(w)throw e;console.error(e),e instanceof Error&&this.applyErrorToDOM(e,a)}return r||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){let{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,`unmount`);return}if(t==null)return;let r=this.mounted?`update`:`mount`;this.mounted=!0,n?.(t,this,r)}getLatestDiff(e=this.fileDiff){return this.editSession?.diff??e}getRenderedDiff(){return this.renderedDiff}syncRenderViewToEditor(){let{editor:e,fileContainer:t}=this,n=this.getLatestAnnotations(),r=this.computeEditorRenderRange(this.renderRange),i=this.getLatestDiff();if(e==null||t==null||i==null||i.isPartial)return;let a=a=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.getLatestDiff()!==i)return;let o=this.editSession?.outgoingDiff,{fileDiff:s}=this,c=o!=null&&s!=null&&o!==i,l=c&&o!=null&&s!=null?Ak(o,s):!1;e.__syncRenderView({highlighter:a,fileContainer:t,fileDiff:i,lineAnnotations:n,renderRange:r,externalDocument:c,resetHistory:l})},o=this.getTheme(),s=i.lang??Dw(i.name),c=bC({theme:o,lang:s});c==null?yC({themes:NS(o),langs:[`text`,s],preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(a):a(c)}computeEditorRenderRange(e){let t=this.getLatestDiff();if(e==null||t==null||Aw(e))return e;let{diffStyle:n=`split`,expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a,o;return eO({diff:t,diffStyle:n,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i,callback:({additionLine:e})=>{e!=null&&(a??=e.lineNumber,o=e.lineNumber)}}),a==null||o==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:a-1,totalLines:o-a+1}}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.outgoingDiff=void 0)}__acceptEditorChange(e){let{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){let{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(e=!0){let{fileDiff:t,editSession:{diff:n,outgoingDiff:r}={}}=this;if(r!=null&&t!=null){if(!t.isPartial&&Ak(r,t))return;n=r}if(!(n==null||n.isPartial))return{diffSession:{oldFile:n.type===`new`?null:{name:n.prevName??n.name,lines:e?[...n.deletionLines]:n.deletionLines},type:n.type,hunks:e?ZT(n.hunks):n.hunks},hasChanges:n.editSessionDirty===!0}}__attachEditor(e){if(this.type!==`file-diff`)throw Error(`FileDiff.__attachEditor: cannot attach an editor to a "${this.type}" diff`);if(this.editor!=null)throw Error(`FileDiff.__attachEditor: an editor is already attached`);if(!this.__canAttachEditor())throw Error(`FileDiff.__attachEditor: a complete diff is required before editing`);let t=()=>{this.editor=void 0,this.finishEditSession()};try{return this.resumeEditorRendering(e),t}catch(e){throw t(),e}}__resumeEditor(e){if(this.editor!==e)throw Error(`FileDiff.__resumeEditor: editor association changed`);this.resumeEditorRendering(e)}resumeEditorRendering(e){let{fileDiff:t}=this,n=this.editSession?.outgoingDiff;n!=null&&t!=null&&!t.isPartial&&this.editSession?.diff===n&&this.installEditSession(t);let r=this.editSession==null&&t!=null&&!t.isPartial?t:void 0;r==null?this.editSession!=null&&this.hunksRenderer.beginEditSession(this.editSession.diff):this.installEditSession(r,e.__getDocumentContents(Fk(r)),e.__getDocumentSessionState()),this.editor=e,this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary();let i=this.editSession?.diff;this.hunksRenderer.editorRenderReady()?(i!=null&&this.hunksRenderer.diffCache===i&&(this.renderedDiff=i),this.syncRenderViewToEditor()):this.rerender()}finishEditSession(){this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks()}__completeEditSession(e,t){this.settleEditSession(t===`install`,e)}settleEditSession(e,t){let{editSession:n,fileDiff:r,lineAnnotations:i}=this;if(n==null||r==null)return;let{diff:a,annotations:o}=n;if(this.editor!=null)throw Error(`FileDiff.__completeEditSession: detach the editor before completing the session`);this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks();let s=o?.current,c,l=null,u=null,d=!1,f;if(t==null)throw Error(`FileDiff.__completeEditSession: editor is required for completion`);let p=QT(a),m={name:p.name,contents:p.additionLines.join(``)};p.lang!=null&&(m.lang=p.lang);let h={fileDiff:p,editor:t,originalFileDiff:r,oldFile:p.type===`new`?null:{name:p.prevName??p.name,contents:p.deletionLines.join(``)},newFile:m,lineAnnotations:s,originalLineAnnotations:i};Object.freeze(h);try{if(t.__emitEditComplete(h),this.options.onEditComplete?.(h)===`accept`){if(p.cacheKey!=null&&p.cacheKey===r.cacheKey)throw Error(`FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey`);c=p,l=h.oldFile,u=h.newFile}}catch(e){d=!0,f=e}if(e&&c!=null&&(this.fileDiff=c,this.additionFile!=null&&(this.deletionFile=l,this.additionFile=u),s!=null&&(this.lineAnnotations=s)),this.editSession=void 0,e&&this.fileContainer!=null&&this.rerender(),d)throw f}finalizeEditSessionHunks(){let e=this.getLatestDiff();if(e==null||e.editSessionDirty!==!0)return!1;let{collapsedContextThreshold:t=1}=this.options,n=VO(e,this.hunksRenderer.getExpandedHunksMap(),t);return UO(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(HO(e,n)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){let n=this.editSession?.diff;if(n==null)throw Error(`FileDiff.applyDocumentChange: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(n),this.hunksRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t),this.rerender(),this.interactionManager.setSelectionDirty()}applySuspendedDocumentChange(e,t){this.applyDocumentChange(e,t),this.hunksRenderer.clearRenderCache()}updateRenderCache(e,t,n={}){let r=this.editSession?.diff;if(r==null)throw Error(`FileDiff.updateRenderCache: requires an active edit session`);this.detachAdditionLines(),this.hunksRenderer.beginEditSession(r);let{shouldRefreshDiffsView:i,lineCountChangeInFlight:a}=n;if(this.hunksRenderer.updateRenderCache(e,t,a)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}i===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle===`split`?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}detachAdditionLines(){let e=this.editSession?.diff,{fileDiff:t}=this;e!=null&&(e.additionLines===t?.additionLines||e.additionLines===e.deletionLines)&&(e.additionLines=[...e.additionLines])}isLineRenderable(e){let t=this.getRenderedDiff();if(t==null)return!0;let{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return KD({fileDiff:t,lineNumber:e,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}getNearestRenderableLine(e,t){let n=this.getRenderedDiff();if(n==null)return e;let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options;return qD({fileDiff:n,lineNumber:e,direction:t,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:i})}revealLine(e){let t=this.getRenderedDiff(),{expandUnchanged:n=!1,collapsedContextThreshold:r=1,expansionLineCount:i=100}=this.options;if(t==null||t.isPartial||n)return!1;let a=this.hunksRenderer.getExpandedHunksMap();for(let[n,o]of t.hunks.entries()){let[s,c]=VD(o);if(e<s){let c=HD({isPartial:t.isPartial,rangeSize:o.collapsedBefore,expandedHunks:a,hunkIndex:n,collapsedContextThreshold:r}),l=s-c.rangeSize;if(c.renderAll||e<l+c.fromStart||e>=s-c.fromEnd)return!1;let u=e-(l+c.fromStart)+1,d=s-c.fromEnd-e;return u<=d?this.expandHunk(n,`up`,u+i):this.expandHunk(n,`down`,d+i),!0}if(e<c)return!1}let o=GD({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:a,collapsedContextThreshold:r,errorPrefix:`FileDiff.revealLine`});if(o==null||o.renderAll)return!1;let s=t.hunks[t.hunks.length-1],[,c]=VD(s);return e<c+o.fromStart||e>=c+o.rangeSize?!1:(this.expandHunk(t.hunks.length,`up`,e-(c+o.fromStart)+1+i),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){wC(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 e=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:`open`});this.placeHolder=document.createElement(`div`),this.placeHolder.dataset.placeholder=``,e.appendChild(this.placeHolder)}return this.setPlaceholderHeight(e)}setPlaceholderHeight(e){return this.placeHolder!=null&&(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||ok(e))return;let n=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>n||await t.primeDiffHighlightCache(e).catch(e=>{console.error(e)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.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.headerCache.lastRenderedHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){let{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!=`function`){for(let{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();return}let n=new Map(this.separatorCache);for(let r of e){let e=r.slotName,i=this.separatorCache.get(e);if(i==null||!wk(r,i.hunkData)){i?.element.remove();let n=document.createElement(`div`);n.style.display=`contents`,n.slot=r.slotName;let a=t(r,this);a!=null&&n.appendChild(a),this.fileContainer.appendChild(n),i={element:n,hunkData:r},this.separatorCache.set(e,i)}n.delete(e)}for(let[e,{element:t}]of n.entries())this.separatorCache.delete(e),t.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(let{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear();return}let e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,n=this.getLatestAnnotations();if(t!=null&&n.length>0)for(let[r,i]of n.entries()){let n=this.getAnnotationSlotName(i),a=`${r}-${n}`,o=this.annotationCache.get(a);if(o==null||!Ck(i,o.annotation)){o?.element.remove();let e=t(i);if(e==null)continue;o={element:gT(n),annotation:i},o.element.appendChild(e),this.fileContainer.appendChild(o.element),this.annotationCache.set(a,o)}e.delete(a)}for(let[t,{element:n}]of e.entries())this.annotationCache.delete(t),n.remove()}renderGutterUtility(){let{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}let n=_T();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){let{fileContainer:n}=this,r=e??n??document.createElement(`diffs-container`),i=n!==r;return n!=null&&i&&this.editor?.__captureFocusForDOMReplacement(),i&&this.emitPostRender(!0),this.fileContainer=r,n!=null&&i&&(this.headerCache.lastRenderedHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),i&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){let{shadowRoot:t}=e;if(t!=null)for(let e of t.children)e instanceof SVGElement?this.spriteSVG??=e:PT(e)&&e.hasAttribute(`data-theme-css`)?(this.themeCSSStyle??=e,this.hasAdoptedThemeCSS=!0):PT(e)&&e.hasAttribute(`data-unsafe-css`)&&(this.unsafeCSSStyle??=e,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});if(this.spriteSVG==null){let e=document.createElement(`div`);e.innerHTML=fT;let t=e.firstChild;t instanceof SVGElement&&(this.spriteSVG=t)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return this.pre==null?(this.pre=document.createElement(`pre`),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(let t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute(`data-unified`)?this.codeUnified=t:t.hasAttribute(`data-deletions`)?this.codeDeletions=t:t.hasAttribute(`data-additions`)&&(this.codeAdditions=t))}applyHeaderToDOM(e,t,n){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;let{headerCache:{fileDiff:r,html:i,lastRenderedHTML:a}}=this,o=(n!==this.editSession?.diff&&YT(r,n)?i:void 0)??sv(e);if(this.headerCache.html=o,this.headerCache.fileDiff=n,o!==a){let e=document.createElement(`div`);e.innerHTML=o;let n=e.firstElementChild;if(!(n instanceof HTMLElement))return;this.headerElement==null?t.shadowRoot?.prepend(n):t.shadowRoot?.replaceChild(n,this.headerElement),this.headerElement=n,this.headerCache.lastRenderedHTML=o}if(this.isContainerManaged)return;let{renderCustomHeader:s,renderHeaderPrefix:c,renderHeaderFilenameSuffix:l,renderHeaderMetadata:u}=this.options;if(s!=null){let e=s(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,vp,e),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}let d=c?.(n)??void 0,f=l?.(n)??void 0,p=u?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,hp,d),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,gp,f),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,_p,p),this.headerCustom?.remove(),this.headerCustom=void 0}clearReusableHeader(){this.headerCache.html=void 0,this.headerCache.fileDiff=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,r){if(r==null){t?.remove();return}let i=t??this.createHeaderSlotElement(n);return t??e.appendChild(i),this.replaceHeaderSlotContent(i,r),i}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){let t=document.createElement(`div`);return t.slot=e,t}injectUnsafeCSS(){let{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===``){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}(this.unsafeCSSStyle?.parentNode!==t||this.appliedUnsafeCSS!==e)&&(this.unsafeCSSStyle??=vT(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=TT(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,r){let i=e.shadowRoot??e.attachShadow({mode:`open`}),a=r??n,o=this.getTheme(),s=typeof o==`string`?o:{...o},c=xT(i);if(this.themeCSSStyle?.parentNode===i&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===a&&this.appliedThemeCSS.scrollbarGutter===c){this.appliedThemeCSS.theme=s;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===i){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c};return}this.themeCSSStyle=BT({shadowRoot:i,currentNode:this.themeCSSStyle,themeCSS:ET(t,a,c)}),this.appliedThemeCSS=this.themeCSSStyle==null?void 0:{theme:s,themeStyles:t,themeType:a,baseThemeType:r,scrollbarGutter:c}}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;e!=null&&this.themeCSSStyle!=null&&(this.themeCSSStyle.textContent=DT(this.themeCSSStyle.textContent??``,xT(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&UT()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?zT(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,n){let r=this.getColumnPair(e);if(r==null)return!1;let i=Vk(t[0]),a=Vk(t[1]);return i==null||a==null?!1:(r.gutter.innerHTML=sv(i),r.content.innerHTML=sv(a),n!==this.lastRowCount&&(r.gutter.style.setProperty(`grid-row`,`span ${n}`),r.content.style.setProperty(`grid-row`,`span ${n}`)),!0)}replaceCodeColumns(e,t){let{overflow:n=`scroll`}=this.options,r=(this.options.hunkSeparators??`line-info`)===`line-info`,i=n===`wrap`?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let a=!1,o=[],s=this.hunksRenderer.renderCodeAST(`unified`,t),c=this.hunksRenderer.renderCodeAST(`deletions`,t),l=this.hunksRenderer.renderCodeAST(`additions`,t);this.editor?.__captureFocusForDOMReplacement(),s==null?c!=null||l!=null?(c==null?(this.codeDeletions?.remove(),this.codeDeletions=void 0):(a=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=jT({code:this.codeDeletions,columnType:`deletions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeDeletions,c,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(c)),o.push(this.codeDeletions)),l==null?(this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=a||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=jT({code:this.codeAdditions,columnType:`additions`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeAdditions,l,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(l)),o.push(this.codeAdditions))):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0):(a=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=jT({code:this.codeUnified,columnType:`unified`,rowSpan:i,containerSize:r}),this.applyCodeColumnsInPlace(this.codeUnified,s,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s)),o.push(this.codeUnified)),o.length===0?e.textContent=``:a&&e.replaceChildren(...o),this.lastRowCount=t.rowCount}applyPartialRender({fileDiff:e,previousRenderRange:t,renderRange:n}){let{pre:r,codeUnified:i,codeAdditions:a,codeDeletions:o,options:{diffStyle:s=`split`}}=this;if(r==null||t==null||n==null||!Number.isFinite(t.totalLines)||!Number.isFinite(n.totalLines)||this.lastRowCount==null)return!1;let c=this.getCodeColumns(s,i,o,a);if(c==null)return!1;let l=t.startingLine,u=n.startingLine,d=l+t.totalLines,f=u+n.totalLines,p=Math.max(l,u),m=Math.min(d,f);if(m<=p)return!1;let h=Math.max(0,p-l),g=Math.max(0,d-m),_=this.trimColumns({columns:c,trimStart:h,trimEnd:g,previousStart:l,overlapStart:p,overlapEnd:m,diffStyle:s});if(_<0)throw Error(`FileDiff.applyPartialRender: failed to trim to overlap`);if(this.lastRowCount<_)throw Error(`FileDiff.applyPartialRender: trimmed beyond DOM row count`);let v=this.lastRowCount-_,y=(t,n)=>{if(!(n<=0))return this.hunksRenderer.renderDiff(e,{startingLine:t,totalLines:n,bufferBefore:0,bufferAfter:0})},b=y(u,Math.max(p-u,0));if(b==null&&u<p)return!1;let x=y(m,Math.max(f-m,0));if(x==null&&f>m)return!1;let S=(e,t)=>{if(e!=null){if(s===`unified`&&!Array.isArray(c))this.insertPartialHTML(s,c,e,t);else if(s===`split`&&Array.isArray(c))this.insertPartialHTML(s,c,e,t);else throw Error(`FileDiff.applyPartialRender.applyChunk: invalid chunk application`);v+=e.rowCount,this.renderedDiff=e.fileDiff}};return this.cleanupErrorWrapper(),S(b,`afterbegin`),S(x,`beforeend`),this.lastRowCount!==v&&(this.applyRowSpan(s,c,v),this.lastRowCount=v),!0}insertPartialHTML(e,t,n,r){if(e===`unified`&&!Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`unified`,n);this.renderPartialColumn(t,e,r)}else if(e===`split`&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST(`deletions`,n),i=this.hunksRenderer.renderCodeAST(`additions`,n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error(`FileDiff.insertPartialHTML: Invalid argument composition`)}refreshSplitDiffView(){let e=this.getLatestDiff();if(this.options.diffStyle!==`split`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`split`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(n))return;let r=(e,n)=>{if(n==null)return;let r=this.hunksRenderer.renderCodeAST(e,t),i=Vk(r?.[0]),a=Vk(r?.[1]);for(let[e,t]of[[n.gutter,i],[n.content,a]])if(t!=null&&e.childElementCount===t.length)for(let n=0;n<t.length;n++){let r=e.children[n],i=t[n].properties[`data-line-type`];i!=null&&r.dataset.lineType!==i&&(r.dataset.lineType=i)}};r(`deletions`,n[0]),r(`additions`,n[1]),this.renderedDiff=t.fileDiff}refreshUnifiedDiffView(){let e=this.getLatestDiff();if(this.options.diffStyle!==`unified`||e==null)return;let t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;let n=this.getCodeColumns(`unified`,this.codeUnified,this.codeDeletions,this.codeAdditions);if(n==null||Array.isArray(n))return;let r=this.hunksRenderer.renderCodeAST(`unified`,t),i=Vk(r?.[0]),a=Vk(r?.[1]),o=()=>{for(let[e,t]of[[n.gutter,i],[n.content,a]])t!=null&&(e.innerHTML=sv(t));t.rowCount!==this.lastRowCount&&(this.applyRowSpan(`unified`,n,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?zT(this.pre,o):o(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,n){if(e==null||t==null)return;let r=Vk(t[0]),i=Vk(t[1]);if(r==null||i==null)throw Error(`FileDiff.insertPartialHTML: Unexpected AST structure`);let a=i.at(0);n===`beforeend`&&a?.type===`element`&&typeof a.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(a.properties[`data-buffer-size`],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let o=i.at(-1);n===`afterbegin`&&o?.type===`element`&&typeof o.properties[`data-buffer-size`]==`number`&&this.mergeBuffersIfNecessary(o.properties[`data-buffer-size`],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,a){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let o=this.getBufferSize(t.dataset);o!=null&&(a?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,o+e),this.updateBufferSize(n,o+e))}applyRowSpan(e,t,n){let r=e=>{e!=null&&(e.gutter.style.setProperty(`grid-row`,`span ${n}`),e.content.style.setProperty(`grid-row`,`span ${n}`))};if(e===`unified`&&!Array.isArray(t))r(t);else if(e===`split`&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error(`dun fuuuuked up`)}trimColumnRows(e,t,n){let r=0,i=0,a=0,o=!1,s=n>=0;if(e==null)return 0;let c=Array.from(e.content.children),l=Array.from(e.gutter.children);if(c.length!==l.length)throw Error(`FileDiff.trimColumnRows: columns do not match`);for(;a<c.length&&!(t<=0&&!s&&!o);){let e=l[a],u=c[a];if(a++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: invalid row elements`);if(o&&(o=!1,e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset||e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset)){e.remove(),u.remove(),i++;continue}if(`lineIndex`in e.dataset&&`lineIndex`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&(t--,t===0&&(o=!0)),i++),r++;continue}if(`separator`in e.dataset&&`separator`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`annotation`&&`lineAnnotation`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`metadata`&&`noNewline`in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if(e.dataset.gutterBuffer===`buffer`&&`contentBuffer`in u.dataset){let a=this.getBufferSize(u.dataset);if(a==null)throw Error(`FileDiff.trimColumnRows: invalid element`);if(t>0){let n=Math.min(t,a),r=a-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=a),t-=n,t===0&&r===0&&(o=!0)}else if(s){let t=r,o=r+a-1;if(n<=t)e.remove(),u.remove(),i+=a;else if(n<=o){let t=o-n+1,r=a-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=a;continue}throw console.error({gutterElement:e,contentElement:u}),Error(`FileDiff.trimColumnRows: unknown row elements`)}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:a,trimStart:o}){let s=Math.max(0,r-i),c=n-i;if(c<0)throw Error(`FileDiff.trimColumns: overlap ends before previous`);let l=o>0,u=a>0;if(!l&&!u)return 0;let d=l?s:0,f=u?c:-1;if(t===`unified`&&!Array.isArray(e))return this.trimColumnRows(e,d,f);if(t===`split`&&Array.isArray(e)){let t=this.trimColumnRows(e[0],d,f),n=this.trimColumnRows(e[1],d,f);if(e[0]!=null&&e[1]!=null&&t!==n)throw Error(`FileDiff.trimColumns: split columns out of sync`);return e[0]==null?n:t}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{gutter:t,content:n}}getCodeColumns(e,t,n,r){if(e===`unified`)return this.getColumnPair(t);{let e=this.getColumnPair(n),t=this.getColumnPair(r);return e!=null||t!=null?[e,t]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore??(this.bufferBefore=document.createElement(`div`),this.bufferBefore.dataset.virtualizerBuffer=`before`,e.before(this.bufferBefore)),this.bufferBefore.style.setProperty(`height`,`${t.bufferBefore}px`),this.bufferBefore.style.setProperty(`contain`,`strict`)):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter??(this.bufferAfter=document.createElement(`div`),this.bufferAfter.dataset.virtualizerBuffer=`after`,e.after(this.bufferAfter)),this.bufferAfter.style.setProperty(`height`,`${t.bufferAfter}px`),this.bufferAfter.style.setProperty(`contain`,`strict`)):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){let{diffIndicators:a=`bars`,disableBackground:o=!1,disableLineNumbers:s=!1,overflow:c=`scroll`,diffStyle:l=`split`}=this.options,u={type:`diff`,diffIndicators:a,disableBackground:o,disableLineNumbers:s,overflow:c,split:l!==`unified`&&t!=null&&n!=null,totalLines:r,customProperties:i};pT(u,this.appliedPreAttributes)||(NT(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:`open`});this.errorWrapper??=document.createElement(`div`),this.errorWrapper.dataset.errorWrapper=``,this.errorWrapper.textContent=``,n.appendChild(this.errorWrapper);let r=document.createElement(`div`);r.dataset.errorMessage=``,r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement(`pre`);i.dataset.errorStack=``,i.innerText=e.stack??`No Error Stack`,this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function Fk(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join(``)}}function Ik(e,t){return e==null||t==null?e==null&&t==null:XT(e,t)}function Lk({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function Rk({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function zk(e,t,n=!1){return!n&&e==null&&t}function Bk(e,t,n=!1){return e==null&&t&&!n}function Vk(e){if(e!=null&&e.type===`element`)return e.children??[]}function Hk({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:a,collapsedContextThreshold:o,canHydratePartialDiff:s}){let c=GT(t,n),l=c,u=i?!0:a,d=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(i==null)throw Error(`computeEstimatedDiffHeights: invalid hunk index`);let a=HD({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:u,hunkIndex:n,collapsedContextThreshold:o}),f=(a.fromStart+a.fromEnd)*t.lineHeight;if(c+=f,l+=f,a.collapsedLines>0){let e=QD({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;c+=e,l+=e}c+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let p=Uk(i);c+=p.split*t.lineHeight,l+=p.unified*t.lineHeight;let m=n===d?GD({fileDiff:e,hunkIndex:n,expandedHunks:u,collapsedContextThreshold:o,errorPrefix:`computeEstimatedDiffHeights`}):void 0;if(m!=null){let e=(m.fromStart+m.fromEnd)*t.lineHeight;if(c+=e,l+=e,m.collapsedLines>0){let e=$D({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}else if(n===d&&e.isPartial&&s){let e=$D({type:r,metrics:t})?.totalHeight??0;c+=e,l+=e}}if(e.hunks.length>0){let e=qT(t);c+=e,l+=e}return{splitHeight:c,unifiedHeight:l}}function Uk(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type===`context`){let e=+(t.lines>0);return{split:e,unified:e}}return Wk(e,t)}function Wk(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}var Gk=3e3,Kk=new Map,qk=-1,Jk=class extends Pk{__id=`little-virtualized-file-diff:${++qk}`;renderType=`virtualized`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:Kk,ghostTextRowsByIndex:new Map};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;pendingHydratedDiff;pendingExpansions;pendingRender;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=WT(n)}setMetrics(e,t=!1){let n=WT(e);(t||!DC(this.metrics,n))&&(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&(this.forceRenderOverride=!0)}syncLineAnnotations(e){return e==null||!this.isNewAnnotations(e)||e.length===0&&this.getLatestAnnotations().length===0?!1:(super.setLineAnnotations(e),!0)}syncEditSessionAnnotationsFromEditor(e){return super.syncEditSessionAnnotationsFromEditor(e)?(this.forceRenderOverride=!0,!0):!1}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e!==t&&(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e){let t=this.getLatestAnnotations();return sT(t)?t.some(t=>t.lineNumber===0?e.type===`new`?t.side===`additions`:e.type!==`deleted`||t.side===`deletions`:!1):!1}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){let t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.`);if(e==null)return;let{options:t}=this,n=!kC(t,e),r=n&&nA(t,e);super.setOptions(e),r&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:rA(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,r)}setThemeType(e){if(this.isAdvancedMode())throw Error(`VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.`);super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:n=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal=0,this.cache.ghostTextRows=Kk,this.cache.ghostTextRowsByIndex.size>0&&this.cache.ghostTextRowsByIndex.clear(),this.invalidateDerivedLayoutCache(t,n),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}applyGhostTextRows(e,t){let{cache:{heightDeltas:n,ghostTextRows:r,ghostTextRowsByIndex:i},metrics:{lineHeight:a}}=this;if(r===t)return!1;let o=this.getDiffStyle(),s=new Map;for(let[n,r]of t){let t=this.getLineIndexForDiff(e,n+1,`additions`);t!=null&&s.set(o===`split`?t[1]:t[0],r)}let c=!1;for(let e of new Set([...i.keys(),...s.keys()])){let t=((s.get(e)??0)-(i.get(e)??0))*a;if(t===0)continue;let r=(n.get(e)??0)+t;r===0?n.delete(e):n.set(e,r),this.cache.measuredHeightDeltaTotal+=t,c=!0}return this.cache.ghostTextRows=t,this.cache.ghostTextRowsByIndex=s,c}reconcileHeights(){let e=!1,{options:{overflow:t=`scroll`},metrics:{lineHeight:n}}=this,r=this.placeHolder==null?this.getRenderedDiff():this.getLayoutDiff();if(this.fileContainer==null||r==null)return this.height!==0&&(e=!0),this.height=0,e;this.top=this.getVirtualizedTop(),e=this.applyGhostTextRows(r,this.editor?.__getGhostTextRows()??Kk);let{ghostTextRowsByIndex:i}=this.cache,a=t!==`scroll`||this.getLatestAnnotations().length>0||this.isResizeDebuggingEnabled();if(this.placeHolder!=null||!a&&this.cache.heightDeltas.size===0&&this.cache.fileAnnotationHeight===0)return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;let o=this.getDiffStyle(),s=o===`split`?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];if(this.renderRange!=null&&lT(this.renderRange)){let t=Yk(s)??0;this.setFileAnnotationHeight(t)&&(e=!0)}for(let t of s){if(t==null)continue;let r=t.children[1];if(!(r instanceof HTMLElement))continue;let s=o===`split`&&t===this.codeDeletions;for(let t of r.children){if(!(t instanceof HTMLElement))continue;let r=t.dataset.lineIndex;if(r==null)continue;let c=sA(r,o),l=i.get(c)??0;if(s&&l>0)continue;let u=this.cache.heightDeltas.get(c)??0;if(!a&&u===l*n)continue;let d=t.getBoundingClientRect().height+l*n,f=!1;t.nextElementSibling instanceof HTMLElement&&(`lineAnnotation`in t.nextElementSibling.dataset||`noNewline`in t.nextElementSibling.dataset)&&(`noNewline`in t.nextElementSibling.dataset&&(f=!0),d+=t.nextElementSibling.getBoundingClientRect().height);let p=this.getEstimatedLineHeight(f),m=d-p;m!==u&&(e=!0,this.cache.measuredHeightDeltaTotal+=m-u,m===0?this.cache.heightDeltas.delete(c):this.cache.heightDeltas.set(c,m))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer!=null&&(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}updateCodeViewLayout(e,t,n,r){let i=!1,a=!1,{pendingExpansions:o,pendingHydratedDiff:s,options:{collapsed:c=!1}}=this;if(s!=null&&(this.pendingHydratedDiff=void 0,s.expectedDiff===e&&(Object.assign(e,s.nextDiff),this.setHydratedState(s.files),this.installHydratedSessionDiff(e),this.forceRenderOverride=!0,i=!0,a=!0)),o!=null){this.pendingExpansions=void 0;for(let{hunkIndex:e,direction:t,expansionLineCountOverride:n}of o)this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,a=!0}let l=this.updateExternalDiff(e,r),{pendingRenderDiff:u,layoutDiffChanged:d,renderedDiffChanged:f,annotationsChanged:p}=this.updatePendingRender(e,r);return!this.forceRenderOverride&&(l||f||p)&&(this.forceRenderOverride=!0),(n?.resetDiffLayoutCache===!0||d)&&(i=!0),(d||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights)&&(a=!0),n?.metrics!=null&&(this.metrics=WT(n.metrics),i=!0,a=!0),this.currentCollapsed!==c&&(this.currentCollapsed=c,i=!0),i?this.resetLayoutCache({includeEstimatedHeights:a}):a&&this.invalidateDerivedLayoutCache(!0),this.top=t,this.computeApproximateSize(!1,u),this.height}getLinePosition(e,t=`additions`){let n=this.getLayoutDiff();if(n==null||e<1)return;let r=this.getLineIndexForDiff(n,e,t);if(r==null)return;let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsed:o=!1,collapsedContextThreshold:s=1}=this.options,c=this.getDiffStyle(),l=this.getHunkSeparatorType(),u=c===`split`?r[1]:r[0];this.approximateLayoutCheckpoints(n);let d=GT(this.metrics,i),f=this.getLayoutCheckpointBeforeLineIndex(u),p=f?.top??d+this.cache.fileAnnotationHeight;if(o)return{top:d,height:0};let m;return eO({diff:n,diffStyle:c,startingLine:f?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:e,hunk:t,collapsedBefore:n,collapsedAfter:r,deletionLine:i,additionLine:a})=>{let o=c===`split`?a?.splitLineIndex??i?.splitLineIndex:a?.unifiedLineIndex??i?.unifiedLineIndex;if(o==null)throw Error(`VirtualizedFileDiff.getLinePosition: missing line index data`);if(n>0){let r=QD({type:l,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(r!=null){if(p+=r.gapBefore,u>=o-n&&u<o)return m={top:p,height:r.height},!0;p+=r.height+r.gapAfter}}let s=this.getLineHeight(o,(a?.noEOFCR??!1)||(i?.noEOFCR??!1));if(o===u)return m={top:p,height:s},!0;if(p+=s,r>0){let e=$D({type:l,metrics:this.metrics});if(e!=null){if(u>o&&u<=o+r)return m={top:p+e.gapBefore,height:e.height},!0;p+=e.totalHeight}}return!1}}),m}getEditorViewport(){return this.virtualizer.type===`simple`?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){let t=this.getLayoutDiff();if(t==null)return;let{disableFileHeader:n=!1,expandUnchanged:r=!1,collapsed:i=!1,collapsedContextThreshold:a=1}=this.options;if(i)return;let o=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints(t);let c=this.getLayoutCheckpointBeforeTop(e),l=c?.top??GT(this.metrics,n)+this.cache.fileAnnotationHeight,u;return eO({diff:t,diffStyle:o,startingLine:c?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:a,callback:({hunkIndex:t,hunk:n,collapsedBefore:r,collapsedAfter:i,deletionLine:a,additionLine:c})=>{let d=o===`split`?c?.splitLineIndex??a?.splitLineIndex:c?.unifiedLineIndex??a?.unifiedLineIndex;if(d==null)throw Error(`VirtualizedFileDiff.getNumericScrollAnchor: missing line index data`);if(r>0){let e=QD({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n?.hunkSpecs});e!=null&&(l+=e.totalHeight)}if(l>=e&&(a==null?c!=null&&(u={lineNumber:c.lineNumber,side:`additions`,top:l}):u={lineNumber:a.lineNumber,side:`deletions`,top:l},u!=null))return!0;let f=this.getLineHeight(d,(c?.noEOFCR??!1)||(a?.noEOFCR??!1));if(l+=f,i>0){let e=$D({type:s,metrics:this.metrics});e!=null&&(l+=e.totalHeight)}return!1}}),u}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){let t=this.getLayoutDiff();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};let n=e==null?this.renderRange:this.computeRenderRangeFromWindow(t,this.top,e);if(n==null)return;let{bufferBefore:r,bufferAfter:i,totalLines:a}=n,o=0;if(a===0){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=i)}return{topOffset:this.top+r+o,height:this.height-(r+i)}}cleanUp(e=!1){let t=this.cache.ghostTextRows.size>0;t&&(this.layoutDirty=!0);let n=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!YT(this.getRenderedDiff(),this.getLatestDiff()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),n&&this.virtualizer.instanceChanged(this,!0)}expandHunk=(e,t,n)=>{this.fileDiff!=null&&(this.loadFilesIfNecessary(),this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:n})):(this.hunksRenderer.expandHunk(e,t,n),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(this.fileDiff===e&&e.isPartial){if(this.isAdvancedMode()){let n=iE(`clone`,e,t);if(await Tk(()=>this.primeHighlightCache(n)),this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:n,files:t}}else{if(iE(`merge`,e,t),this.setHydratedState(t),!this.installHydratedSessionDiff(e)&&(await Tk(()=>this.primeHighlightCache(e)),this.fileDiff!==e))return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}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.getRenderedDiff();if(t==null||t.length===0||n==null)return!1;let{expansionLineCount:r=100,collapsedContextThreshold:i=1}=this.options,a=new Map(this.hunksRenderer.getExpandedHunksMap());for(let e of t){let t={...a.get(e.hunkIndex)??{fromStart:0,fromEnd:0}},n=e.expansionLineCountOverride??r;(e.direction===`up`||e.direction===`both`)&&(t.fromStart+=n),(e.direction===`down`||e.direction===`both`)&&(t.fromEnd+=n),a.set(e.hunkIndex,t)}return KD({fileDiff:n,lineNumber:e,expandedHunks:a,collapsedContextThreshold:i})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),this.enabled&&this.fileDiff!=null&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){if(!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null)return;let e=this.getLatestDiff(),t=e==null?void 0:this.hunksRenderer.getDiffForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!YT(this.getRenderedDiff(),t))}syncGhostTextRows(){let e=this.getAdvancedVirtualizer();e==null?this.getSimpleVirtualizer()?.requestHeightReconcile(this):(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0))}applyDocumentChange(e,t,n=!1){let{renderRange:r}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1});let i=this.getRenderedDiff();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(n&&r!=null&&i!=null){let e=this.virtualizer.getWindowSpecs(),t=this.computeRenderRangeFromWindow(i,this.top??0,e);t.bufferAfter!==r.bufferAfter&&this.updateBuffers(t)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutDiff()){let n=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!n)return;let r=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(t,this.editor?.__getGhostTextRows()??Kk);let{disableFileHeader:i=!1,collapsed:a=!1}=this.options,o=GT(this.metrics,i);if(this.height+=o,a){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,n&&!r&&this.validateComputedHeight(t),this.layoutDirty=!1}getLayoutDiff(){return this.pendingRender?.diff??this.getRenderedDiff()}getActiveEstimatedHeight(e=this.getLayoutDiff()){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.getLayoutDiff()){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:r=1}=this.options,{splitHeight:i,unifiedHeight:a}=Hk({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:n,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,canHydratePartialDiff:iA(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=a}validateComputedHeight(e=this.getLayoutDiff()){if(this.fileContainer==null||e==null)return;let t=this.fileContainer.getBoundingClientRect();t.height===this.height?console.log(`VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT`):console.log(`VirtualizedFileDiff.computeApproximateSize: computed height doesnt match`,{name:e.name,elementHeight:t.height,computedHeight:this.height})}render({fileContainer:e,fileDiff:t,forceRender:n=!1,lineAnnotations:r,...i}={}){let a=Ek(i,`VirtualizedFileDiff.render`),o=a!=null,s=a?.oldFile,c=a?.newFile,l=o&&(!oA(s,this.deletionFile)||!oA(c,this.additionFile)),u=t??this.fileDiff;t==null&&o&&(l||this.fileDiff==null)&&(u=kD(a.oldFile,a.newFile,this.options.parseDiffOptions));let{forceRenderOverride:d,isSetup:f}=this;this.forceRenderOverride=void 0;let p=u!=null&&!YT(this.fileDiff,u),m=p||l;if(e=this.getOrCreateFileContainer(e),u==null)return console.error(`VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data`),!1;p&&this.updateExternalDiff(u,r);let{pendingRenderDiff:h,layoutDiffChanged:g,renderedDiffChanged:_,annotationsChanged:v}=this.pendingRender!=null&&this.pendingRender.latestDiff===(this.getLatestDiff(u)??u)?{pendingRenderDiff:this.pendingRender.diff,layoutDiffChanged:!1,renderedDiffChanged:!1,annotationsChanged:this.syncLineAnnotations(r)}:this.updatePendingRender(u,r);if(g&&this.resetLayoutCache({includeEstimatedHeights:!0}),f)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,h));else{this.computeApproximateSize(!1,h);let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(t==null)throw Error(`VirtualizedFileDiff.render: simple virtualizer is not available`);t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!m||!f))return a!=null&&(this.deletionFile=s,this.additionFile=c),p&&this.clearReusableHeader(),this.renderPlaceholder(this.height);let y=this.virtualizer.getWindowSpecs(),b=this.top??0,x=this.computeRenderRangeFromWindow(h,b,y);return super.render({fileDiff:u,fileContainer:e,renderRange:x,lineAnnotations:r,forceRender:(d??n)||v||_||p,...a,...i})}finalizeRender(){if(!YT(this.getRenderedDiff(),this.pendingRender?.diff))throw Error(`VirtualizedFileDiff.render: rendered a different diff than its prepared layout`);this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){let n=this.getLatestDiff(e)??e,r=this.getRenderedDiff(),{pendingRender:i}=this,a=i?.diff??r,o=this.hunksRenderer.getDiffForNextRender(n);return this.pendingRender={latestDiff:n,diff:o},{pendingRenderDiff:o,annotationsChanged:this.syncLineAnnotations(t),layoutDiffChanged:!YT(a,o),renderedDiffChanged:!YT(r,o)}}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(){return this.virtualizer.type===`advanced`?this.virtualizer.getLocalTopForInstance(this):this.fileContainer==null?0:this.virtualizer.getOffsetInScrollContainer(this.fileContainer)}getSimpleVirtualizer(){return this.virtualizer.type===`simple`?this.virtualizer:void 0}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 aA(this.options.hunkSeparators)}approximateLayoutCheckpoints(e){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e.hunks.length===0||this.options.collapsed===!0)return;let{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,i=e.hunks.length-1,a=iA(e,this.options.loadDiffFiles!=null),o=this.getDiffStyle(),s=this.getHunkSeparatorType(),c=n?!0:this.hunksRenderer.getExpandedHunksMap(),l=Xk(this.cache.heightDeltas),u=GT(this.metrics,t)+this.cache.fileAnnotationHeight,d=0,f=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let a=d,o=d+e,s=$k(a);for(;s<o;){let e=s-a,r=u+(e>0?n:0)+e*this.metrics.lineHeight+eA(i,e)*this.metrics.lineHeight+Zk(l,t,t+e);this.cache.checkpoints.push({renderedLineIndex:s,lineIndex:t+e,top:r}),s+=Gk}u+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+Zk(l,t,t+e)+r,d=o};for(let t=0;t<e.hunks.length;t++){let n=e.hunks[t];if(n==null)throw Error(`VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index`);let l=HD({isPartial:e.isPartial,rangeSize:n.collapsedBefore,expandedHunks:c,hunkIndex:t,collapsedContextThreshold:r}),u=l.collapsedLines>0?QD({type:s,metrics:this.metrics,hunkIndex:t,hunkSpecs:n.hunkSpecs})?.totalHeight??0:0;f({rowCount:l.fromStart,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.rangeSize});let d=u;f({rowCount:l.fromEnd,startLineIndex:(o===`split`?n.splitLineStart:n.unifiedLineStart)-l.fromEnd,preSeparatorHeight:d}),l.fromEnd>0&&(d=0);let p=t===i?GD({fileDiff:e,hunkIndex:t,expandedHunks:c,collapsedContextThreshold:r,errorPrefix:`VirtualizedFileDiff`}):void 0,m=p!=null&&p.collapsedLines>0||t===i&&a?$D({type:s,metrics:this.metrics})?.totalHeight??0:0,h=p==null?0:p.fromStart+p.fromEnd,g=o===`split`?n.splitLineCount:n.unifiedLineCount,_=o===`split`?n.splitLineStart:n.unifiedLineStart;f({rowCount:g,startLineIndex:_,preSeparatorHeight:d,postSeparatorHeight:h===0?m:0,metadataOffsets:tA({diffStyle:o,hunk:n,rowCount:g})}),p!=null&&h>0&&f({rowCount:h,startLineIndex:_+g,postSeparatorHeight:m})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,r;for(;t<=n;){let i=t+n>>1,a=this.cache.checkpoints[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.lineIndex<=e?(r=a,t=i+1):n=i-1}return r}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,a=this.cache.checkpoints[t];if(a==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);a.top<=e?(i=t,n=t+1):r=t-1}if(t==null)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(n==null)throw Error(`VirtualizedFileDiff: invalid checkpoint index`);if(n.renderedLineIndex%t===0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+=t===`split`?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,a=r?!0:this.hunksRenderer.getExpandedHunksMap();for(let[r,o]of e.hunks.entries()){let s=t===`split`?o.splitLineCount:o.unifiedLineCount;n+=s;let c=Math.max(o.collapsedBefore,0),{fromStart:l,fromEnd:u,renderAll:d}=HD({isPartial:e.isPartial,rangeSize:c,expandedHunks:a,hunkIndex:r,collapsedContextThreshold:i});c>0&&(n+=d?c:l+u)}let o=GD({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:a,collapsedContextThreshold:i,errorPrefix:`VirtualizedFileDiff`});return o!=null&&(n+=o.fromStart+o.fromEnd),n}getLayoutLineCount(e,t){let n=this.getExpandedLineCount(e,t),r=t===`split`?e.splitLineCount:e.unifiedLineCount;return Math.max(n,r,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let{disableFileHeader:i=!1,expandUnchanged:a=!1,collapsedContextThreshold:o=1}=this.options,{hunkLineCount:s,lineHeight:c}=this.metrics,l=this.getDiffStyle(),u=this.getHunkSeparatorType(),d=iA(e,this.options.loadDiffFiles!=null),f=this.height,p=this.getLayoutLineCount(e,l),m=GT(this.metrics,i),h=e.hunks.length>0?qT(this.metrics):0,{fileAnnotationHeight:g}=this.cache,_=m+g,v=Math.max(0,f-m-g-h),y=this.hasFileAnnotations(e),b=t+m,x=g>0&&y&&b<r&&b+g>n;if(t<n-f||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h};if(p<=s||e.hunks.length===0)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),p=this.getLayoutLineCount(e,l);let S=Math.ceil(Math.max(r-n,0)/c),C=Math.ceil(S/s)*s+s,w=C/s,ee=w,T=[],te=(n+r)/2,ne=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-C*c*2),s),E=t+(ne?.top??_),re=ne?.renderedLineIndex??0,ie,ae,oe;if(eO({diff:e,diffStyle:l,startingLine:ne?.renderedLineIndex??0,expandedHunks:a?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:i,hunk:a,collapsedBefore:o,collapsedAfter:c,deletionLine:f,additionLine:p})=>{let m=p==null?f.splitLineIndex:p.splitLineIndex,h=p==null?f.unifiedLineIndex:p.unifiedLineIndex,g=(p?.noEOFCR??!1)||(f?.noEOFCR??!1),v=i===e.hunks.length-1&&a!=null&&(l===`split`?m===a.splitLineStart+a.splitLineCount-1:h===a.unifiedLineStart+a.unifiedLineCount-1),y=(o>0?QD({type:u,metrics:this.metrics,hunkIndex:i,hunkSpecs:a?.hunkSpecs}):void 0)?.totalHeight??0;E+=y;let b=re%s===0,x=Math.floor(re/s);if(b&&(T[x]=E-(t+_+y),oe!=null)){if(oe<=0)return!0;oe--}let S=this.getLineHeight(l===`split`?m:h,g);if(E>n-S&&E<r&&(ie??=x),ae==null&&E+S>te&&(ae=x),oe==null&&E>=r&&b&&(oe=ee),re++,E+=S,c>0||v&&d){let e=$D({type:u,metrics:this.metrics});e!=null&&(E<r&&E+e.totalHeight>n&&(ie??=x),ae==null&&E+e.totalHeight>te&&(ae=x),E+=e.totalHeight)}return!1}}),ie==null){if(x)ie=0,ae=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-h}}ae??=ie;let se=Math.round(ae-w/2),ce=Math.max(0,Math.ceil(p/s)-w),le=Math.max(0,Math.min(se,ce)),D=le*s,ue=se<0?C+se*s:C,de=T[le]??0,fe=D===0?0:g+de,O=le+ue/s,k=O<T.length?v-T[O]:v-(E-t-_);return{startingLine:D,totalLines:ue,bufferBefore:fe,bufferAfter:Math.max(0,k)}}};function Yk(e){let t;for(let n of e){if(n==null)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&n.dataset.lineAnnotation===oT&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}function Xk(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,a]of t)n.push(e),i+=a,r.push(i);return{lineIndexes:n,prefixTotals:r}}function Zk({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||e.length===0)return 0;let i=Qk(e,n);return(t[Qk(e,r)]??0)-(t[i]??0)}function Qk(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,a=e[i];if(a==null)throw Error(`VirtualizedFileDiff: invalid prefix index`);a<t?n=i+1:r=i}return n}function $k(e){return Math.ceil(e/Gk)*Gk}function eA(e,t){let n=0;for(let r of e)r<t&&n++;return n}function tA({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(r==null)return[];if(r.type===`context`)return[n-1];let i=Math.max(r.deletions,r.additions),a=r.deletions+r.additions;if(e===`split`)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let o=[],s=n-a;return r.deletions>0&&t.noEOFCRDeletions&&o.push(s+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&o.push(n-1),o}function nA(e,t){return(e.diffStyle??`split`)!==(t.diffStyle??`split`)||(e.overflow??`scroll`)!==(t.overflow??`scroll`)||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??`bars`)!==(t.diffIndicators??`bars`)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function rA(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??`line-info`)!==(t.hunkSeparators??`line-info`)||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function iA(e,t){return e.isPartial&&t&&(e.type===`change`||e.type===`rename-changed`)}function aA(e){return typeof e==`function`?`custom`:e??`line-info`}function oA(e,t){return e==null||t==null?e==null&&t==null:XT(e,t)}function sA(e,t){let[n,r]=e.split(`,`).map(Number);return t===`split`?r:n}function cA(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}var lA=1e3,uA=lA*4,dA=[0,1e-6,.99999,1],fA={overscrollSize:lA,intersectionObserverMargin:uA,resizeDebugging:!1},pA=0,mA=-1,hA=class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++mA}`;config;type=`simple`;intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;reconcileQueue=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...fA,...e}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:dA,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),wC(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)};for(let[e,t]of this.connectQueue.entries())this.connect(e,t);this.connectQueue.clear(),this.markDOMDirty(),wC(this.computeRenderRangeAndEmit)}}instanceChanged(e,t){this.instancesChanged.add(e),t&&this.markDOMDirty(),wC(this.computeRenderRangeAndEmit)}requestHeightReconcile(e){this.reconcileQueue.add(e),wC(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=MC({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(e,t){let n=this.getScrollTop(),r=this.getHeight(),i=this.config.intersectionObserverMargin,a=n-i,o=n+r+i;return!(e<a-t||e>o)}handleContainerResize=e=>{if(this.root==null)return;let t=!1;for(let n of e){let e=n.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: content size change`,this.__id,{sizeChange:e-pA,newSize:e}),pA=e)):n.target===this.root?e!==this.height&&(this.heightDirty=!0,t=!0):n.target===this.contentContainer&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log(`Virtualizer: scroller size change`,this.__id,{sizeChange:e-pA,newSize:e}),pA=e))}t&&wC(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw Error(`Virtualizer.setupWindow: Invalid setup method`);window.addEventListener(`scroll`,this.handleWindowScroll,{passive:!0}),window.addEventListener(`resize`,this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(this.root==null||this.root instanceof Document)throw Error(`Virtualizer.setupElement: Invalid setup method`);this.root.addEventListener(`scroll`,this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),e??=this.root.firstElementChild??void 0,e instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){TC(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener(`scroll`,this.handleElementScroll),window.removeEventListener(`scroll`,this.handleWindowScroll),window.removeEventListener(`resize`,this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(e){return this.getScrollTop()+gA(e,this.getScrollContainerElement())}connect(e,t){if(this.observers.has(e))throw Error(`Virtualizer.connect: instance is already connected...`);return this.intersectionObserver==null?this.connectQueue.set(e,t):(this.intersectionObserver.observe(e),this.observers.set(e,t),this.instancesChanged.add(t),this.markDOMDirty(),wC(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let t=this.observers.get(e);this.connectQueue.delete(e),t!=null&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.instancesChanged.delete(t),this.reconcileQueue.delete(t),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),wC(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,wC(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{!e.__STOP&&this.root!=null&&this.root instanceof Document&&(this.scrollDirty=!0,wC(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,wC(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let t=this.heightDirty||this.scrollHeightDirty,n=this.instancesChanged.size>0;if(this.instancesChanged.size===0){let e=MC({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&cA(this.windowSpecs,e)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let r=this.getScrollAnchor(this.height),i=new Set;for(let e of t?this.observers.values():this.visibleInstances.values())e.onRender(t)&&i.add(e);for(let e of this.instancesChanged)i.has(e)||e.onRender(t)&&i.add(e);this.scrollFix(r);for(let e of i)this.reconcileQueue.delete(e),e.reconcileHeights();for(let e of this.reconcileQueue)e.reconcileHeights()&&(n=!0);this.reconcileQueue.clear(),n||=this.instancesChanged.size>0,n&&this.markDOMDirty(),(n||t)&&wC(this.computeRenderRangeAndEmit),i.clear(),this.instancesChanged.clear()};scrollFix(e){if(e==null)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:r,fileElement:i,fileOffset:a,fileTypeOffset:o}=e;if(n!=null&&r!=null){let e=i.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=gA(e,t);if(n!==r){let e=n-r;this.applyScrollFix(e)}return}}let s=gA(i,t);if(o===`top`)s!==a&&this.applyScrollFix(s-a);else{let e=s+i.getBoundingClientRect().height;e!==a&&this.applyScrollFix(e-a)}}applyScrollFix(e){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:`instant`}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:`instant`}),this.markDOMDirty()}getScrollAnchor(e){let t=this.getScrollContainerElement(),n;for(let[r]of this.visibleInstances.entries()){let i=gA(r,t),a=i+r.offsetHeight,o,s;a<=0?(o=a,s=`bottom`):(o=i,s=`top`);let c,l;if(a>0&&i<e)for(let e of r.shadowRoot?.querySelectorAll(`[data-line][data-line-index]`)??[]){if(!(e instanceof HTMLElement))continue;let n=e.dataset.lineIndex;if(n==null)continue;let r=gA(e,t);if(!(r<0)){c=n,l=r;break}}if(n?.lineOffset!=null&&l==null)continue;let u=!1;(n==null||l!=null&&(n.lineOffset==null||l<n.lineOffset)||l==null&&n.lineOffset==null&&(o>=0&&(n.fileOffset<0||o<n.fileOffset)||o<0&&n.fileOffset<0&&o>n.fileOffset))&&(u=!0),u&&(n={fileElement:r,fileTypeOffset:s,fileOffset:o,lineIndex:c,lineOffset:l})}return n}handleIntersectionChange=e=>{this.scrollDirty=!0;for(let{target:t,isIntersecting:n}of e){if(!(t instanceof HTMLElement))throw Error(`Virtualizer.handleIntersectionChange: target not an HTMLElement`);let e=this.observers.get(t);e!=null&&(n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&wC(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=this.clampScrollTop(e),this.scrollTop=e,e}scrollTo({top:e,behavior:t=`auto`}){let{root:n}=this;if(n==null)return;let r=this.clampScrollTop(e);n instanceof Document?window.scrollTo({top:r,behavior:t}):n.scrollTo({top:r,behavior:t}),this.scrollDirty=!0,wC(this.computeRenderRangeAndEmit)}clampScrollTop(e){return Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function gA(e,t){let n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}var _A=`https://api.github.com`,vA=class extends Error{status;constructor(e,t){super(t),this.status=e,this.name=`GithubApiError`}};function yA(e,t=`application/vnd.github+json`){let n={Accept:t,"X-GitHub-Api-Version":`2022-11-28`};return e&&(n.Authorization=`Bearer ${e}`),n}async function bA(e,t,n){let r=await fetch(e,{headers:yA(t,n)});if(!r.ok)throw new vA(r.status,`GitHub API request failed (${r.status}): ${e}`);return r}async function xA(e,t,n,r){return(await bA(`${_A}/repos/${e}/${t}/pulls/${n}`,r)).json()}async function SA(e,t,n,r){let i=[],a=1;for(;;){let o=await(await bA(`${_A}/repos/${e}/${t}/pulls/${n}/files?per_page=100&page=${a}`,r)).json();if(i.push(...o),o.length<100)break;a++}return i}async function CA(e,t,n,r){return(await bA(`${_A}/repos/${e}/${t}/pulls/${n}`,r,`application/vnd.github.diff`)).text()}async function wA(e,t,n,r,i){let a=`${_A}/repos/${e}/${t}/contents/${n.split(`/`).map(encodeURIComponent).join(`/`)}?ref=${encodeURIComponent(r)}`,o=await fetch(a,{headers:yA(i,`application/vnd.github.raw`)});if(o.status!==404){if(!o.ok)throw Error(`GitHub API request failed (${o.status}): ${a}`);return o.text()}}var TA=/^diff --git a\/.* b\/(.*)$/,EA=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?:\s+\d+)?$/,DA=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@.*$/,OA=/^rename from (.+)$/,kA=/^rename to (.+)$/,AA=/^copy from (.+)$/,jA=/^copy to (.+)$/;function MA(e){return/^diff --git /m.test(e)?{chunks:e.split(/(?=^diff --git )/m).filter(e=>e.trim().length>0),isGitDiff:!0}:{chunks:e.split(/(?=^--- )/m).filter(e=>e.trim().length>0),isGitDiff:!1}}function NA(e){let t=[],n=0;for(;n<e.length;){let r=e[n],i=DA.exec(r);if(!i){n++;continue}let a=r,o=Number(i[1]),s=i[2]===void 0?1:Number(i[2]),c=Number(i[3]),l=i[4]===void 0?1:Number(i[4]);n++;let u=[];for(;n<e.length&&!DA.test(e[n]);)u.push(e[n]),n++;for(;u.length>0&&u[u.length-1]===``;)u.pop();t.push({header:a,oldStart:o,oldLines:s,newStart:c,newLines:l,patch:u.join(`
379
- `)})}return t}function PA(e){let t=0,n=0;for(let r of e)for(let e of r.patch.split(`
380
- `))e.startsWith(`+`)?t++:e.startsWith(`-`)&&n++;return{additions:t,deletions:n}}function FA(e,t){if(e===`new file mode`||/^new file mode \d+$/.test(e)){t.isNewFile=!0;return}if(/^deleted file mode \d+$/.test(e)){t.isDeletedFile=!0;return}if(e.startsWith(`Binary files `)&&e.endsWith(` differ`)){t.isBinary=!0;return}if(e===`GIT binary patch`){t.isBinary=!0;return}t.renameFrom??=OA.exec(e)?.[1],t.renameTo??=kA.exec(e)?.[1],t.copyFrom??=AA.exec(e)?.[1],t.copyTo??=jA.exec(e)?.[1];let n=EA.exec(e);n&&(t.oldIndexSha=n[1],t.newIndexSha=n[2])}function IA(e){let t={isNewFile:!1,isDeletedFile:!1,isBinary:!1,hunkStartIndex:-1};for(let n=1;n<e.length;n++){let r=e[n];if(r.startsWith(`@@ `)){t.hunkStartIndex=n;break}FA(r,t)}return t}function LA(e,t){return e.renameFrom&&e.renameTo?{status:`renamed`,previousPath:e.renameFrom,path:e.renameTo}:e.copyFrom&&e.copyTo?{status:`copied`,previousPath:e.copyFrom,path:e.copyTo}:e.isNewFile?{status:`added`,path:t}:e.isDeletedFile?{status:`removed`,path:t}:{status:`modified`,path:t}}function RA(e){let t=e.split(`
381
- `),n=TA.exec(t[0]??``)?.[1]??``,r=IA(t),{status:i,path:a,previousPath:o}=LA(r,n),s=r.isBinary||r.hunkStartIndex===-1?[]:NA(t.slice(r.hunkStartIndex));return{path:a,previousPath:o,status:i,isBinary:r.isBinary,oldIndexSha:r.oldIndexSha,newIndexSha:r.newIndexSha,hunks:s}}function zA(e){let t=e.split(`
382
- `),n=t[0]?.replace(/^--- /,``).split(` `)[0]??``,r=t[1]?.replace(/^\+\+\+ /,``).split(` `)[0]??``,i=r===`/dev/null`?n:r,a=n===`/dev/null`?`added`:r===`/dev/null`?`removed`:`modified`,o=t.findIndex(e=>e.startsWith(`@@ `));return{path:i,status:a,isBinary:!1,hunks:o===-1?[]:NA(t.slice(o))}}async function BA(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function VA(e){let{chunks:t,isGitDiff:n}=MA(e);return Promise.all(t.map(async e=>{let t=n?RA(e):zA(e),{additions:r,deletions:i}=PA(t.hunks),a;return a=t.status===`removed`&&t.oldIndexSha?t.oldIndexSha:t.newIndexSha?t.newIndexSha:await BA(e),{path:t.path,previousPath:t.previousPath,status:t.status,additions:r,deletions:i,isBinary:t.isBinary,sha:a,hunks:t.hunks}}))}var HA={added:`added`,removed:`removed`,modified:`modified`,renamed:`renamed`,copied:`copied`,changed:`modified`,unchanged:`modified`};async function UA(e,t){let n=HA[e.status]??`modified`;if(e.patch!==void 0){let t=NA(e.patch.split(`
383
- `)),{additions:r,deletions:i}={additions:e.additions,deletions:e.deletions};return{path:e.filename,previousPath:e.previous_filename,status:n,additions:r,deletions:i,isBinary:!1,sha:e.sha,hunks:t}}if(t){let r=(await VA(await t())).find(t=>t.path===e.filename||!!e.previous_filename&&t.previousPath===e.previous_filename);if(r)return{...r,status:n,previousPath:e.previous_filename,sha:e.sha,additions:e.additions,deletions:e.deletions}}return{path:e.filename,previousPath:e.previous_filename,status:n,additions:e.additions,deletions:e.deletions,isBinary:!0,sha:e.sha,hunks:[]}}function WA(e){return e.merged?`merged`:e.state===`closed`?`closed`:e.draft?`draft`:`open`}async function GA(e,t,n,r,i,a){let o,s=()=>o??=a(),c=await Promise.all(i.map(e=>UA(e,s)));return{provider:`github`,id:`github:${e}/${t}#${n}`,title:r.title,description:r.body??``,url:r.html_url,base:{sha:r.base.sha,ref:r.base.ref},head:{sha:r.head.sha,ref:r.head.ref},createdAt:r.created_at,updatedAt:r.updated_at,pullRequest:{author:r.user?.login,state:WA(r)},files:c}}var KA={github:{id:`github`,capabilities:{supportsAuth:!0,supportsComments:!0,requiresNetwork:!0,supportsFullFileContent:!0},async fetchDiff(e,t){if(e.kind!==`github-pr`)throw Error(`GithubProvider cannot handle params of kind "${e.kind}"`);let{owner:n,repo:r,number:i}=e,[a,o]=await Promise.all([xA(n,r,i,t.token),SA(n,r,i,t.token)]);return GA(n,r,i,a,o,()=>CA(n,r,i,t.token))}},paste:{id:`paste`,capabilities:{supportsAuth:!1,supportsComments:!1,requiresNetwork:!1,supportsFullFileContent:!1},async fetchDiff(e){if(e.kind!==`patch-text`)throw Error(`PasteProvider cannot handle params of kind "${e.kind}"`);let{text:t,title:n}=e,[r,i]=await Promise.all([VA(t),BA(t)]);return{provider:`paste`,id:`paste:${i}`,title:n??`Pasted diff`,description:``,files:r}}}};function qA(e){return KA[e]}var JA=Symbol(`diffs-virtualizer`);function YA(e,t,n){return Math.min(n,Math.max(t,e))}var XA=[`width`,`height`,`viewBox`],ZA=[`cx`,`cy`,`r`,`stroke-width`],QA=[`cx`,`cy`,`r`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`],$A=L({__name:`DisplayDonut`,props:{value:{},size:{default:36},thickness:{default:4},color:{}},setup(e){let t=e,n=I(()=>(t.size-t.thickness)/2),r=I(()=>2*Math.PI*n.value),i=I(()=>r.value*(1-YA(t.value,0,1)));return(t,a)=>(R(),F(`svg`,{width:e.size,height:e.size,viewBox:`0 0 ${e.size} ${e.size}`,class:`-rotate-90`},[P(`circle`,{cx:e.size/2,cy:e.size/2,r:n.value,fill:`none`,"stroke-width":e.thickness,class:`op-mute stroke-current`},null,8,ZA),P(`circle`,{cx:e.size/2,cy:e.size/2,r:n.value,fill:`none`,"stroke-width":e.thickness,"stroke-dasharray":r.value,"stroke-dashoffset":i.value,"stroke-linecap":`round`,class:Oe([`transition-all stroke-current`,{"color-active":!e.color}]),style:Me(e.color?{color:e.color}:void 0)},null,14,QA)],8,XA))}});function ej(e,t,n,r,i){if(e<=0||n<=0)return i;let a=Math.floor(n/(e/t)*2)/2;return Math.min(i,Math.max(r,a))}function tj(e,t,n,r,i){let a=H(i);function o(){if(!e.value||!t.value)return;let n=Number.parseFloat(getComputedStyle(e.value).fontSize);a.value=ej(t.value.getBoundingClientRect().width,n,e.value.clientWidth,r,i)}return Xe(e,o),be(n,()=>He(o)),document.fonts?.ready.then(o),a}var nj={class:`text-xs whitespace-nowrap tabular-nums`},rj={key:0,class:`color-success-500`},ij={key:1,class:`color-error-500 ml-1`},aj=L({__name:`DiffStats`,props:{additions:{},deletions:{}},setup(e){return(t,n)=>(R(),F(`span`,nj,[e.additions?(R(),F(`span`,rj,`+`+B(e.additions),1)):U(``,!0),e.deletions?(R(),F(`span`,ij,`-`+B(e.deletions),1)):U(``,!0)]))}}),oj=[{match:/\.vue$/,name:`vue`,icon:`i-catppuccin:vue icon-catppuccin`},{match:/\.tsx$/,name:`tsx`,icon:`i-catppuccin:typescript-react icon-catppuccin`},{match:/\.jsx$/,name:`jsx`,icon:`i-catppuccin:javascript-react icon-catppuccin`},{match:/\.d\.[cm]?ts$/,name:`dts`,icon:`i-catppuccin:typescript-def icon-catppuccin`},{match:/\.[cm]?ts$/,name:`ts`,icon:`i-catppuccin:typescript icon-catppuccin`},{match:/\.[cm]?js$/,name:`js`,icon:`i-catppuccin:javascript icon-catppuccin`},{match:/\.json5?$/,name:`json`,icon:`i-catppuccin:json icon-catppuccin`},{match:/\.ya?ml$/,name:`yaml`,icon:`i-catppuccin:yaml icon-catppuccin`},{match:/\.toml$/,name:`toml`,icon:`i-catppuccin:toml icon-catppuccin`},{match:/\.md$/,name:`markdown`,icon:`i-catppuccin:markdown icon-catppuccin`},{match:/\.html?$/,name:`html`,icon:`i-catppuccin:html icon-catppuccin`},{match:/\.(?:css|postcss)$/,name:`css`,icon:`i-catppuccin:css icon-catppuccin`},{match:/\.s[ac]ss$/,name:`sass`,icon:`i-catppuccin:sass icon-catppuccin`},{match:/\.svg$/,name:`svg`,icon:`i-catppuccin:svg icon-catppuccin`},{match:/\.(?:png|jpe?g|gif|webp|avif|ico)$/,name:`image`,icon:`i-catppuccin:image icon-catppuccin`},{match:/\.(?:woff2?|ttf|otf|eot)$/,name:`font`,icon:`i-catppuccin:font icon-catppuccin`},{match:/\.wasm$/,name:`wasm`,icon:`i-catppuccin:webassembly icon-catppuccin`},{match:/package\.json$/,name:`npm`,icon:`i-catppuccin:npm icon-catppuccin`},{match:/\.(?:test|spec)\.[cm]?[jt]sx?$/,name:`test`,icon:`i-catppuccin:typescript-test icon-catppuccin`}],sj=`i-catppuccin:file`;function cj(e){return e.replace(/[?#].*$/,``)}function lj(e,t=oj){let n=cj(e);for(let e of t)if(e.match.test(n))return{name:e.name,icon:e.icon,description:e.description};return{name:`file`,icon:sj}}function uj(e,t){return lj(e,t).icon}var dj=`i-catppuccin:folder`,fj=`i-catppuccin:folder-open`,pj={src:`i-catppuccin:folder-src`,dist:`i-catppuccin:folder-dist`,node_modules:`i-catppuccin:folder-node`,test:`i-catppuccin:folder-tests`,tests:`i-catppuccin:folder-tests`,public:`i-catppuccin:folder-public`,components:`i-catppuccin:folder-components`,utils:`i-catppuccin:folder-utils`,config:`i-catppuccin:folder-config`,assets:`i-catppuccin:folder-images`,scripts:`i-catppuccin:folder-scripts`,styles:`i-catppuccin:folder-styles`,lib:`i-catppuccin:folder-lib`};function mj(e,t=!1,n=pj){return t?fj:(e?n[e.toLowerCase()]:void 0)??dj}function hj(e){return e.replace(/\\/g,`/`)}function gj(e){return/\bnode_modules\b/.test(hj(e))}function _j(e){let t=e.split(`_`)[0]??``,n=t.lastIndexOf(`@`);if(n<=0)return;let r=t.slice(0,n),i=t.slice(n+1),a=r;return r.includes(`+`)&&(a=r.replace(`+`,`/`),a.startsWith(`@`)||(a=`@${a}`)),{name:a,version:i}}function vj(e){let t=hj(e).match(/\.pnpm\/([^/]+)/);if(t?.[1]!=null)return _j(t[1])}function yj(e){let t=hj(e),n=vj(t);if(n)return n.name;let r=t.lastIndexOf(`node_modules/`);if(r===-1)return;let[i,a]=t.slice(r+13).split(`/`);if(i!=null)return i.startsWith(`@`)&&a!=null?`${i}/${a}`:i}function bj(e,t=`~/`){return hj(e).replace(/.*\.pnpm\/[^/]+\/node_modules\//,t)}function xj(e,t,n={}){let{pnpmCollapse:r=`~/`,maxUp:i=3}=n,a=hj(e),o=hj(t).replace(/\/$/,``);if(a.includes(`.pnpm/`))return bj(a,r);if(!o)return a;if(a===o)return`.`;if(a.startsWith(`${o}/`)){let e=a.slice(o.length+1);return e.startsWith(`.`)?e:`./${e}`}let s=o.split(`/`),c=a.split(`/`),l=0;for(;l<s.length&&l<c.length&&s[l]===c[l];)l++;let u=s.length-l;return u>i||l===0?a:`${`../`.repeat(u)}${c.slice(l).join(`/`)}`}function Sj(e,t,n){let r=gj(e)?yj(e):void 0;return{path:xj(e,t,n),moduleName:r}}var Cj={class:`truncate`},wj={class:`color-base`},Tj={key:1,class:`op-mute italic`},Ej={key:2,class:`op-mute`},Dj={key:1,class:`text-xs op-mute shrink-0`},Oj=L({__name:`DisplayFilePath`,props:{path:{},root:{default:``},icon:{type:Boolean,default:!0},href:{},line:{},column:{},dim:{type:Boolean,default:!0},clickable:{type:Boolean},pnpmCollapse:{},tooltip:{type:[Boolean,String],default:!1}},setup(e){let t=e,n=I(()=>Sj(t.path,t.root,{pnpmCollapse:t.pnpmCollapse})),r=I(()=>{let e=n.value.path,t=e.search(/[?#]/),r=t===-1?e:e.slice(0,t),i=t===-1?``:e.slice(t),a=r.lastIndexOf(`/`);return{dir:a===-1?``:r.slice(0,a+1),base:a===-1?r:r.slice(a+1),query:i}}),i=I(()=>t.href!=null||t.clickable);return(t,a)=>De((R(),V(Ue(e.href?`a`:`span`),{href:e.href,class:Oe([`text-sm font-mono inline-flex gap-1 max-w-full min-w-0 items-center`,{"hover:color-active transition":i.value,"cursor-pointer":e.clickable&&!e.href}])},{default:z(()=>[e.icon?(R(),F(`span`,{key:0,class:Oe([N(uj)(r.value.base),`op-fade shrink-0`]),"aria-hidden":`true`},null,2)):U(``,!0),P(`span`,Cj,[r.value.dir?(R(),F(`span`,{key:0,class:Oe(e.dim?`op-mute`:`color-base`)},B(r.value.dir),3)):U(``,!0),P(`span`,wj,B(r.value.base),1),r.value.query?(R(),F(`span`,Tj,B(r.value.query),1)):U(``,!0),e.line==null?U(``,!0):(R(),F(`span`,Ej,[j(`:`+B(e.line),1),e.column==null?U(``,!0):(R(),F(ze,{key:0},[j(`:`+B(e.column),1)],64))]))]),n.value.moduleName?(R(),F(`span`,Dj,`(`+B(n.value.moduleName)+`)`,1)):U(``,!0)]),_:1},8,[`href`,`class`])),[[N(s),e.tooltip===!0?e.path:e.tooltip||``]])}});function kj(e,t){let n=H(e);function r(e){return t[n.value][e]??n.value}return{state:n,dispatch:e=>{n.value=r(e)}}}function Aj(e,t){let n=H({}),r=H(`none`),i=H(e),a=e.value?`mounted`:`unmounted`,o,s=t.value?.ownerDocument.defaultView??tt,{state:c,dispatch:l}=kj(a,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}}),u=e=>{if(nt){let n=new CustomEvent(e,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(n)}};be(e,async(e,i)=>{let a=i!==e;if(await He(),a){let a=r.value,o=jj(t.value);e?(l(`MOUNT`),u(`enter`),o===`none`&&u(`after-enter`)):o===`none`||o===`undefined`||n.value?.display===`none`?(l(`UNMOUNT`),u(`leave`),u(`after-leave`)):i&&a!==o?(l(`ANIMATION_OUT`),u(`leave`)):(l(`UNMOUNT`),u(`after-leave`))}},{immediate:!0});let d=e=>{if(e.target!==t.value)return;let n=jj(t.value),r=n.includes(CSS.escape(e.animationName)),a=c.value===`mounted`?`enter`:`leave`;if(r&&(u(`after-${a}`),l(`ANIMATION_END`),!i.value)){let e=t.value.style.animationFillMode;t.value.style.animationFillMode=`forwards`,o=s?.setTimeout(()=>{t.value?.style.animationFillMode===`forwards`&&(t.value.style.animationFillMode=e)})}n===`none`&&l(`ANIMATION_END`)},f=e=>{e.target===t.value&&(r.value=jj(t.value))},p=be(t,(e,t)=>{e?(n.value=getComputedStyle(e),e.addEventListener(`animationstart`,f),e.addEventListener(`animationcancel`,d),e.addEventListener(`animationend`,d)):(l(`ANIMATION_END`),o!==void 0&&s?.clearTimeout(o),t?.removeEventListener(`animationstart`,f),t?.removeEventListener(`animationcancel`,d),t?.removeEventListener(`animationend`,d))},{immediate:!0}),m=be(c,()=>{let e=jj(t.value);r.value=c.value===`mounted`?e:`none`});return Pe(()=>{p(),m(),t.value&&(t.value.removeEventListener(`animationstart`,f),t.value.removeEventListener(`animationcancel`,d),t.value.removeEventListener(`animationend`,d)),o!==void 0&&s?.clearTimeout(o)}),{isPresent:I(()=>[`mounted`,`unmountSuspended`].includes(c.value))}}function jj(e){return e&&getComputedStyle(e).animationName||`none`}var Mj=L({name:`Presence`,props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:n}){let{present:r,forceMount:i}=Ee(e),o=H(),{isPresent:s}=Aj(r,o);n({present:s});let c=t.default({present:s.value});c=a(c||[]);let l=Se();if(c&&c?.length>1){let e=l?.parent?.type.name?`<${l.parent.type.name} />`:`component`;throw Error([`Detected an invalid children for \`${e}\` for \`Presence\` component.`,``,"Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.",`You can apply a few solutions:`,["Provide a single child element so that `presence` directive attach correctly.",`Ensure the first child is an actual element instead of a raw text node or comment node.`].map(e=>` - ${e}`).join(`
384
- `)].join(`
385
- `))}return()=>i.value||r.value||s.value?_e(t.default({present:s.value})[0],{ref:e=>{let t=$e(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?o.value=t.firstElementChild:o.value=t),t}}):null}});function Nj(e){return typeof e==`object`?e.key:e}function Pj(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function Fj(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function Ij(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var Lj=(e,t)=>Math.abs(e-t)<1.01,Rj=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})},zj,Bj=()=>{if(zj!==void 0)return zj;if(typeof navigator>`u`)return zj=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return zj=!0;let e=navigator.maxTouchPoints;return zj=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Vj=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Hj=e=>e,Uj=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},Wj=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Vj(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(Vj(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},Gj={passive:!0},Kj=typeof window>`u`||`onscrollend`in window,qj=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Kj,o=0,s=a?null:Rj(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Gj),a&&r.addEventListener(`scrollend`,u,Gj),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Jj=(e,t)=>qj(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Yj=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Xj=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})};function Zj(e,t,n,r){if(t===0)return!1;let i=r(0),a=new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var Qj=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Hj,rangeExtractor:Uj,onChange:()=>{},measureElement:Yj,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>Nj(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||Zj(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=!1,s=0;if(r&&this.scrollOffset!==null){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:c}=this.options,l=0;for(;l<a&&c(l)!==e;)l++;if(l<a){let e=n[l];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(s=n-this.scrollOffset,this.scrollOffset=n,o=!0)}}}(o||i)&&(this.pendingScrollAnchor=[o?r[0]:null,o?r[1]:0,i,s])},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Fj(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&this._intendedScrollOffset===null&&e===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,Bj()&&this.targetWindow!=null&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,Gj),e.addEventListener(`touchend`,n,Gj),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let t=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled){let[e,n,r,i]=t;e!==null&&!r&&(Bj()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?i!==0&&(this._iosDeferredAdjustment+=i):this.scrollState?.behavior===`smooth`&&!Lj(this.getScrollOffset()-i,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),r&&this.scrollToEnd({behavior:r})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;if(this._iosDeferredAdjustment<0&&e>=t-1){this._iosDeferredAdjustment=0;return}let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Fj(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=Fj(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=Pj(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Fj(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>e.length===0||t===0?(this.range=null,null):(this.range=tM(e,t,n,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Fj(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(!this.isIndexInRange(e))return;let n,r,i,a=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&a!=null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=this.itemSizeCache.get(i)??n,s=t-o;if(s!==0){let a=this.options.anchorTo===`end`&&this.scrollState?.behavior!==`smooth`&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,c=a?this.getTotalSize():0,l=this.getScrollOffset()+this.scrollAdjustments,u=this.itemSizeCache.has(i)?r+o<=l&&this.scrollDirection!==`backward`:r<l,d=this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?u:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},s,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++;let f=!1;a?f=this.applyScrollAdjustment(this.getTotalSize()-c):d&&(f=this.applyScrollAdjustment(s)),this.notify(f),this._retryClampedAdjustment()}},this.getVirtualItems=Fj(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return Ij(t[$j(0,t.length-1,r?e=>n[e*2]:e=>Ij(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0;let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{this._iosDeferredAdjustment=0,e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e=`auto`}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:`end`,behavior:e});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){if(e===0)return!1;if(Bj()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=e,!1;{let n=this.getScrollOffset()+this.scrollAdjustments+e,r=this.scrollElement,i=r!==null&&(`scrollHeight`in r||`document`in r)?this.getMaxScrollOffset():null;return this._clampedAdjustment=i!==null&&n>i+.5?{target:n,maxAtWrite:i}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&Lj(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},$j=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function eM(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function tM(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=eM(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=$j(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}function nM(e){let t=new Qj(N(e)),n=We(t),r=t._didMount();return be(()=>N(e).getScrollElement(),e=>{e&&t._willUpdate()},{immediate:!0}),be(()=>N(e),e=>{t.setOptions({...e,onChange:(t,r)=>{var i;ye(n),(i=e.onChange)==null||i.call(e,t,r)}}),t._willUpdate(),ye(n)},{immediate:!0}),Be(r),n}function rM(e){return nM(I(()=>({observeElementRect:Wj,observeElementOffset:Jj,scrollToFn:Xj,...N(e)})))}var[iM,aM]=m(`CheckboxGroupRoot`);function oM(e){return e===`indeterminate`}function sM(e){return oM(e)?`indeterminate`:e?`checked`:`unchecked`}var[cM,lM]=m(`CheckboxRoot`),uM=L({inheritAttrs:!1,__name:`CheckboxRoot`,props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:`on`},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:modelValue`],setup(t,{emit:n}){let r=t,i=n,{forwardRef:a,currentElement:o}=d(),s=iM(null),f=Ze(r,`modelValue`,i,{defaultValue:r.defaultValue??r.falseValue,passive:r.modelValue===void 0}),m=I(()=>s?.disabled.value||r.disabled),h=I(()=>he(f.value,r.trueValue)),g=I(()=>l(s?.modelValue.value)?f.value===`indeterminate`?`indeterminate`:h.value:c(s.modelValue.value,r.value));function _(){if(l(s?.modelValue.value))f.value===`indeterminate`?f.value=r.trueValue:f.value=h.value?r.falseValue:r.trueValue;else{let e=[...s.modelValue.value||[]];if(c(e,r.value)){let t=e.findIndex(e=>he(e,r.value));e.splice(t,1)}else e.push(r.value);s.modelValue.value=e}}let v=p(o),y=u(),b=Ce(),x=I(()=>{if(!b[`aria-label`])return r.id&&o.value?document.querySelector(`[for="${r.id}"]`)?.innerText:void 0});return lM({disabled:m,state:g}),(t,n)=>(R(),F(ze,null,[(R(),V(Ue(N(s)?.rovingFocus.value?N(E):N(ne)),Ne({...t.$attrs,...N(y)},{id:t.id,ref:N(a),role:`checkbox`,"as-child":t.asChild,as:t.as,type:t.as===`button`?`button`:void 0,"aria-checked":N(oM)(g.value)?`mixed`:g.value,"aria-required":t.required,"aria-label":t.$attrs[`aria-label`]||x.value,"data-state":N(sM)(g.value),"data-disabled":m.value?``:void 0,disabled:m.value,focusable:N(s)?.rovingFocus.value?!m.value:void 0,onKeydown:Ke(qe(()=>{},[`prevent`]),[`enter`]),onClick:_}),{default:z(()=>[Ge(t.$slots,`default`,{modelValue:N(f),state:g.value})]),_:3},16,[`id`,`as-child`,`as`,`type`,`aria-checked`,`aria-required`,`aria-label`,`data-state`,`data-disabled`,`disabled`,`focusable`,`onKeydown`])),N(v)&&t.name&&!N(s)?(R(),V(N(e),Ne({key:0,type:`checkbox`,checked:!!g.value,name:t.name,value:t.value,disabled:m.value,required:t.required},N(y)),null,16,[`checked`,`name`,`value`,`disabled`,`required`])):U(`v-if`,!0)],64))}}),dM=L({__name:`CheckboxIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=d(),n=cM();return(e,r)=>(R(),V(N(Mj),{present:e.forceMount||N(oM)(N(n).state.value)||N(n).state.value===!0},{default:z(()=>[A(N(ne),Ne({ref:N(t),"data-state":N(sM)(N(n).state.value),"data-disabled":N(n).disabled.value?``:void 0,style:{pointerEvents:`none`},"as-child":e.asChild,as:e.as},e.$attrs),{default:z(()=>[Ge(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),fM=L({__name:`RadioGroupIndicator`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`span`}},setup(e){let{forwardRef:t}=d(),n=r();return(e,r)=>(R(),V(N(Mj),{present:e.forceMount||N(n).checked.value},{default:z(()=>[A(N(ne),Ne({ref:N(t),"data-state":N(n).checked.value?`checked`:`unchecked`,"data-disabled":N(n).disabled.value?``:void 0,"as-child":e.asChild,as:e.as},e.$attrs),{default:z(()=>[Ge(e.$slots,`default`)]),_:3},16,[`data-state`,`data-disabled`,`as-child`,`as`])]),_:3},8,[`present`]))}}),pM=`outline-none border border-base rounded bg-raised flex h-4 w-4 transition items-center justify-center data-[state=checked]:border-primary-500 data-[state=checked]:bg-primary-500 focus-visible:ring-2 focus-visible:ring-primary-500/40`,mM=L({inheritAttrs:!1,__name:`FormCheckbox`,props:ge({label:{},disabled:{type:Boolean}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=M(e,`modelValue`);return(n,r)=>e.label||n.$slots.default?(R(),F(`label`,Ne({key:0},n.$attrs,{class:[`text-sm inline-flex gap-1.5 cursor-pointer select-none items-center`,{"op-fade saturate-0 pointer-events-none":e.disabled}]}),[A(N(uM),{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,disabled:e.disabled,class:Oe(pM)},{default:z(()=>[A(N(dM),{class:`text-white`},{default:z(()=>[...r[2]||=[P(`div`,{class:`i-ph:check-bold text-micro text-white mt--1px`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:1},8,[`modelValue`,`disabled`]),P(`span`,null,[Ge(n.$slots,`default`,{},()=>[j(B(e.label),1)])])],16)):(R(),V(N(uM),Ne({key:1},n.$attrs,{modelValue:t.value,"onUpdate:modelValue":r[1]||=e=>t.value=e,disabled:e.disabled,class:pM}),{default:z(()=>[A(N(dM),{class:`text-white`},{default:z(()=>[...r[3]||=[P(`div`,{class:`i-ph:check-bold text-micro text-white mt--1px`,"aria-hidden":`true`},null,-1)]]),_:1})]),_:1},16,[`modelValue`,`disabled`]))}}),hM=`file-content:`;function gM(e,t){return`${hM}${t}:${e}`}async function _M(e,t,n){let r=await e.getItem(gM(t,n));return typeof r==`string`?r:void 0}async function vM(e,t,n,r){await e.setItem(gM(t,n),r)}var yM=[`rows`,`placeholder`,`disabled`,`aria-invalid`],bM=L({__name:`FormTextarea`,props:ge({placeholder:{},rows:{default:4},disabled:{type:Boolean},invalid:{type:Boolean},resize:{type:Boolean,default:!0}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=M(e,`modelValue`);return(n,r)=>De((R(),F(`textarea`,{"onUpdate:modelValue":r[0]||=e=>t.value=e,rows:e.rows,placeholder:e.placeholder,disabled:e.disabled,"aria-invalid":e.invalid||void 0,class:Oe([`color-base px-2 py-1.5 outline-none border rounded bg-raised w-full transition placeholder:op-mute focus:ring-2`,[e.invalid?`border-red-500/60 focus:ring-red-500/40`:`border-base focus:ring-primary-500/40`,{"resize-none":!e.resize,"op50 pointer-events-none":e.disabled}]])},null,10,yM)),[[Je,t.value]])}}),xM={class:`p-2 flex flex-col gap-2`},SM={key:0,class:`text-xs text-red-600 dark:text-red-400`},CM={class:`flex flex-wrap gap-2 justify-end`},wM=L({__name:`CommentComposer`,props:{hasPendingReview:{type:Boolean},busy:{type:Boolean},error:{}},emits:[`submit`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=H(``);function a(e){i.value.trim()&&r(`submit`,i.value,e)}return(t,o)=>(R(),F(`div`,xM,[A(bM,{modelValue:i.value,"onUpdate:modelValue":o[0]||=e=>i.value=e,rows:3,placeholder:`Leave a comment`,disabled:e.busy,invalid:!!e.error,onKeydown:[o[1]||=Ke(qe(e=>a(`review`),[`meta`]),[`enter`]),o[2]||=Ke(qe(e=>a(`review`),[`ctrl`]),[`enter`])]},null,8,[`modelValue`,`disabled`,`invalid`]),e.error?(R(),F(`p`,SM,B(e.error),1)):U(``,!0),P(`div`,CM,[A(_,{size:`sm`,variant:`text`,disabled:e.busy,onClick:o[3]||=e=>r(`cancel`)},{default:z(()=>[...o[6]||=[j(` Cancel `,-1)]]),_:1},8,[`disabled`]),n.hasPendingReview?U(``,!0):(R(),V(_,{key:0,size:`sm`,disabled:e.busy||!i.value.trim(),onClick:o[4]||=e=>a(`single`)},{default:z(()=>[...o[7]||=[j(` Add single comment `,-1)]]),_:1},8,[`disabled`])),A(_,{size:`sm`,variant:`primary`,loading:e.busy,disabled:!i.value.trim(),onClick:o[5]||=e=>a(`review`)},{default:z(()=>[j(B(e.hasPendingReview?`Add review comment`:`Start a review`),1)]),_:1},8,[`loading`,`disabled`])])]))}}),TM=Symbol(`diffs-file-content-context`),EM=[`title`],DM=L({__name:`FileStatus`,props:{status:{}},setup(e){let t={added:`A`,removed:`D`,modified:`M`,renamed:`R`,copied:`C`},n={added:`color-success-500 bg-success-500:10`,removed:`color-error-500 bg-error-500:10`,modified:`color-warning-500 bg-warning-500:10`,renamed:`color-blue-500 bg-blue-500:10`,copied:`color-blue-500 bg-blue-500:10`};return(r,i)=>(R(),F(`span`,{class:Oe([`text-xs font-mono rounded inline-flex shrink-0 w-4 items-center justify-center`,n[e.status]]),title:e.status},B(t[e.status]),11,EM))}}),OM=(0,lt.default)(ut);function kM(e){return OM(e)}var AM=`@layer base {
386
- :host {
387
- --diffs-font-fallback: "SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono",
388
- "Courier New", monospace;
389
- --diffs-header-font-fallback: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
390
- "Noto Sans", "Liberation Sans", Arial, sans-serif;
391
- --diffs-mixer: light-dark(#000, #fff);
392
- --diffs-gap-fallback: 8px;
393
- --diffs-scrollbar-gutter-fallback: 6px;
394
- --diffs-scrollbar-gutter: var(--diffs-scrollbar-gutter-override, var(--diffs-scrollbar-gutter-measured, var(--diffs-scrollbar-gutter-fallback)));
395
- --diffs-added-light: #0dbe4e;
396
- --diffs-added-dark: #5ecc71;
397
- --diffs-modified-light: #009fff;
398
- --diffs-modified-dark: #69b1ff;
399
- --diffs-deleted-light: #ff2e3f;
400
- --diffs-deleted-dark: #ff6762;
401
- --diffs-warning-light: #d5a910;
402
- --diffs-warning-dark: #ffd452;
403
- color-scheme: light dark;
404
- font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
405
- font-size: var(--diffs-font-size, 13px);
406
- line-height: var(--diffs-line-height, 20px);
407
- font-feature-settings: var(--diffs-font-features);
408
- --diffs-bg: light-dark(var(--diffs-light-bg, #fff), var(--diffs-dark-bg, #000));
409
- --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))));
410
- --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))));
411
- --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))));
412
- --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))));
413
- --diffs-fg: light-dark(var(--diffs-light, #000), var(--diffs-dark, #fff));
414
- --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))));
415
- --diffs-fg-conflict-marker: var(--diffs-fg-conflict-marker-override, var(--diffs-fg-number));
416
- --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)))));
417
- --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)))));
418
- --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)))));
419
- --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))));
420
- --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)));
421
- --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))));
422
- --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)));
423
- --diffs-selection-base: var(--diffs-modified-base);
424
- --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)));
425
- background-color: var(--diffs-bg);
426
- color: var(--diffs-fg);
427
- display: block;
428
- }
429
-
430
- pre, code, [data-error-wrapper] {
431
- isolation: isolate;
432
- font-family: var(--diffs-font-family, var(--diffs-font-fallback));
433
- outline: none;
434
- margin: 0;
435
- padding: 0;
436
- display: block;
437
- }
438
-
439
- pre, code {
440
- background-color: var(--diffs-bg);
441
- }
442
-
443
- code {
444
- contain: content;
445
- }
446
-
447
- input, button {
448
- font-family: inherit;
449
- font-size: inherit;
450
- line-height: inherit;
451
- }
452
-
453
- *, :before, :after {
454
- box-sizing: border-box;
455
- }
456
-
457
- [data-icon-sprite] {
458
- display: none;
459
- }
460
-
461
- [data-diffs-header], [data-separator] {
462
- font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
463
- }
464
-
465
- [data-diffs-header][data-sticky] {
466
- z-index: 1;
467
- background-color: var(--diffs-bg);
468
- position: sticky;
469
- top: 0;
470
- }
471
-
472
- [data-file-info] {
473
- color: var(--fg);
474
- background-color: color-mix(in lab, var(--bg) 98%, var(--fg));
475
- border-block: 1px solid color-mix(in lab, var(--bg) 95%, var(--fg));
476
- padding: 10px;
477
- font-weight: 700;
478
- }
479
-
480
- [data-diff], [data-file] {
481
- --diffs-grid-number-column-width: minmax(min-content, max-content);
482
- --diffs-code-grid: var(--diffs-grid-number-column-width) 1fr;
483
-
484
- &[data-dehydrated] {
485
- --diffs-code-grid: var(--diffs-grid-number-column-width) minmax(0, 1fr);
486
- }
487
-
488
- &:hover [data-code]::-webkit-scrollbar-thumb {
489
- background-color: var(--diffs-bg-context);
490
- }
491
- }
492
-
493
- @supports (-webkit-touch-callout: none) {
494
- :host {
495
- --diffs-scrollbar-gutter-fallback: 0px;
496
- }
497
- }
498
-
499
- [data-line] span, [data-edit-prediction-suffix] span {
500
- color: light-dark(var(--diffs-token-light, var(--diffs-light)), var(--diffs-token-dark, var(--diffs-dark)));
501
- background-color: light-dark(var(--diffs-token-light-bg, inherit), var(--diffs-token-dark-bg, inherit));
502
- font-weight: light-dark(var(--diffs-token-light-font-weight, inherit), var(--diffs-token-dark-font-weight, inherit));
503
- font-style: light-dark(var(--diffs-token-light-font-style, inherit), var(--diffs-token-dark-font-style, inherit));
504
- text-decoration: light-dark(var(--diffs-token-light-text-decoration, inherit), var(--diffs-token-dark-text-decoration, inherit));
505
- }
506
-
507
- [data-line], [data-gutter-buffer], [data-column-number], [data-line-annotation], [data-no-newline], [data-merge-conflict], [data-merge-conflict-actions], [data-editor-overlay] {
508
- --diffs-computed-decoration-bg: var(--diffs-bg);
509
- --diffs-computed-diff-line-bg: var(--diffs-computed-decoration-bg);
510
- --diffs-computed-selected-line-bg: var(--diffs-computed-diff-line-bg);
511
- --diffs-computed-editor-active-line-bg: var(--diffs-computed-selected-line-bg);
512
- --diffs-computed-hovered-line-bg: var(--diffs-computed-editor-active-line-bg);
513
- --diffs-hover-mix-target: var(--diffs-bg-hover-override, var(--diffs-mixer));
514
- --diffs-line-bg: var(--diffs-computed-hovered-line-bg);
515
- color: var(--diffs-fg);
516
- background-color: var(--diffs-line-bg, var(--diffs-bg));
517
- }
518
-
519
- [data-line], [data-no-newline] {
520
- &[data-decoration-bg] {
521
- --mix-deco-light: 92%;
522
- --mix-deco-dark: 85%;
523
-
524
- &[data-decoration-bg-depth="2"] {
525
- --mix-deco-light: 88%;
526
- --mix-deco-dark: 80%;
527
- }
528
-
529
- &[data-decoration-bg-depth="3"] {
530
- --mix-deco-light: 85%;
531
- --mix-deco-dark: 78%;
532
- }
533
-
534
- --diffs-hover-mix-target: var(--diffs-decoration-bg);
535
- --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
536
- var(--diffs-bg) var(--mix-deco-light),
537
- var(--diffs-decoration-bg)), color-mix(in lab,
538
- var(--diffs-bg) var(--mix-deco-dark),
539
- var(--diffs-decoration-bg)));
540
- }
541
- }
542
-
543
- [data-line-annotation], [data-gutter-buffer="annotation"] {
544
- --diffs-annotation-bg: var(--diffs-bg-context);
545
- --diffs-computed-decoration-bg: var(--diffs-annotation-bg);
546
- --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
547
- }
548
-
549
- [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"] {
550
- --diffs-computed-decoration-bg: var(--diffs-bg-context);
551
- --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
552
- }
553
-
554
- [data-gutter-buffer="merge-conflict-marker-start"], [data-merge-conflict="marker-start"] {
555
- --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
556
- var(--diffs-bg) 78%,
557
- var(--conflict-bg-current-header-override, var(--diffs-addition-base))), color-mix(in lab,
558
- var(--diffs-bg) 68%,
559
- var(--conflict-bg-current-header-override, var(--diffs-addition-base))));
560
- --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
561
- }
562
-
563
- [data-gutter-buffer="merge-conflict-marker-end"], [data-merge-conflict="marker-end"] {
564
- --diffs-computed-decoration-bg: light-dark(color-mix(in lab,
565
- var(--diffs-bg) 78%,
566
- var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))), color-mix(in lab,
567
- var(--diffs-bg) 68%,
568
- var(--conflict-bg-incoming-header-override, var(--diffs-modified-base))));
569
- --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
570
- }
571
-
572
- [data-has-merge-conflict] [data-line-annotation], [data-has-merge-conflict] [data-gutter-buffer="annotation"] {
573
- --diffs-computed-decoration-bg: var(--diffs-bg);
574
- --diffs-hover-mix-target: var(--diffs-computed-editor-active-line-bg);
575
- }
576
-
577
- :where([data-background]) {
578
- & [data-gutter-buffer], & [data-column-number] {
579
- --mix-light: 91%;
580
- --mix-dark: 85%;
581
- }
582
-
583
- & [data-line], & [data-no-newline] {
584
- --mix-light: 88%;
585
- --mix-dark: 80%;
586
- }
587
-
588
- & [data-gutter-buffer], & [data-column-number], & [data-line], & [data-no-newline] {
589
- --diffs-diff-line-mix-target: var(--diffs-bg);
590
-
591
- &[data-line-type="change-deletion"] {
592
- --diffs-diff-line-mix-target: var(--diffs-bg-deletion-override, var(--diffs-deletion-base));
593
- --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
594
-
595
- &:where([data-gutter-buffer], [data-column-number]) {
596
- color: var(--diffs-fg-number-deletion-override, var(--diffs-deletion-base));
597
- --diffs-diff-line-mix-target: var(--diffs-bg-deletion-number-override, var(--diffs-deletion-base));
598
- }
599
-
600
- --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
601
- var(--diffs-computed-decoration-bg) var(--mix-light),
602
- var(--diffs-diff-line-mix-target)), color-mix(in lab,
603
- var(--diffs-computed-decoration-bg) var(--mix-dark),
604
- var(--diffs-diff-line-mix-target)));
605
- }
606
-
607
- &[data-line-type="change-addition"] {
608
- --diffs-diff-line-mix-target: var(--diffs-bg-addition-override, var(--diffs-addition-base));
609
- --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
610
-
611
- &:where([data-gutter-buffer], [data-column-number]) {
612
- color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
613
- --diffs-diff-line-mix-target: var(--diffs-bg-addition-number-override, var(--diffs-addition-base));
614
- }
615
-
616
- --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
617
- var(--diffs-computed-decoration-bg) var(--mix-light),
618
- var(--diffs-diff-line-mix-target)), color-mix(in lab,
619
- var(--diffs-computed-decoration-bg) var(--mix-dark),
620
- var(--diffs-diff-line-mix-target)));
621
- }
622
-
623
- &[data-merge-conflict="current"] {
624
- --diffs-diff-line-mix-target: var(--conflict-bg-current-override, var(--diffs-addition-base));
625
- --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
626
-
627
- &:where([data-gutter-buffer], [data-column-number]) {
628
- color: var(--diffs-fg-number-addition-override, var(--diffs-addition-base));
629
- --diffs-diff-line-mix-target: var(--conflict-bg-current-number-override, var(--diffs-addition-base));
630
- }
631
-
632
- --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
633
- var(--diffs-computed-decoration-bg) var(--mix-light),
634
- var(--diffs-diff-line-mix-target)), color-mix(in lab,
635
- var(--diffs-computed-decoration-bg) var(--mix-dark),
636
- var(--diffs-diff-line-mix-target)));
637
- }
638
-
639
- &[data-merge-conflict="incoming"] {
640
- --diffs-diff-line-mix-target: var(--conflict-bg-incoming-override, var(--diffs-modified-base));
641
- --diffs-hover-mix-target: var(--diffs-diff-line-mix-target);
642
-
643
- &:where([data-gutter-buffer], [data-column-number]) {
644
- color: var(--diffs-modified-base);
645
- --diffs-diff-line-mix-target: var(--conflict-bg-incoming-number-override, var(--diffs-modified-base));
646
- }
647
-
648
- --diffs-computed-diff-line-bg: light-dark(color-mix(in lab,
649
- var(--diffs-computed-decoration-bg) var(--mix-light),
650
- var(--diffs-diff-line-mix-target)), color-mix(in lab,
651
- var(--diffs-computed-decoration-bg) var(--mix-dark),
652
- var(--diffs-diff-line-mix-target)));
653
- }
654
- }
655
- }
656
-
657
- [data-gutter-buffer], [data-column-number], [data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline], [data-editor-overlay] {
658
- --diffs-selection-mix-target: var(--diffs-bg-selection-override, var(--diffs-selection-base));
659
- --diffs-selection-emphasis-mix-target: var(--diffs-selection-mix-target);
660
-
661
- &:where([data-editor-overlay]), &:where([data-line], [data-line-annotation], [data-merge-conflict], [data-merge-conflict-actions], [data-no-newline])[data-selected-line] {
662
- --mix-selection-light: 82%;
663
- --mix-selection-dark: 75%;
664
- --diffs-hover-mix-target: var(--diffs-selection-mix-target);
665
- }
666
-
667
- &:where([data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line])) {
668
- --mix-selection-light: 75%;
669
- --mix-selection-dark: 60%;
670
- --diffs-selection-mix-target: var(--diffs-bg-selection-number-override, var(--diffs-selection-base));
671
- --diffs-hover-mix-target: var(--diffs-selection-mix-target);
672
- }
673
-
674
- &:where([data-line][data-selected-line]):is([data-line-type="change-addition"], [data-line-type="change-deletion"]) {
675
- --diffs-selection-emphasis-mix-target: light-dark(color-mix(in lab,
676
- var(--diffs-diff-line-mix-target, var(--diffs-selection-mix-target))
677
- var(--mix-selection-light),
678
- var(--diffs-selection-mix-target)), var(--diffs-selection-mix-target));
679
- }
680
-
681
- &:where([data-editor-overlay]), &[data-selected-line] {
682
- --diffs-computed-selected-line-bg: light-dark(color-mix(in lab,
683
- var(--diffs-computed-diff-line-bg) var(--mix-selection-light),
684
- var(--diffs-selection-mix-target)), color-mix(in lab,
685
- var(--diffs-computed-diff-line-bg) var(--mix-selection-dark),
686
- var(--diffs-selection-mix-target)));
687
- }
688
- }
689
-
690
- [data-line][data-editor-active-line], [data-column-number][data-editor-active-line] {
691
- --diffs-computed-editor-active-line-bg: color-mix(in lab,
692
- var(--diffs-computed-selected-line-bg)
693
- var(--diffs-editor-active-line-source-mix, 100%),
694
- var(--diffs-selection-emphasis-mix-target));
695
- }
696
-
697
- @media (pointer: fine) {
698
- [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] {
699
- --diffs-computed-hovered-line-bg: light-dark(color-mix(in lab,
700
- var(--diffs-computed-editor-active-line-bg) 97%,
701
- var(--diffs-hover-mix-target)), color-mix(in lab,
702
- var(--diffs-computed-editor-active-line-bg) 91%,
703
- var(--diffs-hover-mix-target)));
704
- }
705
- }
706
-
707
- [data-gutter-buffer][data-selected-line], [data-column-number]:is([data-selected-line], [data-editor-active-line]) {
708
- color: var(--diffs-selection-number-fg);
709
- }
710
-
711
- [data-no-newline] {
712
- user-select: none;
713
-
714
- & span {
715
- opacity: .6;
716
- }
717
- }
718
-
719
- [data-diff-type="split"][data-overflow="scroll"] {
720
- grid-template-columns: 1fr 1fr;
721
- display: grid;
722
-
723
- & [data-additions] {
724
- border-left: 1px solid var(--diffs-bg);
725
- }
726
-
727
- & [data-deletions] {
728
- border-right: 1px solid var(--diffs-bg);
729
- }
730
- }
731
-
732
- [data-code] {
733
- grid-auto-flow: dense;
734
- grid-template-columns: var(--diffs-code-grid);
735
- overflow: var(--diffs-overflow-override, scroll) clip;
736
- overscroll-behavior-x: none;
737
- tab-size: var(--diffs-tab-size, 2);
738
- padding-top: var(--diffs-gap-block, var(--diffs-gap-fallback));
739
- padding-bottom: max(0px,
740
- calc(var(--diffs-gap-block, var(--diffs-gap-fallback)) -
741
- var(--diffs-scrollbar-gutter)));
742
- scrollbar-gutter: stable;
743
- align-self: flex-start;
744
- display: grid;
745
- }
746
-
747
- [data-diffs-scrollbar-measure] {
748
- opacity: 0;
749
- pointer-events: none;
750
- scrollbar-gutter: auto;
751
- grid-template-columns: none;
752
- width: 100px;
753
- height: 100px;
754
- padding: 0;
755
- position: absolute;
756
- top: -200px;
757
- left: -200px;
758
- }
759
-
760
- [data-container-size] {
761
- container-type: inline-size;
762
- }
763
-
764
- [data-code]::-webkit-scrollbar {
765
- width: 0;
766
- height: var(--diffs-scrollbar-gutter);
767
- }
768
-
769
- [data-code]::-webkit-scrollbar-track {
770
- background: none;
771
- }
772
-
773
- [data-code]::-webkit-scrollbar-thumb {
774
- background-color: #0000;
775
- background-clip: content-box;
776
- border: 1px solid #0000;
777
- border-radius: 3px;
778
- }
779
-
780
- [data-code]::-webkit-scrollbar-corner {
781
- background-color: #0000;
782
- }
783
-
784
- @supports ((-moz-appearance: none)) {
785
- [data-code] {
786
- scrollbar-width: thin;
787
- scrollbar-color: var(--diffs-bg-context) transparent;
788
- padding-bottom: var(--diffs-gap-block, var(--diffs-gap-fallback));
789
- }
790
- }
791
-
792
- [data-diffs-header] ~ [data-diff], [data-diffs-header] ~ [data-file] {
793
- & [data-code], &[data-overflow="wrap"], &[data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
794
- padding-top: 0;
795
- }
796
- }
797
-
798
- [data-gutter] {
799
- grid-template-rows: subgrid;
800
- grid-template-columns: subgrid;
801
- z-index: 3;
802
- background-color: var(--diffs-bg);
803
- grid-column: 1;
804
- display: grid;
805
- position: relative;
806
-
807
- & [data-gutter-buffer], & [data-column-number] {
808
- border-right: var(--diffs-gap-style, 2px solid var(--diffs-bg));
809
- }
810
- }
811
-
812
- [data-content] {
813
- grid-template-rows: subgrid;
814
- grid-template-columns: subgrid;
815
- background-color: var(--diffs-bg);
816
- grid-column: 2;
817
- min-width: 0;
818
- display: grid;
819
- }
820
-
821
- [data-diff-type="split"][data-overflow="wrap"], [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] {
822
- grid-auto-flow: dense;
823
- grid-template-columns: repeat(2, var(--diffs-code-grid));
824
- padding-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
825
- display: grid;
826
-
827
- & [data-code] {
828
- display: contents;
829
- }
830
-
831
- & [data-deletions] {
832
- & [data-gutter] {
833
- grid-column: 1;
834
- }
835
-
836
- & [data-content] {
837
- border-right: 1px solid var(--diffs-bg);
838
- grid-column: 2;
839
- }
840
- }
841
-
842
- & [data-additions] {
843
- & [data-gutter] {
844
- border-left: 1px solid var(--diffs-bg);
845
- grid-column: 3;
846
- }
847
-
848
- & [data-content] {
849
- grid-column: 4;
850
- }
851
- }
852
- }
853
-
854
- [data-dehydrated][data-diff-type="split"][data-overflow="scroll"] [data-content] {
855
- overflow: clip;
856
- }
857
-
858
- [data-overflow="scroll"] [data-gutter] {
859
- position: sticky;
860
- left: 0;
861
- }
862
-
863
- [data-interactive-lines] [data-line] {
864
- cursor: pointer;
865
- }
866
-
867
- [data-interactive-line-numbers] [data-column-number] {
868
- cursor: pointer;
869
- touch-action: none;
870
- }
871
-
872
- [data-content-buffer], [data-gutter-buffer] {
873
- user-select: none;
874
- min-height: 1lh;
875
- position: relative;
876
- }
877
-
878
- [data-gutter-buffer] {
879
- padding-left: 2ch;
880
- padding-right: 1ch;
881
-
882
- &:before {
883
- content: "";
884
- min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
885
- display: block;
886
- }
887
- }
888
-
889
- [data-gutter-buffer="annotation"] {
890
- --diffs-annotation-bg: var(--diffs-bg-context-gutter);
891
- min-height: 0;
892
- }
893
-
894
- [data-gutter-buffer="buffer"] {
895
- --diffs-line-bg: var(--diffs-bg-context-gutter);
896
- }
897
-
898
- [data-content-buffer] {
899
- background-position: 5px 0;
900
- background-size: 8px 8px;
901
- background-origin: border-box;
902
- background-image: repeating-linear-gradient(-45deg,
903
- transparent,
904
- transparent calc(3px * 1.414),
905
- var(--diffs-bg-buffer) calc(3px * 1.414),
906
- var(--diffs-bg-buffer) calc(4px * 1.414));
907
- grid-column: 1;
908
- }
909
-
910
- [data-separator] {
911
- box-sizing: content-box;
912
- background-color: var(--diffs-bg);
913
- }
914
-
915
- [data-separator="simple"] {
916
- min-height: 4px;
917
- }
918
-
919
- [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"], [data-separator="simple"] {
920
- background-color: var(--diffs-bg-separator);
921
- }
922
-
923
- [data-separator="line-info"], [data-separator="line-info-basic"], [data-separator="metadata"] {
924
- height: 32px;
925
- position: relative;
926
- }
927
-
928
- [data-separator-wrapper] {
929
- user-select: none;
930
- fill: currentColor;
931
- background-color: var(--diffs-bg);
932
- align-items: center;
933
- height: 100%;
934
- display: flex;
935
- position: absolute;
936
- inset-inline: 0;
937
- }
938
-
939
- [data-content] [data-separator-wrapper] {
940
- display: none;
941
- }
942
-
943
- [data-separator="metadata"] [data-separator-wrapper] {
944
- background-color: var(--diffs-bg-separator);
945
- height: 100%;
946
- color: var(--diffs-fg-number);
947
- white-space: nowrap;
948
- text-overflow: ellipsis;
949
- min-width: min-content;
950
- padding-inline: 1ch;
951
- inset-inline: 100% auto;
952
- overflow: hidden;
953
- }
954
-
955
- [data-separator="line-info"] {
956
- margin-block: var(--diffs-gap-block, var(--diffs-gap-fallback));
957
-
958
- & [data-separator-wrapper] {
959
- min-width: 16px;
960
- }
961
- }
962
-
963
- [data-separator="line-info-basic"], [data-separator="metadata"] {
964
- margin-block: 0;
965
- }
966
-
967
- [data-separator="line-info"][data-separator-first] {
968
- margin-top: 0;
969
- }
970
-
971
- [data-separator="line-info"][data-separator-last] {
972
- margin-bottom: 0;
973
- }
974
-
975
- [data-expand-index] [data-separator-wrapper] {
976
- grid-template-columns: 32px auto;
977
- display: grid;
978
- }
979
-
980
- [data-expand-index] [data-separator-wrapper][data-separator-multi-button] {
981
- grid-template-columns: 32px 32px auto;
982
- }
983
-
984
- [data-expand-button], [data-separator-content] {
985
- background-color: var(--diffs-bg-separator);
986
- flex: none;
987
- align-items: center;
988
- display: flex;
989
- }
990
-
991
- [data-expand-index] [data-separator-content]:hover {
992
- cursor: pointer;
993
- text-decoration: underline;
994
- }
995
-
996
- [data-expand-button] {
997
- cursor: pointer;
998
- min-width: 32px;
999
- color: var(--diffs-fg-number);
1000
- border-right: 2px solid var(--diffs-bg);
1001
- flex-shrink: 0;
1002
- justify-content: center;
1003
- align-self: stretch;
1004
-
1005
- &:hover {
1006
- color: var(--diffs-fg);
1007
- }
1008
-
1009
- &[data-expand-all-button] {
1010
- display: none;
1011
- }
1012
- }
1013
-
1014
- [data-expand-down] [data-icon] {
1015
- transform: scaleY(-1);
1016
- }
1017
-
1018
- [data-separator-content] {
1019
- height: 100%;
1020
- color: var(--diffs-fg-number);
1021
- flex: auto;
1022
- justify-content: flex-start;
1023
- padding: 0 1ch;
1024
- overflow: hidden;
1025
- }
1026
-
1027
- [data-separator="line-info"], [data-separator="line-info-basic"] {
1028
- & [data-separator-content] {
1029
- user-select: none;
1030
- height: 100%;
1031
- overflow: clip;
1032
- }
1033
- }
1034
-
1035
- [data-unmodified-lines] {
1036
- text-overflow: ellipsis;
1037
- white-space: nowrap;
1038
- flex: 0 auto;
1039
- min-width: 0;
1040
- display: block;
1041
- overflow: hidden;
1042
- }
1043
-
1044
- @supports (width: 1cqi) {
1045
- [data-unified] {
1046
- & [data-separator="line-info"] [data-separator-wrapper] {
1047
- padding-inline: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1048
- width: 100cqi;
1049
-
1050
- & [data-separator-content] {
1051
- border-radius: 6px;
1052
- }
1053
- }
1054
-
1055
- & [data-separator="line-info"][data-expand-index] [data-separator-wrapper] [data-separator-content] {
1056
- border-top-left-radius: unset;
1057
- border-bottom-left-radius: unset;
1058
- }
1059
- }
1060
-
1061
- [data-gutter] {
1062
- & [data-separator="line-info"] [data-separator-wrapper] {
1063
- padding-left: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1064
- }
1065
-
1066
- & [data-separator="line-info"] [data-separator-content] {
1067
- border-top-left-radius: 6px;
1068
- border-bottom-left-radius: 6px;
1069
- }
1070
-
1071
- & [data-separator="line-info"][data-expand-index] [data-separator-content] {
1072
- border-top-left-radius: unset;
1073
- border-bottom-left-radius: unset;
1074
- }
1075
- }
1076
-
1077
- [data-additions] {
1078
- & [data-content] [data-separator="line-info"] {
1079
- background-color: var(--diffs-bg);
1080
-
1081
- & [data-separator-wrapper] {
1082
- display: none;
1083
- }
1084
- }
1085
-
1086
- & [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
1087
- background-color: var(--diffs-bg-separator);
1088
- border-top-right-radius: 6px;
1089
- border-bottom-right-radius: 6px;
1090
- height: 100%;
1091
- display: block;
1092
-
1093
- & [data-separator-content], & [data-expand-button] {
1094
- display: none;
1095
- }
1096
- }
1097
- }
1098
-
1099
- [data-overflow="scroll"] [data-additions] [data-gutter] [data-separator="line-info"] [data-separator-wrapper] {
1100
- width: calc(100cqi - var(--diffs-gap-inline, var(--diffs-gap-fallback)));
1101
- }
1102
-
1103
- [data-overflow="wrap"] [data-additions] [data-content] [data-separator="line-info"] [data-separator-wrapper] {
1104
- background-color: var(--diffs-bg-separator);
1105
- height: 100%;
1106
- margin-right: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1107
- border-top-right-radius: 6px;
1108
- border-bottom-right-radius: 6px;
1109
- display: block;
1110
-
1111
- & [data-separator-content], & [data-expand-button] {
1112
- display: none;
1113
- }
1114
- }
1115
-
1116
- [data-separator="line-info"] [data-separator-wrapper] {
1117
- & [data-expand-both], & [data-expand-down], & [data-expand-up] {
1118
- border-top-left-radius: 6px;
1119
- border-bottom-left-radius: 6px;
1120
- }
1121
- }
1122
-
1123
- @media (pointer: fine) {
1124
- [data-separator="line-info"] [data-separator-wrapper] {
1125
- &[data-separator-multi-button] {
1126
- & [data-expand-up] {
1127
- border-top-left-radius: 6px;
1128
- border-bottom-left-radius: unset;
1129
- }
1130
-
1131
- & [data-expand-down] {
1132
- border-bottom-left-radius: 6px;
1133
- border-top-left-radius: unset;
1134
- }
1135
- }
1136
- }
1137
- }
1138
- }
1139
-
1140
- @media (pointer: coarse) {
1141
- [data-separator="line-info-basic"] [data-separator-wrapper][data-separator-multi-button] {
1142
- grid-template-columns: 34px 34px auto;
1143
-
1144
- & [data-separator-content] {
1145
- grid-column: unset;
1146
- grid-row: unset;
1147
- }
1148
- }
1149
-
1150
- @supports (width: 1cqi) {
1151
- [data-separator="line-info"] [data-separator-wrapper] {
1152
- & [data-expand-both], & [data-expand-down], & [data-expand-up] {
1153
- border-top-left-radius: 6px;
1154
- border-bottom-left-radius: 6px;
1155
- }
1156
-
1157
- &[data-separator-multi-button] {
1158
- & [data-expand-up] {
1159
- border-top-left-radius: 6px;
1160
- border-bottom-left-radius: 6px;
1161
- }
1162
-
1163
- & [data-expand-down] {
1164
- border-bottom-left-radius: unset;
1165
- border-top-left-radius: unset;
1166
- }
1167
- }
1168
- }
1169
- }
1170
- }
1171
-
1172
- @media (pointer: fine) {
1173
- [data-separator-wrapper][data-separator-multi-button] {
1174
- grid-template-rows: 50% 50%;
1175
- display: grid;
1176
-
1177
- & [data-separator-content] {
1178
- grid-area: 1 / 2 / -1;
1179
- min-width: min-content;
1180
- }
1181
-
1182
- & [data-expand-button] {
1183
- grid-column: 1;
1184
- }
1185
- }
1186
-
1187
- [data-separator="line-info"] [data-separator-wrapper], [data-separator="line-info"] [data-separator-wrapper][data-separator-multi-button] {
1188
- grid-template-columns: 34px auto;
1189
- }
1190
-
1191
- [data-separator="line-info-basic"][data-expand-index] [data-separator-wrapper] {
1192
- grid-template-columns: 100% auto;
1193
- }
1194
-
1195
- [data-separator="line-info"], [data-separator="line-info-basic"] {
1196
- & [data-separator-multi-button] {
1197
- & [data-expand-up] {
1198
- border-bottom: 1px solid var(--diffs-bg);
1199
- border-right: 2px solid var(--diffs-bg);
1200
- }
1201
-
1202
- & [data-expand-down] {
1203
- border-top: 1px solid var(--diffs-bg);
1204
- border-right: 2px solid var(--diffs-bg);
1205
- }
1206
- }
1207
- }
1208
- }
1209
-
1210
- [data-additions] [data-gutter] [data-separator-wrapper], [data-additions] [data-separator="line-info-basic"] [data-separator-wrapper], [data-content] [data-separator-wrapper] {
1211
- display: none;
1212
- }
1213
-
1214
- [data-line-annotation] {
1215
- min-height: var(--diffs-annotation-min-height, 0);
1216
- z-index: 2;
1217
- }
1218
-
1219
- [data-merge-conflict-actions] {
1220
- z-index: 2;
1221
- }
1222
-
1223
- [data-separator="custom"] {
1224
- grid-template-columns: subgrid;
1225
- display: grid;
1226
- }
1227
-
1228
- [data-line], [data-column-number], [data-no-newline] {
1229
- padding-inline: 1ch;
1230
- position: relative;
1231
- }
1232
-
1233
- [data-indicators="classic"] [data-line] {
1234
- padding-inline-start: 2ch;
1235
- }
1236
-
1237
- [data-indicators="classic"] {
1238
- & [data-line-type="change-addition"], & [data-line-type="change-deletion"] {
1239
- &[data-no-newline], &[data-line] {
1240
- &:before {
1241
- user-select: none;
1242
- width: 1ch;
1243
- height: 1lh;
1244
- display: inline-block;
1245
- position: absolute;
1246
- top: 0;
1247
- left: 0;
1248
- }
1249
- }
1250
- }
1251
-
1252
- & [data-line-type="change-addition"] {
1253
- &[data-line], &[data-no-newline] {
1254
- &:before {
1255
- content: "+";
1256
- color: var(--diffs-addition-base);
1257
- }
1258
- }
1259
- }
1260
-
1261
- & [data-line-type="change-deletion"] {
1262
- &[data-line], &[data-no-newline] {
1263
- &:before {
1264
- content: "-";
1265
- color: var(--diffs-deletion-base);
1266
- }
1267
- }
1268
- }
1269
- }
1270
-
1271
- [data-indicators="bars"] {
1272
- & [data-line-type="change-deletion"], & [data-line-type="change-addition"] {
1273
- &[data-column-number] {
1274
- &:before {
1275
- content: "";
1276
- user-select: none;
1277
- contain: strict;
1278
- width: 4px;
1279
- height: 100%;
1280
- display: block;
1281
- position: absolute;
1282
- top: 0;
1283
- left: 0;
1284
- }
1285
- }
1286
- }
1287
-
1288
- & [data-line-type="change-deletion"] {
1289
- &[data-column-number] {
1290
- &:before {
1291
- background-image: linear-gradient(0deg,
1292
- var(--diffs-bg-deletion) 50%,
1293
- var(--diffs-deletion-base) 50%);
1294
- background-repeat: repeat;
1295
- background-size: 2px 2px;
1296
- background-size: calc(1lh / round(1lh / 2px))
1297
- calc(1lh / round(1lh / 2px));
1298
- }
1299
- }
1300
- }
1301
-
1302
- & [data-line-type="change-addition"] {
1303
- &[data-column-number] {
1304
- &:before {
1305
- background-color: var(--diffs-addition-base);
1306
- }
1307
- }
1308
- }
1309
- }
1310
-
1311
- [data-overflow="wrap"] {
1312
- & [data-line] {
1313
- white-space: pre-wrap;
1314
- word-break: break-word;
1315
- }
1316
-
1317
- & [data-annotation-content] {
1318
- word-break: break-word;
1319
- }
1320
- }
1321
-
1322
- [data-overflow="scroll"] [data-line] {
1323
- white-space: pre;
1324
- min-height: 1lh;
1325
- }
1326
-
1327
- [data-column-number] {
1328
- box-sizing: content-box;
1329
- text-align: right;
1330
- user-select: none;
1331
- color: var(--diffs-fg-number);
1332
- padding-left: 2ch;
1333
- }
1334
-
1335
- [data-line-number-content] {
1336
- min-width: var(--diffs-min-number-column-width, var(--diffs-min-number-column-width-default, 3ch));
1337
- z-index: 1;
1338
- display: inline-block;
1339
- position: relative;
1340
- }
1341
-
1342
- [data-disable-line-numbers] {
1343
- & [data-gutter-buffer], & [data-column-number] {
1344
- min-width: 4px;
1345
- padding: 0;
1346
-
1347
- &:before {
1348
- min-width: 0;
1349
- }
1350
- }
1351
-
1352
- & [data-line-number-content] {
1353
- display: none;
1354
- }
1355
-
1356
- & [data-gutter-utility-slot] {
1357
- right: unset;
1358
- justify-content: flex-start;
1359
- left: 0;
1360
- }
1361
-
1362
- &[data-indicators="bars"] [data-gutter-utility-slot] {
1363
- left: 6px;
1364
- }
1365
- }
1366
-
1367
- [data-file][data-disable-line-numbers] {
1368
- & [data-gutter-buffer], & [data-column-number] {
1369
- border-right: 0;
1370
- min-width: 0;
1371
- }
1372
- }
1373
-
1374
- [data-diff-span] {
1375
- box-decoration-break: clone;
1376
- border-radius: 3px;
1377
- }
1378
-
1379
- [data-line-type="change-addition"] [data-diff-span] {
1380
- background-color: var(--diffs-bg-addition-emphasis);
1381
- }
1382
-
1383
- [data-line-type="change-deletion"] [data-diff-span] {
1384
- background-color: var(--diffs-bg-deletion-emphasis);
1385
- }
1386
-
1387
- [data-merge-conflict="marker-start"], [data-merge-conflict="marker-base"], [data-merge-conflict="marker-separator"], [data-merge-conflict="marker-end"] {
1388
- color: var(--diffs-fg);
1389
- padding-left: 1ch;
1390
- }
1391
-
1392
- [data-merge-conflict="marker-start"], [data-merge-conflict="marker-end"] {
1393
- align-items: center;
1394
- display: flex;
1395
-
1396
- &:after {
1397
- color: var(--diffs-fg-conflict-marker);
1398
- font-size: .75rem;
1399
- font-style: normal;
1400
- line-height: 1.25rem;
1401
- font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
1402
- padding-left: 1ch;
1403
- }
1404
- }
1405
-
1406
- [data-merge-conflict="marker-start"]:after {
1407
- content: "(Current Change)";
1408
- }
1409
-
1410
- [data-merge-conflict="marker-end"]:after {
1411
- content: "(Incoming Change)";
1412
- }
1413
-
1414
- [data-merge-conflict-actions-content] {
1415
- min-height: 1.75rem;
1416
- font-family: var(--diffs-header-font-family, var(--diffs-header-font-fallback));
1417
- color: var(--diffs-fg);
1418
- align-items: center;
1419
- gap: .25rem;
1420
- padding-inline: .5rem;
1421
- font-size: .75rem;
1422
- line-height: 1.2;
1423
- display: flex;
1424
- }
1425
-
1426
- [data-merge-conflict-action] {
1427
- appearance: none;
1428
- color: var(--diffs-fg-number);
1429
- font: inherit;
1430
- cursor: pointer;
1431
- background: none;
1432
- border: 0;
1433
- padding: 0;
1434
- font-style: normal;
1435
- }
1436
-
1437
- [data-merge-conflict-action]:hover {
1438
- color: var(--diffs-fg);
1439
- }
1440
-
1441
- [data-merge-conflict-action="current"]:hover {
1442
- color: var(--diffs-addition-base);
1443
- }
1444
-
1445
- [data-merge-conflict-action="incoming"]:hover {
1446
- color: var(--diffs-modified-base);
1447
- }
1448
-
1449
- [data-merge-conflict-action-separator] {
1450
- color: var(--diffs-fg-number);
1451
- opacity: .6;
1452
- user-select: none;
1453
- }
1454
-
1455
- [data-diffs-header="default"] {
1456
- background-color: var(--diffs-bg);
1457
- justify-content: space-between;
1458
- align-items: center;
1459
- gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1460
- min-height: calc(1lh + (var(--diffs-gap-block, var(--diffs-gap-fallback)) * 3));
1461
- z-index: 2;
1462
- flex-direction: row;
1463
- padding-inline: 16px;
1464
- display: flex;
1465
- position: relative;
1466
- top: 0;
1467
- }
1468
-
1469
- [data-header-content] {
1470
- align-items: center;
1471
- gap: var(--diffs-gap-inline, var(--diffs-gap-fallback));
1472
- white-space: nowrap;
1473
- flex-direction: row;
1474
- min-width: 0;
1475
- display: flex;
1476
- }
1477
-
1478
- [data-header-content] [data-prev-name], [data-header-content] [data-title] {
1479
- text-overflow: ellipsis;
1480
- white-space: nowrap;
1481
- direction: rtl;
1482
- min-width: 0;
1483
- overflow: hidden;
1484
- }
1485
-
1486
- [data-prev-name] {
1487
- opacity: .7;
1488
- }
1489
-
1490
- [data-rename-icon] {
1491
- fill: currentColor;
1492
- flex-grow: 0;
1493
- flex-shrink: 0;
1494
- }
1495
-
1496
- [data-diffs-header="default"] [data-metadata] {
1497
- white-space: nowrap;
1498
- align-items: center;
1499
- gap: 1ch;
1500
- display: flex;
1501
- }
1502
-
1503
- [data-diffs-header="default"] [data-additions-count] {
1504
- font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1505
- color: var(--diffs-addition-base);
1506
- }
1507
-
1508
- [data-diffs-header="default"] [data-deletions-count] {
1509
- font-family: var(--diffs-font-family, var(--diffs-font-fallback));
1510
- color: var(--diffs-deletion-base);
1511
- }
1512
-
1513
- [data-change-icon] {
1514
- fill: currentColor;
1515
- flex-shrink: 0;
1516
- }
1517
-
1518
- [data-change-icon="change"], [data-change-icon="rename-pure"], [data-change-icon="rename-changed"] {
1519
- color: var(--diffs-modified-base);
1520
- }
1521
-
1522
- [data-change-icon="new"] {
1523
- color: var(--diffs-addition-base);
1524
- }
1525
-
1526
- [data-change-icon="deleted"] {
1527
- color: var(--diffs-deletion-base);
1528
- }
1529
-
1530
- [data-change-icon="file"] {
1531
- opacity: .6;
1532
- }
1533
-
1534
- [data-annotation-content] {
1535
- z-index: 2;
1536
- isolation: isolate;
1537
- white-space: normal;
1538
- align-self: flex-start;
1539
- min-width: 0;
1540
- display: flow-root;
1541
- position: relative;
1542
- }
1543
-
1544
- [data-overflow="scroll"] [data-annotation-content], [data-overflow="scroll"] [data-merge-conflict-actions-content] {
1545
- width: var(--diffs-column-content-width, auto);
1546
- left: var(--diffs-column-number-width, 0);
1547
- position: sticky;
1548
- }
1549
-
1550
- [data-annotation-slot] {
1551
- text-wrap-mode: wrap;
1552
- word-break: normal;
1553
- white-space-collapse: collapse;
1554
- }
1555
-
1556
- [data-gutter-utility-slot] {
1557
- touch-action: none;
1558
- justify-content: flex-end;
1559
- display: flex;
1560
- position: absolute;
1561
- top: 0;
1562
- bottom: 0;
1563
- right: 0;
1564
- }
1565
-
1566
- [data-utility-button] {
1567
- appearance: none;
1568
- cursor: pointer;
1569
- width: 1lh;
1570
- height: 1lh;
1571
- font-size: var(--diffs-font-size, 13px);
1572
- line-height: var(--diffs-line-height, 20px);
1573
- background-color: var(--diffs-modified-base);
1574
- color: var(--diffs-bg);
1575
- fill: currentColor;
1576
- z-index: 4;
1577
- touch-action: none;
1578
- border: none;
1579
- border-radius: 4px;
1580
- justify-content: center;
1581
- align-items: center;
1582
- margin-right: calc(-1lh + 1ch);
1583
- padding: 0;
1584
- display: flex;
1585
- position: relative;
1586
-
1587
- &:before {
1588
- content: "";
1589
- display: block;
1590
- position: absolute;
1591
- inset: 0 0 0 -4px;
1592
- }
1593
- }
1594
-
1595
- [data-decoration-bar-stack] {
1596
- pointer-events: none;
1597
- isolation: isolate;
1598
- z-index: 1;
1599
- background-color: var(--diffs-decoration-bar-color, transparent);
1600
- box-sizing: content-box;
1601
- border-left: 2px solid var(--diffs-bg);
1602
- border-right: 2px solid var(--diffs-bg);
1603
- width: 6px;
1604
- position: absolute;
1605
- top: 0;
1606
- bottom: 0;
1607
- right: -2px;
1608
-
1609
- [data-decoration-bar-depth="1"] & {
1610
- background-color: color-mix(in lab,
1611
- var(--diffs-bg) 20%,
1612
- var(--diffs-decoration-bar-color, transparent));
1613
- }
1614
-
1615
- [data-decoration-bar-depth="2"] & {
1616
- background-color: color-mix(in lab,
1617
- var(--diffs-bg) 45%,
1618
- var(--diffs-decoration-bar-color, transparent));
1619
- }
1620
-
1621
- [data-decoration-bar-depth="3"] & {
1622
- background-color: color-mix(in lab,
1623
- var(--diffs-bg) 65%,
1624
- var(--diffs-decoration-bar-color, transparent));
1625
- }
1626
-
1627
- [data-decoration-bar-start] & {
1628
- border-top-left-radius: 5px;
1629
- border-top-right-radius: 5px;
1630
- }
1631
-
1632
- [data-decoration-bar-end] & {
1633
- z-index: 3;
1634
- border-bottom-right-radius: 5px;
1635
- border-bottom-left-radius: 5px;
1636
- }
1637
- }
1638
-
1639
- [data-placeholder] {
1640
- contain: strict;
1641
- }
1642
-
1643
- [data-error-wrapper] {
1644
- padding: var(--diffs-gap-block, var(--diffs-gap-fallback))
1645
- var(--diffs-gap-inline, var(--diffs-gap-fallback));
1646
- scrollbar-width: none;
1647
- max-height: 400px;
1648
- overflow: auto;
1649
-
1650
- & [data-error-message] {
1651
- color: var(--diffs-deletion-base);
1652
- font-size: 18px;
1653
- font-weight: bold;
1654
- }
1655
-
1656
- & [data-error-stack] {
1657
- color: var(--diffs-fg-number);
1658
- }
1659
- }
1660
- }
1661
-
1662
- @layer theme, rendered, unsafe;
1663
- `,jM;function MM(e){let t=e.shadowRoot??e.attachShadow({mode:`open`});return jM??=(()=>{let e=new CSSStyleSheet;return e.replaceSync(AM),e})(),t.adoptedStyleSheets.includes(jM)||(t.adoptedStyleSheets=[...t.adoptedStyleSheets,jM]),t}var NM=[`src`,`width`,`height`,`alt`],PM=L({__name:`GithubAvatar`,props:{login:{},size:{default:20}},setup(e){return(t,n)=>(R(),F(`img`,{src:`https://github.com/${e.login}.png?size=${e.size*2}`,width:e.size,height:e.size,alt:`${e.login}'s avatar`,class:`rounded-full shrink-0`},null,8,NM))}}),FM={class:`text-sm px-3 py-2 flex flex-col gap-1.5`},IM={class:`flex gap-2 items-center`},LM={class:`font-medium`},RM={key:0,class:`flex flex-col gap-2`},zM={class:`flex gap-2 justify-end`},BM=L({__name:`ReviewCommentCard`,props:{comment:{},isViewer:{type:Boolean},busy:{type:Boolean}},emits:[`edit`,`delete`],setup(e,{emit:t}){let n=e,r=t,i=H(!1),a=H(``);function o(){a.value=n.comment.body,i.value=!0}function s(){a.value.trim()&&(r(`edit`,a.value),i.value=!1)}return(t,n)=>(R(),F(`article`,FM,[P(`header`,IM,[e.comment.author?(R(),V(PM,{key:0,login:e.comment.author.login,size:18},null,8,[`login`])):U(``,!0),P(`span`,LM,B(e.comment.author?.login??`ghost`),1),A(S,{date:e.comment.createdAt,class:`text-xs op-fade`},null,8,[`date`]),e.comment.pending?(R(),V(h,{key:1,text:`Pending`,class:`text-xs text-amber-700 dark:text-amber-400`})):U(``,!0),n[3]||=P(`div`,{class:`flex-auto`},null,-1),e.isViewer&&!i.value?(R(),F(ze,{key:2},[A(v,{compact:``,icon:`i-ph:pencil-simple-duotone`,label:`Edit comment`,disabled:e.busy,onClick:o},null,8,[`disabled`]),A(v,{compact:``,icon:`i-ph:trash-duotone`,label:`Delete comment`,disabled:e.busy,onClick:n[0]||=e=>r(`delete`)},null,8,[`disabled`])],64)):U(``,!0)]),i.value?(R(),F(`div`,RM,[A(bM,{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e,rows:3,disabled:e.busy,onKeydown:[Ke(qe(s,[`meta`]),[`enter`]),Ke(qe(s,[`ctrl`]),[`enter`])]},null,8,[`modelValue`,`disabled`,`onKeydown`]),P(`div`,zM,[A(_,{size:`sm`,variant:`text`,disabled:e.busy,onClick:n[2]||=e=>i.value=!1},{default:z(()=>[...n[4]||=[j(` Cancel `,-1)]]),_:1},8,[`disabled`]),A(_,{size:`sm`,variant:`primary`,disabled:e.busy||!a.value.trim(),onClick:s},{default:z(()=>[...n[5]||=[j(` Save `,-1)]]),_:1},8,[`disabled`])])])):(R(),V(Re,{key:1},{default:z(()=>[A(N(np),{value:e.comment.body,class:`text-sm`},null,8,[`value`])]),_:1}))]))}}),VM={class:`font-sans my-1 text-left border border-base rounded-lg bg-base max-w-200 overflow-hidden`},HM={class:`divide-#9992 divide-y`},UM={key:0,class:`text-xs text-red-600 px-3 pb-1 dark:text-red-400`},WM={key:1,class:`px-2 py-1.5 border-t border-base bg-raised flex flex-col gap-2`},GM={class:`flex gap-2 justify-end`},KM={key:1,class:`flex gap-2 items-center`},qM={key:1,class:`flex-1`},JM=L({__name:`ReviewThreadCard`,props:{thread:{},reviews:{}},setup(e){let t=e,n=H(!1),r=H(),i=H(!1),a=H(``),o=I(()=>t.reviews.canWrite),s=I(()=>o.value&&!!t.thread.threadId&&!t.thread.pending);async function c(e){n.value=!0,r.value=void 0;try{await e()}catch(e){r.value=e instanceof Error?e.message:String(e)}finally{n.value=!1}}async function l(){let e=a.value;e.trim()&&await c(async()=>{await t.reviews.reply(t.thread.rootId,e),a.value=``,i.value=!1})}return(t,u)=>(R(),F(`div`,VM,[P(`div`,HM,[(R(!0),F(ze,null,Ae(e.thread.comments,t=>(R(),V(BM,{key:t.id,comment:t,"is-viewer":!!t.author&&t.author.login===e.reviews.viewerLogin,busy:n.value,onEdit:n=>c(()=>e.reviews.editComment(t.id,n)),onDelete:n=>c(()=>e.reviews.deleteComment(t.id))},null,8,[`comment`,`is-viewer`,`busy`,`onEdit`,`onDelete`]))),128))]),r.value?(R(),F(`p`,UM,B(r.value),1)):U(``,!0),o.value?(R(),F(`footer`,WM,[i.value?(R(),F(ze,{key:0},[A(bM,{modelValue:a.value,"onUpdate:modelValue":u[0]||=e=>a.value=e,rows:2,placeholder:`Reply…`,disabled:n.value,onKeydown:[Ke(qe(l,[`meta`]),[`enter`]),Ke(qe(l,[`ctrl`]),[`enter`])]},null,8,[`modelValue`,`disabled`,`onKeydown`]),P(`div`,GM,[A(_,{size:`sm`,variant:`text`,disabled:n.value,onClick:u[1]||=e=>i.value=!1},{default:z(()=>[...u[4]||=[j(` Cancel `,-1)]]),_:1},8,[`disabled`]),A(_,{size:`sm`,variant:`primary`,loading:n.value,disabled:!a.value.trim(),onClick:l},{default:z(()=>[...u[5]||=[j(` Reply `,-1)]]),_:1},8,[`loading`,`disabled`])])],64)):(R(),F(`div`,KM,[e.thread.pending?(R(),F(`div`,qM)):(R(),F(`button`,{key:0,type:`button`,class:`text-sm color-base px-2 py-1 text-left border border-base rounded bg-base op-fade flex-1 hover:op-100`,onClick:u[2]||=e=>i.value=!0},` Reply… `)),s.value?(R(),V(_,{key:2,size:`sm`,disabled:n.value,icon:`i-ph:check-circle-duotone`,onClick:u[3]||=t=>c(()=>e.reviews.resolveThread(e.thread.threadId))},{default:z(()=>[...u[6]||=[j(` Resolve `,-1)]]),_:1},8,[`disabled`])):U(``,!0)]))])):U(``,!0)]))}}),YM=[`id`],XM={class:`text-sm flex gap-2 min-w-0 items-center`},ZM={class:`flex shrink-0 gap-2 items-center`},QM={key:0,class:`text-xs op-fade`},$M={key:2,class:`text-xs op-fade`},eN=[`title`],tN={key:0,class:`text-sm p-4 op-fade`},nN={key:1,ref:`container`},rN=[`slot`],iN={key:0,class:`my-1 border border-base rounded-lg bg-base max-w-200 overflow-hidden`},aN=640,oN=L({__name:`FileDiff`,props:{store:{},file:{}},setup(e,{expose:t}){let r=e,i=I(()=>r.store.reviewed.has(r.file.sha)),a=xe(k,n),s=xe(TM,void 0),c=xe(JA,void 0),l=Te(`container`),u=H(i.value||kM(r.file.path)),d;function f(e){let t=e.previousPath??e.path,n=e.path,r=[`diff --git a/${t} b/${n}`];e.status===`added`?r.push(`new file mode 100644`):e.status===`removed`?r.push(`deleted file mode 100644`):e.status===`renamed`?r.push(`rename from ${t}`,`rename to ${n}`):e.status===`copied`&&r.push(`copy from ${t}`,`copy to ${n}`),r.push(`--- ${e.status===`added`?`/dev/null`:`a/${t}`}`),r.push(`+++ ${e.status===`removed`?`/dev/null`:`b/${n}`}`);for(let t of e.hunks)r.push(t.header,t.patch);return r.join(`
1664
- `)}let p=H(),m=H(),h=H(!1),_=H(),y=I(()=>p.value!==void 0||m.value!==void 0),b=I(()=>!!s?.value&&!r.file.isBinary&&!y.value);async function x(e,t,n,r,i){let a=await g(),o=await _M(a,e,t);if(o!==void 0)return o;let s=await wA(r,i,e,t,n);return s!==void 0&&await vM(a,e,t,s),s}async function S(){let e=s?.value;if(!(!e||h.value||y.value)){h.value=!0,_.value=void 0;try{let{owner:t,repo:n,baseSha:i,headSha:a}=e,s=o.value.githubToken||void 0,c=r.file.previousPath??r.file.path,[l,u]=await Promise.all([r.file.status===`added`?void 0:x(c,i,s,t,n),r.file.status===`removed`?void 0:x(r.file.path,a,s,t,n)]);p.value=l,m.value=u}catch(e){_.value=e instanceof Error?e:Error(String(e))}finally{h.value=!1}}}let C=I(()=>{if(u.value||r.file.isBinary)return;let e=r.file.previousPath??r.file.path;return PE(f(r.file),y.value?{oldFile:p.value===void 0?void 0:{name:e,contents:p.value},newFile:m.value===void 0?void 0:{name:r.file.path,contents:m.value}}:void 0)}),w=H(0),ee;be(l,(e,t)=>{t&&ee?.unobserve(t),e&&(ee??=new ResizeObserver(e=>{w.value=e[0]?.contentRect.width??0}),ee.observe(e))},{immediate:!0}),Le(()=>ee?.disconnect());let T=I(()=>r.store.reviews),te=I(()=>{let e=T.value;return e?e.threads.filter(t=>t.path===r.file.path&&t.line!==void 0&&!t.outdated&&t.resolved!==!0&&(e.showThreads||t.pending)):[]}),ne=I(()=>T.value?.threads.filter(e=>e.path===r.file.path&&e.resolved===!0).length??0),E=H(),re=H(!1),ie=H(),ae=I(()=>{let e=new Map;function t(t,n){let r=`${t}-${n}`,i=e.get(r);return i||(i={side:t,line:n,threads:[],hasDraft:!1},e.set(r,i)),i}for(let e of te.value)t(e.side,e.line).threads.push(e);return E.value&&(t(E.value.side,E.value.line).hasDraft=!0),[...e.values()]}),oe=I(()=>ae.value.map(e=>({side:e.side,lineNumber:e.line}))),se=I(()=>(T.value?.canWrite??!1)&&!r.file.isBinary);function ce(e){let t=e.endSide??e.side??`additions`,n=Math.max(e.start,e.end),i=Math.min(e.start,e.end);E.value={path:r.file.path,side:t,line:n,...i<n?{startLine:i,startSide:e.side??t}:{}},ie.value=void 0}async function le(e,t){let n=E.value,r=T.value;if(n&&r){re.value=!0,ie.value=void 0;try{await r.addComment(n,e,t),E.value=void 0}catch(e){ie.value=e instanceof Error?e.message:String(e)}finally{re.value=!1}}}let D=I(()=>r.file.additions===0||r.file.deletions===0),ue=I(()=>r.store.ui.layout===`unified`||D.value||w.value>0&&w.value<aN?`unified`:r.store.ui.layout),de=I(()=>({diffStyle:ue.value,themeType:a.value?`dark`:`light`,disableErrorHandling:!1,disableFileHeader:!0,...se.value?{enableGutterUtility:!0,enableLineSelection:!0,onGutterUtilityClick:ce}:{}}));function fe(){d?.cleanUp(),l.value&&!r.file.isBinary&&!u.value&&C.value&&(MM(l.value),d=c?new Jk(de.value,c,void 0,void 0,!0):new Pk(de.value,void 0,!0),d.render({fileDiff:C.value,fileContainer:l.value,lineAnnotations:oe.value.map(e=>({...e}))}))}return je(fe),Le(()=>d?.cleanUp()),be(u,()=>fe(),{flush:`post`}),be(de,e=>{d?.setOptions(e),d?.rerender()}),be([C,l],([e,t])=>{e&&t&&d?.render({fileDiff:e,fileContainer:t,lineAnnotations:oe.value.map(e=>({...e}))})}),be(oe,e=>{d?.setLineAnnotations(e.map(e=>({...e})))}),be(i,e=>{u.value=e}),t({expand:()=>{u.value=!1}}),(t,n)=>(R(),F(`div`,{id:`file-${e.file.sha}`,class:`border border-base rounded-lg overflow-hidden`},[P(`header`,{class:`z-[20] px-2 py-1.5 flex gap-2 items-center justify-between`,role:`button`,onClick:n[2]||=qe(e=>u.value=!u.value,[`self`])},[P(`div`,XM,[A(mM,{"model-value":i.value,"aria-label":`Mark as reviewed`,"onUpdate:modelValue":n[0]||=t=>e.store.toggleReviewed(e.file.sha,t)},null,8,[`model-value`]),A(Oj,{path:e.file.path,class:`min-w-0`},null,8,[`path`])]),P(`div`,ZM,[ne.value?(R(),F(`span`,QM,B(ne.value)+` resolved`,1)):U(``,!0),e.file.isBinary?(R(),F(`span`,$M,`Binary file`)):(R(),V(aj,{key:1,additions:e.file.additions,deletions:e.file.deletions},null,8,[`additions`,`deletions`])),A(DM,{status:e.file.status},null,8,[`status`]),_.value?(R(),F(`span`,{key:3,class:`text-xs text-red-500`,title:_.value.message},`Failed to load`,8,eN)):U(``,!0),b.value||h.value?(R(),V(v,{key:4,compact:``,icon:h.value?`i-ph:spinner-duotone animate-spin`:`i-ph:file-text-duotone`,disabled:h.value,label:`Load full file content`,tooltip:`Load full file content`,onClick:S},null,8,[`icon`,`disabled`])):U(``,!0),A(v,{compact:``,icon:u.value?`i-ph:caret-right`:`i-ph:caret-down`,label:u.value?`Expand file`:`Collapse file`,onClick:n[1]||=e=>u.value=!u.value},null,8,[`icon`,`label`])])]),e.file.isBinary?(R(),F(`div`,tN,` Binary file not shown. `)):u.value?U(``,!0):(R(),F(`div`,nN,[(R(!0),F(ze,null,Ae(ae.value,t=>(R(),F(`div`,{key:`${t.side}-${t.line}`,slot:`annotation-${t.side}-${t.line}`,"data-annotation-slot":``,class:`font-sans px-2 text-left whitespace-normal`},[(R(!0),F(ze,null,Ae(t.threads,t=>(R(),V(JM,{key:t.rootId,thread:t,reviews:e.store.reviews},null,8,[`thread`,`reviews`]))),128)),t.hasDraft?(R(),F(`div`,iN,[A(wM,{"has-pending-review":!!e.store.reviews.pendingReview,busy:re.value,error:ie.value,onSubmit:le,onCancel:n[3]||=e=>E.value=void 0},null,8,[`has-pending-review`,`busy`,`error`])])):U(``,!0)],8,rN))),128))],512))],8,YM))}}),sN=[`title`],cN=L({__name:`DisplayFileIcon`,props:{path:{},rules:{},directory:{type:Boolean},open:{type:Boolean},folderRules:{}},setup(e){let t=e,n=I(()=>{if(t.directory){let e=t.path.replace(/\/+$/,``).split(`/`).pop()||`folder`;return{name:e,icon:mj(e,t.open,t.folderRules)}}return lj(t.path,t.rules)});return(e,t)=>(R(),F(`span`,{class:Oe([`icon-catppuccin`,n.value.icon]),title:n.value.name,"aria-hidden":`true`},null,10,sN))}}),lN={ref:`scrollEl`,class:`max-h-100 overflow-auto`},uN={class:`op-fade truncate`},dN=[`onClick`],fN=L({__name:`FileTree`,props:{store:{},files:{}},emits:[`navigate`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>{let e={name:``,children:new Map};for(let t of[...n.files].sort((e,t)=>e.path.localeCompare(t.path))){let n=t.path.split(`/`),r=e;for(let e=0;e<n.length-1;e++){let t=n[e],i=r.children.get(t);i||(i={name:t,children:new Map},r.children.set(t,i)),r=i}r.children.set(`\0file:${t.path}`,{name:n[n.length-1],children:new Map,file:t})}function t(e){let n=[];for(let r of e.children.values())n.push(...r.file?[r.file]:t(r));return n}let r=[];function i(e,n,a){for(let[o,s]of e.children){if(s.file){r.push({key:`file:${s.file.path}`,depth:n,type:`file`,name:s.name,file:s.file});continue}let e=s.name,c=s,l=`${a}${o}/`;for(;c.children.size===1;){let[t,n]=[...c.children.entries()][0];if(n.file)break;e+=`/${n.name}`,c=n,l+=`${t}/`}r.push({key:`folder:${l}`,depth:n,type:`folder`,name:e,files:t(c)}),i(c,n+1,l)}}return i(e,0,``),r});function a(e){let t=e.filter(e=>n.store.reviewed.has(e.sha)).length;return t===0?!1:t===e.length||`indeterminate`}function o(e,t){for(let r of e)n.store.toggleReviewed(r.sha,t)}let s=Te(`scrollEl`),c=rM(I(()=>({count:i.value.length,getScrollElement:()=>s.value,estimateSize:()=>24,overscan:10})));return(t,n)=>(R(),F(`div`,lN,[P(`div`,{style:Me({height:`${N(c).getTotalSize()}px`,position:`relative`})},[(R(!0),F(ze,null,Ae(N(c).getVirtualItems().map(e=>({item:e,row:i.value[e.index]})),t=>(R(),F(`div`,{key:t.row.key,class:`text-sm flex gap-1.5 items-center`,style:Me({position:`absolute`,top:0,left:0,width:`100%`,height:`${t.item.size}px`,transform:`translateY(${t.item.start}px)`,paddingLeft:`${.5+t.row.depth}em`})},[t.row.type===`folder`?(R(),F(ze,{key:0},[A(N(uM),{class:`outline-none border border-base rounded bg-raised flex shrink-0 h-4 w-4 transition items-center justify-center data-[state=checked]:border-primary-500 data-[state=indeterminate]:border-primary-500 data-[state=checked]:bg-primary-500 data-[state=indeterminate]:bg-primary-500 focus-visible:ring-2 focus-visible:ring-primary-500/40`,"model-value":a(t.row.files),"aria-label":`Mark all files in ${t.row.name} as reviewed`,"onUpdate:modelValue":e=>o(t.row.files,e===!0)},{default:z(()=>[A(N(dM),{class:`text-white`},{default:z(()=>[P(`div`,{class:Oe([a(t.row.files)===`indeterminate`?`i-ph:minus-bold`:`i-ph:check-bold`,`text-micro mt--1px`]),"aria-hidden":`true`},null,2)]),_:2},1024)]),_:2},1032,[`model-value`,`aria-label`,`onUpdate:modelValue`]),A(cN,{directory:``,path:t.row.name,class:`op-fade`},null,8,[`path`]),P(`span`,uN,B(t.row.name),1)],64)):t.row.file?(R(),F(ze,{key:1},[A(mM,{"model-value":e.store.reviewed.has(t.row.file.sha),"onUpdate:modelValue":n=>e.store.toggleReviewed(t.row.file.sha,n)},null,8,[`model-value`,`onUpdate:modelValue`]),P(`button`,{type:`button`,class:`text-left flex flex-1 gap-1.5 min-w-0 items-center`,onClick:e=>r(`navigate`,t.row.file.sha)},[A(Oj,{path:t.row.name,dim:!1,class:`flex-1 min-w-0`},null,8,[`path`]),A(aj,{additions:t.row.file.additions,deletions:t.row.file.deletions},null,8,[`additions`,`deletions`]),A(DM,{status:t.row.file.status},null,8,[`status`])],8,dN)],64)):U(``,!0)],4))),128))],4)],512))}});function pN(e,t){let n=e.filePaths.map(e=>t.get(e)).filter(e=>e!=null);return{key:e.key,label:e.label,summary:e.summary,files:n,added:n.reduce((e,t)=>e+t.additions,0),deleted:n.reduce((e,t)=>e+t.deletions,0)}}function mN(e,t){let n=new Map(t.map(e=>[e.path,e]));return e.map(e=>({...pN(e,n),children:(e.children??[]).map(e=>pN(e,n))}))}function hN(e){return e.files.length+e.children.reduce((e,t)=>e+t.files.length,0)}function gN(e){return{added:e.added+e.children.reduce((e,t)=>e+t.added,0),deleted:e.deleted+e.children.reduce((e,t)=>e+t.deleted,0)}}var _N={class:`scroll-mt-[var(--diffs-header-height)]`},vN={key:0,class:`p-3 border-b border-base flex flex-col gap-2`},yN={class:`flex w-full items-center`},bN=[`aria-expanded`],xN={class:`flex flex-1 flex-col gap-1.5 min-w-0`},SN=[`title`],CN={class:`leading-1em flex gap-2 items-center`},wN={class:`text-xs op-fade`},TN={class:`text-xs op-fade`},EN={key:0,class:`px-2 flex shrink-0 gap-1 items-center`},DN={class:`px-2 flex flex-wrap gap-1.5`},ON=[`onClick`],kN={key:1,class:`p-3 flex flex-col gap-4 lg:grid lg:grid-cols-[1fr_4fr]`},AN={class:`flex shrink-0 flex-col gap-3 min-w-70 top-[var(--diffs-header-height)] lg:self-start lg:sticky`},jN={key:0,class:`text-xs leading-1em mb--2 px-3 op-fade truncate`},MN={key:1,class:`bg-base flex w-full items-center`},NN=[`aria-expanded`],PN={class:`flex-1 min-w-0`},FN={class:`leading-1em flex gap-2 items-center`},IN=[`title`],LN=[`title`],RN={class:`leading-1em flex gap-2 items-center`},zN={class:`text-xs op-fade`},BN={key:0,class:`px-2 flex shrink-0 gap-1 items-center`},VN={class:`flex flex-col gap-3 min-w-0`},HN={key:2,class:`flex flex-col gap-4`},UN=L({__name:`DiffGroup`,props:{store:{},group:{},collapsed:{type:Boolean},parentLabel:{}},emits:[`toggle`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>hN(n.group)),a=I(()=>gN(n.group)),o=I(()=>a.value.added),s=I(()=>a.value.deleted),c=I(()=>[...n.group.files,...n.group.children.flatMap(e=>e.files)].filter(e=>n.store.reviewed.has(e.sha)).length),l=H(new Set);function u(e){let t=new Set(l.value);t.has(e)?t.delete(e):t.add(e),l.value=t}let d=H(),f=H(),p=tj(d,f,()=>n.group.label,14,20),m=I(()=>!n.parentLabel&&n.group.children.length>0),h=new Map;function g(e,t){t?h.set(e,t.$el):h.delete(e)}function _(e){h.get(e)?.scrollIntoView({behavior:`smooth`,block:`start`})}let y=I(()=>i.value===0?1:c.value/i.value),b=new Map;function x(e,t){t?b.set(e,t):b.delete(e)}function S(e){b.get(e)?.expand(),He(()=>{document.getElementById(`file-${e}`)?.scrollIntoView({behavior:`smooth`,block:`start`})})}return(t,n)=>(R(),F(`section`,_N,[m.value?(R(),F(`header`,vN,[P(`div`,yN,[P(`button`,{type:`button`,class:`px-2 py-1 text-left flex flex-1 min-w-0 items-start`,"aria-expanded":!e.collapsed,onClick:n[0]||=e=>r(`toggle`)},[A(v,{compact:``,class:`ml--5 py2 op-mute hover:op-100`,icon:e.collapsed?`i-ph:caret-right`:`i-ph:caret-down`,label:`Toggle group`,as:`span`},null,8,[`icon`]),P(`div`,xN,[P(`span`,{class:`text-2xl leading-1em font-medium truncate`,title:e.group.label},B(e.group.label),9,SN),P(`div`,CN,[A(aj,{additions:o.value,deletions:s.value},null,8,[`additions`,`deletions`]),P(`span`,wN,B(i.value)+` file`+B(i.value===1?``:`s`),1),A($A,{value:y.value,size:12,thickness:2.5},null,8,[`value`]),P(`span`,TN,B(e.group.children.length)+` subgroup`+B(e.group.children.length===1?``:`s`),1)])])],8,bN),t.$slots.actions?(R(),F(`div`,EN,[Ge(t.$slots,`actions`)])):U(``,!0)]),e.collapsed?U(``,!0):(R(),F(ze,{key:0},[e.group.summary?(R(),V(Re,{key:0},{default:z(()=>[A(N(np),{value:e.group.summary,class:`text-sm px-2 op-fade max-w-200`},null,8,[`value`])]),_:1})):U(``,!0),P(`div`,DN,[(R(!0),F(ze,null,Ae(e.group.children,e=>(R(),F(`button`,{key:e.key,type:`button`,class:`text-xs px-2 py-0.5 border border-base rounded-full op-fade transition hover:op-100`,onClick:t=>_(e.key)},B(e.label)+` · `+B(e.files.length),9,ON))),128))])],64))])):U(``,!0),!m.value||!e.collapsed&&e.group.files.length?(R(),F(`div`,kN,[P(`aside`,AN,[e.parentLabel?(R(),F(`div`,jN,B(e.parentLabel)+` › `,1)):U(``,!0),m.value?U(``,!0):(R(),F(`header`,MN,[P(`button`,{type:`button`,class:`text-sm px-2 py-1 text-left flex flex-1 min-w-0 items-start`,"aria-expanded":!e.collapsed,onClick:n[1]||=e=>r(`toggle`)},[A(v,{compact:``,class:`ml--5 py1.5 op-mute hover:op-100`,icon:e.collapsed?`i-ph:caret-right`:`i-ph:caret-down`,label:`Toggle group`,as:`span`},null,8,[`icon`]),P(`div`,PN,[P(`div`,FN,[P(`span`,{ref_key:`labelBox`,ref:d,class:`text-xl font-medium flex-1 min-w-0 truncate`,style:Me({fontSize:`${N(p)}px`}),title:e.group.label},[P(`span`,{ref_key:`labelText`,ref:f},B(e.group.label),513)],12,IN),P(`div`,{class:`flex shrink-0 items-center`,title:`${c.value} / ${i.value} files reviewed`},null,8,LN)]),P(`div`,RN,[A(aj,{additions:o.value,deletions:s.value},null,8,[`additions`,`deletions`]),P(`span`,zN,B(i.value)+` file`+B(i.value===1?``:`s`),1),A($A,{value:y.value,size:12,thickness:2.5},null,8,[`value`])])])],8,NN),t.$slots.actions?(R(),F(`div`,BN,[Ge(t.$slots,`actions`)])):U(``,!0)])),e.collapsed?U(``,!0):(R(),F(ze,{key:2},[e.group.summary&&!m.value?(R(),V(Re,{key:0},{default:z(()=>[A(N(np),{value:e.group.summary,class:`text-sm pb-2 border-b border-base op-fade`},null,8,[`value`])]),_:1})):U(``,!0),A(fN,{store:e.store,files:e.group.files,onNavigate:S},null,8,[`store`,`files`])],64))]),P(`div`,VN,[e.collapsed?U(``,!0):(R(!0),F(ze,{key:0},Ae(e.group.files,t=>(R(),V(oN,{key:t.sha,ref_for:!0,ref:e=>x(t.sha,e),store:e.store,file:t},null,8,[`store`,`file`]))),128))])])):U(``,!0),m.value&&!e.collapsed?(R(),F(`div`,HN,[(R(!0),F(ze,null,Ae(e.group.children,t=>(R(),V(UN,{key:t.key,ref_for:!0,ref:e=>g(t.key,e),store:e.store,group:{...t,children:[]},collapsed:l.value.has(t.key),"parent-label":e.group.label,onToggle:e=>u(t.key)},null,8,[`store`,`group`,`collapsed`,`parent-label`,`onToggle`]))),128))])):U(``,!0)]))}}),WN=[`title`],GN=[`title`],KN=L({__name:`DiffAnalyzeButton`,props:{llm:{}},setup(e){return(t,n)=>(R(),F(ze,null,[e.llm.isSetup?!e.llm.hasAiResult||e.llm.analyzeMode===`llm`?(R(),V(_,{key:1,class:`text-xs shrink-0`,disabled:e.llm.isAnalyzing,variant:e.llm.hasAiResult?`text`:`primary`,icon:e.llm.isAnalyzing?`i-ph:spinner-duotone animate-spin`:`i-ph-sparkle-duotone`,onClick:n[1]||=t=>e.llm.reanalyze()},{default:z(()=>[j(B(e.llm.isAnalyzing?`Analyzing…`:e.llm.hasAiResult?`Re-analyze`:`Analyze with AI`),1)]),_:1},8,[`disabled`,`variant`,`icon`])):U(``,!0):(R(),V(_,{key:0,class:`text-xs shrink-0 shadow`,size:`sm`,icon:`i-ph:key-duotone`,variant:`primary`,onClick:n[0]||=e=>O.value=!0},{default:z(()=>[...n[2]||=[j(` Setup API Keys `,-1)]]),_:1})),e.llm.isAnalyzing&&e.llm.progress?(R(),F(`span`,{key:2,class:`text-xs op-mute max-w-64 truncate self-center`,title:e.llm.progress.message},B(e.llm.progress.message),9,WN)):e.llm.error?(R(),F(`span`,{key:3,class:`text-xs text-red-500 max-w-80 truncate self-center`,title:`AI analysis failed: ${e.llm.error.message}`},`AI analysis failed: `+B(e.llm.error.message),9,GN)):U(``,!0)],64))}}),qN={class:`text-sm flex flex-1 flex-wrap gap-1.5 min-w-0 items-center relative`},JN=[`onClick`],YN={class:`flex flex-col items-start`},XN={class:`text-xs flex items-center`},ZN={class:`op-mute`},QN=L({__name:`DiffGroupNav`,props:{groups:{},groupsVisable:{},reviewed:{}},emits:[`select`],setup(e){let t=e;function n(e){let n=[...e.files,...e.children.flatMap(e=>e.files)];return n.length===0?1:n.filter(e=>t.reviewed.has(e.sha)).length/n.length}return(t,r)=>(R(),F(`div`,qN,[(R(!0),F(ze,null,Ae(e.groups,r=>(R(),F(`button`,{key:r.key,type:`button`,class:Oe([`px-2 py-0.5 border border-base rounded flex gap-2 transition items-center hover:bg-active hover:op-100`,e.groupsVisable.includes(r.key)?`op-100 border-primary:50 bg-primary:10 color-base`:`op-fade`]),onClick:e=>t.$emit(`select`,r.key)},[P(`div`,YN,[P(`div`,null,B(r.label),1),P(`div`,XN,[A(aj,{additions:N(gN)(r).added,deletions:N(gN)(r).deleted},null,8,[`additions`,`deletions`]),P(`span`,ZN,`・`+B(N(hN)(r))+` Files`,1)])]),n(r)===0?U(``,!0):(R(),V($A,{key:0,value:n(r),size:18,thickness:2},null,8,[`value`]))],10,JN))),128))]))}}),$N={key:0,class:`op-fade`},eP={key:1,class:`text-xs ml-0.5 op-fade`},tP=L({__name:`DisplayNumber`,props:{value:{},prefix:{},suffix:{},options:{},mono:{type:Boolean,default:!0}},setup(e){let t=e,n=I(()=>pe(t.value,t.options));return(t,r)=>(R(),F(`span`,{class:Oe({"font-mono tabular-nums":e.mono})},[e.prefix?(R(),F(`span`,$N,B(e.prefix),1)):U(``,!0),j(B(n.value),1),e.suffix?(R(),F(`span`,eP,B(e.suffix),1)):U(``,!0)],2))}}),nP=L({__name:`DisplayNumberBadge`,props:{value:{},prefix:{},suffix:{},options:{},color:{type:[Boolean,Number,String],default:!1}},setup(e){return(t,n)=>(R(),V(h,{color:e.color,class:`text-micro`},{default:z(()=>[Ge(t.$slots,`default`,{},()=>[A(tP,{value:e.value,prefix:e.prefix,suffix:e.suffix,options:e.options},null,8,[`value`,`prefix`,`suffix`,`options`])])]),_:3},8,[`color`]))}}),rP={class:`shrink-0 relative`},iP=L({__name:`DiffReviewButton`,props:{pendingCommentCount:{}},emits:[`review`],setup(e){return(t,n)=>(R(),F(`div`,rP,[A(_,{size:`sm`,variant:`action`,icon:`i-ph:chat-centered-text-duotone`,onClick:n[0]||=e=>t.$emit(`review`)},{default:z(()=>[...n[1]||=[j(` Add Review `,-1)]]),_:1}),e.pendingCommentCount>0?(R(),V(nP,{key:0,value:e.pendingCommentCount,class:`right--2 top--2 absolute`},null,8,[`value`])):U(``,!0)]))}}),aP=L({__name:`DiffReviewThreadsToggle`,props:{showThreads:{type:Boolean}},emits:[`update:showThreads`],setup(e){return(t,n)=>(R(),V(v,{class:Oe([`shrink-0`,e.showThreads?``:`op-fade`]),icon:e.showThreads?`i-ph:chats-duotone`:`i-ph:chats`,label:e.showThreads?`Hide review comments`:`Show review comments`,tooltip:e.showThreads?`Hide review comments`:`Show review comments`,onClick:n[0]||=n=>t.$emit(`update:showThreads`,!e.showThreads)},null,8,[`class`,`icon`,`label`,`tooltip`]))}}),oP=L({__name:`FormRadioGroup`,props:ge({options:{},orientation:{default:`vertical`}},{modelValue:{},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=M(e,`modelValue`);return(n,r)=>(R(),V(N(f),{modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e,class:Oe([`flex gap-3`,e.orientation===`vertical`?`flex-col`:`flex-row flex-wrap`])},{default:z(()=>[(R(!0),F(ze,null,Ae(e.options,e=>(R(),F(`label`,{key:e.value,class:Oe([`text-sm inline-flex gap-2 cursor-pointer select-none items-center`,{"op50 pointer-events-none":e.disabled}])},[A(N(i),{value:e.value,disabled:e.disabled,class:`outline-none border border-base rounded-full bg-raised flex h-4 w-4 transition items-center justify-center data-[state=checked]:border-primary-500 focus-visible:ring-2 focus-visible:ring-primary-500/40`},{default:z(()=>[A(N(fM),{class:`rounded-full bg-primary-500 h-2 w-2 block`})]),_:1},8,[`value`,`disabled`]),j(` `+B(e.label??e.value),1)],2))),128))]),_:1},8,[`modelValue`,`class`]))}}),sP={class:`p-3 flex flex-col gap-3 w-full sm:w-100`},cP={key:0,class:`text-sm op-fade`},lP={key:1,class:`text-sm text-red-600 dark:text-red-400`},uP={class:`flex gap-2 items-center justify-end`},dP=L({__name:`ReviewSubmitModal`,props:{open:{type:Boolean},reviews:{},document:{}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=t,i=H(``),a=H(`COMMENT`),o=H(!1),s=H(),c=[{value:`COMMENT`,label:`Comment`},{value:`APPROVE`,label:`Approve`},{value:`REQUEST_CHANGES`,label:`Request changes`}];async function l(e){o.value=!0,s.value=void 0;try{await e(),i.value=``,a.value=`COMMENT`,r(`update:open`,!1)}catch(e){s.value=e instanceof Error?e.message:String(e)}finally{o.value=!1}}return(t,u)=>(R(),V(T,{title:`Review changes`,open:e.open,document:e.document,"onUpdate:open":u[4]||=e=>r(`update:open`,e)},{default:z(()=>[P(`div`,sP,[e.reviews.pendingCommentCount>0?(R(),F(`p`,cP,` Submitting includes your `+B(e.reviews.pendingCommentCount)+` pending comment`+B(e.reviews.pendingCommentCount===1?``:`s`)+`. `,1)):U(``,!0),A(bM,{modelValue:i.value,"onUpdate:modelValue":u[0]||=e=>i.value=e,rows:4,placeholder:`Leave a summary (optional for Approve)`,disabled:o.value,invalid:!!s.value},null,8,[`modelValue`,`disabled`,`invalid`]),A(oP,{modelValue:a.value,"onUpdate:modelValue":u[1]||=e=>a.value=e,options:c},null,8,[`modelValue`]),s.value?(R(),F(`p`,lP,B(s.value),1)):U(``,!0),P(`div`,uP,[e.reviews.pendingReview?(R(),V(_,{key:0,variant:`text`,class:`text-red-600 dark:text-red-400`,disabled:o.value,onClick:u[2]||=e=>l(()=>n.reviews.discardPendingReview())},{default:z(()=>[...u[5]||=[j(` Discard review `,-1)]]),_:1},8,[`disabled`])):U(``,!0),u[7]||=P(`div`,{class:`flex-auto`},null,-1),A(_,{variant:`primary`,loading:o.value,disabled:a.value!==`APPROVE`&&!i.value.trim()&&e.reviews.pendingCommentCount===0,onClick:u[3]||=e=>l(()=>n.reviews.submitReview(a.value,i.value))},{default:z(()=>[...u[6]||=[j(` Submit review `,-1)]]),_:1},8,[`loading`,`disabled`])])])]),_:1},8,[`open`,`document`]))}}),fP={class:`mxa max-w-500 w-full`},pP={class:`flex flex-wrap gap-2 items-start`},mP={class:`text-lg font-semibold flex flex-auto gap-2 break-words items-center`},hP=[`href`],gP={key:1,class:`text-sm flex shrink-0 gap-1.5 items-center`},_P={class:`shrink-0`},vP={class:`text-sm text-sm op-fade flex flex-wrap gap-x-3 gap-y-1 items-center`},yP=[`href`],bP={key:1,class:`flex gap-1.5 items-center`},xP={key:2,class:`font-mono flex gap-1 items-center`},SP={class:`text-xs font-mono px-2 py-0.5 border border-base rounded bg-code`},CP={class:`text-xs font-mono px-2 py-0.5 border border-base rounded bg-code`},wP={class:`text-sm pt-2 flex gap-2 items-center`},TP={class:`shrink-0 whitespace-nowrap`},EP={class:`text-xs opacity-50`},DP=L({__name:`DiffsHeader`,props:{document:{},store:{},groupsVisable:{},scrollY:{}},setup(e){let n=e,r=I(()=>n.store.diff),i=I(()=>n.store.groups),a=I(()=>n.store.ui.isEmbedded),o=I(()=>r.value.files.length),s=I(()=>r.value.files.filter(e=>n.store.reviewed.has(e.sha)).length),c=I(()=>r.value.files.reduce((e,t)=>e+t.additions,0)),l=I(()=>r.value.files.reduce((e,t)=>e+t.deletions,0)),u=I(()=>o.value===0?1:s.value/o.value),d=I(()=>n.store.llm?.hasAiResult??!1),f=I(()=>n.store.llm?.analyzeMode??`rule-based`),p=[{value:`rule-based`,label:`Rules`},{value:`llm`,label:`AI`,icon:`i-ph-sparkle-duotone`}],m=I(()=>r.value.provider===`github`?t(r.value.id):void 0),h=I(()=>n.store.reviews),g=H(!1);function _(e){(n.document??document).getElementById(`group-${e}`)?.scrollIntoView({behavior:`smooth`,block:`start`})}return(t,n)=>(R(),F(`header`,{class:Oe([`px4 py2 border-b bg-base flex flex-col gap-2 transition-all left-0 right-0 top-0 sticky z-nav`,e.scrollY>20?`border-base shadow-md`:`border-transparent`])},[P(`div`,fP,[P(`div`,pP,[r.value.pullRequest?.state?(R(),V(w,{key:0,state:r.value.pullRequest.state,class:`mt-1`},null,8,[`state`])):U(``,!0),P(`h1`,mP,[j(B(r.value.title)+` `,1),m.value?(R(),F(`a`,{key:0,href:r.value.url,target:`_blank`,rel:`noopener`,class:`text-base font-normal op-fade hover:underline`},`#`+B(m.value.number),9,hP)):U(``,!0),r.value.provider===`github`?(R(),V(v,{key:1,icon:`i-ph:arrows-clockwise-duotone`,label:`Refresh`,tooltip:`Refresh`,class:`text-sm shrink-0`,onClick:n[0]||=t=>e.store.refresh()})):U(``,!0)]),e.store.llm&&d.value?(R(),F(`div`,gP,[n[5]||=P(`span`,{class:`op-fade`},`Analyze by`,-1),A(me,{"model-value":f.value,options:p,"onUpdate:modelValue":n[1]||=t=>e.store.llm?.setAnalyzeMode(t)},null,8,[`model-value`])])):U(``,!0),h.value?(R(),V(aP,{key:2,"show-threads":h.value.showThreads,"onUpdate:showThreads":n[2]||=e=>h.value.setShowThreads(e)},null,8,[`show-threads`])):U(``,!0),P(`div`,_P,[A(ee,{document:e.document,"is-embedded":a.value},null,8,[`document`,`is-embedded`])])]),P(`div`,vP,[m.value&&!a.value?(R(),F(`a`,{key:0,href:r.value.url,target:`_blank`,rel:`noopener`,class:`op-fade flex gap-1.5 items-center`},[P(`span`,null,B(m.value.owner)+`/`+B(m.value.repo),1)],8,yP)):U(``,!0),r.value.pullRequest?.author?(R(),F(`span`,bP,[n[6]||=j(` by `,-1),A(PM,{login:r.value.pullRequest.author,size:16},null,8,[`login`]),j(` `+B(r.value.pullRequest.author),1)])):U(``,!0),r.value.base&&r.value.head&&!a.value?(R(),F(`span`,xP,[P(`span`,SP,B(r.value.base.ref),1),n[7]||=j(` ← `,-1),P(`span`,CP,B(r.value.head.ref),1)])):U(``,!0),e.store.llm?(R(),V(KN,{key:3,llm:e.store.llm},null,8,[`llm`])):U(``,!0)]),P(`div`,wP,[A(QN,{groups:i.value,"groups-visable":e.groupsVisable,reviewed:e.store.reviewed,onSelect:_},null,8,[`groups`,`groups-visable`,`reviewed`]),n[8]||=P(`div`,{class:`flex-auto`},null,-1),A(aj,{additions:c.value,deletions:l.value},null,8,[`additions`,`deletions`]),A($A,{value:u.value,size:18,thickness:3},null,8,[`value`]),P(`span`,TP,[j(B(s.value)+` `,1),P(`span`,EP,`/ `+B(o.value)+` reviewed`,1)]),h.value?.canWrite?(R(),V(iP,{key:0,"pending-comment-count":h.value.pendingCommentCount,onReview:n[3]||=e=>g.value=!0},null,8,[`pending-comment-count`])):U(``,!0)])]),h.value?(R(),V(dP,{key:0,open:g.value,"onUpdate:open":n[4]||=e=>g.value=e,reviews:h.value,document:e.document},null,8,[`open`,`reviews`,`document`])):U(``,!0)],2))}}),OP={key:0,class:`border border-base rounded-lg`},kP=[`aria-expanded`],AP={class:`font-mono op-mute`},jP={key:0,class:`border-t border-base divide-#9992 divide-y`},MP={class:`flex gap-2 items-center`},NP={class:`font-medium`},PP={class:`op-fade`},FP=L({__name:`ReviewSummaries`,props:{summaries:{}},setup(e){let t=H(!1),n={approved:{label:`approved`,icon:`i-ph:check-circle-duotone text-green-600 dark:text-green-400`},changes_requested:{label:`requested changes`,icon:`i-ph:x-circle-duotone text-red-600 dark:text-red-400`},commented:{label:`commented`,icon:`i-ph:chat-circle-dots-duotone op-fade`},dismissed:{label:`review dismissed`,icon:`i-ph:prohibit op-mute`}};return(r,i)=>e.summaries.length?(R(),F(`section`,OP,[P(`button`,{type:`button`,class:`text-sm px-3 py-2 flex gap-1.5 w-full items-center`,"aria-expanded":t.value,onClick:i[0]||=e=>t.value=!t.value},[P(`span`,{class:Oe(t.value?`i-ph:caret-down`:`i-ph:caret-right`),"aria-hidden":`true`},null,2),i[1]||=P(`span`,{class:`font-medium`},`Reviews`,-1),P(`span`,AP,B(e.summaries.length),1)],8,kP),t.value?(R(),F(`ul`,jP,[(R(!0),F(ze,null,Ae(e.summaries,e=>(R(),F(`li`,{key:e.id,class:`text-sm px-3 py-2 flex flex-col gap-1`},[P(`div`,MP,[P(`span`,{class:Oe(n[e.state].icon),"aria-hidden":`true`},null,2),e.author?(R(),V(PM,{key:0,login:e.author.login,size:16},null,8,[`login`])):U(``,!0),P(`span`,NP,B(e.author?.login??`ghost`),1),P(`span`,PP,B(n[e.state].label),1),e.submittedAt?(R(),V(S,{key:1,date:e.submittedAt,class:`text-xs op-fade`},null,8,[`date`])):U(``,!0)]),e.body?(R(),V(Re,{key:0},{default:z(()=>[A(N(np),{value:e.body,class:`text-sm pl-6 op-fade`},null,8,[`value`])]),_:2},1024)):U(``,!0)]))),128))])):U(``,!0)])):U(``,!0)}}),IP={key:0,class:`mxa px-4 py-12 max-w-500 w-full`},LP={key:1,class:`mxa px-4 py-12 max-w-500 w-full`},RP={class:`mxa py-4 flex flex-col gap-4 max-w-500 w-full`},zP={key:0,class:`text-sm text-amber-700 mb-4 px-3 py-2 border border-amber:20 rounded-lg bg-amber:10 bg-raised flex gap-3 items-center justify-between dark:text-amber-400`},BP={key:3,class:`mxa px-4 py-12 max-w-500 w-full`},VP=L({__name:`DiffsPage`,props:{document:{},store:{}},setup(e){let n=e,r=we(()=>W(()=>import(`./ChatWidget-BXmVT9ns.js`),__vite__mapDeps([30,1,2,3,4,5,31]))),i=I(()=>n.store?.diff),a=I(()=>n.store?.grouped),o=I(()=>n.store?.isLoading??!1),s=I(()=>n.store?.error),c=I(()=>n.store?.isStale??!1),l=I(()=>n.store?.groups??[]),u=I(()=>{let e=i.value;if(!e||e.provider!==`github`||!e.base||!e.head||!qA(`github`).capabilities.supportsFullFileContent)return;let n=t(e.id);if(n)return{owner:n.owner,repo:n.repo,baseSha:e.base.sha,headSha:e.head.sha}});Ie(TM,u);let d=new hA;Ie(JA,d);let f=Te(`root`);je(()=>{d.setup(n.document&&!(n.document instanceof Document)?f.value:document)}),Le(()=>d.cleanUp());let p=H(new Set);function m(e){let t=new Set(p.value);t.has(e)?t.delete(e):t.add(e),p.value=t}let h=H(0);Qe(()=>n.document??document,`scroll`,e=>{h.value=e.target instanceof Element?e.target.scrollTop:window.scrollY,b()},{capture:!0});let g=Te(`header`),{height:v}=Ye(()=>g.value?.$el),y=H([]);function b(){let e=n.document??document,t=window.innerHeight;y.value=l.value.filter(n=>{let r=e.getElementById(`group-${n.key}`);if(!r)return!1;let i=r.getBoundingClientRect();return i.bottom>v.value&&i.top<t}).map(e=>e.key)}return be([l,v],()=>He(b),{immediate:!0}),(t,n)=>(R(),F(`div`,{ref:`root`,class:`diffs-page color-base bg-base`,style:Me({"--diffs-header-height":N(v)?`${N(v)}px`:void 0})},[P(`div`,null,[o.value&&!i.value?(R(),F(`div`,IP,[Ge(t.$slots,`loading`,{},()=>[A(lp,{text:`Loading…`})])])):s.value?(R(),F(`div`,LP,[Ge(t.$slots,`error`,{error:s.value,retry:()=>e.store?.load()},()=>[A(sp,{icon:`i-ph:warning-duotone`,title:`Something went wrong`},{hint:z(()=>[j(B(s.value.message),1)]),actions:z(()=>[A(_,{variant:`primary`,onClick:n[0]||=t=>e.store?.load()},{default:z(()=>[...n[2]||=[j(` Retry `,-1)]]),_:1})]),_:1})])])):i.value&&a.value?(R(),F(ze,{key:2},[A(DP,{ref:`header`,document:e.document,store:e.store,"groups-visable":y.value,"scroll-y":h.value},null,8,[`document`,`store`,`groups-visable`,`scroll-y`]),P(`div`,RP,[Ge(t.$slots,`stale`,{refresh:()=>e.store?.refresh()},()=>[c.value?(R(),F(`div`,zP,[n[4]||=P(`span`,null,`This pull request has new commits since it was cached.`,-1),A(_,{size:`sm`,onClick:n[1]||=t=>e.store?.refresh()},{default:z(()=>[...n[3]||=[j(` Refresh `,-1)]]),_:1})])):U(``,!0)]),e.store?.reviews?(R(),V(FP,{key:0,summaries:e.store.reviews.summaries},null,8,[`summaries`])):U(``,!0),a.value?.overallSummary?(R(),V(Re,{key:1},{default:z(()=>[A(N(np),{value:a.value?.overallSummary,class:`text-sm px-4 pb-2 border-b border-base op-fade`},null,8,[`value`])]),_:1})):U(``,!0),(R(!0),F(ze,null,Ae(l.value,t=>(R(),V(UN,{id:`group-${t.key}`,key:t.key,store:e.store,group:t,collapsed:p.value.has(t.key),onToggle:e=>m(t.key)},null,8,[`id`,`store`,`group`,`collapsed`,`onToggle`]))),128)),n[5]||=P(`div`,{class:`text-xs mt-200 p2 text-center op50 italic`},` You have reached the end of the diff. `,-1)]),e.store?.llm?.hasAiResult?(R(),V(N(r),{key:0,store:e.store},null,8,[`store`])):U(``,!0)],64)):(R(),F(`div`,BP,[Ge(t.$slots,`empty`)]))])],4))}}),HP={id:`none`,available:!0,async analyze(e){let t={groups:[{key:`all`,label:`All files`,filePaths:e.files.map(e=>e.path)}],schemaVersion:1};return ce(`none`,t)}},UP=`code`,WP=dt.map(e=>({category:e.category,isMatch:e.patterns?(0,lt.default)(e.patterns):()=>!1}));function GP(e){for(let{category:t,isMatch:n}of WP)if(n(e))return t;return UP}var KP={code:`Code`,tests:`Tests`,docs:`Docs`,deps:`Dependencies`,config:`Config`,generated:`Generated`,other:`Other`},qP={code:`Source changes.`,tests:`Test coverage for the change.`,docs:`Documentation updates.`,deps:`Dependency version changes.`,config:`Configuration changes.`,generated:`Generated or build output changes.`,other:`Other changes that don't fit an existing category.`},JP={id:`rule-based`,available:!0,async analyze(e){let t=new Map;for(let n of e.files){let e=n.isBinary?`other`:GP(n.path),r=t.get(e);r||(r={key:e,label:KP[e],summary:qP[e],filePaths:[]},t.set(e,r)),r.filePaths.push(n.path)}let n={groups:Array.from(t.values()).sort((e,t)=>dt.findIndex(t=>t.category===e.key)-dt.findIndex(e=>e.category===t.key)),schemaVersion:1};return ce(`rule-based`,n)}},YP={none:HP,"rule-based":JP,llm:vt,"web-llm":{id:`web-llm`,available:!1,analyze:()=>{throw Error(`web-llm adapter not implemented yet`)}}};function XP(e){return YP[e]}function ZP(e){return e?.role===`assistant`&&e.stopReason===`error`}function QP({diff:e,session:t,onSessionChange:n,onGroupingUpdate:r}){let i=H(!1),a=H(),o=We(),s,c=!1,l=I(()=>t.value!==void 0),u=I(()=>((o.value?.session===t.value?o.value?.messages:void 0)??t.value?.messages??[]).slice(t.value?.chatStartIndex??0));async function d(l,u){let d=ve(e.value),f=t.value;if(!d||!f||i.value)return;let p=mt();if(!p){a.value=Error(ft);return}let m=()=>t.value!==f||ve(e.value)!==d;a.value=void 0,i.value=!0,c=!1;try{let{createChatSession:e}=await W(async()=>{let{createChatSession:e}=await import(`./chat-CP0CZKJo.js`);return{createChatSession:e}},__vite__mapDeps([32,0,1,2,3,4,5]));if(c||m())return;let t=e({diff:d,resolved:p,messages:u,onGroupingUpdate:e=>m()?void 0:r(e)});s=t;let i=()=>{let{streamingMessage:e}=t.state;o.value={session:f,messages:e?[...t.state.messages,e]:[...t.state.messages]}};i();let h=t.subscribe(i);try{await l(t)}finally{h()}if(m())return;let g={messages:[...t.state.messages],chatStartIndex:f.chatStartIndex};await n(g);let _=g.messages.at(-1);ZP(_)&&(a.value=Error(_.errorMessage??`Chat request failed`))}catch(e){m()||(a.value=e instanceof Error?e:Error(String(e)))}finally{s=void 0,o.value=void 0,i.value=!1}}async function f(e){e.trim()&&t.value&&await d(t=>t.prompt(e),ve(t.value.messages))}async function p(){let e=ve(t.value?.messages);e&&ZP(e.at(-1))&&await d(e=>e.continue(),e.slice(0,-1))}function m(){c=!0,s?.abort()}ke()&&Be(m);async function h(){let e=t.value;e&&(m(),a.value=void 0,await n({messages:ve(e.messages).slice(0,e.chatStartIndex),chatStartIndex:e.chatStartIndex}))}return{available:l,messages:u,isStreaming:i,error:a,send:f,retry:p,stop:m,clear:h}}var $P=`https://api.github.com`;async function eF(e,t,n,r){let i=await fetch(t,{method:e,headers:yA(n),body:r===void 0?void 0:JSON.stringify(r)});if(!i.ok){let e;try{e=(await i.json()).message}catch{}throw new vA(i.status,e??`GitHub API request failed (${i.status}): ${t}`)}return i}async function tF(e,t){let n=[],r=1;for(;;){let i=await(await eF(`GET`,`${e}${e.includes(`?`)?`&`:`?`}per_page=100&page=${r}`,t)).json();if(n.push(...i),i.length<100)break;r++}return n}async function nF(e,t,n,r){return tF(`${$P}/repos/${e}/${t}/pulls/${n}/comments`,r)}async function rF(e,t,n,r){return tF(`${$P}/repos/${e}/${t}/pulls/${n}/reviews`,r)}async function iF(e,t,n,r,i){return tF(`${$P}/repos/${e}/${t}/pulls/${n}/reviews/${r}/comments`,i)}async function aF(e,t,n,r,i){await eF(`POST`,`${$P}/repos/${e}/${t}/pulls/${n}/comments`,i,{body:r.body,commit_id:r.commitId,path:r.path,side:r.side,line:r.line,start_line:r.startLine,start_side:r.startSide})}async function oF(e,t,n,r,i){await eF(`POST`,`${$P}/repos/${e}/${t}/pulls/${n}/reviews`,i,{commit_id:r.commitId,comments:[{path:r.path,body:r.body,side:r.side,line:r.line,start_line:r.startLine,start_side:r.startSide}]})}async function sF(e,t,n,r,i,a){await eF(`POST`,`${$P}/repos/${e}/${t}/pulls/${n}/comments/${r}/replies`,a,{body:i})}async function cF(e,t,n,r,i){await eF(`PATCH`,`${$P}/repos/${e}/${t}/pulls/comments/${n}`,i,{body:r})}async function lF(e,t,n,r){await eF(`DELETE`,`${$P}/repos/${e}/${t}/pulls/comments/${n}`,r)}async function uF(e,t,n,r,i,a,o){await eF(`POST`,`${$P}/repos/${e}/${t}/pulls/${n}/reviews/${r}/events`,o,{event:i,body:a})}async function dF(e,t,n,r,i,a){await eF(`POST`,`${$P}/repos/${e}/${t}/pulls/${n}/reviews`,a,{event:r,body:i})}async function fF(e,t,n,r,i){await eF(`DELETE`,`${$P}/repos/${e}/${t}/pulls/${n}/reviews/${r}`,i)}var pF=`https://api.github.com/graphql`;async function mF(e,t,n){let r=await fetch(pF,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${n}`},body:JSON.stringify({query:e,variables:t})});if(!r.ok)throw new vA(r.status,`GitHub GraphQL request failed (${r.status})`);let i=await r.json();if(i.errors?.length)throw new vA(i.errors.some(e=>e.type===`FORBIDDEN`)?403:500,i.errors.map(e=>e.message).join(`; `));if(!i.data)throw new vA(500,`GitHub GraphQL response contained no data`);return i.data}var hF=`
1665
- query ReviewThreads($owner: String!, $repo: String!, $number: Int!, $cursor: String) {
1666
- repository(owner: $owner, name: $repo) {
1667
- pullRequest(number: $number) {
1668
- reviewThreads(first: 100, after: $cursor) {
1669
- pageInfo { hasNextPage endCursor }
1670
- nodes {
1671
- id
1672
- isResolved
1673
- comments(first: 1) { nodes { fullDatabaseId } }
1674
- }
1675
- }
1676
- }
1677
- }
1678
- }`;async function gF(e,t,n,r){let i=new Map,a=null;for(;;){let o=(await mF(hF,{owner:e,repo:t,number:Number(n),cursor:a},r)).repository?.pullRequest?.reviewThreads;if(!o)break;for(let e of o.nodes){let t=e.comments.nodes[0]?.fullDatabaseId;t!=null&&i.set(Number(t),{threadId:e.id,isResolved:e.isResolved})}if(!o.pageInfo.hasNextPage)break;a=o.pageInfo.endCursor}return i}var _F=`
1679
- mutation ResolveThread($threadId: ID!) {
1680
- resolveReviewThread(input: { threadId: $threadId }) {
1681
- thread { id isResolved }
1682
- }
1683
- }`;async function vF(e,t){await mF(_F,{threadId:e},t)}var yF=`
1684
- mutation AddPendingThread($reviewId: ID!, $path: String!, $body: String!, $line: Int!, $side: DiffSide!, $startLine: Int, $startSide: DiffSide) {
1685
- addPullRequestReviewThread(input: {
1686
- pullRequestReviewId: $reviewId,
1687
- path: $path,
1688
- body: $body,
1689
- line: $line,
1690
- side: $side,
1691
- startLine: $startLine,
1692
- startSide: $startSide
1693
- }) {
1694
- thread { id }
1695
- }
1696
- }`;function bF(e){return e===`additions`?`RIGHT`:`LEFT`}async function xF(e,t,n,r){await mF(yF,{reviewId:e,path:t.path,body:n,line:t.line,side:bF(t.side),startLine:t.startLine??null,startSide:t.startSide?bF(t.startSide):null},r)}function SF(e){return e===`LEFT`?`deletions`:`additions`}function CF(e){return e?{login:e.login,avatarUrl:e.avatar_url}:void 0}var wF={APPROVED:`approved`,CHANGES_REQUESTED:`changes_requested`,COMMENTED:`commented`,DISMISSED:`dismissed`};function TF(e){let t=new Map;function n(n,r){let i=n.in_reply_to_id??n.id,a=t.get(i);if(!a){let o=e.resolutions?.get(i);a={rootId:i,path:n.path,side:SF(n.side),line:n.line??void 0,startLine:n.start_line??void 0,startSide:n.start_side?SF(n.start_side):void 0,outdated:n.line==null,resolved:o?.isResolved,threadId:o?.threadId,pending:r,comments:[]},t.set(i,a)}a.comments.push({id:n.id,author:CF(n.user),body:n.body,createdAt:n.created_at,url:n.html_url,pending:r})}for(let t of e.comments)n(t,!1);for(let t of e.pendingComments)n(t,!0);let r=[],i;for(let t of e.reviews){if(t.state===`PENDING`){i={id:t.id,nodeId:t.node_id,body:t.body??``};continue}if(t.state===`COMMENTED`&&!t.body)continue;let e=wF[t.state];e&&r.push({id:t.id,author:CF(t.user),state:e,body:t.body??``,submittedAt:t.submitted_at,url:t.html_url})}return{threads:[...t.values()],summaries:r,pendingReview:i}}var EF=et(`diffs:show-review-comments`,!0);function DF(e){return e===`additions`?`RIGHT`:`LEFT`}function OF(e,t){let{owner:n,repo:r,number:i}=e,a=t.token||void 0,o=H({threads:[],summaries:[],pendingReview:void 0}),s=H(!1),c=H(),l=H(!1),u=H(),d=I(()=>!!a&&l.value&&!u.value),f=I(()=>o.value.threads.reduce((e,t)=>e+t.comments.filter(e=>e.pending).length,0));async function p(){let[e,t]=await Promise.all([nF(n,r,i,a),rF(n,r,i,a)]),o=t.find(e=>e.state===`PENDING`),[s,c]=await Promise.all([o?iF(n,r,i,o.id,a):Promise.resolve([]),a?gF(n,r,i,a).catch(()=>void 0):Promise.resolve(void 0)]);return TF({comments:e,reviews:t,pendingComments:s,resolutions:c})}async function m(){let e=await p();o.value=e;let n=t.getCacheKey();if(n){let t=await g();await D(t,n,e)}}async function h(){let e=t.cachedData?.();e&&(o.value=e),s.value=!e;try{if(a){let e=await b(a);c.value=e?.login,l.value=e!==void 0&&(e.scopes.length===0||e.scopes.includes(`repo`)||e.scopes.includes(`public_repo`))}await m()}catch{}finally{s.value=!1}}async function _(e){try{return await e()}catch(e){throw e instanceof vA&&e.status===403&&(u.value=`This token cannot write reviews on this repository. It needs the "repo" scope (classic token) or "Pull requests: Read and write" permission (fine-grained token).`),e}}function v(){if(!a)throw Error(`A GitHub token is required to leave reviews.`);return a}async function y(e,a,s){let c=v();await _(async()=>{if(s===`review`&&o.value.pendingReview){await xF(o.value.pendingReview.nodeId,e,a,c);return}let l=t.getHeadSha();if(!l)throw Error(`The diff has not finished loading yet.`);let u={body:a,commitId:l,path:e.path,side:DF(e.side),line:e.line,startLine:e.startLine,startSide:e.startSide?DF(e.startSide):void 0};s===`review`?await oF(n,r,i,u,c):await aF(n,r,i,u,c)}),await m()}async function x(e,t){await _(()=>sF(n,r,i,e,t,v())),await m()}async function S(e,t){await _(()=>cF(n,r,e,t,v())),await m()}async function C(e){await _(()=>lF(n,r,e,v())),await m()}async function w(e){await _(()=>vF(e,v())),await m()}async function ee(e,t){let a=v();await _(async()=>{let s=o.value.pendingReview;s?await uF(n,r,i,s.id,e,t,a):await dF(n,r,i,e,t,a)}),await m()}async function T(){let e=o.value.pendingReview;e&&(await _(()=>fF(n,r,i,e.id,v())),await m())}return Fe({threads:I(()=>o.value.threads),summaries:I(()=>o.value.summaries),pendingReview:I(()=>o.value.pendingReview),pendingCommentCount:f,isLoading:s,viewerLogin:c,canWrite:d,writeBlockedReason:u,showThreads:EF,setShowThreads:e=>{EF.value=e},load:h,addComment:y,reply:x,editComment:S,deleteComment:C,resolveThread:w,submitReview:ee,discardPendingReview:T})}function kF(e,t={}){let n=t.llm??!0,r=H(),i=H({}),a=H(!1),o=H(),s=H(!1),c=H(n?`llm`:`rule-based`),l=H(!1),u=H(),d=H(new Set),f=H(),p=H(),m=We(),h;ke()&&Be(()=>h?.abort());let _,v=e.kind===`github-pr`&&qA(`github`).capabilities.supportsComments?OF(e,{token:t.token,getHeadSha:()=>r.value?.head?.sha,getCacheKey:()=>u.value,cachedData:()=>_}):void 0,y=I(()=>i.value[c.value]??i.value[`rule-based`]),b=I(()=>i.value.llm!==void 0),S=I(()=>vt.available),w=I(()=>r.value&&y.value?mN(y.value.groups,r.value.files):[]),ee=QP({diff:r,session:m,async onSessionChange(e){m.value=e,u.value&&await oe(await g(),u.value,e)},async onGroupingUpdate(e){i.value={...i.value,llm:e},u.value&&await x(await g(),u.value,`llm`,e)}});async function T(){if(!r.value)return;let e=await g();d.value=await re(e,r.value.files.map(e=>e.sha))}async function ne(e,t){let n=await g();await fe(n,e,t);let r=new Set(d.value);t?r.add(e):r.delete(e),d.value=r}async function E(e){ee.stop(),p.value=void 0;let t=new AbortController;h=t;try{let{result:n,transcript:r}=await _t(e,{onProgress:e=>f.value=e,signal:t.signal});if(t.signal.aborted)return;if(i.value={...i.value,llm:n},m.value={messages:r,chatStartIndex:r.length},u.value){let e=await g();await x(e,u.value,`llm`,n),await oe(e,u.value,m.value)}}catch(e){t.signal.aborted||(p.value=e instanceof Error?e:Error(String(e)))}finally{h===t&&(h=void 0)}}async function ae(e){if(r.value){l.value=!0;try{if(e===`llm`){await E(r.value);return}let t=await XP(e).analyze(r.value);if(i.value={...i.value,[e]:t},u.value){let n=await g();await x(n,u.value,e,t)}}finally{f.value=void 0,l.value=!1}}}async function ce(e){c.value=e,e!==`llm`&&i.value[e]===void 0&&await ae(e)}async function le(){await ae(`llm`),await ce(`llm`)}async function D(e,t){ee.stop(),h?.abort();let n=await g(),a=await JP.analyze(t);r.value=t,u.value=e;let o={"rule-based":a};i.value=o,m.value=void 0,await te(n,{key:e,diff:t,headSha:t.head?.sha??``,analyzedBy:o,lastViewedAt:Date.now(),sizeBytes:ue(t,o)}),await T(),c.value!==`rule-based`&&c.value!==`llm`&&await ae(c.value)}async function de(){let n=await qA(e.kind===`github-pr`?`github`:`paste`).fetchDiff(e,t),r=n.id;return await D(r,n),r}async function O(n){if(e.kind===`github-pr`)try{let r=await xA(e.owner,e.repo,e.number,t.token);s.value=r.head.sha!==n}catch{}}async function k(){a.value=!0,o.value=void 0,s.value=!1;try{if(e.kind===`github-pr`){let t=`github:${e.owner}/${e.repo}#${e.number}`,n=await g(),a=await ie(n,t);a?(r.value=a.diff,u.value=t,i.value=a.analyzedBy,m.value=a.llmSession,_=a.reviews,await C(n,t),await T(),O(a.headSha)):await de(),v?.load()}else{let n=await qA(`paste`).fetchDiff(e,t),a=n.id,o=await g(),s=await ie(o,a);s?(r.value=s.diff,u.value=a,i.value=s.analyzedBy,m.value=s.llmSession,await C(o,a),await T()):await D(a,n)}}catch(e){o.value=e instanceof Error?e:Error(String(e))}finally{a.value=!1}}async function pe(){a.value=!0,o.value=void 0;try{await de(),s.value=!1,v?.load()}catch(e){o.value=e instanceof Error?e:Error(String(e))}finally{a.value=!1}}let me=Fe({layout:se,isEmbedded:t.isEmbedded??!1,setLayout:e=>{se.value=e}});return Fe({diff:r,grouped:y,isLoading:a,error:o,isStale:s,reviewed:d,groups:w,ui:me,llm:n?Fe({isSetup:S,isAnalyzing:l,progress:f,error:p,hasAiResult:b,analyzeMode:c,setAnalyzeMode:ce,reanalyze:le,chat:Fe(ee)}):void 0,reviews:v,load:k,refresh:pe,toggleReviewed:ne})}export{np as a,ct as c,sp as i,VP as n,gt as o,lp as r,ut as s,kF as t};