vanilla-breeze 0.5.0 → 0.6.1

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 (263) hide show
  1. package/custom-elements.json +23071 -13897
  2. package/dist/cdn/components/accordion-wc.js +1 -1
  3. package/dist/cdn/components/activity-feed.js +1 -1
  4. package/dist/cdn/components/ai-chat.js +5 -5
  5. package/dist/cdn/components/ai-summary.js +2 -2
  6. package/dist/cdn/components/analytics-panel.js +2 -2
  7. package/dist/cdn/components/audio-player.js +4 -4
  8. package/dist/cdn/components/audio-visualizer.js +2 -2
  9. package/dist/cdn/components/author-index.js +2 -2
  10. package/dist/cdn/components/brand-mark.js +1 -1
  11. package/dist/cdn/components/bread-crumb.js +1 -1
  12. package/dist/cdn/components/calendar-wc.js +2 -2
  13. package/dist/cdn/components/card-list.js +1 -1
  14. package/dist/cdn/components/carousel-wc.js +1 -1
  15. package/dist/cdn/components/change-set.js +1 -1
  16. package/dist/cdn/components/chart-wc.js +56 -32
  17. package/dist/cdn/components/chat-input.js +1 -1
  18. package/dist/cdn/components/chat-window.js +1 -1
  19. package/dist/cdn/components/color-picker.js +1 -1
  20. package/dist/cdn/components/combo-box.js +1 -1
  21. package/dist/cdn/components/command-palette.js +1 -1
  22. package/dist/cdn/components/comment-box.js +51 -50
  23. package/dist/cdn/components/comment-thread.js +50 -49
  24. package/dist/cdn/components/comment-wc.js +1 -1
  25. package/dist/cdn/components/compare-surface.js +1 -1
  26. package/dist/cdn/components/consent-banner.js +1 -1
  27. package/dist/cdn/components/content-lens.js +1 -1
  28. package/dist/cdn/components/content-swap.js +1 -1
  29. package/dist/cdn/components/context-menu.js +1 -1
  30. package/dist/cdn/components/data-table.js +1 -1
  31. package/dist/cdn/components/date-picker.js +1 -1
  32. package/dist/cdn/components/day-view.js +1 -1
  33. package/dist/cdn/components/diagram-wc.js +2 -2
  34. package/dist/cdn/components/drag-surface.js +1 -1
  35. package/dist/cdn/components/drop-down.js +1 -1
  36. package/dist/cdn/components/emoji-picker.js +1 -1
  37. package/dist/cdn/components/flow-diagram.js +1 -1
  38. package/dist/cdn/components/foot-notes.js +1 -1
  39. package/dist/cdn/components/form-field.js +1 -1
  40. package/dist/cdn/components/geo-map.js +170 -54
  41. package/dist/cdn/components/glossary-index.js +1 -1
  42. package/dist/cdn/components/glossary-wc.js +1 -1
  43. package/dist/cdn/components/heading-links.js +1 -1
  44. package/dist/cdn/components/highlight-wc.js +6 -2
  45. package/dist/cdn/components/icon-wc.js +11 -10
  46. package/dist/cdn/components/image-gallery.js +1 -1
  47. package/dist/cdn/components/image-map.js +1 -1
  48. package/dist/cdn/components/include-file.js +1 -1
  49. package/dist/cdn/components/manifest.json +101 -101
  50. package/dist/cdn/components/markdown-editor.js +60 -1
  51. package/dist/cdn/components/markdown-viewer.js +50 -49
  52. package/dist/cdn/components/nav-bar.js +1 -1
  53. package/dist/cdn/components/note-wc.js +6 -2
  54. package/dist/cdn/components/notification-wc.js +33 -32
  55. package/dist/cdn/components/page-info.js +6 -72
  56. package/dist/cdn/components/page-stats.js +1 -1
  57. package/dist/cdn/components/page-toc.js +1 -1
  58. package/dist/cdn/components/page-tools.js +1 -1
  59. package/dist/cdn/components/page-tour.js +1 -38
  60. package/dist/cdn/components/pager-wc.js +1 -1
  61. package/dist/cdn/components/poll-wc.js +1 -1
  62. package/dist/cdn/components/pop-over.js +1 -1
  63. package/dist/cdn/components/popularity-index.js +1 -8
  64. package/dist/cdn/components/print-page.js +1 -1
  65. package/dist/cdn/components/progress-tracker.js +1 -1
  66. package/dist/cdn/components/qr-code.js +1 -1
  67. package/dist/cdn/components/reaction-bar.js +1 -1
  68. package/dist/cdn/components/reader-view.js +25 -25
  69. package/dist/cdn/components/reading-progress.js +1 -1
  70. package/dist/cdn/components/recently-visited.js +1 -26
  71. package/dist/cdn/components/score-card.js +21 -5
  72. package/dist/cdn/components/selection-menu.js +1 -1
  73. package/dist/cdn/components/settings-panel.js +88 -142
  74. package/dist/cdn/components/share-wc.js +2 -2
  75. package/dist/cdn/components/short-cuts.js +1 -1
  76. package/dist/cdn/components/site-index.js +1 -10
  77. package/dist/cdn/components/site-map.js +1 -1
  78. package/dist/cdn/components/site-search.js +1 -51
  79. package/dist/cdn/components/slide-accept.js +1 -1
  80. package/dist/cdn/components/social-embed.js +1 -1
  81. package/dist/cdn/components/split-surface.js +1 -1
  82. package/dist/cdn/components/star-rating.js +1 -1
  83. package/dist/cdn/components/status-wc.js +1 -1
  84. package/dist/cdn/components/stepper-wc.js +1 -1
  85. package/dist/cdn/components/tab-set.js +1 -1
  86. package/dist/cdn/components/text-reader.js +2 -2
  87. package/dist/cdn/components/theme-picker.js +86 -83
  88. package/dist/cdn/components/time-index.js +1 -11
  89. package/dist/cdn/components/time-picker.js +1 -1
  90. package/dist/cdn/components/toast-msg.js +6 -6
  91. package/dist/cdn/components/tool-tip.js +1 -1
  92. package/dist/cdn/components/topic-map.js +6 -3
  93. package/dist/cdn/components/trust-filter.js +1 -3
  94. package/dist/cdn/components/version-switcher.js +5 -5
  95. package/dist/cdn/components/video-player.js +67 -9
  96. package/dist/cdn/components/watch-wc.js +6 -2
  97. package/dist/cdn/components/week-view.js +1 -1
  98. package/dist/cdn/components/youtube-player.js +1 -1
  99. package/dist/cdn/emoji-extended.js +2 -0
  100. package/dist/cdn/fonts/atkinson-hyperlegible-OFL.txt +93 -0
  101. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-italic.woff2 +0 -0
  102. package/dist/cdn/fonts/atkinson-hyperlegible-latin-400-normal.woff2 +0 -0
  103. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-italic.woff2 +0 -0
  104. package/dist/cdn/fonts/atkinson-hyperlegible-latin-700-normal.woff2 +0 -0
  105. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-italic.woff2 +0 -0
  106. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2 +0 -0
  107. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-italic.woff2 +0 -0
  108. package/dist/cdn/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2 +0 -0
  109. package/dist/cdn/fonts/latinmodern-math-GUST-LICENSE.txt +30 -0
  110. package/dist/cdn/fonts/latinmodern-math.woff2 +0 -0
  111. package/dist/cdn/fonts/math-fonts.css +14 -0
  112. package/dist/cdn/packs/effects.full.css +1 -1
  113. package/dist/cdn/packs/effects.full.js +1 -1
  114. package/dist/cdn/packs/fonts-display.full.css +1 -1
  115. package/dist/cdn/packs/fonts-display.theme.css +1 -1
  116. package/dist/cdn/packs/icons.bundle.js +1 -1
  117. package/dist/cdn/packs/icons.full.css +1 -1
  118. package/dist/cdn/packs/icons.theme.css +1 -1
  119. package/dist/cdn/packs/journal.effects.css +1 -1
  120. package/dist/cdn/packs/journal.full.css +1 -1
  121. package/dist/cdn/packs/kawaii.effects.css +1 -1
  122. package/dist/cdn/packs/kawaii.full.css +2 -2
  123. package/dist/cdn/packs/kawaii.full.js +4 -4
  124. package/dist/cdn/packs/kawaii.theme.css +1 -1
  125. package/dist/cdn/packs/manifest.json +17 -17
  126. package/dist/cdn/packs/memphis.full.css +1 -1
  127. package/dist/cdn/packs/memphis.theme.css +1 -1
  128. package/dist/cdn/packs/ui.full.css +1 -1
  129. package/dist/cdn/packs/ui.full.js +89 -86
  130. package/dist/cdn/themes/8bit.css +1 -1
  131. package/dist/cdn/themes/8bit.tokens.json +1 -1
  132. package/dist/cdn/themes/alpha1999-dark.tokens.json +1 -1
  133. package/dist/cdn/themes/alpha1999.css +1 -1
  134. package/dist/cdn/themes/alpha1999.tokens.json +1 -1
  135. package/dist/cdn/themes/art-deco-dark.tokens.json +1 -1
  136. package/dist/cdn/themes/art-deco.css +1 -1
  137. package/dist/cdn/themes/art-deco.tokens.json +1 -1
  138. package/dist/cdn/themes/bauhaus-dark.tokens.json +1 -1
  139. package/dist/cdn/themes/bauhaus.css +1 -1
  140. package/dist/cdn/themes/bauhaus.tokens.json +1 -1
  141. package/dist/cdn/themes/brutalist-dark.tokens.json +1 -1
  142. package/dist/cdn/themes/brutalist.css +1 -1
  143. package/dist/cdn/themes/brutalist.tokens.json +1 -1
  144. package/dist/cdn/themes/catppuccin-frappe.css +1 -1
  145. package/dist/cdn/themes/catppuccin-frappe.tokens.json +1 -1
  146. package/dist/cdn/themes/catppuccin-latte-dark.tokens.json +1 -1
  147. package/dist/cdn/themes/catppuccin-latte.css +1 -1
  148. package/dist/cdn/themes/catppuccin-latte.tokens.json +1 -1
  149. package/dist/cdn/themes/catppuccin-macchiato.css +1 -1
  150. package/dist/cdn/themes/catppuccin-macchiato.tokens.json +1 -1
  151. package/dist/cdn/themes/catppuccin-mocha.css +1 -1
  152. package/dist/cdn/themes/catppuccin-mocha.tokens.json +1 -1
  153. package/dist/cdn/themes/classic-dark.tokens.json +1 -1
  154. package/dist/cdn/themes/classic.css +1 -1
  155. package/dist/cdn/themes/classic.tokens.json +1 -1
  156. package/dist/cdn/themes/claymorphism-dark.tokens.json +1 -1
  157. package/dist/cdn/themes/claymorphism.css +1 -1
  158. package/dist/cdn/themes/claymorphism.tokens.json +2 -1
  159. package/dist/cdn/themes/clinical-dark.tokens.json +1 -1
  160. package/dist/cdn/themes/clinical.css +1 -1
  161. package/dist/cdn/themes/clinical.tokens.json +1 -1
  162. package/dist/cdn/themes/cottagecore-dark.tokens.json +1 -1
  163. package/dist/cdn/themes/cottagecore.css +1 -1
  164. package/dist/cdn/themes/cottagecore.tokens.json +1 -1
  165. package/dist/cdn/themes/cyber.css +1 -1
  166. package/dist/cdn/themes/cyber.tokens.json +1 -1
  167. package/dist/cdn/themes/dawn-dark.tokens.json +1 -1
  168. package/dist/cdn/themes/dawn.css +1 -1
  169. package/dist/cdn/themes/dawn.tokens.json +1 -1
  170. package/dist/cdn/themes/dracula.css +1 -1
  171. package/dist/cdn/themes/dracula.tokens.json +1 -1
  172. package/dist/cdn/themes/dusk.css +1 -1
  173. package/dist/cdn/themes/dusk.tokens.json +1 -1
  174. package/dist/cdn/themes/editorial-dark.tokens.json +1 -1
  175. package/dist/cdn/themes/editorial.css +1 -1
  176. package/dist/cdn/themes/editorial.tokens.json +1 -1
  177. package/dist/cdn/themes/financial-dark.tokens.json +1 -1
  178. package/dist/cdn/themes/financial.css +1 -1
  179. package/dist/cdn/themes/financial.tokens.json +1 -1
  180. package/dist/cdn/themes/genai.css +1 -1
  181. package/dist/cdn/themes/genai.tokens.json +1 -1
  182. package/dist/cdn/themes/glassmorphism-dark.tokens.json +1 -1
  183. package/dist/cdn/themes/glassmorphism.css +1 -1
  184. package/dist/cdn/themes/glassmorphism.tokens.json +1 -1
  185. package/dist/cdn/themes/government-dark.tokens.json +1 -1
  186. package/dist/cdn/themes/government.css +1 -1
  187. package/dist/cdn/themes/government.tokens.json +1 -1
  188. package/dist/cdn/themes/gruvbox-dark.tokens.json +1 -1
  189. package/dist/cdn/themes/gruvbox.css +1 -1
  190. package/dist/cdn/themes/gruvbox.tokens.json +1 -1
  191. package/dist/cdn/themes/high-noon-dark.tokens.json +1 -1
  192. package/dist/cdn/themes/high-noon.css +1 -1
  193. package/dist/cdn/themes/high-noon.tokens.json +1 -1
  194. package/dist/cdn/themes/journal-dark.tokens.json +4 -2
  195. package/dist/cdn/themes/journal.css +1 -1
  196. package/dist/cdn/themes/journal.tokens.json +4 -2
  197. package/dist/cdn/themes/kawaii-dark.tokens.json +1 -1
  198. package/dist/cdn/themes/kawaii.css +1 -1
  199. package/dist/cdn/themes/kawaii.tokens.json +1 -1
  200. package/dist/cdn/themes/magna-dark.tokens.json +1 -1
  201. package/dist/cdn/themes/magna.css +1 -1
  202. package/dist/cdn/themes/magna.tokens.json +1 -1
  203. package/dist/cdn/themes/manifest.json +44 -44
  204. package/dist/cdn/themes/midnight.css +1 -1
  205. package/dist/cdn/themes/midnight.tokens.json +1 -1
  206. package/dist/cdn/themes/minimal-dark.tokens.json +1 -1
  207. package/dist/cdn/themes/minimal.css +1 -1
  208. package/dist/cdn/themes/minimal.tokens.json +1 -1
  209. package/dist/cdn/themes/modern-dark.tokens.json +1 -1
  210. package/dist/cdn/themes/modern.css +1 -1
  211. package/dist/cdn/themes/modern.tokens.json +1 -1
  212. package/dist/cdn/themes/nes-dark.tokens.json +7 -2
  213. package/dist/cdn/themes/nes.css +1 -1
  214. package/dist/cdn/themes/nes.tokens.json +1 -1
  215. package/dist/cdn/themes/neumorphism-dark.tokens.json +1 -1
  216. package/dist/cdn/themes/neumorphism.css +1 -1
  217. package/dist/cdn/themes/neumorphism.tokens.json +1 -1
  218. package/dist/cdn/themes/nord-dark.tokens.json +1 -1
  219. package/dist/cdn/themes/nord.css +1 -1
  220. package/dist/cdn/themes/nord.tokens.json +1 -1
  221. package/dist/cdn/themes/organic-dark.tokens.json +1 -1
  222. package/dist/cdn/themes/organic.css +1 -1
  223. package/dist/cdn/themes/organic.tokens.json +1 -1
  224. package/dist/cdn/themes/rose-pine-dark.tokens.json +1 -1
  225. package/dist/cdn/themes/rose-pine.css +1 -1
  226. package/dist/cdn/themes/rose-pine.tokens.json +1 -1
  227. package/dist/cdn/themes/rough-dark.tokens.json +1 -1
  228. package/dist/cdn/themes/rough.css +1 -1
  229. package/dist/cdn/themes/rough.tokens.json +1 -1
  230. package/dist/cdn/themes/solarized-dark.tokens.json +1 -1
  231. package/dist/cdn/themes/solarized.css +1 -1
  232. package/dist/cdn/themes/solarized.tokens.json +1 -1
  233. package/dist/cdn/themes/startup-dark.tokens.json +1 -1
  234. package/dist/cdn/themes/startup.css +1 -1
  235. package/dist/cdn/themes/startup.tokens.json +1 -1
  236. package/dist/cdn/themes/super2026-dark.tokens.json +1 -1
  237. package/dist/cdn/themes/super2026.css +1 -1
  238. package/dist/cdn/themes/super2026.tokens.json +1 -1
  239. package/dist/cdn/themes/swiss-dark.tokens.json +1 -1
  240. package/dist/cdn/themes/swiss.css +1 -1
  241. package/dist/cdn/themes/swiss.tokens.json +1 -1
  242. package/dist/cdn/themes/terminal.css +1 -1
  243. package/dist/cdn/themes/terminal.tokens.json +1 -1
  244. package/dist/cdn/themes/tokyo-night-dark.tokens.json +1 -1
  245. package/dist/cdn/themes/tokyo-night.css +1 -1
  246. package/dist/cdn/themes/tokyo-night.tokens.json +1 -1
  247. package/dist/cdn/themes/vaporwave-dark.tokens.json +1 -1
  248. package/dist/cdn/themes/vaporwave.css +1 -1
  249. package/dist/cdn/themes/vaporwave.tokens.json +1 -1
  250. package/dist/cdn/themes/win9x-dark.tokens.json +6 -2
  251. package/dist/cdn/themes/win9x.css +1 -1
  252. package/dist/cdn/themes/win9x.tokens.json +3 -1
  253. package/dist/cdn/vanilla-breeze-autoload.js +187 -297
  254. package/dist/cdn/vanilla-breeze-charts.css +1 -1
  255. package/dist/cdn/vanilla-breeze-charts.js +56 -32
  256. package/dist/cdn/vanilla-breeze-core.css +1 -1
  257. package/dist/cdn/vanilla-breeze-core.js +166 -262
  258. package/dist/cdn/vanilla-breeze-dev.js +1 -1
  259. package/dist/cdn/vanilla-breeze-extras.js +272 -130
  260. package/dist/cdn/vanilla-breeze.css +1 -1
  261. package/dist/cdn/vanilla-breeze.js +536 -621
  262. package/dist/cdn/view-transitions.css +2 -0
  263. package/package.json +15 -7
@@ -1,60 +1,61 @@
1
- var _e=Object.defineProperty;var C=(n,e)=>()=>(n&&(e=n(n=0)),e);var he=(n,e)=>{for(var t in e)_e(n,t,{get:e[t],enumerable:!0})};function A(n,e,t={}){let s=t.priority??10,r={impl:e,bundle:t.bundle,contract:t.contract,priority:s},i=ue.get(n);if(customElements.get(n)){if(!i||i.priority>=s){i&&i.priority===s&&i.impl!==e&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}" (priority ${i.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${n}> defined by "${i.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(i&&i.priority>=s){i.priority===s&&console.warn(`[VB Bundle] Tag <${n}> already registered by "${i.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}ue.set(n,r),customElements.define(n,e)}var Tt,ue,z=C(()=>{Tt=window.matchMedia("(prefers-reduced-motion: reduce)"),ue=new Map});var w,q=C(()=>{w=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,s,r){e.addEventListener(t,s,r),this.#e.push(()=>e.removeEventListener(t,s,r))}_reinit(){for(let e of this.#e)e();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#t||(this.#t=this.attachInternals());let s=this.#t.states;try{t?s.add(e):s.delete(e)}catch{let r=`--${e}`;t?s.add(r):s.delete(r)}}_adoptInternals(e){this.#t||(this.#t=e)}}});function B(n){if(!n||typeof n!="string")return"";let e=document.createElement("template");return e.innerHTML=n,e.content.querySelectorAll("script, iframe, object, embed, form, base, link, meta, noscript").forEach(r=>r.remove()),e.content.querySelectorAll("*").forEach(r=>{for(let i of[...r.attributes]){if(i.name.startsWith("on")){r.removeAttribute(i.name);continue}if(["href","src","action","formaction","xlink:href"].includes(i.name)){let l=i.value.trim().toLowerCase();(l.startsWith("javascript:")||l.startsWith("data:text/html"))&&r.removeAttribute(i.name);continue}(i.name==="srcdoc"||i.name==="data"&&r.tagName==="OBJECT")&&r.removeAttribute(i.name)}}),e.innerHTML}var V=C(()=>{});function K(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function ke(n){E=n}function u(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(b.caret,"$1"),t=t.replace(r,l),s},getRegex:()=>new RegExp(t,e)};return s}function y(n,e){if(e){if(b.escapeTest.test(n))return n.replace(b.escapeReplace,me)}else if(b.escapeTestNoEncode.test(n))return n.replace(b.escapeReplaceNoEncode,me);return n}function fe(n){try{n=encodeURI(n).replace(b.percentDecode,"%")}catch{return null}return n}function ge(n,e){let t=n.replace(b.findPipe,(i,l,o)=>{let a=!1,h=l;for(;--h>=0&&o[h]==="\\";)a=!a;return a?"|":" |"}),s=t.split(b.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(b.slashPipe,"|");return s}function L(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s;){let i=n.charAt(s-r-1);if(i===e&&!t)r++;else if(i!==e&&t)r++;else break}return n.slice(0,s-r)}function xt(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function wt(n,e=0){let t=e,s="";for(let r of n)if(r===" "){let i=4-t%4;s+=" ".repeat(i),t+=i}else s+=r,t++;return s}function be(n,e,t,s,r){let i=e.href,l=e.title||null,o=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let a={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:l,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,a}function yt(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
2
- `).map(i=>{let l=i.match(t.other.beginningSpace);if(l===null)return i;let[o]=l;return o.length>=r.length?i.slice(r.length):i}).join(`
3
- `)}function m(n,e){return $.parse(n,e)}var E,S,Be,b,Ne,Me,De,_,He,X,xe,we,Oe,J,Ze,Y,Fe,je,O,ee,Qe,ye,Ve,te,pe,Ue,We,Ge,Ke,ve,Xe,T,Z,re,Je,Ae,Ye,et,tt,Se,rt,st,$e,nt,it,lt,at,ot,ct,ht,ut,pt,dt,M,mt,Ee,Ce,ft,de,se,gt,U,bt,N,I,kt,me,D,k,H,ne,x,P,vt,$,It,Lt,Pt,_t,Bt,Nt,Mt,Te=C(()=>{E=K();S={exec:()=>null};Be=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},Ne=/^(?:[ \t]*(?:\n|$))+/,Me=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,De=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,He=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,X=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,xe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,we=u(xe).replace(/bull/g,X).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Oe=u(xe).replace(/bull/g,X).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),J=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ze=/^[^\n]+/,Y=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Fe=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Y).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),je=u(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,X).getRegex(),O="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ee=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Qe=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ee).replace("tag",O).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ye=u(J).replace("hr",_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",O).getRegex(),Ve=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ye).getRegex(),te={blockquote:Ve,code:Me,def:Fe,fences:De,heading:He,hr:_,html:Qe,lheading:we,list:je,newline:Ne,paragraph:ye,table:S,text:Ze},pe=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",O).getRegex(),Ue={...te,lheading:Oe,table:pe,paragraph:u(J).replace("hr",_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",pe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",O).getRegex()},We={...te,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ee).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:S,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(J).replace("hr",_).replace("heading",` *#{1,6} *[^
4
- ]`).replace("lheading",we).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ge=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ke=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ve=/^( {2,}|\\)\n(?!\s*$)/,Xe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,T=/[\p{P}\p{S}]/u,Z=/[\s\p{P}\p{S}]/u,re=/[^\s\p{P}\p{S}]/u,Je=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Z).getRegex(),Ae=/(?!~)[\p{P}\p{S}]/u,Ye=/(?!~)[\s\p{P}\p{S}]/u,et=/(?:[^\s\p{P}\p{S}]|~)/u,tt=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Be?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Se=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,rt=u(Se,"u").replace(/punct/g,T).getRegex(),st=u(Se,"u").replace(/punct/g,Ae).getRegex(),$e="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",nt=u($e,"gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Z).replace(/punct/g,T).getRegex(),it=u($e,"gu").replace(/notPunctSpace/g,et).replace(/punctSpace/g,Ye).replace(/punct/g,Ae).getRegex(),lt=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Z).replace(/punct/g,T).getRegex(),at=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,T).getRegex(),ot="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ct=u(ot,"gu").replace(/notPunctSpace/g,re).replace(/punctSpace/g,Z).replace(/punct/g,T).getRegex(),ht=u(/\\(punct)/,"gu").replace(/punct/g,T).getRegex(),ut=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),pt=u(ee).replace("(?:-->|$)","-->").getRegex(),dt=u("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",pt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,mt=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",M).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ee=u(/^!?\[(label)\]\[(ref)\]/).replace("label",M).replace("ref",Y).getRegex(),Ce=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",Y).getRegex(),ft=u("reflink|nolink(?!\\()","g").replace("reflink",Ee).replace("nolink",Ce).getRegex(),de=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,se={_backpedal:S,anyPunctuation:ht,autolink:ut,blockSkip:tt,br:ve,code:Ke,del:S,delLDelim:S,delRDelim:S,emStrongLDelim:rt,emStrongRDelimAst:nt,emStrongRDelimUnd:lt,escape:Ge,link:mt,nolink:Ce,punctuation:Je,reflink:Ee,reflinkSearch:ft,tag:dt,text:Xe,url:S},gt={...se,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",M).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",M).getRegex()},U={...se,emStrongRDelimAst:it,emStrongLDelim:st,delLDelim:at,delRDelim:ct,url:u(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",de).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:u(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",de).getRegex()},bt={...U,br:u(ve).replace("{2,}","*").getRegex(),text:u(U.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},N={normal:te,gfm:Ue,pedantic:We},I={normal:se,gfm:U,breaks:bt,pedantic:gt},kt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},me=n=>kt[n];D=class{options;rules;lexer;constructor(n){this.options=n||E}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:L(t,`
5
- `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],s=yt(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=L(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:L(e[0],`
6
- `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=L(e[0],`
1
+ var Ve=Object.defineProperty;var $=(i,e)=>()=>(i&&(e=i(i=0)),e);var fe=(i,e)=>{for(var t in e)Ve(i,t,{get:e[t],enumerable:!0})};function A(i,e,t={}){let r=t.priority??10,s={impl:e,bundle:t.bundle,contract:t.contract,priority:r},n=me.get(i);if(customElements.get(i)){if(!n||n.priority>=r){n&&n.priority===r&&n.impl!==e&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}" (priority ${n.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${i}> defined by "${n.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(n&&n.priority>=r){n.priority===r&&console.warn(`[VB Bundle] Tag <${i}> already registered by "${n.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}me.set(i,s),customElements.define(i,e)}var pr,me,L=$(()=>{pr=window.matchMedia("(prefers-reduced-motion: reduce)"),me=new Map});var w,z=$(()=>{w=class extends HTMLElement{#e=[];#r;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,r,s){e.addEventListener(t,r,s),this.#e.push(()=>e.removeEventListener(t,r,s))}_reinit(){for(let e of this.#e)e();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#r||(this.#r=this.attachInternals());let r=this.#r.states;try{t?r.add(e):r.delete(e)}catch{let s=`--${e}`;t?r.add(s):r.delete(s)}}_adoptInternals(e){this.#r||(this.#r=e)}#t(){return this.constructor.formAssociated&&this.#r?this.#r:null}get validity(){return this.#t()?.validity}get validationMessage(){return this.#t()?.validationMessage??""}get willValidate(){return this.#t()?.willValidate??!1}get form(){return this.#t()?.form??null}checkValidity(){return this.#t()?.checkValidity()??!0}reportValidity(){return this.#t()?.reportValidity()??!0}}});function nt(i){return String(i).replace(/[\u0000- \u007f-\u009f]/g,"").toLowerCase()}function ge(i,e=!1){let t=nt(i);return e?/(^|,)(javascript|vbscript|livescript):/.test(t)?!0:/(^|,)data:/.test(t)?t.split(/(?=data:)/).filter(s=>s.startsWith("data:")).some(s=>!/^data:(image|audio|video|font)\//.test(s)):!1:/^(javascript|vbscript|livescript|data):/.test(t)}function ke(i){let e=String(i).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\\/g,"").replace(/\s+/g,"").toLowerCase();return/expression\(|javascript:|vbscript:|-moz-binding|behavior:|@import|position:fixed/.test(e)}function ot(i,e){if(We.has(e))return!0;let t=i.namespaceURI;return!!(t&&!Qe.has(t)||e==="title"&&t!==j||be.has(e)&&t===j&&i.children?.length||Ge.has(e)&&(i.getAttribute("attributeName")||i.getAttribute("attributename")||"").toLowerCase().includes("href"))}function ct(i,e){for(let t of[...i.attributes]){let r=t.name.toLowerCase();if(r.startsWith("on")||Je.has(r)||!e.keepIds&&Ye.has(r)){i.removeAttribute(t.name);continue}if(r==="style"){(!e.keepStyle||ke(t.value))&&i.removeAttribute(t.name);continue}if((r==="id"||r==="name")&&!e.keepIds){let s=lt(t.value);r==="id"?e.ids.set(t.value,s):e.ids.set(`name:${t.value}`,s),i.setAttribute(t.name,s);continue}if(Ke.has(r)||r.endsWith(":href")){ge(t.value,!1)&&i.removeAttribute(t.name);continue}Xe.has(r)&&ge(t.value,!0)&&i.removeAttribute(t.name)}}function ht(i,e){let t=(i.getAttribute("type")||"").toLowerCase();e==="button"&&t!=="button"&&i.setAttribute("type","button"),e==="input"&&/^(submit|reset|image)$/.test(t)&&i.setAttribute("type","button")}function ut(i,e){for(let t of i)for(let r of[...t.attributes]){let s=r.name.toLowerCase(),n=r.value;if((s==="href"||s.endsWith(":href"))&&n.startsWith("#")){let a=pt(n.slice(1));e.has(a)&&t.setAttribute(r.name,`#${e.get(a)}`)}else if(s==="usemap"&&n.startsWith("#")){let a=e.get(`name:${n.slice(1)}`);a?t.setAttribute(r.name,`#${a}`):t.removeAttribute(r.name)}else if(et.has(s)){let a=n.split(/\s+/).filter(Boolean).map(o=>e.get(o)||(o.startsWith(Q)?o:null)).filter(Boolean);a.length?t.setAttribute(r.name,a.join(" ")):t.removeAttribute(r.name)}else n.includes("url(#")&&t.setAttribute(r.name,n.replace(/url\(#([^)]+)\)/g,(a,o)=>e.has(o)?`url(#${e.get(o)})`:a))}}function pt(i){try{return decodeURIComponent(i)}catch{return i}}function xe(i){let e=i.childNodes;if(e)for(let t of[...e])t.nodeType===8?t.remove():(t.nodeType===1||t.nodeType===11)&&xe(t)}function we(i,e){xe(i);let t=[...i.querySelectorAll("*")];e.includeRoot&&t.unshift(i);let r=new Map,s=[],n={...e,ids:r};for(let a of t){if(!ft(a,i))continue;let o=at(a);if(e.svgOnly&&(be.has(o)||o==="style")){if(o==="style"&&ke(a.textContent||"")){a.remove();continue}}else if(ot(a,o)){a.remove();continue}if(!e.keepIds&&!e.svgOnly&&rt.has(o)){dt(a);continue}if(o==="template"){let h=a.content;h&&we(h,{...e,includeRoot:!1})}ct(a,n),e.keepIds||ht(a,o);let l=tt[o];if(l)for(let h of l)a.removeAttribute(h);if(o==="include-file"&&!e.allowIncludeFile&&a.removeAttribute("src"),!e.keepIds&&!e.svgOnly&&o.includes("-")&&o!=="include-file"&&!it.has(o))for(let h of st)a.removeAttribute(h);s.push(a)}!e.keepIds&&r.size&&ut(s,r)}function dt(i){let e=i.parentNode;if(e){for(let t of[...i.childNodes])e.insertBefore(t,i);i.remove()}}function ft(i,e){let t=i;for(;t;){if(t===e)return!0;t=t.parentNode??t.parent??null}return!1}function q(i,e={}){let t=document.createElement("template");return i&&typeof i=="string"&&(t.innerHTML=i,we(t.content,{allowIncludeFile:!!e.allowIncludeFile,keepIds:!!e.keepIds,keepStyle:!!e.keepStyle})),t.content}var Ze,j,je,Qe,Q,We,be,Ge,Ke,Xe,Je,Ye,et,tt,rt,st,it,at,lt,W=$(()=>{Ze="http://www.w3.org/1999/xhtml",j="http://www.w3.org/2000/svg",je="http://www.w3.org/1998/Math/MathML",Qe=new Set([Ze,j,je]),Q="user-content-",We=new Set(["script","iframe","frame","frameset","object","embed","applet","portal","fencedframe","form","base","link","meta","noscript","foreignobject","style","xmp","noembed","noframes","plaintext","mglyph","malignmark","annotation-xml"]),be=new Set(["title","desc"]),Ge=new Set(["animate","set","animatemotion","animatetransform"]),Ke=new Set(["href","xlink:href","action","formaction","data","codebase","cite","background","longdesc","manifest","to","from","values","by"]),Xe=new Set(["src","poster","srcset"]),Je=new Set(["srcdoc","form","formaction","formmethod","formtarget","formenctype","formnovalidate","action","method","ping"]),Ye=new Set(["popovertarget","popovertargetaction","commandfor","command","interestfor","autofocus"]),et=new Set(["for","headers","list","aria-labelledby","aria-describedby","aria-controls","aria-owns","aria-flowto","aria-details","aria-errormessage","aria-activedescendant"]),tt={"include-file":["trusted","allow-scripts","allow-cross-origin"],"markdown-viewer":["src","sanitize","ping","allow-cross-origin"]},rt=new Set(["social-embed","youtube-player","geo-map"]),st=["src","src-dark","data-src","url","endpoint","tile-url","data-versions"],it=new Set(["audio-player","video-player","image-map","brand-mark"]);at=i=>String(i.localName||i.tagName||"").toLowerCase(),lt=i=>i.startsWith(Q)?i:Q+i});function J(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}function $e(i){T=i}function u(i,e=""){let t=typeof i=="string"?i:i.source,r={replace:(s,n)=>{let a=typeof n=="string"?n:n.source;return a=a.replace(b.caret,"$1"),t=t.replace(s,a),r},getRegex:()=>new RegExp(t,e)};return r}function y(i,e){if(e){if(b.escapeTest.test(i))return i.replace(b.escapeReplace,Ae)}else if(b.escapeTestNoEncode.test(i))return i.replace(b.escapeReplaceNoEncode,Ae);return i}function Se(i){try{i=encodeURI(i).replace(b.percentDecode,"%")}catch{return null}return i}function Ee(i,e){let t=i.replace(b.findPipe,(n,a,o)=>{let l=!1,h=a;for(;--h>=0&&o[h]==="\\";)l=!l;return l?"|":" |"}),r=t.split(b.splitPipe),s=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(b.slashPipe,"|");return r}function _(i,e,t){let r=i.length;if(r===0)return"";let s=0;for(;s<r;){let n=i.charAt(r-s-1);if(n===e&&!t)s++;else if(n!==e&&t)s++;else break}return i.slice(0,r-s)}function Jt(i,e){if(i.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<i.length;r++)if(i[r]==="\\")r++;else if(i[r]===e[0])t++;else if(i[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function Yt(i,e=0){let t=e,r="";for(let s of i)if(s===" "){let n=4-t%4;r+=" ".repeat(n),t+=n}else r+=s,t++;return r}function Te(i,e,t,r,s){let n=e.href,a=e.title||null,o=i[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:i[0].charAt(0)==="!"?"image":"link",raw:t,href:n,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,l}function er(i,e,t){let r=i.match(t.other.indentCodeCompensation);if(r===null)return e;let s=r[1];return e.split(`
2
+ `).map(n=>{let a=n.match(t.other.beginningSpace);if(a===null)return n;let[o]=a;return o.length>=s.length?n.slice(s.length):n}).join(`
3
+ `)}function f(i,e){return E.parse(i,e)}var T,S,mt,b,gt,bt,kt,M,xt,Y,Re,Ce,wt,ee,yt,te,vt,At,O,re,St,Le,Et,se,ye,Tt,$t,Rt,Ct,ze,Lt,R,U,ie,zt,Ie,It,_t,Nt,_e,Mt,qt,Ne,Pt,Bt,Dt,Ht,Ot,Ut,Ft,Vt,Zt,jt,B,Qt,Me,qe,Wt,ve,ne,Gt,G,Kt,P,I,Xt,Ae,D,k,H,ae,x,N,le,E,gr,br,kr,xr,wr,yr,vr,Pe=$(()=>{T=J();S={exec:()=>null};mt=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:i=>new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}#`),htmlBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:i=>new RegExp(`^ {0,${Math.min(3,i-1)}}>`)},gt=/^(?:[ \t]*(?:\n|$))+/,bt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,kt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,M=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,xt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Y=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Re=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ce=u(Re).replace(/bull/g,Y).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),wt=u(Re).replace(/bull/g,Y).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ee=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,yt=/^[^\n]+/,te=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vt=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",te).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),At=u(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Y).getRegex(),O="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",re=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,St=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",re).replace("tag",O).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Le=u(ee).replace("hr",M).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",O).getRegex(),Et=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Le).getRegex(),se={blockquote:Et,code:bt,def:vt,fences:kt,heading:xt,hr:M,html:St,lheading:Ce,list:At,newline:gt,paragraph:Le,table:S,text:yt},ye=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",M).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",O).getRegex(),Tt={...se,lheading:wt,table:ye,paragraph:u(ee).replace("hr",M).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ye).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",O).getRegex()},$t={...se,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",re).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:S,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(ee).replace("hr",M).replace("heading",` *#{1,6} *[^
4
+ ]`).replace("lheading",Ce).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Rt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ct=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ze=/^( {2,}|\\)\n(?!\s*$)/,Lt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,R=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,ie=/[^\s\p{P}\p{S}]/u,zt=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U).getRegex(),Ie=/(?!~)[\p{P}\p{S}]/u,It=/(?!~)[\s\p{P}\p{S}]/u,_t=/(?:[^\s\p{P}\p{S}]|~)/u,Nt=u(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",mt?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),_e=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Mt=u(_e,"u").replace(/punct/g,R).getRegex(),qt=u(_e,"u").replace(/punct/g,Ie).getRegex(),Ne="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Pt=u(Ne,"gu").replace(/notPunctSpace/g,ie).replace(/punctSpace/g,U).replace(/punct/g,R).getRegex(),Bt=u(Ne,"gu").replace(/notPunctSpace/g,_t).replace(/punctSpace/g,It).replace(/punct/g,Ie).getRegex(),Dt=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ie).replace(/punctSpace/g,U).replace(/punct/g,R).getRegex(),Ht=u(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,R).getRegex(),Ot="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Ut=u(Ot,"gu").replace(/notPunctSpace/g,ie).replace(/punctSpace/g,U).replace(/punct/g,R).getRegex(),Ft=u(/\\(punct)/,"gu").replace(/punct/g,R).getRegex(),Vt=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Zt=u(re).replace("(?:-->|$)","-->").getRegex(),jt=u("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Zt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),B=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Qt=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",B).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Me=u(/^!?\[(label)\]\[(ref)\]/).replace("label",B).replace("ref",te).getRegex(),qe=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",te).getRegex(),Wt=u("reflink|nolink(?!\\()","g").replace("reflink",Me).replace("nolink",qe).getRegex(),ve=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ne={_backpedal:S,anyPunctuation:Ft,autolink:Vt,blockSkip:Nt,br:ze,code:Ct,del:S,delLDelim:S,delRDelim:S,emStrongLDelim:Mt,emStrongRDelimAst:Pt,emStrongRDelimUnd:Dt,escape:Rt,link:Qt,nolink:qe,punctuation:zt,reflink:Me,reflinkSearch:Wt,tag:jt,text:Lt,url:S},Gt={...ne,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",B).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B).getRegex()},G={...ne,emStrongRDelimAst:Bt,emStrongLDelim:qt,delLDelim:Ht,delRDelim:Ut,url:u(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",ve).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:u(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",ve).getRegex()},Kt={...G,br:u(ze).replace("{2,}","*").getRegex(),text:u(G.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},P={normal:se,gfm:Tt,pedantic:$t},I={normal:ne,gfm:G,breaks:Kt,pedantic:Gt},Xt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ae=i=>Xt[i];D=class{options;rules;lexer;constructor(i){this.options=i||T}space(i){let e=this.rules.block.newline.exec(i);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(i){let e=this.rules.block.code.exec(i);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:_(t,`
5
+ `)}}}fences(i){let e=this.rules.block.fences.exec(i);if(e){let t=e[0],r=er(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(i){let e=this.rules.block.heading.exec(i);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=_(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(i){let e=this.rules.block.hr.exec(i);if(e)return{type:"hr",raw:_(e[0],`
6
+ `)}}blockquote(i){let e=this.rules.block.blockquote.exec(i);if(e){let t=_(e[0],`
7
7
  `).split(`
8
- `),s="",r="",i=[];for(;t.length>0;){let l=!1,o=[],a;for(a=0;a<t.length;a++)if(this.rules.other.blockquoteStart.test(t[a]))o.push(t[a]),l=!0;else if(!l)o.push(t[a]);else break;t=t.slice(a);let h=o.join(`
8
+ `),r="",s="",n=[];for(;t.length>0;){let a=!1,o=[],l;for(l=0;l<t.length;l++)if(this.rules.other.blockquoteStart.test(t[l]))o.push(t[l]),a=!0;else if(!a)o.push(t[l]);else break;t=t.slice(l);let h=o.join(`
9
9
  `),c=h.replace(this.rules.other.blockquoteSetextReplace,`
10
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
11
- ${h}`:h,r=r?`${r}
12
- ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=d,t.length===0)break;let p=i.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let g=p,f=g.raw+`
10
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
11
+ ${h}`:h,s=s?`${s}
12
+ ${c}`:c;let d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,n,!0),this.lexer.state.top=d,t.length===0)break;let p=n.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let g=p,m=g.raw+`
13
13
  `+t.join(`
14
- `),v=this.blockquote(f);i[i.length-1]=v,s=s.substring(0,s.length-g.raw.length)+v.raw,r=r.substring(0,r.length-g.text.length)+v.text;break}else if(p?.type==="list"){let g=p,f=g.raw+`
14
+ `),v=this.blockquote(m);n[n.length-1]=v,r=r.substring(0,r.length-g.raw.length)+v.raw,s=s.substring(0,s.length-g.text.length)+v.text;break}else if(p?.type==="list"){let g=p,m=g.raw+`
15
15
  `+t.join(`
16
- `),v=this.list(f);i[i.length-1]=v,s=s.substring(0,s.length-p.raw.length)+v.raw,r=r.substring(0,r.length-g.raw.length)+v.raw,t=f.substring(i.at(-1).raw.length).split(`
17
- `);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim(),s=t.length>1,r={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");let i=this.rules.other.listItemRegex(t),l=!1;for(;n;){let a=!1,h="",c="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;h=e[0],n=n.substring(h.length);let d=wt(e[2].split(`
18
- `,1)[0],e[1].length),p=n.split(`
19
- `,1)[0],g=!d.trim(),f=0;if(this.options.pedantic?(f=2,c=d.trimStart()):g?f=e[1].length+1:(f=d.search(this.rules.other.nonSpaceChar),f=f>4?1:f,c=d.slice(f),f+=e[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+`
20
- `,n=n.substring(p.length+1),a=!0),!a){let v=this.rules.other.nextBulletRegex(f),ae=this.rules.other.hrRegex(f),oe=this.rules.other.fencesBeginRegex(f),ce=this.rules.other.headingBeginRegex(f),Le=this.rules.other.htmlBeginRegex(f),Pe=this.rules.other.blockquoteBeginRegex(f);for(;n;){let Q=n.split(`
21
- `,1)[0],R;if(p=Q,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),R=p):R=p.replace(this.rules.other.tabCharGlobal," "),oe.test(p)||ce.test(p)||Le.test(p)||Pe.test(p)||v.test(p)||ae.test(p))break;if(R.search(this.rules.other.nonSpaceChar)>=f||!p.trim())c+=`
22
- `+R.slice(f);else{if(g||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||oe.test(d)||ce.test(d)||ae.test(d))break;c+=`
23
- `+p}g=!p.trim(),h+=Q+`
24
- `,n=n.substring(Q.length+1),d=R.slice(f)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(l=!0)),r.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),r.raw+=h}let o=r.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let a of r.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(a.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};a.checked=c.checked,r.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=c.raw+a.tokens[0].raw,a.tokens[0].text=c.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(c)):a.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):a.tokens.unshift(c)}}if(!r.loose){let h=a.tokens.filter(d=>d.type==="space"),c=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=c}}if(r.loose)for(let a of r.items){a.loose=!0;for(let h of a.tokens)h.type==="text"&&(h.type="paragraph")}return r}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:r}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=ge(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
- `):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<t.length;l++)i.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:i.align[l]});for(let l of r)i.rows.push(ge(l,i.header.length).map((o,a)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[a]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e){let t=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
26
- `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let i=L(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{let i=xt(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s=s.slice(1):s=s.slice(1,-1)),be(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return be(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||!s[1]&&!s[2]&&!s[3]&&!s[4]||s[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[3])||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,i,l,o=r,a=0,h=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*n.length+r);(s=h.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){o+=l;continue}else if((s[5]||s[6])&&r%3&&!((r+l)%3)){a+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o+a);let c=[...s[0]][0].length,d=n.slice(0,r+s.index+c+l);if(Math.min(r,l)%2){let g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n,e,t=""){let s=this.rules.inline.delLDelim.exec(n);if(s&&(!s[1]||!t||this.rules.inline.punctuation.exec(t))){let r=[...s[0]].length-1,i,l,o=r,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*n.length+r);(s=a.exec(e))!==null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i||(l=[...i].length,l!==r))continue;if(s[3]||s[4]){o+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o);let h=[...s[0]][0].length,c=n.slice(0,r+s.index+h+l),d=c.slice(r,-r);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let t,s;return e[2]==="@"?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,s;if(e[2]==="@")t=e[0],s="mailto:"+t;else{let r;do r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(r!==e[0]);t=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},k=class W{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||E,this.options.tokenizer=this.options.tokenizer||new D,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:b,block:N.normal,inline:I.normal};this.options.pedantic?(t.block=N.pedantic,t.inline=I.pedantic):this.options.gfm&&(t.block=N.gfm,this.options.breaks?t.inline=I.breaks:t.inline=I.gfm),this.tokenizer.rules=t}static get rules(){return{block:N,inline:I}}static lex(e,t){return new W(t).lex(e)}static lexInline(e,t){return new W(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
27
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(l=>(r=l.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let l=t.at(-1);r.raw.length===1&&l!==void 0?l.raw+=`
28
- `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
16
+ `),v=this.list(m);n[n.length-1]=v,r=r.substring(0,r.length-p.raw.length)+v.raw,s=s.substring(0,s.length-g.raw.length)+v.raw,t=m.substring(n.at(-1).raw.length).split(`
17
+ `);continue}}return{type:"blockquote",raw:r,tokens:n,text:s}}}list(i){let e=this.rules.block.list.exec(i);if(e){let t=e[1].trim(),r=t.length>1,s={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");let n=this.rules.other.listItemRegex(t),a=!1;for(;i;){let l=!1,h="",c="";if(!(e=n.exec(i))||this.rules.block.hr.test(i))break;h=e[0],i=i.substring(h.length);let d=Yt(e[2].split(`
18
+ `,1)[0],e[1].length),p=i.split(`
19
+ `,1)[0],g=!d.trim(),m=0;if(this.options.pedantic?(m=2,c=d.trimStart()):g?m=e[1].length+1:(m=d.search(this.rules.other.nonSpaceChar),m=m>4?1:m,c=d.slice(m),m+=e[1].length),g&&this.rules.other.blankLine.test(p)&&(h+=p+`
20
+ `,i=i.substring(p.length+1),l=!0),!l){let v=this.rules.other.nextBulletRegex(m),ue=this.rules.other.hrRegex(m),pe=this.rules.other.fencesBeginRegex(m),de=this.rules.other.headingBeginRegex(m),Ue=this.rules.other.htmlBeginRegex(m),Fe=this.rules.other.blockquoteBeginRegex(m);for(;i;){let Z=i.split(`
21
+ `,1)[0],C;if(p=Z,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),C=p):C=p.replace(this.rules.other.tabCharGlobal," "),pe.test(p)||de.test(p)||Ue.test(p)||Fe.test(p)||v.test(p)||ue.test(p))break;if(C.search(this.rules.other.nonSpaceChar)>=m||!p.trim())c+=`
22
+ `+C.slice(m);else{if(g||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||pe.test(d)||de.test(d)||ue.test(d))break;c+=`
23
+ `+p}g=!p.trim(),h+=Z+`
24
+ `,i=i.substring(Z.length+1),d=C.slice(m)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0)),s.items.push({type:"list_item",raw:h,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),s.raw+=h}let o=s.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l of s.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let h=this.rules.other.listTaskCheckbox.exec(l.raw);if(h){let c={type:"checkbox",raw:h[0]+" ",checked:h[0]!=="[ ]"};l.checked=c.checked,s.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=c.raw+l.tokens[0].raw,l.tokens[0].text=c.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(c)):l.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):l.tokens.unshift(c)}}if(!s.loose){let h=l.tokens.filter(d=>d.type==="space"),c=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=c}}if(s.loose)for(let l of s.items){l.loose=!0;for(let h of l.tokens)h.type==="text"&&(h.type="paragraph")}return s}}html(i){let e=this.rules.block.html.exec(i);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(i){let e=this.rules.block.def.exec(i);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:s}}}table(i){let e=this.rules.block.table.exec(i);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=Ee(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
+ `):[],n={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?n.align.push("right"):this.rules.other.tableAlignCenter.test(a)?n.align.push("center"):this.rules.other.tableAlignLeft.test(a)?n.align.push("left"):n.align.push(null);for(let a=0;a<t.length;a++)n.header.push({text:t[a],tokens:this.lexer.inline(t[a]),header:!0,align:n.align[a]});for(let a of s)n.rows.push(Ee(a,n.header.length).map((o,l)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:n.align[l]})));return n}}lheading(i){let e=this.rules.block.lheading.exec(i);if(e){let t=e[1].trim();return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:t,tokens:this.lexer.inline(t)}}}paragraph(i){let e=this.rules.block.paragraph.exec(i);if(e){let t=e[1].charAt(e[1].length-1)===`
26
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(i){let e=this.rules.block.text.exec(i);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(i){let e=this.rules.inline.escape.exec(i);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(i){let e=this.rules.inline.tag.exec(i);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(i){let e=this.rules.inline.link.exec(i);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let n=_(t.slice(0,-1),"\\");if((t.length-n.length)%2===0)return}else{let n=Jt(e[2],"()");if(n===-2)return;if(n>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+n;e[2]=e[2].substring(0,n),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){let n=this.rules.other.pedanticHrefTitle.exec(r);n&&(r=n[1],s=n[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),Te(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(i,e){let t;if((t=this.rules.inline.reflink.exec(i))||(t=this.rules.inline.nolink.exec(i))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){let n=t[0].charAt(0);return{type:"text",raw:n,text:n}}return Te(t,s,t[0],this.lexer,this.rules)}}emStrong(i,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(i);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,n,a,o=s,l=0,h=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*i.length+s);(r=h.exec(e))!==null;){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n)continue;if(a=[...n].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&s%3&&!((s+a)%3)){l+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+l);let c=[...r[0]][0].length,d=i.slice(0,s+r.index+c+a);if(Math.min(s,a)%2){let g=d.slice(1,-1);return{type:"em",raw:d,text:g,tokens:this.lexer.inlineTokens(g)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(i){let e=this.rules.inline.code.exec(i);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(i){let e=this.rules.inline.br.exec(i);if(e)return{type:"br",raw:e[0]}}del(i,e,t=""){let r=this.rules.inline.delLDelim.exec(i);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let s=[...r[0]].length-1,n,a,o=s,l=this.rules.inline.delRDelim;for(l.lastIndex=0,e=e.slice(-1*i.length+s);(r=l.exec(e))!==null;){if(n=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!n||(a=[...n].length,a!==s))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let h=[...r[0]][0].length,c=i.slice(0,s+r.index+h+a),d=c.slice(s,-s);return{type:"del",raw:c,text:d,tokens:this.lexer.inlineTokens(d)}}}}autolink(i){let e=this.rules.inline.autolink.exec(i);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(i){let e;if(e=this.rules.inline.url.exec(i)){let t,r;if(e[2]==="@")t=e[0],r="mailto:"+t;else{let s;do s=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(s!==e[0]);t=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(i){let e=this.rules.inline.text.exec(i);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},k=class K{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new D,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:b,block:P.normal,inline:I.normal};this.options.pedantic?(t.block=P.pedantic,t.inline=I.pedantic):this.options.gfm&&(t.block=P.gfm,this.options.breaks?t.inline=I.breaks:t.inline=I.gfm),this.tokenizer.rules=t}static get rules(){return{block:P,inline:I}}static lex(e,t){return new K(t).lex(e)}static lexInline(e,t){return new K(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
27
+ `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let s;if(this.options.extensions?.block?.some(a=>(s=a.call({lexer:this},e,t))?(e=e.substring(s.raw.length),t.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let a=t.at(-1);s.raw.length===1&&a!==void 0?a.raw+=`
28
+ `:t.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
29
29
  `)?"":`
30
- `)+r.raw,l.text+=`
31
- `+r.text,this.inlineQueue.at(-1).src=l.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let l=t.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
30
+ `)+s.raw,a.text+=`
31
+ `+s.text,this.inlineQueue.at(-1).src=a.text):t.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="paragraph"||a?.type==="text"?(a.raw+=(a.raw.endsWith(`
32
32
  `)?"":`
33
- `)+r.raw,l.text+=`
34
- `+r.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let l=1/0,o=e.slice(1),a;this.options.extensions.startBlock.forEach(h=>{a=h.call({lexer:this},o),typeof a=="number"&&a>=0&&(l=Math.min(l,a))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let l=t.at(-1);s&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
33
+ `)+s.raw,a.text+=`
34
+ `+s.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},t.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),t.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),t.push(s);continue}let n=e;if(this.options.extensions?.startBlock){let a=1/0,o=e.slice(1),l;this.options.extensions.startBlock.forEach(h=>{l=h.call({lexer:this},o),typeof l=="number"&&l>=0&&(a=Math.min(a,l))}),a<1/0&&a>=0&&(n=e.substring(0,a+1))}if(this.state.top&&(s=this.tokenizer.paragraph(n))){let a=t.at(-1);r&&a?.type==="paragraph"?(a.raw+=(a.raw.endsWith(`
35
35
  `)?"":`
36
- `)+r.raw,l.text+=`
37
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(r),s=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let l=t.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
36
+ `)+s.raw,a.text+=`
37
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(s),r=n.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let a=t.at(-1);a?.type==="text"?(a.raw+=(a.raw.endsWith(`
38
38
  `)?"":`
39
- `)+r.raw,l.text+=`
40
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(r);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let s=e,r=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!==null;)a.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!==null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!==null;)i=r[2]?r[2].length:0,s=s.slice(0,r.index+i)+"["+"a".repeat(r[0].length-i-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let l=!1,o="";for(;e;){l||(o=""),l=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e,s,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),p;this.options.extensions.startInline.forEach(g=>{p=g.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(h)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),l=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},H=class{options;parser;constructor(n){this.options=n||E}space(n){return""}code({text:n,lang:e,escaped:t}){let s=(e||"").match(b.notSpaceStart)?.[0],r=n.replace(b.endingNewline,"")+`
41
- `;return s?'<pre><code class="language-'+y(s)+'">'+(t?r:y(r,!0))+`</code></pre>
42
- `:"<pre><code>"+(t?r:y(r,!0))+`</code></pre>
43
- `}blockquote({tokens:n}){return`<blockquote>
44
- ${this.parser.parse(n)}</blockquote>
45
- `}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
46
- `}hr(n){return`<hr>
47
- `}list(n){let e=n.ordered,t=n.start,s="";for(let l=0;l<n.items.length;l++){let o=n.items[l];s+=this.listitem(o)}let r=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+r+i+`>
48
- `+s+"</"+r+`>
49
- `}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
50
- `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
51
- `}table(n){let e="",t="";for(let r=0;r<n.header.length;r++)t+=this.tablecell(n.header[r]);e+=this.tablerow({text:t});let s="";for(let r=0;r<n.rows.length;r++){let i=n.rows[r];t="";for(let l=0;l<i.length;l++)t+=this.tablecell(i[l]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
39
+ `)+s.raw,a.text+=`
40
+ `+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(s);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let r=e,s=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let n;for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)n=s[2]?s[2].length:0,r=r.slice(0,s.index+n)+"["+"a".repeat(s[0].length-n-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,o="";for(;e;){a||(o=""),a=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=t.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(l=this.tokenizer.emStrong(e,r,o)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.del(e,r,o)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),t.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),t.push(l);continue}let h=e;if(this.options.extensions?.startInline){let c=1/0,d=e.slice(1),p;this.options.extensions.startInline.forEach(g=>{p=g.call({lexer:this},d),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(h)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(o=l.raw.slice(-1)),a=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):t.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},H=class{options;parser;constructor(i){this.options=i||T}space(i){return""}code({text:i,lang:e,escaped:t}){let r=(e||"").match(b.notSpaceStart)?.[0],s=i.replace(b.endingNewline,"")+`
41
+ `;return r?'<pre><code class="language-'+y(r)+'">'+(t?s:y(s,!0))+`</code></pre>
42
+ `:"<pre><code>"+(t?s:y(s,!0))+`</code></pre>
43
+ `}blockquote({tokens:i}){return`<blockquote>
44
+ ${this.parser.parse(i)}</blockquote>
45
+ `}html({text:i}){return i}def(i){return""}heading({tokens:i,depth:e}){return`<h${e}>${this.parser.parseInline(i)}</h${e}>
46
+ `}hr(i){return`<hr>
47
+ `}list(i){let e=i.ordered,t=i.start,r="";for(let a=0;a<i.items.length;a++){let o=i.items[a];r+=this.listitem(o)}let s=e?"ol":"ul",n=e&&t!==1?' start="'+t+'"':"";return"<"+s+n+`>
48
+ `+r+"</"+s+`>
49
+ `}listitem(i){return`<li>${this.parser.parse(i.tokens)}</li>
50
+ `}checkbox({checked:i}){return"<input "+(i?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:i}){return`<p>${this.parser.parseInline(i)}</p>
51
+ `}table(i){let e="",t="";for(let s=0;s<i.header.length;s++)t+=this.tablecell(i.header[s]);e+=this.tablerow({text:t});let r="";for(let s=0;s<i.rows.length;s++){let n=i.rows[s];t="";for(let a=0;a<n.length;a++)t+=this.tablecell(n[a]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
52
52
  <thead>
53
53
  `+e+`</thead>
54
- `+s+`</table>
55
- `}tablerow({text:n}){return`<tr>
56
- ${n}</tr>
57
- `}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
58
- `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${y(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let s=this.parser.parseInline(t),r=fe(n);if(r===null)return s;n=r;let i='<a href="'+n+'"';return e&&(i+=' title="'+y(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=fe(n);if(r===null)return y(t);n=r;let i=`<img src="${n}" alt="${y(t)}"`;return e&&(i+=` title="${y(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:y(n.text)}},ne=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},x=class G{options;renderer;textRenderer;constructor(e){this.options=e||E,this.options.renderer=this.options.renderer||new H,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ne}static parse(e,t){return new G(t).parse(e)}static parseInline(e,t){return new G(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let s=0;s<e.length;s++){let r=e[s];if(this.options.extensions?.renderers?.[r.type]){let l=r,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){t+=o||"";continue}}let i=r;switch(i.type){case"space":{t+=this.renderer.space(i);break}case"hr":{t+=this.renderer.hr(i);break}case"heading":{t+=this.renderer.heading(i);break}case"code":{t+=this.renderer.code(i);break}case"table":{t+=this.renderer.table(i);break}case"blockquote":{t+=this.renderer.blockquote(i);break}case"list":{t+=this.renderer.list(i);break}case"checkbox":{t+=this.renderer.checkbox(i);break}case"html":{t+=this.renderer.html(i);break}case"def":{t+=this.renderer.def(i);break}case"paragraph":{t+=this.renderer.paragraph(i);break}case"text":{t+=this.renderer.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let s="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=o||"";continue}}let l=i;switch(l.type){case"escape":{s+=t.text(l);break}case"html":{s+=t.html(l);break}case"link":{s+=t.link(l);break}case"image":{s+=t.image(l);break}case"checkbox":{s+=t.checkbox(l);break}case"strong":{s+=t.strong(l);break}case"em":{s+=t.em(l);break}case"codespan":{s+=t.codespan(l);break}case"br":{s+=t.br(l);break}case"del":{s+=t.del(l);break}case"text":{s+=t.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},P=class{options;block;constructor(n){this.options=n||E}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(n=this.block){return n?k.lex:k.lexInline}provideParser(n=this.block){return n?x.parse:x.parseInline}},vt=class{defaults=K();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=x;Renderer=H;TextRenderer=ne;Lexer=k;Tokenizer=D;Hooks=P;constructor(...n){this.use(...n)}walkTokens(n,e){let t=[];for(let s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{let r=s;for(let i of r.header)t=t.concat(this.walkTokens(i.tokens,e));for(let i of r.rows)for(let l of i)t=t.concat(this.walkTokens(l.tokens,e));break}case"list":{let r=s;t=t.concat(this.walkTokens(r.items,e));break}default:{let r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{let l=r[i].flat(1/0);t=t.concat(this.walkTokens(l,e))}):r.tokens&&(t=t.concat(this.walkTokens(r.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){let i=e.renderers[r.name];i?e.renderers[r.name]=function(...l){let o=r.renderer.apply(this,l);return o===!1&&(o=i.apply(this,l)),o}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),t.renderer){let r=this.defaults.renderer||new H(this.defaults);for(let i in t.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,o=t.renderer[l],a=r[l];r[l]=(...h)=>{let c=o.apply(r,h);return c===!1&&(c=a.apply(r,h)),c||""}}s.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new D(this.defaults);for(let i in t.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,o=t.tokenizer[l],a=r[l];r[l]=(...h)=>{let c=o.apply(r,h);return c===!1&&(c=a.apply(r,h)),c}}s.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new P;for(let i in t.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,o=t.hooks[l],a=r[l];P.passThroughHooks.has(i)?r[l]=h=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(i))return(async()=>{let d=await o.call(r,h);return a.call(r,d)})();let c=o.call(r,h);return a.call(r,c)}:r[l]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(r,h);return d===!1&&(d=await a.apply(r,h)),d})();let c=o.apply(r,h);return c===!1&&(c=a.apply(r,h)),c}}s.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(l){let o=[];return o.push(i.call(this,l)),r&&(o=o.concat(r.call(this,l))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return k.lex(n,e??this.defaults)}parser(n,e){return x.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let s={...t},r={...this.defaults,...s},i=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=n),r.async)return(async()=>{let l=r.hooks?await r.hooks.preprocess(e):e,o=await(r.hooks?await r.hooks.provideLexer(n):n?k.lex:k.lexInline)(l,r),a=r.hooks?await r.hooks.processAllTokens(o):o;r.walkTokens&&await Promise.all(this.walkTokens(a,r.walkTokens));let h=await(r.hooks?await r.hooks.provideParser(n):n?x.parse:x.parseInline)(a,r);return r.hooks?await r.hooks.postprocess(h):h})().catch(i);try{r.hooks&&(e=r.hooks.preprocess(e));let l=(r.hooks?r.hooks.provideLexer(n):n?k.lex:k.lexInline)(e,r);r.hooks&&(l=r.hooks.processAllTokens(l)),r.walkTokens&&this.walkTokens(l,r.walkTokens);let o=(r.hooks?r.hooks.provideParser(n):n?x.parse:x.parseInline)(l,r);return r.hooks&&(o=r.hooks.postprocess(o)),o}catch(l){return i(l)}}}onError(n,e){return t=>{if(t.message+=`
59
- Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+y(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},$=new vt;m.options=m.setOptions=function(n){return $.setOptions(n),m.defaults=$.defaults,ke(m.defaults),m};m.getDefaults=K;m.defaults=E;m.use=function(...n){return $.use(...n),m.defaults=$.defaults,ke(m.defaults),m};m.walkTokens=function(n,e){return $.walkTokens(n,e)};m.parseInline=$.parseInline;m.Parser=x;m.parser=x.parse;m.Renderer=H;m.TextRenderer=ne;m.Lexer=k;m.lexer=k.lex;m.Tokenizer=D;m.Hooks=P;m.parse=m;It=m.options,Lt=m.setOptions,Pt=m.use,_t=m.walkTokens,Bt=m.parseInline,Nt=x.parse,Mt=k.lex});var Re={};he(Re,{MarkdownViewer:()=>F});var F,ze=C(()=>{z();q();Te();V();F=class extends w{#e=null;#t=null;#r=null;#i=null;#n=null;static get observedAttributes(){return["src"]}setup(){this.#l()}teardown(){this.#t?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(e,t,s){e==="src"&&s&&t!==s&&this.isConnected&&this.#l()}get parser(){return this.#e}set parser(e){this.#e=typeof e=="function"?e:null}get markdown(){return this.#i??this.#n??""}set markdown(e){let t=e==null?null:String(e);this.#i!==t&&(this.#i=t,this.#l())}async render(){await this.#l()}async reload(){this.getAttribute("src")&&await this.#l()}#s(){if(this.getAttribute("src"))return null;let e=this.querySelector('script[type="text/markdown"]');if(e)return e.textContent;let t=this.querySelector("template[data-md]");if(t)return t.content.textContent;let s=this.querySelector(":scope > pre");return s?s.textContent:null}async#l(){let e=this.getAttribute("src"),t;if(this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),e){this.#t?.abort(),this.#t=new AbortController,this.setAttribute("data-loading",""),this.#o("markdown-viewer:fetch",{src:e});try{let i=await fetch(e,{signal:this.#t.signal});if(!i.ok)throw new Error(`HTTP ${i.status}: ${i.statusText}`);t=await i.text()}catch(i){if(i.name==="AbortError")return;this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#o("markdown-viewer:error",{error:i.message});return}this.removeAttribute("data-loading")}else this.#i!=null?t=this.#i:t=this.#s();if(t==null)return;this.#n=t;let s;try{s=await(await this.#a())(t)}catch(i){this.setAttribute("data-error",""),this.#o("markdown-viewer:error",{error:i.message});return}this.#r||(this.#r=document.createElement("div"),this.#r.className="md-content",this.#r.setAttribute("part","content"),this.appendChild(this.#r)),this.#r.innerHTML=this.#u()?B(String(s??"")):s,this.#c(),this.setAttribute("data-rendered","");let r=this.getAttribute("ping");if(r&&navigator.sendBeacon?.(r,JSON.stringify({src:e||"inline"})),this.#o("markdown-viewer:rendered",{src:e,node:this.#r}),this.hasAttribute("highlight"))for(let i of this.#r.querySelectorAll('pre > code[class*="language-"]')){let l=i.className.match(/language-(\S+)/)?.[1]||"";this.#o("markdown-viewer:highlight",{node:i,language:l})}}async#a(){return this.#e?this.#e:e=>m.parse(e,{gfm:!0})}#u(){let e=this.getAttribute("sanitize");return e==null?!0:!/^(off|false)$/i.test(e.trim())}#c(){if(!this.#r)return;let e=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;e&&(this.#r.dataset.theme=e)}#o(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-viewer",F)});var qe={};he(qe,{MarkdownEditor:()=>j});var j,Ie=C(()=>{z();q();j=class extends w{#e=null;#t=null;#r=null;#i=null;#n="";#s=null;static get observedAttributes(){return["name","placeholder","rows"]}setup(){this.#l(),this.#a(),this.#c()}teardown(){this.#s!==null&&clearTimeout(this.#s),this.removeAttribute("data-editing")}attributeChangedCallback(e,t,s){!this.#e||t===s||(e==="name"&&(this.#e.name=s||""),e==="placeholder"&&(this.#e.placeholder=s||""),e==="rows"&&(this.#e.rows=parseInt(s,10)||10))}get value(){return this.#e?.value??""}set value(e){if(!this.#e)return;let t=e==null?"":String(e);this.#e.value!==t&&(this.#e.value=t,this.#c(),this.dispatchEvent(new CustomEvent("markdown-editor:change",{detail:{value:t,source:"api"},bubbles:!0})))}get textarea(){return this.#e}#l(){let t=this.querySelector("textarea")?.value||"";this.#r=document.createElement("section"),this.#r.className="md-editor-pane",this.#r.setAttribute("aria-label","Markdown source"),this.#i=document.createElement("section"),this.#i.className="md-preview-pane",this.#i.setAttribute("aria-label","Rendered preview"),this.#i.setAttribute("aria-live","polite"),this.#e=document.createElement("textarea"),this.#e.className="md-editor-input",this.#e.value=t,this.#e.name=this.getAttribute("name")||"",this.#e.placeholder=this.getAttribute("placeholder")||"Write markdown here...",this.#e.rows=parseInt(this.getAttribute("rows")??"",10)||10,this.#e.setAttribute("spellcheck","true"),this.#t=document.createElement("markdown-viewer"),this.hasAttribute("highlight")&&this.#t.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;s&&(this.#t.dataset.theme=s),this.#r.appendChild(this.#e),this.#i.appendChild(this.#t),this.innerHTML="",this.appendChild(this.#r),this.appendChild(this.#i),this.#n=t}#a(){let e=this.#e;e&&(this.listen(e,"input",()=>{this.#o("markdown-editor:input",{value:e.value}),this.#u()}),this.listen(e,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(e,"blur",()=>{this.removeAttribute("data-editing"),e.value!==this.#n&&(this.#n=e.value,this.#o("markdown-editor:change",{value:e.value}))}),this.hasAttribute("data-tab-indent")&&this.listen(e,"keydown",t=>{let s=t;if(s.key==="Tab"&&!s.shiftKey&&!s.ctrlKey&&!s.metaKey){s.preventDefault();let{selectionStart:r,selectionEnd:i}=e;e.setRangeText(" ",r,i,"end"),e.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#u(){this.#s!==null&&clearTimeout(this.#s),this.#s=setTimeout(()=>this.#c(),150)}#c(){if(!this.#t)return;let e=this.#e?.value||"";if(!e.trim()){let s=this.#t.querySelector(".md-content");s&&(s.innerHTML="");return}let t=this.#t.querySelector('script[type="text/markdown"]');t||(t=document.createElement("script"),t.type="text/markdown",this.#t.prepend(t)),t.textContent=e,this.#t.removeAttribute("data-rendered"),this.#t.render?.()}#o(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-editor",j)});z();q();V();z();q();var At=n=>Math.max(10,Math.ceil(n*.1)),ie=class extends w{static formAssociated=!0;static observedAttributes=["value","disabled","placeholder","label","submit-label","cancel-label","data-show-cancel"];#e;#t=null;#r=null;#i=null;#n=null;#s=null;#l=null;#a=null;#u=null;#c=!1;#o=!1;constructor(){super(),this.#e=this.attachInternals(),this._adoptInternals(this.#e)}setup(){Promise.resolve().then(()=>(ze(),Re)).catch(()=>console.warn('[VB] comment-box: markdown-viewer failed to load (missing importmap for "marked"?)')),Promise.resolve().then(()=>(Ie(),qe)).catch(()=>console.warn("[VB] comment-box: markdown-editor failed to load"));let e=[...this.querySelectorAll(':scope > [slot="toolbar"]'),...this.querySelectorAll(":scope > .comment-box-actions > .comment-box-toolbar > *")],t=this.querySelector(":scope > markdown-editor");if(!t){t=document.createElement("markdown-editor");let r=document.createElement("textarea");this.hasAttribute("value")&&(r.value=this.getAttribute("value")||""),t.appendChild(r)}this.#t=t,this.hasAttribute("placeholder")&&this.#t.setAttribute("placeholder",this.getAttribute("placeholder")||""),this.#r=document.createElement("div"),this.#r.className="comment-box-actions",this.#i=document.createElement("div"),this.#i.className="comment-box-toolbar",e.forEach(r=>this.#i?.appendChild(r)),e.length&&(this.#i.setAttribute("role","group"),this.#i.setAttribute("aria-label","Comment tools")),this.#r.appendChild(this.#i);let s=document.createElement("div");s.className="comment-box-buttons",this.#s=null,this.hasAttribute("data-show-cancel")&&(this.#s=this.#w(),s.appendChild(this.#s)),this.#n=document.createElement("button"),this.#n.type="button",this.#n.className="comment-box-submit",this.#n.textContent=this.getAttribute("submit-label")||"Comment",s.appendChild(this.#n),this.#r.appendChild(s),this.#l=null,this.#a=null,this.hasAttribute("data-max-length")&&(this.#l=document.createElement("span"),this.#l.className="comment-box-counter",this.#l.setAttribute("aria-hidden","true"),this.#r.appendChild(this.#l),this.#a=document.createElement("span"),this.#a.className="comment-box-status visually-hidden",this.#a.setAttribute("role","status"),this.#r.appendChild(this.#a)),this.replaceChildren(this.#t,this.#r),this.listen(this.#n,"click",this.#v),this.#s&&this.listen(this.#s,"click",this.#A),this.#b(),this.listen(this.#t,"markdown-editor:upgraded",()=>this.#b()),this.#p(),this.#d(),this.#m(),this.#x()}teardown(){this.#u=null}get#h(){return this.#t?.textarea??this.#t?.querySelector("textarea")??null}#w(){let e=document.createElement("button");return e.type="button",e.className="comment-box-cancel",e.textContent=this.getAttribute("cancel-label")||"Cancel",e}#b(){let e=this.#h;e&&(this.#y(e),this.#p(),this.#m(),e!==this.#u&&(this.#u=e,this.listen(e,"input",this.#S),this.listen(e,"keydown",this.#f)))}#y(e=this.#h){if(!e)return;let t=this.#e.labels?.[0],s=this.getAttribute("label")||t?.textContent?.trim()||"Comment";e.setAttribute("aria-label",s)}attributeChangedCallback(e,t,s){!this.isConnected||!this.#t||(e==="value"?this.value=s??"":e==="placeholder"?s==null?this.#t.removeAttribute("placeholder"):this.#t.setAttribute("placeholder",s):e==="label"?this.#y():e==="disabled"?this.#p():e==="submit-label"?this.#n&&(this.#n.textContent=s||"Comment"):e==="cancel-label"?this.#s&&(this.#s.textContent=s||"Cancel"):e==="data-show-cancel"&&(this.hasAttribute("data-show-cancel")&&!this.#s&&this.#n?(this.#s=this.#w(),this.#n.before(this.#s),this.listen(this.#s,"click",this.#A),this.#p()):!this.hasAttribute("data-show-cancel")&&this.#s&&(this.#s.remove(),this.#s=null)))}#S=()=>{this.#d(),this.#m(),this.#x(),this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))};#f=e=>{e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#v())};#v=()=>{if(this.#c||this.#k())return;if(!this.#e.validity.valid){this.#e.reportValidity(),this.#h?.focus();return}let e=this.value,t=[],s=!0,r=new CustomEvent("comment-box:submit",{bubbles:!0,cancelable:!0,detail:{value:e,waitUntil(l){if(!s)throw new DOMException("waitUntil() must be called while comment-box:submit is dispatching","InvalidStateError");t.push(Promise.resolve(l))}}}),i=this.dispatchEvent(r);if(s=!1,!!i){if(!t.length){this.clear();return}this.#g(!0),Promise.all(t).then(()=>{this.#g(!1),this.clear()},()=>{this.#g(!1),this.#h?.focus()})}};#A=()=>{let e=this.value;this.dispatchEvent(new CustomEvent("comment-box:cancel",{bubbles:!0,detail:{value:e}}))};#k(){return this.hasAttribute("disabled")||this.#o}#g(e){this.#c=e,e?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),this.#p()}#p(){let e=this.#k(),t=this.#h;t&&(t.disabled=e,t.readOnly=this.#c),this.#n&&(this.#n.disabled=e,this.#c?this.#n.setAttribute("aria-disabled","true"):this.#n.removeAttribute("aria-disabled")),this.#s&&(this.#s.disabled=e)}#d(){this.#e.setFormValue(this.value)}#m(){let e=this.value,t=Number(this.getAttribute("data-min-length"))||0,s=Number(this.getAttribute("data-max-length"))||1/0,r=this.hasAttribute("required"),i=this.#h&&this.contains(this.#h)?this.#h:null;if(r&&e.length===0){this.#e.setValidity({valueMissing:!0},"Please add a comment.",i||void 0);return}if(e.length<t){this.#e.setValidity({tooShort:!0},`At least ${t} characters required.`,i||void 0);return}if(e.length>s){this.#e.setValidity({tooLong:!0},`No more than ${s} characters.`,i||void 0);return}this.#e.setValidity({})}#x(){if(!this.#l)return;let e=Number(this.getAttribute("data-max-length"))||0,t=this.value.length;if(this.#l.textContent=e?`${t} / ${e}`:String(t),this.#l.classList.toggle("is-over",e>0&&t>e),!this.#a)return;let s=e-t,r="";e&&s<0?r=`${-s} characters over the limit`:e&&s<=At(e)&&(r=`${s} characters remaining`),this.#a.textContent!==r&&(this.#a.textContent=r)}get value(){return this.#t?.value??""}set value(e){this.#t&&(this.#t.value=e==null?"":String(e),this.#d(),this.#m(),this.#x())}get busy(){return this.#c}clear(){this.value="",this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:"",length:0}}))}focus(){this.#h?.focus()}formResetCallback(){this.value=this.getAttribute("value")??""}formStateRestoreCallback(e){e!=null&&(this.value=e)}formDisabledCallback(e){this.#o=e,this.#p()}get form(){return this.#e.form}get name(){return this.getAttribute("name")}get type(){return this.localName}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}checkValidity(){return this.#e.checkValidity()}reportValidity(){return this.#e.reportValidity()}};A("comment-box",ie);var St=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];function $t(n){if(!n)return null;try{let e=new URL(n,document.baseURI);return e.protocol==="http:"||e.protocol==="https:"?n:null}catch{return null}}var Et=0,le=class extends w{#e=null;#t=null;#r=0;setup(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Comments"),this.#e=this.querySelector(":scope > template[data-reply-form]"),this.#i().forEach(e=>this.#s(e)),this.listen(this,"click",this.#h),this.listen(this,"comment-box:submit",this.#y),this.listen(this,"comment-box:cancel",this.#S),this.#p(),this.#r=setInterval(()=>this.#p(),6e4)}teardown(){clearInterval(this.#r)}#i(){return[...this.querySelectorAll(":scope > article[data-comment]")]}#n(e){return this.querySelector(`:scope > article[data-comment][id="${CSS.escape(e)}"]`)}#s(e){if(e.dataset.decorated==="")return;e.dataset.decorated="";let t=this.#l(e);e.style.setProperty("--comment-depth",String(t)),this.#a(e),e.appendChild(this.#c(e))}#l(e){let t=0,s=e.dataset.parent,r=new Set;for(;s&&!r.has(s);){r.add(s);let i=this.#n(s);if(!i)break;t+=1,s=i.dataset.parent}return t}#a(e){e.querySelector(":scope > .comment-header")?.remove();let t=this.#u(e),s=e.querySelector(":scope > [data-comment-body]");s?e.insertBefore(t,s):e.prepend(t);let r=[...t.querySelectorAll(".comment-author, .comment-time")].map(i=>i.id);e.setAttribute("aria-labelledby",r.join(" "))}#u(e){let t=document.createElement("header");t.className="comment-header";let s=e.id||`comment-thread-${++Et}`,r=e.dataset.author||"Unknown",i=$t(e.dataset.authorHref),l=e.dataset.authorAvatar;if(l){let h=document.createElement("user-avatar");h.setAttribute("name",r);let c=document.createElement("img");c.src=l,c.alt="",c.loading="lazy",c.decoding="async",h.appendChild(c),t.appendChild(h)}let o=document.createElement(i?"a":"span");o.className="comment-author",o.id=`${s}-author`,o.textContent=r,i&&(o.href=i),t.appendChild(o);let a=e.dataset.time;if(a){let h=document.createElement("time");h.className="comment-time",h.id=`${s}-time`,h.setAttribute("datetime",a);let c=this.#d(a);c&&h.setAttribute("title",c),h.textContent=this.#g(a)||a,t.appendChild(h)}if(e.dataset.edited){let h=document.createElement("span");h.className="comment-edited";let c=this.#d(e.dataset.edited);c&&(h.title=`Edited ${c}`),h.textContent="(edited)",t.appendChild(h)}return t}#c(e){let t=document.createElement("footer");if(t.className="comment-footer",this.hasAttribute("data-disabled"))return t;t.setAttribute("role","group"),t.setAttribute("aria-label","Comment actions");let s=document.createElement("button");if(s.type="button",s.className="comment-action comment-reply",s.textContent="Reply",t.appendChild(s),e.hasAttribute("data-mine")){let r=document.createElement("button");r.type="button",r.className="comment-action comment-edit",r.textContent="Edit",t.appendChild(r);let i=document.createElement("button");i.type="button",i.className="comment-action comment-delete",i.textContent="Delete",t.appendChild(i)}return this.#o(e,t),t}#o(e,t=e.querySelector(":scope > .comment-footer")){if(!t)return;let s=e.dataset.author||"Unknown",r=e.dataset.time?this.#d(e.dataset.time):"",i=r?` from ${r}`:"";t.querySelector(".comment-reply")?.setAttribute("aria-label",`Reply to ${s}${i}`),t.querySelector(".comment-edit")?.setAttribute("aria-label",`Edit your comment${i}`),t.querySelector(".comment-delete")?.setAttribute("aria-label",`Delete your comment${i}`)}#h=e=>{let t=e.target.closest?.("button.comment-action");if(!t)return;let s=t.closest("article[data-comment]");!s||s.parentElement!==this||(t.classList.contains("comment-reply")?this.#w(s):t.classList.contains("comment-edit")?this.#v(s):t.classList.contains("comment-delete")&&this.#A(s))};#w(e){if(this.#t&&this.#f(!1),!this.#e)return;let s=this.#e.content.cloneNode(!0).firstElementChild??document.createElement("comment-box");s.hasAttribute("data-show-cancel")||s.setAttribute("data-show-cancel",""),s.localName==="comment-box"&&!s.hasAttribute("label")&&s.setAttribute("label",`Reply to ${e.dataset.author||"comment"}`);let r=document.createElement("div");r.className="comment-reply-form",r.setAttribute("data-parent",e.id||""),r.appendChild(s),e.appendChild(r),this.#t=r,requestAnimationFrame(()=>s.focus?.())}#b(e){let t=e.target.closest?.(".comment-reply-form");return t&&t===this.#t?t:null}#y=e=>{let t=this.#b(e);if(!t)return;let s=e,r=t.parentElement,i=[],l=!0,o=this.dispatchEvent(new CustomEvent("comment-thread:reply",{bubbles:!0,cancelable:!0,detail:{parentId:r.id,value:s.detail.value,waitUntil(h){if(!l)throw new DOMException("waitUntil() must be called while comment-thread:reply is dispatching","InvalidStateError");i.push(Promise.resolve(h))}}}));if(l=!1,!o){s.preventDefault();return}if(!i.length){this.#f(!0);return}let a=Promise.all(i);s.detail.waitUntil?.(a),a.then(()=>{this.#t===t&&this.#f(!0)},()=>{})};#S=e=>{this.#b(e)&&this.#f(!0)};#f(e){let t=this.#t;if(!t)return;let s=t.parentElement,r=t.contains(document.activeElement);t.remove(),this.#t=null,(e||r)&&s?.querySelector(":scope > .comment-footer > .comment-reply")?.focus()}#v(e){let s=e.querySelector(":scope > [data-comment-body]")?.textContent.trim()??"";this.dispatchEvent(new CustomEvent("comment-thread:edit-request",{bubbles:!0,detail:{commentId:e.id,value:s}}))}#A(e){this.dispatchEvent(new CustomEvent("comment-thread:delete-request",{bubbles:!0,detail:{commentId:e.id}}))}#k(){return this.closest("[lang]")?.lang||void 0}#g(e){let t=new Date(e).getTime();if(Number.isNaN(t))return"";let s=(t-Date.now())/1e3,r=new Intl.RelativeTimeFormat(this.#k(),{numeric:"auto"});for(let[i,l]of St)if(Math.abs(s)>=l)return r.format(Math.trunc(s/l),i);return r.format(0,"second")}#p(){for(let e of this.querySelectorAll(":scope > article[data-comment] > .comment-header > time")){let t=e.getAttribute("datetime");if(!t)continue;let s=this.#g(t);s&&(e.textContent=s)}}#d(e){let t=new Date(e);return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(this.#k(),{dateStyle:"medium",timeStyle:"short"}).format(t)}#m(e,t){t.bodyText!=null?e.textContent=String(t.bodyText):t.bodyHtml!=null&&(e.innerHTML=B(String(t.bodyHtml))),"body"in t&&console.warn("[VB] comment-thread: `body` was removed \u2014 pass `bodyText` (plain text) or `bodyHtml` (sanitized HTML).")}addComment(e){let t=document.createElement("article");t.setAttribute("data-comment",""),t.id=e.id,t.dataset.author=e.author,e.authorHref&&(t.dataset.authorHref=e.authorHref),e.authorAvatar&&(t.dataset.authorAvatar=e.authorAvatar),t.dataset.time=e.time,e.parentId&&(t.dataset.parent=e.parentId),e.mine&&t.setAttribute("data-mine",""),e.edited&&(t.dataset.edited=e.edited);let s=document.createElement("div");s.setAttribute("data-comment-body",""),this.#m(s,e),t.appendChild(s);let r=e.parentId?this.#x(e.parentId):null;if(r)r.after(t);else if(this.#e?.parentNode===this)this.insertBefore(t,this.#e);else{let i=this.#i(),l=i[i.length-1];l?l.after(t):this.appendChild(t)}return this.#s(t),t}#x(e){let t=this.#n(e);if(!t)return null;let s=new Set([e]),r=t,i=t.nextElementSibling;for(;i instanceof HTMLElement&&i.matches("article[data-comment]")&&s.has(i.dataset.parent??"");)i.id&&s.add(i.id),r=i,i=i.nextElementSibling;return r}updateComment(e,t={}){let s=this.#n(e);if(!s)return;let r=s.querySelector(":scope > [data-comment-body]");r&&this.#m(r,t),t.author!=null&&(s.dataset.author=t.author),t.edited!=null&&(s.dataset.edited=t.edited),this.#a(s),this.#o(s)}removeComment(e){this.#n(e)?.remove()}};A("comment-thread",le);export{le as CommentThread};
54
+ `+r+`</table>
55
+ `}tablerow({text:i}){return`<tr>
56
+ ${i}</tr>
57
+ `}tablecell(i){let e=this.parser.parseInline(i.tokens),t=i.header?"th":"td";return(i.align?`<${t} align="${i.align}">`:`<${t}>`)+e+`</${t}>
58
+ `}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${y(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:e,tokens:t}){let r=this.parser.parseInline(t),s=Se(i);if(s===null)return r;i=s;let n='<a href="'+i+'"';return e&&(n+=' title="'+y(e)+'"'),n+=">"+r+"</a>",n}image({href:i,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let s=Se(i);if(s===null)return y(t);i=s;let n=`<img src="${i}" alt="${y(t)}"`;return e&&(n+=` title="${y(e)}"`),n+=">",n}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:y(i.text)}},ae=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},x=class X{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new H,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ae}static parse(e,t){return new X(t).parse(e)}static parseInline(e,t){return new X(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let r=0;r<e.length;r++){let s=e[r];if(this.options.extensions?.renderers?.[s.type]){let a=s,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){t+=o||"";continue}}let n=s;switch(n.type){case"space":{t+=this.renderer.space(n);break}case"hr":{t+=this.renderer.hr(n);break}case"heading":{t+=this.renderer.heading(n);break}case"code":{t+=this.renderer.code(n);break}case"table":{t+=this.renderer.table(n);break}case"blockquote":{t+=this.renderer.blockquote(n);break}case"list":{t+=this.renderer.list(n);break}case"checkbox":{t+=this.renderer.checkbox(n);break}case"html":{t+=this.renderer.html(n);break}case"def":{t+=this.renderer.def(n);break}case"paragraph":{t+=this.renderer.paragraph(n);break}case"text":{t+=this.renderer.text(n);break}default:{let a='Token with "'+n.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let r="";for(let s=0;s<e.length;s++){let n=e[s];if(this.options.extensions?.renderers?.[n.type]){let o=this.options.extensions.renderers[n.type].call({parser:this},n);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(n.type)){r+=o||"";continue}}let a=n;switch(a.type){case"escape":{r+=t.text(a);break}case"html":{r+=t.html(a);break}case"link":{r+=t.link(a);break}case"image":{r+=t.image(a);break}case"checkbox":{r+=t.checkbox(a);break}case"strong":{r+=t.strong(a);break}case"em":{r+=t.em(a);break}case"codespan":{r+=t.codespan(a);break}case"br":{r+=t.br(a);break}case"del":{r+=t.del(a);break}case"text":{r+=t.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},N=class{options;block;constructor(i){this.options=i||T}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(i=this.block){return i?k.lex:k.lexInline}provideParser(i=this.block){return i?x.parse:x.parseInline}},le=class{defaults=J();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=x;Renderer=H;TextRenderer=ae;Lexer=k;Tokenizer=D;Hooks=N;constructor(...i){this.use(...i)}walkTokens(i,e){let t=[];for(let r of i)switch(t=t.concat(e.call(this,r)),r.type){case"table":{let s=r;for(let n of s.header)t=t.concat(this.walkTokens(n.tokens,e));for(let n of s.rows)for(let a of n)t=t.concat(this.walkTokens(a.tokens,e));break}case"list":{let s=r;t=t.concat(this.walkTokens(s.items,e));break}default:{let s=r;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(n=>{let a=s[n].flat(1/0);t=t.concat(this.walkTokens(a,e))}):s.tokens&&(t=t.concat(this.walkTokens(s.tokens,e)))}}return t}use(...i){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let n=e.renderers[s.name];n?e.renderers[s.name]=function(...a){let o=s.renderer.apply(this,a);return o===!1&&(o=n.apply(this,a)),o}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let n=e[s.level];n?n.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){let s=this.defaults.renderer||new H(this.defaults);for(let n in t.renderer){if(!(n in s))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let a=n,o=t.renderer[a],l=s[a];s[a]=(...h)=>{let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c||""}}r.renderer=s}if(t.tokenizer){let s=this.defaults.tokenizer||new D(this.defaults);for(let n in t.tokenizer){if(!(n in s))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let a=n,o=t.tokenizer[a],l=s[a];s[a]=(...h)=>{let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c}}r.tokenizer=s}if(t.hooks){let s=this.defaults.hooks||new N;for(let n in t.hooks){if(!(n in s))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let a=n,o=t.hooks[a],l=s[a];N.passThroughHooks.has(n)?s[a]=h=>{if(this.defaults.async&&N.passThroughHooksRespectAsync.has(n))return(async()=>{let d=await o.call(s,h);return l.call(s,d)})();let c=o.call(s,h);return l.call(s,c)}:s[a]=(...h)=>{if(this.defaults.async)return(async()=>{let d=await o.apply(s,h);return d===!1&&(d=await l.apply(s,h)),d})();let c=o.apply(s,h);return c===!1&&(c=l.apply(s,h)),c}}r.hooks=s}if(t.walkTokens){let s=this.defaults.walkTokens,n=t.walkTokens;r.walkTokens=function(a){let o=[];return o.push(n.call(this,a)),s&&(o=o.concat(s.call(this,a))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,e){return k.lex(i,e??this.defaults)}parser(i,e){return x.parse(i,e??this.defaults)}parseMarkdown(i){return(e,t)=>{let r={...t},s={...this.defaults,...r},n=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return n(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return n(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return n(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=i),s.async)return(async()=>{let a=s.hooks?await s.hooks.preprocess(e):e,o=await(s.hooks?await s.hooks.provideLexer(i):i?k.lex:k.lexInline)(a,s),l=s.hooks?await s.hooks.processAllTokens(o):o;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser(i):i?x.parse:x.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(n);try{s.hooks&&(e=s.hooks.preprocess(e));let a=(s.hooks?s.hooks.provideLexer(i):i?k.lex:k.lexInline)(e,s);s.hooks&&(a=s.hooks.processAllTokens(a)),s.walkTokens&&this.walkTokens(a,s.walkTokens);let o=(s.hooks?s.hooks.provideParser(i):i?x.parse:x.parseInline)(a,s);return s.hooks&&(o=s.hooks.postprocess(o)),o}catch(a){return n(a)}}}onError(i,e){return t=>{if(t.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,i){let r="<p>An error occurred:</p><pre>"+y(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},E=new le;f.options=f.setOptions=function(i){return E.setOptions(i),f.defaults=E.defaults,$e(f.defaults),f};f.getDefaults=J;f.defaults=T;f.use=function(...i){return E.use(...i),f.defaults=E.defaults,$e(f.defaults),f};f.walkTokens=function(i,e){return E.walkTokens(i,e)};f.parseInline=E.parseInline;f.Parser=x;f.parser=x.parse;f.Renderer=H;f.TextRenderer=ae;f.Lexer=k;f.lexer=k.lex;f.Tokenizer=D;f.Hooks=N;f.parse=f;gr=f.options,br=f.setOptions,kr=f.use,xr=f.walkTokens,wr=f.parseInline,yr=x.parse,vr=k.lex});var Be={};fe(Be,{MarkdownViewer:()=>F});var tr,rr,sr,ir,nr,F,oe=$(()=>{L();z();Pe();W();tr="Failed to load markdown",rr=/^:::[ \t]*(note|info|tip|warning|danger)(?:[ \t]+([^\n]*?))?[ \t]*\n([\s\S]*?)\n?^:::[ \t]*(?:\n+|$)/m,sr=i=>i.replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`),ir={name:"vbCallout",level:"block",start(i){return i.match(/^:::[ \t]*(?:note|info|tip|warning|danger)\b/m)?.index},tokenizer(i){let e=rr.exec(i);if(!e||e.index!==0)return;let t=e[1],r=(e[2]||"").trim()||t[0].toUpperCase()+t.slice(1),s={type:"vbCallout",raw:e[0],kind:t,title:r,tokens:[]};return this.lexer.blockTokens(e[3],s.tokens),s},renderer(i){return`<aside data-callout="${i.kind}" role="note"><p data-callout-title><strong>${sr(i.title)}</strong></p>${this.parser.parse(i.tokens)}</aside>
60
+ `}},nr=new le({gfm:!0,extensions:[ir]}),F=class extends w{#e=null;#r=null;#t=null;#l=null;#s=null;#i=null;#a=0;static get observedAttributes(){return["src","sanitize","allow-cross-origin"]}setup(){this.#u()}teardown(){this.#r?.abort(),this.removeAttribute("data-rendered"),this.removeAttribute("data-loading")}attributeChangedCallback(e,t,r){t===r||!this.isConnected||!this.hasAttribute("data-upgraded")||this.#u()}get parser(){return this.#e}set parser(e){this.#e=typeof e=="function"?e:null}get markdown(){return this.#s??this.#i??""}set markdown(e){let t=e==null?null:String(e);this.#s!==t&&(this.#s=t,this.#u())}async render(){await this.#u()}async reload(){this.getAttribute("src")&&await this.#u()}#n(){let e=this.querySelector('script[type="text/markdown"]');if(e)return e.textContent;let t=this.querySelector("template[data-md]");if(t)return t.content.textContent;let r=this.querySelector(":scope > pre");return r?r.textContent:null}#c(e){let t;try{t=new URL(e,document.baseURI)}catch{throw new Error(`Invalid URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`Refused ${t.protocol} URL: only http(s) is allowed`);return this.#h(t.href),t.href}#h(e){if(!this.hasAttribute("allow-cross-origin")&&new URL(e).origin!==location.origin)throw new Error(`Refused cross-origin URL ${e} (add allow-cross-origin to permit)`)}async#u(){let e=++this.#a,t=this.getAttribute("src"),r;if(this.#r?.abort(),this.#r=null,this.removeAttribute("data-rendered"),this.removeAttribute("data-error"),this.removeAttribute("data-loading"),this.#l?.remove(),this.#l=null,t){let a=new AbortController;this.#r=a,this.setAttribute("data-loading",""),this.#f("markdown-viewer:fetch",{src:t});try{let o=this.#c(t),l=await fetch(o,{signal:a.signal});if(l.url&&this.#h(l.url),!l.ok)throw new Error(`HTTP ${l.status}: ${l.statusText}`);r=await l.text()}catch(o){if(o.name==="AbortError"||e!==this.#a)return;this.#o(o);return}if(e!==this.#a)return;this.removeAttribute("data-loading")}else this.#s!=null?r=this.#s:r=this.#n();if(r==null){this.#t?.replaceChildren();return}this.#i=r;let s;try{s=await(await this.#m())(r)}catch(a){if(e!==this.#a)return;this.#o(a);return}if(e!==this.#a)return;(!this.#t||this.#t.parentNode!==this)&&(this.#t=document.createElement("div"),this.#t.className="md-content",this.#t.setAttribute("part","content"),this.appendChild(this.#t)),this.hasAttribute("dir")?this.#t.removeAttribute("dir"):this.#t.setAttribute("dir","auto"),this.#p()?this.#t.replaceChildren(q(String(s??""))):this.#t.innerHTML=String(s??""),this.#d(),this.setAttribute("data-rendered","");let n=this.getAttribute("ping");if(n&&navigator.sendBeacon?.(n,JSON.stringify({src:t||"inline"})),this.#f("markdown-viewer:rendered",{src:t,node:this.#t}),this.hasAttribute("highlight"))for(let a of this.#t.querySelectorAll('pre > code[class*="language-"]')){let o=a.className.match(/language-(\S+)/)?.[1]||"";this.#f("markdown-viewer:highlight",{node:a,language:o})}}#o(e){if(this.removeAttribute("data-loading"),this.setAttribute("data-error",""),this.#t?.replaceChildren(),!this.querySelector(":scope > pre")){let t=document.createElement("p");t.setAttribute("role","alert"),t.setAttribute("data-md-error",""),t.textContent=this.getAttribute("data-label-error")||tr,this.append(t),this.#l=t}this.#f("markdown-viewer:error",{error:e.message})}async#m(){return this.#e?this.#e:e=>nr.parse(e)}#p(){let e=this.getAttribute("sanitize");return e==null?!0:!/^(off|false)$/i.test(e.trim())}#d(){if(!this.#t)return;let e=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;e&&(this.#t.dataset.theme=e)}#f(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-viewer",F)});var He={};fe(He,{MarkdownEditor:()=>V});var De,ar,V,Oe=$(()=>{L();z();oe();De={source:"Markdown source",preview:"Rendered preview",tabHint:"Tab inserts spaces. Press Escape, then Tab, to move focus."},ar=0,V=class extends w{#e=null;#r=null;#t=null;#l=null;#s=null;#i="";#a=null;#n=null;#c=!1;#h={placeholder:null,rows:null};static get observedAttributes(){return["placeholder","rows","highlight","data-label-source","data-label-preview"]}setup(){this.#u()||this.#o(),this.#x(),this.#g()}teardown(){this.#n!==null&&clearTimeout(this.#n),this.#n=null,this.#c=!1,this.removeAttribute("data-editing")}attributeChangedCallback(e,t,r){!this.#e||t===r||(e==="placeholder"?this.#f(this.#e,"placeholder",r??this.#h.placeholder):e==="rows"?this.#m():e==="highlight"?this.#r?.toggleAttribute("highlight",r!=null):this.#p())}get value(){return this.#e?.value??this.#a??""}set value(e){let t=e==null?"":String(e);if(!this.#e){this.#a=t;return}this.#e.value!==t&&(this.#e.value=t,this.#i=t,this.#g(),this.#b("markdown-editor:change",{value:t,source:"api"}))}get textarea(){return this.#e}#u(){return!!(this.#e&&this.#t?.parentNode===this&&this.#l?.parentNode===this&&this.#t.contains(this.#e))}#o(){let e=this.#e&&this.contains(this.#e)?this.#e:this.querySelector("textarea"),t=[...this.childNodes];e||(e=document.createElement("textarea"),t.push(e)),this.#e=e,this.#h={placeholder:e.getAttribute("placeholder"),rows:e.getAttribute("rows")},this.hasAttribute("placeholder")&&(e.placeholder=this.getAttribute("placeholder")??""),this.#m(),e.hasAttribute("dir")||(e.dir="auto"),e.hasAttribute("spellcheck")||(e.spellcheck=!0),this.#t=document.createElement("section"),this.#t.className="md-editor-pane",this.#t.append(...t),this.#l=document.createElement("section"),this.#l.className="md-preview-pane",this.#r=document.createElement("markdown-viewer");let r=e.getAttribute("dir");r&&r!=="auto"&&(this.#l.dir=r),this.#r.dir=r||"auto",this.hasAttribute("highlight")&&this.#r.setAttribute("highlight","");let s=this.dataset.theme??this.closest("[data-theme]")?.dataset.theme;if(s&&(this.#r.dataset.theme=s),this.#l.append(this.#r),this.hasAttribute("data-tab-indent")){this.#s=document.createElement("span"),this.#s.className="visually-hidden",this.#s.id=`md-editor-tab-hint-${++ar}`,this.#s.textContent=this.dataset.labelTabHint||De.tabHint,this.#t.append(this.#s);let n=e.getAttribute("aria-describedby");e.setAttribute("aria-describedby",n?`${n} ${this.#s.id}`:this.#s.id)}this.replaceChildren(this.#t,this.#l),this.#p(),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")&&!e.labels?.length&&!e.title&&e.setAttribute("aria-label",this.#d("source")),this.#a!=null&&(e.value=this.#a,this.#a=null),this.#i=e.value}#m(){if(!this.#e)return;let e=this.getAttribute("rows")??this.#h.rows;this.#e.rows=parseInt(e??"",10)||10}#p(){this.#t?.setAttribute("aria-label",this.#d("source")),this.#l?.setAttribute("aria-label",this.#d("preview"))}#d(e){return(e==="source"?this.dataset.labelSource:this.dataset.labelPreview)||De[e]}#f(e,t,r){r==null?e.removeAttribute(t):e.setAttribute(t,r)}#x(){let e=this.#e;e&&(this.listen(e,"input",()=>{this.#b("markdown-editor:input",{value:e.value}),this.#v()}),this.listen(e,"focus",()=>{this.setAttribute("data-editing","")}),this.listen(e,"blur",()=>{this.removeAttribute("data-editing"),this.#c=!1,e.value!==this.#i&&(this.#i=e.value,this.#b("markdown-editor:change",{value:e.value,source:"user"}))}),this.listen(this.getRootNode(),"reset",t=>{!e.form||t.target!==e.form||queueMicrotask(()=>{this.#i=e.value,this.#g()})},{capture:!0}),this.hasAttribute("data-tab-indent")&&this.listen(e,"keydown",t=>{let r=t;if(r.key==="Escape"){this.#c=!0;return}if(r.key!=="Tab"||r.shiftKey||r.ctrlKey||r.metaKey||r.altKey){["Shift","Control","Alt","Meta"].includes(r.key)||(this.#c=!1);return}if(this.#c||e.readOnly||e.disabled){this.#c=!1;return}if(r.preventDefault(),!document.execCommand("insertText",!1," ")){let{selectionStart:s,selectionEnd:n}=e;e.setRangeText(" ",s,n,"end"),e.dispatchEvent(new Event("input",{bubbles:!0}))}}))}#v(){this.#n!==null&&clearTimeout(this.#n),this.#n=setTimeout(()=>this.#g(),150)}#g(){this.#n!==null&&clearTimeout(this.#n),this.#n=null,this.#r&&(this.#r.markdown=this.#e?.value??"")}#b(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}};A("markdown-editor",V)});L();z();W();L();z();var lr=i=>Math.max(10,Math.ceil(i*.1)),ce=class extends w{static formAssociated=!0;static observedAttributes=["value","disabled","placeholder","label","submit-label","cancel-label","data-show-cancel"];#e;#r=null;#t=null;#l=null;#s=null;#i=null;#a=null;#n=null;#c=null;#h=!1;#u=!1;constructor(){super(),this.#e=this.attachInternals(),this._adoptInternals(this.#e)}setup(){Promise.resolve().then(()=>(oe(),Be)).catch(()=>console.warn('[VB] comment-box: markdown-viewer failed to load (missing importmap for "marked"?)')),Promise.resolve().then(()=>(Oe(),He)).catch(()=>console.warn("[VB] comment-box: markdown-editor failed to load"));let e=[...this.querySelectorAll(':scope > [slot="toolbar"]'),...this.querySelectorAll(":scope > .comment-box-actions > .comment-box-toolbar > *")],t=this.querySelector(":scope > markdown-editor");if(!t){t=document.createElement("markdown-editor");let s=document.createElement("textarea");this.hasAttribute("value")&&(s.value=this.getAttribute("value")||""),t.appendChild(s)}this.#r=t,this.hasAttribute("placeholder")&&this.#r.setAttribute("placeholder",this.getAttribute("placeholder")||""),this.#t=document.createElement("div"),this.#t.className="comment-box-actions",this.#l=document.createElement("div"),this.#l.className="comment-box-toolbar",e.forEach(s=>this.#l?.appendChild(s)),e.length&&(this.#l.setAttribute("role","group"),this.#l.setAttribute("aria-label","Comment tools")),this.#t.appendChild(this.#l);let r=document.createElement("div");r.className="comment-box-buttons",this.#i=null,this.hasAttribute("data-show-cancel")&&(this.#i=this.#m(),r.appendChild(this.#i)),this.#s=document.createElement("button"),this.#s.type="button",this.#s.className="comment-box-submit",this.#s.textContent=this.getAttribute("submit-label")||"Comment",r.appendChild(this.#s),this.#t.appendChild(r),this.#a=null,this.#n=null,this.hasAttribute("data-max-length")&&(this.#a=document.createElement("span"),this.#a.className="comment-box-counter",this.#a.setAttribute("aria-hidden","true"),this.#t.appendChild(this.#a),this.#n=document.createElement("span"),this.#n.className="comment-box-status visually-hidden",this.#n.setAttribute("role","status"),this.#t.appendChild(this.#n)),this.replaceChildren(this.#r,this.#t),this.listen(this.#s,"click",this.#v),this.#i&&this.listen(this.#i,"click",this.#g),this.#p(),this.listen(this.#r,"markdown-editor:upgraded",()=>this.#p()),this.#k(),this.#w(),this.#y(),this.#S()}teardown(){this.#c=null}get#o(){return this.#r?.textarea??this.#r?.querySelector("textarea")??null}#m(){let e=document.createElement("button");return e.type="button",e.className="comment-box-cancel",e.textContent=this.getAttribute("cancel-label")||"Cancel",e}#p(){let e=this.#o;e&&(this.#d(e),this.#k(),this.#y(),e!==this.#c&&(this.#c=e,this.listen(e,"input",this.#f),this.listen(e,"keydown",this.#x)))}#d(e=this.#o){if(!e)return;let t=this.#e.labels?.[0],r=this.getAttribute("label")||t?.textContent?.trim()||"Comment";e.setAttribute("aria-label",r)}attributeChangedCallback(e,t,r){!this.isConnected||!this.#r||(e==="value"?this.value=r??"":e==="placeholder"?r==null?this.#r.removeAttribute("placeholder"):this.#r.setAttribute("placeholder",r):e==="label"?this.#d():e==="disabled"?this.#k():e==="submit-label"?this.#s&&(this.#s.textContent=r||"Comment"):e==="cancel-label"?this.#i&&(this.#i.textContent=r||"Cancel"):e==="data-show-cancel"&&(this.hasAttribute("data-show-cancel")&&!this.#i&&this.#s?(this.#i=this.#m(),this.#s.before(this.#i),this.listen(this.#i,"click",this.#g),this.#k()):!this.hasAttribute("data-show-cancel")&&this.#i&&(this.#i.remove(),this.#i=null)))}#f=()=>{this.#w(),this.#y(),this.#S(),this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:this.value,length:this.value.length}}))};#x=e=>{e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),this.#v())};#v=()=>{if(this.#h||this.#b())return;if(!this.#e.validity.valid){this.#e.reportValidity(),this.#o?.focus();return}let e=this.value,t=[],r=!0,s=new CustomEvent("comment-box:submit",{bubbles:!0,cancelable:!0,detail:{value:e,waitUntil(a){if(!r)throw new DOMException("waitUntil() must be called while comment-box:submit is dispatching","InvalidStateError");t.push(Promise.resolve(a))}}}),n=this.dispatchEvent(s);if(r=!1,!!n){if(!t.length){this.clear();return}this.#A(!0),Promise.all(t).then(()=>{this.#A(!1),this.clear()},()=>{this.#A(!1),this.#o?.focus()})}};#g=()=>{let e=this.value;this.dispatchEvent(new CustomEvent("comment-box:cancel",{bubbles:!0,detail:{value:e}}))};#b(){return this.hasAttribute("disabled")||this.#u}#A(e){this.#h=e,e?this.setAttribute("aria-busy","true"):this.removeAttribute("aria-busy"),this.#k()}#k(){let e=this.#b(),t=this.#o;t&&(t.disabled=e,t.readOnly=this.#h),this.#s&&(this.#s.disabled=e,this.#h?this.#s.setAttribute("aria-disabled","true"):this.#s.removeAttribute("aria-disabled")),this.#i&&(this.#i.disabled=e)}#w(){this.#e.setFormValue(this.value)}#y(){let e=this.value,t=Number(this.getAttribute("data-min-length"))||0,r=Number(this.getAttribute("data-max-length"))||1/0,s=this.hasAttribute("required"),n=this.#o&&this.contains(this.#o)?this.#o:null;if(s&&e.length===0){this.#e.setValidity({valueMissing:!0},"Please add a comment.",n||void 0);return}if(e.length<t){this.#e.setValidity({tooShort:!0},`At least ${t} characters required.`,n||void 0);return}if(e.length>r){this.#e.setValidity({tooLong:!0},`No more than ${r} characters.`,n||void 0);return}this.#e.setValidity({})}#S(){if(!this.#a)return;let e=Number(this.getAttribute("data-max-length"))||0,t=this.value.length;if(this.#a.textContent=e?`${t} / ${e}`:String(t),this.#a.classList.toggle("is-over",e>0&&t>e),!this.#n)return;let r=e-t,s="";e&&r<0?s=`${-r} characters over the limit`:e&&r<=lr(e)&&(s=`${r} characters remaining`),this.#n.textContent!==s&&(this.#n.textContent=s)}get value(){return this.#r?.value??""}set value(e){this.#r&&(this.#r.value=e==null?"":String(e),this.#w(),this.#y(),this.#S())}get busy(){return this.#h}clear(){this.value="",this.dispatchEvent(new CustomEvent("comment-box:input",{bubbles:!0,detail:{value:"",length:0}}))}focus(){this.#o?.focus()}formResetCallback(){this.value=this.getAttribute("value")??""}formStateRestoreCallback(e){e!=null&&(this.value=e)}formDisabledCallback(e){this.#u=e,this.#k()}get form(){return this.#e.form}get name(){return this.getAttribute("name")}get type(){return this.localName}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}checkValidity(){return this.#e.checkValidity()}reportValidity(){return this.#e.reportValidity()}};A("comment-box",ce);var or=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60]];function cr(i){if(!i)return null;try{let e=new URL(i,document.baseURI);return e.protocol==="http:"||e.protocol==="https:"?i:null}catch{return null}}var hr=0,he=class extends w{#e=null;#r=null;#t=0;setup(){this.hasAttribute("role")||this.setAttribute("role","region"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Comments"),this.#e=this.querySelector(":scope > template[data-reply-form]"),this.#l().forEach(e=>this.#i(e)),this.listen(this,"click",this.#o),this.listen(this,"comment-box:submit",this.#d),this.listen(this,"comment-box:cancel",this.#f),this.#k(),this.#t=setInterval(()=>this.#k(),6e4)}teardown(){clearInterval(this.#t)}#l(){return[...this.querySelectorAll(":scope > article[data-comment]")]}#s(e){return this.querySelector(`:scope > article[data-comment][id="${CSS.escape(e)}"]`)}#i(e){if(e.dataset.decorated==="")return;e.dataset.decorated="";let t=this.#a(e);e.style.setProperty("--comment-depth",String(t)),this.#n(e),e.appendChild(this.#h(e))}#a(e){let t=0,r=e.dataset.parent,s=new Set;for(;r&&!s.has(r);){s.add(r);let n=this.#s(r);if(!n)break;t+=1,r=n.dataset.parent}return t}#n(e){e.querySelector(":scope > .comment-header")?.remove();let t=this.#c(e),r=e.querySelector(":scope > [data-comment-body]");r?e.insertBefore(t,r):e.prepend(t);let s=[...t.querySelectorAll(".comment-author, .comment-time")].map(n=>n.id);e.setAttribute("aria-labelledby",s.join(" "))}#c(e){let t=document.createElement("header");t.className="comment-header";let r=e.id||`comment-thread-${++hr}`,s=e.dataset.author||"Unknown",n=cr(e.dataset.authorHref),a=e.dataset.authorAvatar;if(a){let h=document.createElement("user-avatar"),c=document.createElement("img");c.src=a,c.alt="",c.loading="lazy",c.decoding="async",h.appendChild(c),t.appendChild(h)}let o=document.createElement(n?"a":"span");o.className="comment-author",o.id=`${r}-author`,o.textContent=s,n&&(o.href=n),t.appendChild(o);let l=e.dataset.time;if(l){let h=document.createElement("time");h.className="comment-time",h.id=`${r}-time`,h.setAttribute("datetime",l);let c=this.#w(l);c&&h.setAttribute("title",c),h.textContent=this.#A(l)||l,t.appendChild(h)}if(e.dataset.edited){let h=document.createElement("span");h.className="comment-edited";let c=this.#w(e.dataset.edited);c&&(h.title=`Edited ${c}`),h.textContent="(edited)",t.appendChild(h)}return t}#h(e){let t=document.createElement("footer");if(t.className="comment-footer",this.hasAttribute("data-disabled"))return t;t.setAttribute("role","group"),t.setAttribute("aria-label","Comment actions");let r=document.createElement("button");if(r.type="button",r.className="comment-action comment-reply",r.textContent="Reply",t.appendChild(r),e.hasAttribute("data-mine")){let s=document.createElement("button");s.type="button",s.className="comment-action comment-edit",s.textContent="Edit",t.appendChild(s);let n=document.createElement("button");n.type="button",n.className="comment-action comment-delete",n.textContent="Delete",t.appendChild(n)}return this.#u(e,t),t}#u(e,t=e.querySelector(":scope > .comment-footer")){if(!t)return;let r=e.dataset.author||"Unknown",s=e.dataset.time?this.#w(e.dataset.time):"",n=s?` from ${s}`:"";t.querySelector(".comment-reply")?.setAttribute("aria-label",`Reply to ${r}${n}`),t.querySelector(".comment-edit")?.setAttribute("aria-label",`Edit your comment${n}`),t.querySelector(".comment-delete")?.setAttribute("aria-label",`Delete your comment${n}`)}#o=e=>{let t=e.target.closest?.("button.comment-action");if(!t)return;let r=t.closest("article[data-comment]");!r||r.parentElement!==this||(t.classList.contains("comment-reply")?this.#m(r):t.classList.contains("comment-edit")?this.#v(r):t.classList.contains("comment-delete")&&this.#g(r))};#m(e){if(this.#r&&this.#x(!1),!this.#e)return;let r=this.#e.content.cloneNode(!0).firstElementChild??document.createElement("comment-box");r.hasAttribute("data-show-cancel")||r.setAttribute("data-show-cancel",""),r.localName==="comment-box"&&!r.hasAttribute("label")&&r.setAttribute("label",`Reply to ${e.dataset.author||"comment"}`);let s=document.createElement("div");s.className="comment-reply-form",s.setAttribute("data-parent",e.id||""),s.appendChild(r),e.appendChild(s),this.#r=s,requestAnimationFrame(()=>r.focus?.())}#p(e){let t=e.target.closest?.(".comment-reply-form");return t&&t===this.#r?t:null}#d=e=>{let t=this.#p(e);if(!t)return;let r=e,s=t.parentElement,n=[],a=!0,o=this.dispatchEvent(new CustomEvent("comment-thread:reply",{bubbles:!0,cancelable:!0,detail:{parentId:s.id,value:r.detail.value,waitUntil(h){if(!a)throw new DOMException("waitUntil() must be called while comment-thread:reply is dispatching","InvalidStateError");n.push(Promise.resolve(h))}}}));if(a=!1,!o){r.preventDefault();return}if(!n.length){this.#x(!0);return}let l=Promise.all(n);r.detail.waitUntil?.(l),l.then(()=>{this.#r===t&&this.#x(!0)},()=>{})};#f=e=>{this.#p(e)&&this.#x(!0)};#x(e){let t=this.#r;if(!t)return;let r=t.parentElement,s=t.contains(document.activeElement);t.remove(),this.#r=null,(e||s)&&r?.querySelector(":scope > .comment-footer > .comment-reply")?.focus()}#v(e){let r=e.querySelector(":scope > [data-comment-body]")?.textContent.trim()??"";this.dispatchEvent(new CustomEvent("comment-thread:edit-request",{bubbles:!0,detail:{commentId:e.id,value:r}}))}#g(e){this.dispatchEvent(new CustomEvent("comment-thread:delete-request",{bubbles:!0,detail:{commentId:e.id}}))}#b(){return this.closest("[lang]")?.lang||void 0}#A(e){let t=new Date(e).getTime();if(Number.isNaN(t))return"";let r=(t-Date.now())/1e3,s=new Intl.RelativeTimeFormat(this.#b(),{numeric:"auto"});for(let[n,a]of or)if(Math.abs(r)>=a)return s.format(Math.trunc(r/a),n);return s.format(0,"second")}#k(){for(let e of this.querySelectorAll(":scope > article[data-comment] > .comment-header > time")){let t=e.getAttribute("datetime");if(!t)continue;let r=this.#A(t);r&&(e.textContent=r)}}#w(e){let t=new Date(e);return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat(this.#b(),{dateStyle:"medium",timeStyle:"short"}).format(t)}#y(e,t){t.bodyText!=null?e.textContent=String(t.bodyText):t.bodyHtml!=null&&e.replaceChildren(q(String(t.bodyHtml))),"body"in t&&console.warn("[VB] comment-thread: `body` was removed \u2014 pass `bodyText` (plain text) or `bodyHtml` (sanitized HTML).")}addComment(e){let t=document.createElement("article");t.setAttribute("data-comment",""),t.id=e.id,t.dataset.author=e.author,e.authorHref&&(t.dataset.authorHref=e.authorHref),e.authorAvatar&&(t.dataset.authorAvatar=e.authorAvatar),t.dataset.time=e.time,e.parentId&&(t.dataset.parent=e.parentId),e.mine&&t.setAttribute("data-mine",""),e.edited&&(t.dataset.edited=e.edited);let r=document.createElement("div");r.setAttribute("data-comment-body",""),this.#y(r,e),t.appendChild(r);let s=e.parentId?this.#S(e.parentId):null;if(s)s.after(t);else if(this.#e?.parentNode===this)this.insertBefore(t,this.#e);else{let n=this.#l(),a=n[n.length-1];a?a.after(t):this.appendChild(t)}return this.#i(t),t}#S(e){let t=this.#s(e);if(!t)return null;let r=new Set([e]),s=t,n=t.nextElementSibling;for(;n instanceof HTMLElement&&n.matches("article[data-comment]")&&r.has(n.dataset.parent??"");)n.id&&r.add(n.id),s=n,n=n.nextElementSibling;return s}updateComment(e,t={}){let r=this.#s(e);if(!r)return;let s=r.querySelector(":scope > [data-comment-body]");s&&this.#y(s,t),t.author!=null&&(r.dataset.author=t.author),t.edited!=null&&(r.dataset.edited=t.edited),this.#n(r),this.#u(r)}removeComment(e){this.#s(e)?.remove()}};A("comment-thread",he);export{he as CommentThread};
60
61
  //# sourceMappingURL=comment-thread.js.map
@@ -1,2 +1,2 @@
1
- var c=class extends HTMLElement{#e=[];#t;connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#e)e();this.#e=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,n,i){e.addEventListener(t,n,i),this.#e.push(()=>e.removeEventListener(t,n,i))}_reinit(){for(let e of this.#e)e();this.#e=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#t||(this.#t=this.attachInternals());let n=this.#t.states;try{t?n.add(e):n.delete(e)}catch{let i=`--${e}`;t?n.add(i):n.delete(i)}}_adoptInternals(e){this.#t||(this.#t=e)}};var b=window.matchMedia("(prefers-reduced-motion: reduce)");var l=new Map;function f(r,e,t={}){let n=t.priority??10,i={impl:e,bundle:t.bundle,contract:t.contract,priority:n},s=l.get(r);if(customElements.get(r)){if(!s||s.priority>=n){s&&s.priority===n&&s.impl!==e&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}" (priority ${s.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${r}> defined by "${s.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(s&&s.priority>=n){s.priority===n&&console.warn(`[VB Bundle] Tag <${r}> already registered by "${s.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}l.set(r,i),customElements.define(r,e)}var h=0,a=class extends c{#e=null;#t=null;setup(){if(this.#e=this.querySelector(":scope > button"),this.#t=this.querySelector(":scope > .comment-wc-reason"),!this.#e){let t=document.createElement("button");t.type="button";let n=document.createElement("icon-wc");n.setAttribute("name","message-circle"),n.setAttribute("size","sm"),n.setAttribute("aria-hidden","true"),t.appendChild(n);let i=document.createElement("span");i.className="comment-wc-reason visually-hidden",i.id=`comment-wc-reason-${++h}`,i.textContent="Comments are unavailable: this content has no review surface.",this.append(t,i),this.#e=t,this.#t=i}this.#n(),this.listen(this,"click",this.#s);let e=this.closest("selection-menu");e&&this.listen(e,"toggle",()=>this.#n())}#i(){let e=this.closest("review-surface");if(e)return e;let t=this.closest("selection-menu")?.getAttribute("for");return t?document.querySelector(`review-surface[for="${CSS.escape(t)}"]`):null}#n(){let e=this.#e;if(!e)return;!!this.#i()?(e.removeAttribute("aria-disabled"),e.removeAttribute("aria-describedby"),e.setAttribute("aria-label","Add comment")):(e.setAttribute("aria-disabled","true"),e.setAttribute("aria-label","Add comment"),this.#t&&e.setAttribute("aria-describedby",this.#t.id))}#s=e=>{if(!this.#e?.contains(e.target))return;this.#n();let t=this.#i();if(!t)return;let n=this.closest("selection-menu");if(!n)return;let i=n.getSelection();if(!i)return;let s=i.range.getBoundingClientRect(),o=t.getBoundingClientRect(),d=(s.left+s.width/2-o.left)/o.width*100,u=(s.top-o.top)/o.height*100;typeof t.addPin=="function"&&t.addPin({x:d,y:u,text:i.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:i.text,x:d,y:u},bubbles:!0})),n.dismiss()}};f("comment-wc",a);
1
+ var c=class extends HTMLElement{#t=[];#e;constructor(){super(),this.hasAttribute("data-upgraded")&&this.removeAttribute("data-upgraded")}connectedCallback(){this.hasAttribute("data-upgraded")||this.setup()!==!1&&(this.setAttribute("data-upgraded",""),queueMicrotask(()=>{this.dispatchEvent(new CustomEvent(`${this.localName}:upgraded`,{bubbles:!0}))}))}disconnectedCallback(){for(let e of this.#t)e();this.#t=[],this.removeAttribute("data-upgraded"),this.teardown()}listen(e,t,i,n){e.addEventListener(t,i,n),this.#t.push(()=>e.removeEventListener(t,i,n))}_reinit(){for(let e of this.#t)e();this.#t=[],this.teardown(),this.removeAttribute("data-upgraded"),this.isConnected&&this.setup()!==!1&&this.setAttribute("data-upgraded","")}setup(){}teardown(){}setState(e,t){this.#e||(this.#e=this.attachInternals());let i=this.#e.states;try{t?i.add(e):i.delete(e)}catch{let n=`--${e}`;t?i.add(n):i.delete(n)}}_adoptInternals(e){this.#e||(this.#e=e)}#i(){return this.constructor.formAssociated&&this.#e?this.#e:null}get validity(){return this.#i()?.validity}get validationMessage(){return this.#i()?.validationMessage??""}get willValidate(){return this.#i()?.willValidate??!1}get form(){return this.#i()?.form??null}checkValidity(){return this.#i()?.checkValidity()??!0}reportValidity(){return this.#i()?.reportValidity()??!0}};var b=window.matchMedia("(prefers-reduced-motion: reduce)");var u=new Map;function f(s,e,t={}){let i=t.priority??10,n={impl:e,bundle:t.bundle,contract:t.contract,priority:i},r=u.get(s);if(customElements.get(s)){if(!r||r.priority>=i){r&&r.priority===i&&r.impl!==e&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}" (priority ${r.priority}). Skipping "${t.bundle}".`);return}console.warn(`[VB Bundle] Tag <${s}> defined by "${r.bundle}" cannot be replaced (customElements.define is permanent). "${t.bundle}" has higher priority but arrived late.`);return}if(r&&r.priority>=i){r.priority===i&&console.warn(`[VB Bundle] Tag <${s}> already registered by "${r.bundle}". Skipping "${t.bundle}" (first wins at equal priority).`);return}u.set(s,n),customElements.define(s,e)}var h=0,a=class extends c{#t=null;#e=null;setup(){if(this.#t=this.querySelector(":scope > button"),this.#e=this.querySelector(":scope > .comment-wc-reason"),!this.#t){let t=document.createElement("button");t.type="button";let i=document.createElement("icon-wc");i.setAttribute("name","message-circle"),i.setAttribute("size","sm"),i.setAttribute("aria-hidden","true"),t.appendChild(i);let n=document.createElement("span");n.className="comment-wc-reason visually-hidden",n.id=`comment-wc-reason-${++h}`,n.textContent="Comments are unavailable: this content has no review surface.",this.append(t,n),this.#t=t,this.#e=n}this.#n(),this.listen(this,"click",this.#r);let e=this.closest("selection-menu");e&&this.listen(e,"toggle",()=>this.#n())}#i(){let e=this.closest("review-surface");if(e)return e;let t=this.closest("selection-menu")?.getAttribute("for");return t?document.querySelector(`review-surface[for="${CSS.escape(t)}"]`):null}#n(){let e=this.#t;if(!e)return;!!this.#i()?(e.removeAttribute("aria-disabled"),e.removeAttribute("aria-describedby"),e.setAttribute("aria-label","Add comment")):(e.setAttribute("aria-disabled","true"),e.setAttribute("aria-label","Add comment"),this.#e&&e.setAttribute("aria-describedby",this.#e.id))}#r=e=>{if(!this.#t?.contains(e.target))return;this.#n();let t=this.#i();if(!t)return;let i=this.closest("selection-menu");if(!i)return;let n=i.getSelection();if(!n)return;let r=n.range.getBoundingClientRect(),o=t.getBoundingClientRect(),d=(r.left+r.width/2-o.left)/o.width*100,l=(r.top-o.top)/o.height*100;typeof t.addPin=="function"&&t.addPin({x:d,y:l,text:n.text}),this.dispatchEvent(new CustomEvent("comment-wc:created",{detail:{text:n.text,x:d,y:l},bubbles:!0})),i.dismiss()}};f("comment-wc",a);
2
2
  //# sourceMappingURL=comment-wc.js.map