litepaseo 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +16 -8
- package/dist/server/cli.mjs +2 -2
- package/dist/server/{worker-CFb51N-2.mjs → worker-CmsAgviJ.mjs} +73 -12
- package/dist/web/assets/ChangesPanel-DdtJswMt.js +2 -0
- package/dist/web/assets/ChangesPanel-DdtJswMt.js.br +0 -0
- package/dist/web/assets/ChangesPanel-DdtJswMt.js.gz +0 -0
- package/dist/web/assets/CodeBlockNode-BOeBLCjf.js +3 -0
- package/dist/web/assets/CodeBlockNode-BOeBLCjf.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-BOeBLCjf.js.gz +0 -0
- package/dist/web/assets/ConversationSearch-BXfGhrtx.js +1 -0
- package/dist/web/assets/ConversationSearch-BXfGhrtx.js.br +0 -0
- package/dist/web/assets/ConversationSearch-BXfGhrtx.js.gz +0 -0
- package/dist/web/assets/FileViewer-C93qu9YH.js +2 -0
- package/dist/web/assets/FileViewer-C93qu9YH.js.br +0 -0
- package/dist/web/assets/FileViewer-C93qu9YH.js.gz +0 -0
- package/dist/web/assets/FilesPanel-DyqtBDO_.js +1 -0
- package/dist/web/assets/FilesPanel-DyqtBDO_.js.br +0 -0
- package/dist/web/assets/FilesPanel-DyqtBDO_.js.gz +0 -0
- package/dist/web/assets/HostSettings-BCsvyF_3.js +5 -0
- package/dist/web/assets/HostSettings-BCsvyF_3.js.br +0 -0
- package/dist/web/assets/HostSettings-BCsvyF_3.js.gz +0 -0
- package/dist/web/assets/MarkdownMessage-CejBvgRc.js +199 -0
- package/dist/web/assets/MarkdownMessage-CejBvgRc.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-CejBvgRc.js.gz +0 -0
- package/dist/web/assets/{PreCodeBlock-BoklyLrw.js → PreCodeBlock-BBTzkaAH.js} +1 -1
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-4BQzC8nU.js +1 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-4BQzC8nU.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-4BQzC8nU.js.gz +0 -0
- package/dist/web/assets/SubagentsPanel-D1bEm5QC.js +1 -0
- package/dist/web/assets/SubagentsPanel-D1bEm5QC.js.br +0 -0
- package/dist/web/assets/SubagentsPanel-D1bEm5QC.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-wazWBZjN.js +3 -0
- package/dist/web/assets/TerminalPanel-wazWBZjN.js.br +0 -0
- package/dist/web/assets/TerminalPanel-wazWBZjN.js.gz +0 -0
- package/dist/web/assets/Tooltip-CrG6tFax.js +1 -0
- package/dist/web/assets/Tooltip-CrG6tFax.js.br +0 -0
- package/dist/web/assets/Tooltip-CrG6tFax.js.gz +0 -0
- package/dist/web/assets/index-Cmpdc3EH.js +35 -0
- package/dist/web/assets/index-Cmpdc3EH.js.br +0 -0
- package/dist/web/assets/index-Cmpdc3EH.js.gz +0 -0
- package/dist/web/assets/index10-C9Xw5wOS.js +6 -0
- package/dist/web/assets/index10-C9Xw5wOS.js.br +0 -0
- package/dist/web/assets/index10-C9Xw5wOS.js.gz +0 -0
- package/dist/web/assets/index3-dduGUVTy.js +1 -0
- package/dist/web/assets/index4-qdeznE4u.js +1 -0
- package/dist/web/assets/index5-Cxc_iCM3.js +1 -0
- package/dist/web/assets/index5-Cxc_iCM3.js.br +0 -0
- package/dist/web/assets/index5-Cxc_iCM3.js.gz +0 -0
- package/dist/web/assets/index6-DsTT-iog.js +1 -0
- package/dist/web/assets/index6-DsTT-iog.js.br +0 -0
- package/dist/web/assets/index6-DsTT-iog.js.gz +0 -0
- package/dist/web/assets/index7-Bgw61c0t.js +2 -0
- package/dist/web/assets/index7-Bgw61c0t.js.br +0 -0
- package/dist/web/assets/index7-Bgw61c0t.js.gz +0 -0
- package/dist/web/assets/index8-DLEM8iM5.js +2 -0
- package/dist/web/assets/index8-DLEM8iM5.js.br +0 -0
- package/dist/web/assets/index8-DLEM8iM5.js.gz +0 -0
- package/dist/web/assets/index9-CUy1AFI-.js +1 -0
- package/dist/web/assets/index9-CUy1AFI-.js.br +0 -0
- package/dist/web/assets/index9-CUy1AFI-.js.gz +0 -0
- package/dist/web/assets/vue.runtime.esm-bundler-4XjPOHMM.js +4 -0
- package/dist/web/assets/vue.runtime.esm-bundler-4XjPOHMM.js.br +0 -0
- package/dist/web/assets/vue.runtime.esm-bundler-4XjPOHMM.js.gz +0 -0
- package/dist/web/index.html +2 -2
- package/dist/web/index.html.br +0 -0
- package/dist/web/index.html.gz +0 -0
- package/package.json +1 -1
- package/dist/web/assets/ChangesPanel-BlSVs9IZ.js +0 -2
- package/dist/web/assets/ChangesPanel-BlSVs9IZ.js.br +0 -0
- package/dist/web/assets/ChangesPanel-BlSVs9IZ.js.gz +0 -0
- package/dist/web/assets/CodeBlockNode-CaXaKazH.js +0 -3
- package/dist/web/assets/CodeBlockNode-CaXaKazH.js.br +0 -0
- package/dist/web/assets/CodeBlockNode-CaXaKazH.js.gz +0 -0
- package/dist/web/assets/ConversationSearch-y9eWywB5.js +0 -1
- package/dist/web/assets/ConversationSearch-y9eWywB5.js.br +0 -0
- package/dist/web/assets/ConversationSearch-y9eWywB5.js.gz +0 -0
- package/dist/web/assets/FileViewer-BqUwuFz5.js +0 -2
- package/dist/web/assets/FileViewer-BqUwuFz5.js.br +0 -0
- package/dist/web/assets/FileViewer-BqUwuFz5.js.gz +0 -0
- package/dist/web/assets/FilesPanel-D1VnWV0v.js +0 -1
- package/dist/web/assets/FilesPanel-D1VnWV0v.js.br +0 -0
- package/dist/web/assets/FilesPanel-D1VnWV0v.js.gz +0 -0
- package/dist/web/assets/HostSettings-CS8WUZFq.js +0 -5
- package/dist/web/assets/HostSettings-CS8WUZFq.js.br +0 -0
- package/dist/web/assets/HostSettings-CS8WUZFq.js.gz +0 -0
- package/dist/web/assets/MarkdownMessage-De-SfrGN.js +0 -199
- package/dist/web/assets/MarkdownMessage-De-SfrGN.js.br +0 -0
- package/dist/web/assets/MarkdownMessage-De-SfrGN.js.gz +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-YIH3qNv0.js +0 -1
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-YIH3qNv0.js.br +0 -0
- package/dist/web/assets/PreCodeBlock.vue_vue_type_style_index_0_lang-YIH3qNv0.js.gz +0 -0
- package/dist/web/assets/SubagentsPanel-DDNeI4kF.js +0 -1
- package/dist/web/assets/SubagentsPanel-DDNeI4kF.js.br +0 -0
- package/dist/web/assets/SubagentsPanel-DDNeI4kF.js.gz +0 -0
- package/dist/web/assets/TerminalPanel-BNiO8y4X.js +0 -3
- package/dist/web/assets/TerminalPanel-BNiO8y4X.js.br +0 -0
- package/dist/web/assets/TerminalPanel-BNiO8y4X.js.gz +0 -0
- package/dist/web/assets/Tooltip-DW5DjEkp.js +0 -1
- package/dist/web/assets/Tooltip-DW5DjEkp.js.br +0 -0
- package/dist/web/assets/Tooltip-DW5DjEkp.js.gz +0 -0
- package/dist/web/assets/index-Cvb6bO2l.js +0 -35
- package/dist/web/assets/index-Cvb6bO2l.js.br +0 -0
- package/dist/web/assets/index-Cvb6bO2l.js.gz +0 -0
- package/dist/web/assets/index10-HE3YKxWe.js +0 -6
- package/dist/web/assets/index10-HE3YKxWe.js.br +0 -0
- package/dist/web/assets/index10-HE3YKxWe.js.gz +0 -0
- package/dist/web/assets/index3-DGhUvPvG.js +0 -1
- package/dist/web/assets/index4-8S_uvaZW.js +0 -1
- package/dist/web/assets/index5-D_Gw1TcQ.js +0 -1
- package/dist/web/assets/index5-D_Gw1TcQ.js.br +0 -0
- package/dist/web/assets/index5-D_Gw1TcQ.js.gz +0 -0
- package/dist/web/assets/index6-C5JVVCiu.js +0 -1
- package/dist/web/assets/index6-C5JVVCiu.js.br +0 -0
- package/dist/web/assets/index6-C5JVVCiu.js.gz +0 -0
- package/dist/web/assets/index7-DuLrtgHQ.js +0 -2
- package/dist/web/assets/index7-DuLrtgHQ.js.br +0 -0
- package/dist/web/assets/index7-DuLrtgHQ.js.gz +0 -0
- package/dist/web/assets/index8-BIK4cA-n.js +0 -2
- package/dist/web/assets/index8-BIK4cA-n.js.br +0 -0
- package/dist/web/assets/index8-BIK4cA-n.js.gz +0 -0
- package/dist/web/assets/index9-VNQ82Mso.js +0 -1
- package/dist/web/assets/index9-VNQ82Mso.js.br +0 -0
- package/dist/web/assets/index9-VNQ82Mso.js.gz +0 -0
- package/dist/web/assets/vue.runtime.esm-bundler-DwGo9CTz.js +0 -4
- package/dist/web/assets/vue.runtime.esm-bundler-DwGo9CTz.js.br +0 -0
- package/dist/web/assets/vue.runtime.esm-bundler-DwGo9CTz.js.gz +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vue.runtime.esm-bundler-4XjPOHMM.js","assets/rolldown-runtime-XKyaHtl9.js","assets/Tooltip-CrG6tFax.js","assets/index-Cmpdc3EH.js","assets/index-CwWokVo4.css","assets/PreCodeBlock-BBTzkaAH.js","assets/PreCodeBlock.vue_vue_type_style_index_0_lang-4BQzC8nU.js","assets/CodeBlockNode-BOeBLCjf.js","assets/safeRaf-BDp3SJMs.js","assets/index6-DsTT-iog.js","assets/index5-Cxc_iCM3.js","assets/index10-C9Xw5wOS.js","assets/index8-DLEM8iM5.js","assets/index9-CUy1AFI-.js","assets/index3-dduGUVTy.js","assets/index4-qdeznE4u.js","assets/index7-Bgw61c0t.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,H as s,J as c,K as l,N as u,O as d,Q as f,R as p,S as m,T as h,U as g,V as _,W as v,X as y,Y as b,Z as x,_ as S,at as C,ct as w,et as T,f as E,g as D,h as O,it as k,j as A,k as j,l as M,n as N,nt as ee,ot as te,q as P,rt as ne,st as F,tt as I,v as L,w as re,y as R,z}from"./vue.runtime.esm-bundler-4XjPOHMM.js";import{o as B,t as ie}from"./index-Cmpdc3EH.js";import{n as ae,t as oe}from"./highlight-BnTrj1LT.js";function se(e){var t;if(typeof e==`boolean`)return e;let n=e;if(n?.expandUnchanged===!0)return!1;let r=Number(n==null||(t=n.parseDiffOptions)==null?void 0:t.context),i=Number(n?.collapsedContextThreshold);return{enabled:!0,contextLineCount:isFinite(r)&&r>=0?Math.floor(r):2,minimumLineCount:isFinite(i)&&i>=0?Math.floor(i)+1:6,revealLineCount:5}}function ce(e){return e.diffStyle===`unified`}function le(e){let t=String(e??``).split(/\r?\n/,1)[0]?.trim()??``;if(t.length<3)return``;let n=t[0];if(n!=="`"&&n!==`~`||t[1]!==n||t[2]!==n)return``;let r=3;for(;t[r]===n;)r+=1;return t.slice(r).trim()}function ue(e){return(String(e??``).trim().split(/\s+/,1)[0]??``)===`diff`}function de(e){return e.diff===!0||ue(e.language)||ue(le(String(e.raw??``)))}function fe(e){let t=le(e);if(!t)return``;let n=t.split(/\s+/).filter(Boolean);if(!n.length)return``;let r=n[0]===`diff`?n.slice(1):n;for(let e of r){let t=e.includes(`:`)?e.slice(e.indexOf(`:`)+1):e;if(t&&/[./\\-]/.test(t))return t}return``}function pe(e,t,n){let r=fe(e);return{title:r||t,caption:r?n?`Diff / ${t}`:t:``}}function me(e){let t=String(e??``).replace(/\r\n$|\n$|\r$/,``);return t?t.split(/\r\n|\n|\r/):[]}var he=``,ge=``,_e=null;function ve(e,t){if(_e&&he===e&&ge===t)return _e;let n=me(e),r=me(t),i=0,a=n.length-1,o=r.length-1;for(;i<=a&&i<=o&&n[i]===r[i];)i++;for(;a>=i&&o>=i&&n[a]===r[o];)a--,o--;let s=Math.max(0,a-i+1),c=Math.max(0,o-i+1),l;if(s===0||c===0)l={removed:s,added:c};else if((s+1)*(c+1)<=15e5){let e=new Map,t=new Uint32Array(c);for(let n=0;n<c;n++){let a=r[i+n],o=e.get(a);o===void 0&&(o=e.size+1,e.set(a,o)),t[n]=o}let a=new Uint32Array(s);for(let t=0;t<s;t++)a[t]=e.get(n[i+t])??0;let o=c+1,u=new Uint32Array(o),d=new Uint32Array(o);for(let e=s-1;e>=0;e--){d[c]=0;for(let n=c-1;n>=0;n--)d[n]=a[e]===t[n]?u[n+1]+1:Math.max(u[n],d[n+1]);let n=u;u=d,d=n}let f=u[0];l={removed:s-f,added:c-f}}else l={removed:s,added:c};return he=e,ge=t,_e=l,l}function ye(e){return`
|
|
3
|
+
[data-file] [data-line],
|
|
4
|
+
[data-diff] [data-line] {
|
|
5
|
+
white-space: ${e===`wrap`?`pre-wrap`:`pre`} !important;
|
|
6
|
+
overflow-wrap: ${e===`wrap`?`anywhere`:`normal`} !important;
|
|
7
|
+
word-break: normal !important;
|
|
8
|
+
}`}function be(){return`
|
|
9
|
+
[data-no-newline],
|
|
10
|
+
[data-gutter-buffer="metadata"] {
|
|
11
|
+
--diffs-computed-decoration-bg: var(--markstream-diff-metadata-bg) !important;
|
|
12
|
+
--diffs-computed-diff-line-bg: var(--markstream-diff-metadata-bg) !important;
|
|
13
|
+
--diffs-computed-selected-line-bg: var(--markstream-diff-metadata-bg) !important;
|
|
14
|
+
--diffs-line-bg: var(--markstream-diff-metadata-bg) !important;
|
|
15
|
+
color: var(--markstream-diff-metadata-fg) !important;
|
|
16
|
+
background-color: var(--markstream-diff-metadata-bg) !important;
|
|
17
|
+
}`}function xe(e,t=``){return`[data-file], [data-diff] { --diffs-min-number-column-width-default: 2ch !important; }
|
|
18
|
+
${ye(e)}
|
|
19
|
+
${be()}
|
|
20
|
+
${t}`.trim()}function V(e){"@babel/helpers - typeof";return V=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},V(e)}function Se(e,t){if(V(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(V(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ce(e){var t=Se(e,`string`);return V(t)==`symbol`?t:t+``}function we(e,t,n){return(t=Ce(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Te(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?H(Object(n),!0).forEach(function(t){we(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ee(){return{original:[],modified:[],matches:[],originalLines:new Set,modifiedLines:new Set}}function De(e,t){if(e.length===0||e.length>t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Oe(e,t,n,r){e.original=t,e.modified=n,e.matches=r,e.originalLines=new Set(t),e.modifiedLines=new Set(n)}var ke=[`diff `,`index `,`--- `,`+++ `,`@@ `],Ae=`\`,je=/\r\n$|\n$|\r$/,Me=/\r\n|\n|\r/,Ne=/(?:\r\n|\n|\r)$/;function Pe(e,t){let n=String(e??``);return t?n:n.replace(je,``)}function Fe(e,t){let n=Pe(e,t);return n?n.split(Me):[]}function Ie(e,t,n,r){let i=Pe(e,t),a=r===`original`?`originalSplit`:`modifiedSplit`,o=n[a];if(o&&t===o.loading&&i.startsWith(o.source)){if(i===``)return n[a]={source:``,loading:t,lines:[]},[];let e=i.slice(o.source.length);if(e===``)return o.lines;let r=o.source.endsWith(`\r`),s=(r?o.source.slice(-1)+e:(o.lines.at(-1)??``)+e).split(Me),c=r?o.lines.slice(0,-1).concat(s.slice(1)):o.lines.slice(0,-1).concat(s);return n[a]={source:i,loading:t,lines:c},c}let s=i?i.split(Me):[];return n[a]={source:i,loading:t,lines:s},s}function Le(e){var t;return((t=String(e??``).split(/\s+/g)[0])==null||(t=t.split(`:`)[0])==null?void 0:t.toLowerCase().replace(/[^\w-]/g,``))||`plaintext`}function Re(e){return String(e??``).trim().length===0}function U(e,t,n,r,i=!1){let a=Re(e);return{code:e,empty:a,key:n,kind:a&&t!==`hunk`&&t!==`spacer`&&!i?`context`:t,number:r}}function ze(e,t){return!Re(e[t])||t<e.length-1}function Be(e){return e.startsWith(`-`)&&!e.startsWith(`---`)}function W(e){return e.startsWith(`+`)&&!e.startsWith(`+++`)}function Ve(e){return e.some(e=>ke.some(t=>e.startsWith(t)))}function He(e,t){return!t&&e.startsWith(` `)&&!e.startsWith(` `)?` ${e}`:e}function Ue(e){return Ne.test(String(e??``))}function We(e,t){return Te(Te({},U(`No newline at end of file`,`metadata`,e,``)),{},{metadataKind:t})}function Ge(e,t,n){let r=String(t??``).length>0&&!Ue(t),i=String(n??``).length>0&&!Ue(n);return!r&&!i||(r&&e.push(We(`inline-no-newline-original`,`removed`)),i&&e.push(We(`inline-no-newline-modified`,`added`))),e}function Ke(e,t){if(Le(e)===`diff`)return!0;let n=String(t??``).split(/\r?\n/,1)[0]?.trim()??``;return/^`{3,}\s*diff(?:\s|$)|^~{3,}\s*diff(?:\s|$)/.test(n)}function qe(e,t,n){let r=e.some(e=>Be(e)),i=e.some(e=>W(e));return r&&i||Ke(t,n)&&(r||i)}function Je(e,t,n){if(n&&De(n.original,e)&&De(n.modified,t)){let r=e.slice(n.original.length),i=t.slice(n.modified.length);if(r.every(e=>!n.modifiedLines.has(e))&&i.every(e=>!n.originalLines.has(e))){let a=n.matches.concat(Ye(r,i).map(e=>({originalIndex:e.originalIndex+n.original.length,modifiedIndex:e.modifiedIndex+n.modified.length})));for(let e of r)n.originalLines.add(e);for(let e of i)n.modifiedLines.add(e);return n.original=e,n.modified=t,n.matches=a,a}}let r=Ye(e,t);return n&&Oe(n,e,t,r),r}function Ye(e,t){let n=[],r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];)n.push({originalIndex:r,modifiedIndex:r}),r++;let i=[],a=e.length-1,o=t.length-1;for(;a>=r&&o>=r&&e[a]===t[o];)i.push({originalIndex:a,modifiedIndex:o}),a--,o--;i.reverse();let s=a-r+1,c=o-r+1;if(s<=0||c<=0||(s+1)*(c+1)>15e5)return n.concat(i);let l=new Map,u=new Uint32Array(c);for(let e=0;e<c;e++){let n=t[r+e],i=l.get(n);i===void 0&&(i=l.size+1,l.set(n,i)),u[e]=i}let d=new Uint32Array(s);for(let t=0;t<s;t++)d[t]=l.get(e[r+t])??0;let f=c+1,p=new Uint32Array((s+1)*(c+1));for(let e=s-1;e>=0;e--)for(let t=c-1;t>=0;t--){let n=e*f+t;p[n]=d[e]===u[t]?p[(e+1)*f+t+1]+1:Math.max(p[(e+1)*f+t],p[e*f+t+1])}let m=[],h=0,g=0;for(;h<s&&g<c;)e[r+h]===t[r+g]?(m.push({originalIndex:r+h,modifiedIndex:r+g}),h++,g++):p[(h+1)*f+g]>=p[h*f+g+1]?h++:g++;return n.concat(m,i)}var Xe=[`diff `,`index `,`--- `,`+++ `];function Ze(e,t){return t&&Xe.some(t=>e.startsWith(t))}function Qe(e){let t=[],n=1,r=1,i=Ve(e);for(let[a,o]of e.entries())if(o===Ae){let e=t.at(-1)?.kind,n=e===`removed`||e===`added`?e:`context`;t.push(We(`inline-no-newline-${a}`,n))}else if(Ze(o,i))continue;else if(o.startsWith(`@@`)){let e=o.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);e&&(n=Number(e[1]),r=Number(e[2])),t.push(U(o,`hunk`,`inline-hunk-${a}`,``))}else if(Be(o))t.push(U(He(o.slice(1),i),`removed`,`inline-removed-${a}`,n++,!0));else if(W(o))t.push(U(He(o.slice(1),i),`added`,`inline-added-${a}`,r++,!0));else{let e=i&&o.startsWith(` `)?o.slice(1):o;t.push(U(e,`context`,`inline-context-${a}`,r)),n++,r++}return t}function $e(e,t,n,r){let i=r?Ie(e,n,r,`original`):Fe(e,n),a=r?Ie(t,n,r,`modified`):Fe(t,n),o=Je(i,a,r);if(o.length>0){let e=[],t=0,n=0;for(let r of o){for(;t<r.originalIndex;)e.push(U(i[t],`removed`,`inline-removed-source-${t}`,t+1,ze(i,t))),t++;for(;n<r.modifiedIndex;)e.push(U(a[n],`added`,`inline-added-source-${n}`,n+1,ze(a,n))),n++;e.push(U(a[r.modifiedIndex],`context`,`inline-context-source-${r.originalIndex}-${r.modifiedIndex}`,r.modifiedIndex+1)),t=r.originalIndex+1,n=r.modifiedIndex+1}for(;t<i.length;)e.push(U(i[t],`removed`,`inline-removed-source-${t}`,t+1,ze(i,t))),t++;for(;n<a.length;)e.push(U(a[n],`added`,`inline-added-source-${n}`,n+1,ze(a,n))),n++;return e}let s=[],c=0,l=i.length-1,u=a.length-1;for(;c<=l&&c<=u&&i[c]===a[c];)s.push(U(a[c],`context`,`inline-prefix-${c}`,c+1)),c++;let d=[];for(;l>=c&&u>=c&&i[l]===a[u];)d.unshift(U(a[u],`context`,`inline-suffix-${u}`,u+1)),l--,u--;for(let e=c;e<=l;e++)s.push(U(i[e],`removed`,`inline-removed-source-${e}`,e+1,ze(i,e)));for(let e=c;e<=u;e++)s.push(U(a[e],`added`,`inline-added-source-${e}`,e+1,ze(a,e)));return s.concat(d)}function et(e,t,n,r,i){let a=i?Ie(e,n,i,`original`):Fe(e,n),o=i?Ie(t,n,i,`modified`):Fe(t,n),s=Je(a,o,i),c=[],l=[],u=0,d=0,f=0,p=(e,t)=>{let n=Math.max(e-u,t-d);for(let r=0;r<n;r++){let n=u+r,i=d+r;c.push(n<e?U(a[n],`removed`,`original-changed-${f}-${n}`,n+1,ze(a,n)):U(``,`spacer`,`original-spacer-${f}-${r}`,``)),l.push(i<t?U(o[i],`added`,`modified-changed-${f}-${i}`,i+1,ze(o,i)):U(``,`spacer`,`modified-spacer-${f}-${r}`,``))}u=e,d=t,f++};for(let e of s)p(e.originalIndex,e.modifiedIndex),c.push(U(a[e.originalIndex],`context`,`original-context-${e.originalIndex}-${e.modifiedIndex}`,e.originalIndex+1)),l.push(U(o[e.modifiedIndex],`context`,`modified-context-${e.originalIndex}-${e.modifiedIndex}`,e.modifiedIndex+1)),u=e.originalIndex+1,d=e.modifiedIndex+1;p(a.length,o.length);let m=String(e??``).length>0&&!Ue(e),h=String(t??``).length>0&&!Ue(t);return(m||h)&&(c.push(m?We(`original-no-newline`,`removed`):U(``,`spacer`,`original-no-newline-spacer`,``)),l.push(h?We(`modified-no-newline`,`added`):U(``,`spacer`,`modified-no-newline-spacer`,``))),nt([{key:`original`,className:`markstream-pre__diff-pane--original`,lines:c},{key:`modified`,className:`markstream-pre__diff-pane--modified`,lines:l}],r)}function tt(e){if(e==null||e===!1)return null;let t=e===!0?{}:e;return t.enabled===!1?null:{contextLineCount:Math.max(0,Math.floor(t.contextLineCount??2)),minimumLineCount:Math.max(1,Math.floor(t.minimumLineCount??4))}}function nt(e,t){let n=tt(t);if(!n||e.length<1||e.length>2||e.length===2&&e[0].lines.length!==e[1].lines.length)return e;let r=e[0].lines,i=e[1]?.lines,a=r.length;for(;a>0&&e.every(e=>e.lines[a-1].kind===`metadata`);)a--;let o=e=>r[e].kind===`context`&&(i===void 0||i[e].kind===`context`&&r[e].code===i[e].code),s=[],c=0;for(;c<a;){let e=c;for(;c<a&&o(c);)c++;let t=c;if(t-e>=n.minimumLineCount){let i=e+(e===0?0:n.contextLineCount),o=t===a,c=t-(o?0:n.contextLineCount);c-i>=n.minimumLineCount&&s.push({start:i,end:o?r.length:c,count:o?a-i:c-i,first:i===0,last:o})}c===e&&c++}return s.length?e.map((e,t)=>{let n=[],r=0;for(let i of s)n.push(...e.lines.slice(r,i.start)),n.push({code:t===0?`${i.count} unmodified lines`:``,kind:`collapsed`,empty:!1,key:`${e.key}-collapsed-${i.start}-${i.end}`,number:``,collapsedFirst:i.first,collapsedLast:i.last}),r=i.end;return n.push(...e.lines.slice(r)),Te(Te({},e),{},{lines:n})}):e}function rt(e){let t=e.loading===!0,n=e.inline===!0,r=Fe(e.code,t),i=e.originalCode,a=e.updatedCode,o=i!=null||a!=null;if(n)return nt([{key:`inline`,className:`markstream-pre__diff-pane--inline`,lines:o?Ge($e(i,a,t,e.matchCache),i,a):Qe(r)}],e.hideUnchangedRegions);if(!qe(r,e.language,e.raw)&&o)return et(i,a,t,e.hideUnchangedRegions,e.matchCache);let{original:s,modified:c}=at(r);return nt([{key:`original`,className:`markstream-pre__diff-pane--original`,lines:s.map((e,t)=>Te(Te({},e),{},{key:`original-${t}`,number:e.kind===`metadata`||e.kind===`spacer`?``:e.number}))},{key:`modified`,className:`markstream-pre__diff-pane--modified`,lines:c.map((e,t)=>Te(Te({},e),{},{key:`modified-${t}`,number:e.kind===`metadata`||e.kind===`spacer`?``:e.number}))}],e.hideUnchangedRegions)}function it(e){let t=e.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);return t?{original:Number(t[1]),modified:Number(t[2])}:void 0}function at(e){let t=[],n=[],r=Ve(e),i=1,a=1,o=`context`,s=0;for(;s<e.length;){let c=e[s];if(c===Ae){o===`removed`?(t.push(We(`original-patch-no-newline`,`removed`)),n.push(U(``,`spacer`,``,``))):o===`added`?(t.push(U(``,`spacer`,``,``)),n.push(We(`modified-patch-no-newline`,`added`))):(t.push(We(`original-patch-no-newline`,`context`)),n.push(We(`modified-patch-no-newline`,`context`))),s++;continue}if(Ze(c,r)){s++;continue}if(c.startsWith(`@@`)){let e=it(c);e&&(i=e.original,a=e.modified),t.push(U(c,`hunk`,``,``)),n.push(U(c,`hunk`,``,``)),o=`context`,s++;continue}if(Be(c)||W(c)){let c=[],l=[];for(;s<e.length&&(Be(e[s])||W(e[s]));)Be(e[s])?(c.push(He(e[s].slice(1),r)),o=`removed`):(l.push(He(e[s].slice(1),r)),o=`added`),s++;let u=Math.max(c.length,l.length);for(let e=0;e<u;e++)t.push(e<c.length?U(c[e],`removed`,``,i++,!0):U(``,`spacer`,``,``)),n.push(e<l.length?U(l[e],`added`,``,a++,!0):U(``,`spacer`,``,``));continue}let l=r&&c.startsWith(` `)?c.slice(1):c;t.push(U(l,`context`,``,i++)),n.push(U(l,`context`,``,a++)),o=`context`,s++}return{original:t,modified:n}}function ot(e,t){let n=e.match(/^---[^\S\r\n]*(?:\r\n?|\n)[\s\S]*?(?:\r\n?|\n)---[^\S\r\n]*(?:\r\n?|\n)/)?.[0]??``,r=e.slice(n.length);return r.trimStart().startsWith(`%%{`)?e:n+t+r}function st(e){let{getTranslate:t,setTranslate:n,canStart:r,onActiveChange:i}=e,a=null,o={x:0,y:0},s={x:0,y:0};function c(e){let t=e?.pointerId;(t==null||t===a)&&a!=null&&(a=null,typeof window<`u`&&(window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),window.removeEventListener(`blur`,c)),i?.(!1))}function l(e){a!=null&&e.pointerId===a&&(e.buttons===0?c():n({x:s.x+(e.clientX-o.x),y:s.y+(e.clientY-o.y)}))}function u(e){e.button===0&&a==null&&(!r||r(e))&&(e.preventDefault(),a=e.pointerId,o={x:e.clientX,y:e.clientY},s=t(),typeof window>`u`?a=null:(window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c),window.addEventListener(`blur`,c),i?.(!0)))}return{start:u,stop:c,isActive:()=>a!=null}}function ct(e){let t=Number.parseFloat(String(e??``));return Number.isFinite(t)&&t>0?t:0}function lt(e,t){if(!e)return t;if(e.classList.contains(`markstream-pre__diff-line--collapsed`))return 32;let n=e.querySelector(`.markstream-pre__diff-content`);return Math.max(t,Math.ceil(n?.getBoundingClientRect().height??0))}function ut(e,t){let n=window.getComputedStyle(e),r=ct(n.getPropertyValue(`--markstream-pre-diff-line-height`))||ct(n.lineHeight)||18,i=e.querySelectorAll(`.markstream-pre__diff-pane--original .markstream-pre__diff-line`),a=e.querySelectorAll(`.markstream-pre__diff-pane--modified .markstream-pre__diff-line`),o=Array.from({length:Math.max(i.length,a.length)},(e,t)=>{let n=lt(i[t]??null,r),o=lt(a[t]??null,r);return{rowHeight:Math.max(r,n,o),originalHeight:n,modifiedHeight:o}});return o.length===t.length&&o.every((e,n)=>{let r=t[n];return r&&Math.abs(e.rowHeight-r.rowHeight)<=.5&&Math.abs(e.originalHeight-r.originalHeight)<=.5&&Math.abs(e.modifiedHeight-r.modifiedHeight)<=.5})?t:o}function dt(e){let t=e.isDark?`dark`:`light`;return e.theme===void 0?(e.isDark?e.darkTheme??e.themes?.[0]:e.lightTheme??e.themes?.[1])??`vitesse-${t}`:typeof e.theme==`string`?e.theme:e.theme[t]}function ft(e,t=!1){let n=e.toLowerCase();return n?/dark|night|moon|black|dracula|mocha|frappe|macchiato|ocean|poimandres|monokai|laserwave|tokyo|rose-pine|material-theme/.test(n)&&!/light|latte|dawn|lotus/.test(n):t}function pt(e){let t=dt(e),n=t===`vitesse-dark`||t!==`vitesse-light`&&ft(t,e.isDark===!0);if(t!==`vitesse-dark`&&t!==`vitesse-light`){let e=n?`var(--markstream-code-theme-bg, #121212)`:`var(--markstream-code-theme-bg, #ffffff)`,r=n?`var(--markstream-code-theme-fg, #dbd7caee)`:`var(--markstream-code-theme-fg, #393a34)`,i=n?`var(--markstream-code-theme-line-number, #dedcd550)`:`var(--markstream-code-theme-line-number, #393a3450)`;return{builtin:!1,dark:n,name:t,background:e,diffAddedLine:`color-mix(in lab, ${e} ${n?`80%`:`88%`}, ${n?`#4d9375`:`#1e754f`})`,diffAddedNumber:`color-mix(in lab, ${e} ${n?`85%`:`91%`}, ${n?`#4d9375`:`#1e754f`})`,diffRemovedLine:`color-mix(in lab, ${e} ${n?`80%`:`88%`}, ${n?`#cb7676`:`#ab5959`})`,diffRemovedNumber:`color-mix(in lab, ${e} ${n?`85%`:`91%`}, ${n?`#cb7676`:`#ab5959`})`,foreground:r,lineNumber:i}}return n?{builtin:!0,dark:!0,name:t,background:`#121212`,diffAddedLine:`color-mix(in lab, #121212 80%, #4d9375)`,diffAddedNumber:`color-mix(in lab, #121212 85%, #4d9375)`,diffRemovedLine:`color-mix(in lab, #121212 80%, #cb7676)`,diffRemovedNumber:`color-mix(in lab, #121212 85%, #cb7676)`,foreground:`#dbd7caee`,lineNumber:`#dedcd550`}:{builtin:!0,dark:!1,name:t,background:`#ffffff`,diffAddedLine:`color-mix(in lab, #ffffff 88%, #1e754f)`,diffAddedNumber:`color-mix(in lab, #ffffff 91%, #1e754f)`,diffRemovedLine:`color-mix(in lab, #ffffff 88%, #ab5959)`,diffRemovedNumber:`color-mix(in lab, #ffffff 91%, #ab5959)`,foreground:`#393a34`,lineNumber:`#393a3450`}}function mt(e){return Te(Te({},e.builtin?{"--markstream-code-theme-bg":e.background,"--markstream-code-theme-fg":e.foreground,"--markstream-code-theme-line-number":e.lineNumber}:{}),{},{"--markstream-diff-added-line-fill":e.diffAddedLine,"--markstream-diff-added-number-fill":e.diffAddedNumber,"--markstream-diff-metadata-bg":e.background,"--markstream-diff-metadata-fg":e.lineNumber,"--markstream-diff-removed-line-fill":e.diffRemovedLine,"--markstream-diff-removed-number-fill":e.diffRemovedNumber,"--markstream-pre-resolved-theme-bg":e.background,"--markstream-pre-resolved-theme-fg":e.foreground,"--markstream-pre-resolved-theme-line-number":e.lineNumber})}var ht=`"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace`;function gt(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function _t(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function vt(e){let t=gt(e?.fontSize)??12,n=gt(e?.lineHeight)??(t===12?18:Math.max(12,Math.round(t*1.5))),r=typeof e?.fontFamily==`string`&&e.fontFamily.trim()?e.fontFamily.trim():ht,i=_t(e?.padding)??8;return{fontFamily:r,fontSize:t,lineHeight:n,maxHeight:gt(e?.maxHeight)??500,overflow:e?.overflow??`wrap`,padding:i,paddingBottom:i,scrollbarGutter:6,tabSize:gt(e?.tabSize)??4}}function yt(e,t){let n=t.padding==null?`1ch`:`${e.padding}px`;return Te(Te({"--markstream-code-font-family":e.fontFamily,"--markstream-code-padding-x":n,"--markstream-code-padding-y":`${e.padding}px`,"--markstream-code-padding-bottom":`${e.paddingBottom}px`,"--markstream-code-scrollbar-gutter":`${e.scrollbarGutter}px`,"--markstream-code-tab-size":String(e.tabSize)},t.diff?{"--markstream-pre-diff-line-height":`${e.lineHeight}px`}:{}),{},{"--markstream-pre-line-number-top":`${e.padding}px`,"--markstream-pre-line-number-left":`0px`,"--markstream-pre-line-number-padding-left":`2ch`,"--markstream-pre-line-number-padding-right":`1ch`,"--markstream-pre-line-number-separator-width":`2px`,"--markstream-pre-line-number-gap-to-code":n,"--markstream-code-padding-left":`calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))`,"background-color":`var(--markstream-code-fallback-bg, var(--markstream-code-theme-bg, var(--markstream-pre-resolved-theme-bg)))`,color:`var(--markstream-code-fallback-fg, var(--markstream-code-theme-fg, var(--markstream-pre-resolved-theme-fg)))`,"box-sizing":`border-box`,"font-family":e.fontFamily,"font-size":`${e.fontSize}px`,"line-height":`${e.lineHeight}px`,"tab-size":e.tabSize,"white-space":e.overflow===`scroll`?`pre`:`pre-wrap`,overflow:`auto`,"overflow-x":e.overflow===`wrap`?`hidden`:`auto`,"overflow-y":`auto`,"overflow-wrap":e.overflow===`wrap`?`anywhere`:`normal`,"word-break":`normal`,"padding-top":`${e.padding}px`,"padding-bottom":`${e.paddingBottom}px`,"padding-left":t.showLineNumbers?`var(--markstream-code-padding-left)`:n,"padding-right":n,"max-height":`${e.maxHeight}px`,"scrollbar-gutter":t.diff?`auto`:`stable`,width:`100%`,margin:`0`})}function bt(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function xt(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){bt(a,r,i,o,s,`next`,e)}function s(e){bt(a,r,i,o,s,`throw`,e)}o(void 0)})}}var St={maxCharsPerSecond:3e3,maxCommitFps:20,startDelayMs:0,flushOnFinish:!0,maxCharsPerCommit:160,catchUpLatencyMs:220,catchUpThreshold:400};function Ct(e,t){let n=!1,r=!1,i=0,a,o=0,s=256,c=0,l=!1,u=0,d=!1,f=!1,p=[],m=typeof document<`u`&&typeof requestAnimationFrame==`function`,h=e=>{n=e,t.onReady(e)};function g(){i&&cancelAnimationFrame(i),a!=null&&clearTimeout(a),i=0,a=void 0}function _(t=!0){g(),o++,r&&(document.removeEventListener(`visibilitychange`,y),r=!1,t&&e.resume()),p.length&&!f&&v()}function v(){f||i||a!=null||(document.visibilityState===`hidden`?a=setTimeout(b,200):i=requestAnimationFrame(()=>{var e;i=0;let n=performance.now();(e=t.measure)==null||e.call(t);let r=Math.max(1,c+performance.now()-n);s=Math.max(256,Math.min(1024,Math.floor(s*Math.max(.25,Math.min(1.5,12/r))))),a=setTimeout(b,0)}))}function y(){g(),v()}function b(){return x.apply(this,arguments)}function x(){return x=xt(function*(){i=0,a=void 0;let n=o,l=performance.now();for(;p.length;){if(yield t.commit(p.shift()),n!==o||f)return;if(performance.now()-l>=12){c=performance.now()-l,v();return}}r&&(e.getSnapshot().pendingChars?(yield t.commit(()=>e.flush({maxChars:s})),n!==o||f||(c=performance.now()-l,v())):(_(),yield t.commit(()=>h(!0))))}),x.apply(this,arguments)}function S(){let n=t.flushOnFinish!==!1;!n||!m||e.getSnapshot().source.length<=1024?(e.finish({flush:n}),h(!0)):(e.pause(),r=!0,e.finish({flush:!1}),s=256,c=12,e.getSnapshot().pendingChars<=1024&&e.flush(),document.addEventListener(`visibilitychange`,y),v())}return{update(t,r,i,a,o=!0){if(f=!1,!r&&a!==!0&&(l=!0),!l&&!r&&a===!0){_(),e.reset(t),e.finish({flush:!0}),h(!0);return}let s=e.getSnapshot();if(!r&&a===!0&&n&&t===s.source&&s.caughtUp)return;if(h(!1),_(),r||!i){u=0,d=!1,e.reset(r?``:t),!r&&a&&e.finish({flush:!0}),h(!r&&a===!0);return}let c=!1;if(!t||!t.startsWith(s.source))u=0,d=!1,e.reset(t),c=!!t;else if(t!==s.source){let n=t.slice(s.source.length);!o&&n.length<=8?(u++,d||u>=2&&s.pendingChars<=8?(d=!0,e.reset(t,{prefixKnown:!0})):e.enqueue(n)):(u=0,d=!1,e.enqueue(n))}a&&(c?(e.finish({flush:!0}),h(!0)):S())},scheduleCleanup(e){f||(m?(p.push(e),v()):e())},dispose(){f=!0,p.length=0,_(!1)}}}var wt={plain:`plaintext`,text:`plaintext`,txt:`plaintext`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,ts:`typescript`,mts:`typescript`,cts:`typescript`,golang:`go`,py:`python`,rb:`ruby`,rs:`rust`,kt:`kotlin`,kts:`kotlin`,md:`markdown`,yml:`yaml`,sh:`shellscript`,bash:`shellscript`,zsh:`shellscript`,shell:`shellscript`,shellscript:`shellscript`,ps:`powershell`,ps1:`powershell`,pwsh:`powershell`,"c++":`cpp`,"c#":`csharp`,cs:`csharp`,objc:`objective-c`,objectivec:`objective-c`,"objective-c":`objective-c`,objectivecpp:`objective-cpp`,"objective-c++":`objective-cpp`,"objective-cpp":`objective-cpp`};function Tt(e){let t=String(e??``).trim();if(!t)return``;let[n=``]=t.split(/\s+/);return n.split(`:`)[0]?.trim().toLowerCase()??``}function Et(e){let t=Tt(e);return wt[t]??t}var G=`|checkbox|checkbox_input|emoji|emphasis|hardbreak|highlight|inline_code|insert|link|reference|strikethrough|strong|subscript|superscript|text|`,Dt=`|emphasis|highlight|insert|link|strikethrough|strong|subscript|superscript|`;function Ot(e){if(!e||typeof e!=`object`)return!1;let t=`|${e.type}|`;if(!G.includes(t))return!1;if(!Dt.includes(t))return!0;let n=e.children;return Array.isArray(n)&&n.every(Ot)}function kt(e,t=!0,n=!1){if(!e||!n&&e.length===0)return null;if(e.every(Ot))return e;if(!t||e.length!==1)return null;let r=e[0];if(r?.type!==`paragraph`||!Array.isArray(r.children))return null;let i=r.children;return(n||i.length>0)&&i.every(Ot)?i:null}function At(e){if(!e?.length)return null;let t=``;for(let n of e){if(n?.type!==`text`||n.center===!0)return null;t+=String(n.content??n.raw??``)}return t}function jt(e,t,n=1){let r=Number(e);return Number.isFinite(r)?Math.max(n,r):t}function Mt(e,t){let n=Number(e);return Number.isFinite(n)?Math.max(0,n):t}var Nt=2048,K=200;function Pt(){return typeof performance<`u`?performance.now():Date.now()}var Ft=class{constructor(e={},t){this.source=``,this.visible=``,this.done=!1,this.paused=!1,this.listeners=new Set,this.rafId=0,this.timerId=null,this.visibilityListener=null,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.lastArrival=null,this.hasStarted=!1,this.destroyed=!1,this.fenceScanOffset=0,this.fenceLineStart=0,this.fenceLineState=`candidate`,this.fenceIndent=0,this.fenceMarker=``,this.fenceMarkerLength=0,this.activeFenceMarker=``,this.activeFenceLength=0,this.blockedRevealEnd=0,this.atomicRevealRanges=[],this.atomicRevealRangeIndex=0,this.getSnapshot=()=>({source:this.source,visible:this.visible,done:this.done,paused:this.paused,pendingChars:this.pendingChars,caughtUp:this.caughtUp,final:this.final}),this.subscribe=e=>this.destroyed?()=>{}:(this.listeners.add(e),()=>{this.listeners.delete(e)}),this.enqueue=e=>{if(this.destroyed||!e)return;this.done&&=!1;let t=this.source.length>0,n=this.pendingChars<=0,r=this.isRevealBlocked();this.source+=e,this.scanAppendedSource();let i=Pt(),a=this.lastArrival==null?e.length:e.length/Math.max(.01,(i-this.lastArrival)/1e3);this.currentCps=zt(this.lastArrival==null?a:this.currentCps*.9+a*.1,this.minCharsPerSecond,this.maxCharsPerSecond),this.lastArrival=i,(n||r&&!this.isRevealBlocked())&&(this.startedAt=t&&this.hasStarted?i-this.normalizedStartDelayMs:i,this.lastTick=i,this.charBudget=0),this.hasStarted=!0,this.emit(),this.ensureLoop()},this.finish=(e={})=>{this.destroyed||(this.done=!0,this.releaseTrailingFenceCandidate(),e.flush??this.flushOnFinish?(this.visible=this.source,this.discardConsumedAtomicRanges(),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.lastArrival=null,this.cancelLoop(),this.emit()):(this.emit(),this.ensureLoop()))},this.flush=e=>{if(!this.destroyed){if(this.releaseTrailingFenceCandidate(),e?.maxChars!=null){let t=Math.trunc(jt(e.maxChars,1));this.visible+=this.takeNextRevealSlice(t).text}else this.visible=this.source;this.discardConsumedAtomicRanges(),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.lastArrival=null,this.cancelLoop(),this.emit()}},this.reset=(e=``,t)=>{if(this.destroyed)return;this.cancelLoop(),t?.prefixKnown||e.startsWith(this.source)?(this.source=e,this.scanAppendedSource()):(this.resetFenceScanner(),this.source=e,this.scanAppendedSource());let n=this.getRevealableEnd();this.visible=n>=this.source.length?this.source:this.source.slice(0,n),this.discardConsumedAtomicRanges(),this.done=!1,this.paused=!1,this.hasStarted=!1,this.startedAt=0,this.lastTick=0,this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.lastArrival=null,this.emit()},this.pause=()=>{this.destroyed||this.paused||(this.paused=!0,this.cancelLoop(),this.emit())},this.resume=()=>{if(this.destroyed||!this.paused)return;this.paused=!1;let e=Pt();this.lastTick=e,this.startedAt||=e,this.emit(),this.ensureLoop()},this.destroy=()=>{this.destroyed||(this.destroyed=!0,this.cancelLoop(),this.detachVisibilityListener(),this.listeners.clear())},this.dispose=()=>{this.destroy()},this.tick=e=>{if(this.rafId=0,this.timerId=null,this.destroyed||this.paused)return;if(!this.hasRevealableChars()){this.startedAt=0,this.lastTick=0,this.charBudget=0;return}if(e-this.startedAt<this.normalizedStartDelayMs){this.ensureLoop();return}let t=this.pendingChars;if(this.burstInitialContent&&t>=this.burstRevealThresholdChars){let e=this.getRevealableEnd();this.visible.length<e&&(this.visible=e>=this.source.length?this.source:this.source.slice(0,e),this.charBudget=0,this.currentCps=this.minCharsPerSecond,this.emit()),this.ensureLoop();return}let n=1e3/Math.max(1,this.maxCommitFps),r=Math.min(100,Math.max(0,e-this.lastTick));if(r<n){this.ensureLoop();return}this.lastTick=e;let i=this.pendingChars,a=i>this.normalizedCatchUpThreshold?this.normalizedCatchUpLatencyMs:this.normalizedTargetLatencyMs,o=zt(i/Math.max(.001,a/1e3),this.minCharsPerSecond,this.maxCharsPerSecond);if(this.currentCps+=(o-this.currentCps)*.2,this.charBudget+=this.currentCps*(r/1e3),this.charBudget<1){this.ensureLoop();return}let s=Math.min(Math.floor(this.charBudget),this.maxCharsPerCommit),c=this.takeNextRevealSlice(s);c.text&&(this.visible+=c.text,this.charBudget=Math.max(0,this.charBudget-c.graphemeCount),this.emit()),this.ensureLoop()},this.handleVisibilityChange=()=>{this.destroyed||(this.isDocumentHidden()?(this.cancelLoop(),this.ensureLoop()):this.timerId==null&&this.rafId||(this.cancelLoop(),this.ensureLoop()))};let{minCharsPerSecond:n=40,maxCharsPerSecond:r=1e3,targetLatencyMs:i=900,catchUpLatencyMs:a=350,catchUpThreshold:o=600,maxCommitFps:s=30,startDelayMs:c=80,maxCharsPerCommit:l=80,flushOnFinish:u=!1,burstInitialContent:d=!1,burstRevealThresholdChars:f=Nt}=e;this.minCharsPerSecond=jt(n,40,1),this.maxCharsPerSecond=Math.max(this.minCharsPerSecond,jt(r,1e3,1)),this.normalizedTargetLatencyMs=jt(i,900,1),this.normalizedCatchUpLatencyMs=jt(a,350,1),this.normalizedCatchUpThreshold=Mt(o,600),this.normalizedStartDelayMs=Mt(c,80),this.maxCommitFps=Math.trunc(jt(s,30,1)),this.maxCharsPerCommit=Math.trunc(jt(l,80,1)),this.flushOnFinish=u,this.burstInitialContent=d===!0,this.burstRevealThresholdChars=Math.max(1,Math.trunc(jt(f,Nt,1))),this.segmenter=Lt(),t&&this.listeners.add(t),this.currentCps=this.minCharsPerSecond}attachVisibilityListener(){this.visibilityListener||typeof document>`u`||typeof document.addEventListener!=`function`||(this.visibilityListener=this.handleVisibilityChange,document.addEventListener(`visibilitychange`,this.visibilityListener))}detachVisibilityListener(){this.visibilityListener&&typeof document<`u`&&typeof document.removeEventListener==`function`&&(document.removeEventListener(`visibilitychange`,this.visibilityListener),this.visibilityListener=null)}get pendingChars(){return Math.max(0,this.source.length-this.visible.length)}get caughtUp(){return this.pendingChars===0}get final(){return this.done&&this.caughtUp}resetFenceScanner(){this.fenceScanOffset=0,this.fenceLineStart=0,this.fenceLineState=`candidate`,this.fenceIndent=0,this.fenceMarker=``,this.fenceMarkerLength=0,this.activeFenceMarker=``,this.activeFenceLength=0,this.blockedRevealEnd=0,this.atomicRevealRanges.length=0,this.atomicRevealRangeIndex=0}scanAppendedSource(e=!1){for(;this.fenceScanOffset<this.source.length;){let t=this.source[this.fenceScanOffset];if(t===`\r`){if(this.fenceScanOffset+1>=this.source.length&&!e)break;if(this.source[this.fenceScanOffset+1]===`
|
|
21
|
+
`){let e=this.fenceScanOffset+2;this.completeFenceLine(e),this.fenceScanOffset=e;continue}}if(t===`
|
|
22
|
+
`){let e=this.fenceScanOffset+1;this.completeFenceLine(e),this.fenceScanOffset=e}else this.consumeFenceCharacter(t),this.fenceScanOffset++}this.updateFenceRevealBlock()}consumeFenceCharacter(e){if(this.fenceLineState!==`normal`){if(this.fenceLineState===`opening`)this.fenceMarker==="`"&&e==="`"&&(this.fenceLineState=`normal`);else if(this.fenceLineState===`closing`)e!==` `&&e!==` `&&(this.fenceLineState=`normal`);else if(this.fenceMarker)e===this.fenceMarker?this.fenceMarkerLength++:this.fenceLineState=this.activeFenceMarker?this.fenceMarker===this.activeFenceMarker&&this.fenceMarkerLength>=this.activeFenceLength&&(e===` `||e===` `)?`closing`:`normal`:this.fenceMarkerLength>=3?`opening`:`normal`;else{if(e===` `&&this.fenceIndent<3){this.fenceIndent++;return}if(e==="`"||e===`~`){this.fenceMarker=e,this.fenceMarkerLength=1;return}this.fenceLineState=`normal`}}}completeFenceLine(e){let t=this.fenceLineState===`candidate`&&this.fenceMarkerLength>=3;!this.activeFenceMarker&&(this.fenceLineState===`opening`||t)?(this.atomicRevealRanges.push({start:this.fenceLineStart,end:e}),this.activeFenceMarker=this.fenceMarker,this.activeFenceLength=this.fenceMarkerLength):this.activeFenceMarker&&this.fenceMarker===this.activeFenceMarker&&this.fenceMarkerLength>=this.activeFenceLength&&(this.fenceLineState===`closing`||t)&&(this.activeFenceMarker=``,this.activeFenceLength=0),this.fenceLineStart=e,this.fenceLineState=`candidate`,this.fenceIndent=0,this.fenceMarker=``,this.fenceMarkerLength=0,this.blockedRevealEnd=0}updateFenceRevealBlock(){this.blockedRevealEnd=!this.activeFenceMarker&&(this.fenceLineState===`opening`||this.fenceLineState===`candidate`&&(this.fenceIndent>0||this.fenceMarkerLength>0))?this.fenceLineStart+1:0}releaseTrailingFenceCandidate(){this.scanAppendedSource(!0),this.blockedRevealEnd&&=((this.fenceLineState===`opening`||this.fenceLineState===`candidate`&&this.fenceMarkerLength>=3)&&this.source.length>this.fenceLineStart&&this.atomicRevealRanges.push({start:this.fenceLineStart,end:this.source.length}),this.fenceLineState=`normal`,0)}isRevealBlocked(){return this.blockedRevealEnd!==0}getRevealableEnd(){return this.blockedRevealEnd?Math.min(this.source.length,this.blockedRevealEnd-1):this.source.length}hasRevealableChars(){return this.visible.length<this.getRevealableEnd()}takeNextRevealSlice(e){this.discardConsumedAtomicRanges();let t=this.getRevealableEnd();if(this.visible.length>=t)return{text:``,graphemeCount:0};let n=this.atomicRevealRanges[this.atomicRevealRangeIndex];if(n&&this.visible.length>=n.start&&this.visible.length<n.end)return Rt(this.source,this.visible.length,n.end-this.visible.length,this.segmenter,Math.min(n.end,t));let r=n&&n.start>this.visible.length?Math.min(n.start,t):t;return Rt(this.source,this.visible.length,e,this.segmenter,r)}discardConsumedAtomicRanges(){for(;this.atomicRevealRangeIndex<this.atomicRevealRanges.length&&this.atomicRevealRanges[this.atomicRevealRangeIndex].end<=this.visible.length;)this.atomicRevealRangeIndex++;this.atomicRevealRangeIndex>=64&&this.atomicRevealRangeIndex*2>=this.atomicRevealRanges.length&&(this.atomicRevealRanges.splice(0,this.atomicRevealRangeIndex),this.atomicRevealRangeIndex=0)}isDocumentHidden(){return typeof document<`u`&&document.visibilityState===`hidden`}ensureLoop(){this.destroyed||this.rafId||this.timerId!=null||this.paused||!this.hasRevealableChars()||(typeof requestAnimationFrame==`function`?(this.attachVisibilityListener(),this.isDocumentHidden()&&typeof setTimeout==`function`?this.timerId=setTimeout(()=>{this.timerId=null,this.tick(Pt())},K):this.rafId=requestAnimationFrame(this.tick)):this.flush())}cancelLoop(){this.rafId&&=(typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(this.rafId),0),this.timerId!=null&&(clearTimeout(this.timerId),this.timerId=null),this.detachVisibilityListener()}emit(){if(!this.destroyed)for(let e of this.listeners)e()}};function It(e={},t){let n=new Ft(e,t);return{getSnapshot:n.getSnapshot,subscribe:n.subscribe,enqueue:n.enqueue,finish:n.finish,flush:n.flush,reset:n.reset,pause:n.pause,resume:n.resume,destroy:n.destroy,dispose:n.dispose}}function Lt(){if(typeof Intl>`u`)return null;let e=Intl.Segmenter;return e?new e(void 0,{granularity:`grapheme`}):null}function Rt(e,t,n,r,i=e.length){let a=Math.min(e.length,Math.max(t,i));if(t>=a||n<=0)return{text:``,graphemeCount:0};if(!r){let r=t,i=0;for(;r<a&&i<n;){let t=e.charCodeAt(r),n=e.charCodeAt(r+1);r=Math.min(a,r+(t>=55296&&t<=56319&&n>=56320&&n<=57343?2:1)),i++}return{text:e.slice(t,r),graphemeCount:i}}let o=t,s=0,c=!0;for(;s<n&&o<a;){let t=e.codePointAt(o),n=t>65535?2:1;if(o+n>a||!Vt(t)){c=!1;break}o+=n,s++}if(c&&o>t&&!(o<a&&e.charCodeAt(o-1)===13&&e.charCodeAt(o)===10)){let n=e.codePointAt(o),r=n!=null&&o+(n!=null&&n>65535?2:1)<=a&&Vt(n);if(o>=a||r)return{text:e.slice(t,o),graphemeCount:s}}let l=a-t,u=Math.min(l,Math.max(64,n*2));for(;;){let i=u>=l,a=e.slice(t,t+u),o=0,s=0;for(let i of r.segment(a)){if(s>=n)return{text:e.slice(t,t+o),graphemeCount:s};o+=i.segment.length,s++}if(i)return{text:e.slice(t,t+o),graphemeCount:s};u=Math.min(l,u*2)}}function zt(e,t,n){return Math.min(n,Math.max(t,e))}function Bt(e){return e>=11904&&e<=12329||e>=12336&&e<=12351||e>=12352&&e<=12440||e>=12443&&e<=12543||e>=12544&&e<=12799||e>=12800&&e<=13311||e>=13312&&e<=19903||e>=19968&&e<=40959||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65103||e>=65280&&e<=65437||e>=65440&&e<=65519||e>=127488&&e<=127743||e>=131072&&e<=196607}function Vt(e){return e<=127||Bt(e)}var Ht=Intl.Segmenter,Ut=Ht?new Ht(void 0,{granularity:`word`}):null,Wt=64;function Gt(e){let t=[],n=!0;for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127){n=!1;break}let r=n||!Ut?Array.from(e.matchAll(/[a-z0-9]+|[^a-z0-9]+/gi),([e])=>({segment:e,isWordLike:/^[a-z0-9]/i.test(e)})):Ut.segment(e);for(let{segment:e,isWordLike:n}of r)n||!t.length?t.push(e):t[t.length-1]+=e;return t}function Kt(e){let t=e,n=[],r=e,i=0,a;function o(e,o,s){if(!s&&e===r&&n.length===0||s&&e===r&&(!o||o===e||n.length>0))return;let c=o??r;if(s&&c&&e.length>c.length&&e.startsWith(c)){c!==r&&(t=c,n=[],a=void 0);let o=e.slice(c.length),s=Gt((a?.content??``)+o);if(a&&s[0]?.startsWith(a.content)){let e=s.shift(),r=n.findIndex(e=>e.id===a.id);r<0?t+=e.slice(a.content.length):(n=[...n],n[r]=Te(Te({},a),{},{content:e})),a=Te(Te({},a),{},{content:e})}else a&&(s=Gt(o));if(!n.length&&s.length&&/^\s+$/.test(s[0])&&(t+=s.shift()),s.length>Wt&&(s=[s.slice(0,-1).join(``),s[s.length-1]]),s.length){let e=performance.now(),t=s.map(t=>({id:i++,content:t,startedAt:e,finished:!1}));n=[...n,...t],a=t[t.length-1]}}else t=e,n=[],a=void 0;r=e}function s(){let e=0,r=``;for(let t of n){if(!t.finished)break;r+=t.content,e++}e&&(t+=r,n=n.slice(e))}function c(e,t=!1){let r=n.find(t=>t.id===e);r&&(r.finished=!0,a?.id===e&&(a=r),t||s())}function l(e=!1){for(let e of n)e.finished=!0;n.length&&(a=n[n.length-1]),e||s()}return{getSnapshot:()=>({settledContent:t,segments:n}),update:o,finish:c,finishAll:l,settleFinished:s}}var qt=[/javascript:/i,/expression\s*\(/i,/url\s*\(\s*javascript:/i,/@import/i],Jt=/^(?:https?:|mailto:|tel:|#|\/|data:image\/(?:png|gif|jpe?g|webp);)/i;function Yt(e){return e.replace(/["']\s*javascript:/gi,`#`).replace(/\bjavascript:/gi,`#`).replace(/["']\s*vbscript:/gi,`#`).replace(/\bvbscript:/gi,`#`).replace(/\bdata:text\/html/gi,`#`)}function Xt(e){if(!e)return``;let t=e.trim();return Jt.test(t)?t:``}function Zt(e){let t=new Set([`script`]),n=[e,...Array.from(e.querySelectorAll(`*`))];for(let e of n){if(t.has(e.tagName.toLowerCase())){e.remove();continue}let n=Array.from(e.attributes);for(let t of n){let n=t.name;if(/^on/i.test(n))e.removeAttribute(n);else if(n===`style`&&t.value&&qt.some(e=>e.test(t.value)))e.removeAttribute(n);else if((n===`href`||n===`xlink:href`)&&t.value){let r=Xt(t.value);if(!r){e.removeAttribute(n);continue}r!==t.value&&e.setAttribute(n,r)}}}}function Qt(e,t){if(typeof DOMParser>`u`||!e)return``;let n=Yt(e),r=new DOMParser().parseFromString(n,`image/svg+xml`).documentElement;if(!r||r.nodeName.toLowerCase()!==`svg`)return``;let i=r;return Zt(i),t&&i.classList.add(t),i.outerHTML}var $t=Object.create,en=Object.defineProperty,tn=Object.getOwnPropertyDescriptor,nn=Object.getOwnPropertyNames,rn=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty,on=(e,t)=>function(){return t||(0,e[nn(e)[0]])((t={exports:{}}).exports,t),t.exports},sn=e=>{let t={};for(var n in e)en(t,n,{get:e[n],enumerable:!0});return t},q=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=nn(t),a=0,o=i.length,s;a<o;a++)s=i[a],!an.call(e,s)&&s!==n&&en(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=tn(t,s))||r.enumerable});return e},cn=(e,t,n)=>(n=e==null?{}:$t(rn(e)),q(t||!e||!e.__esModule?en(n,`default`,{value:e,enumerable:!0}):n,e));function ln(e,t,n,r){let i=Number(e[t].meta.id+1).toString(),a=``;return typeof r.docId==`string`&&(a=`-${r.docId}-`),a+i}function un(e,t){let n=Number(e[t].meta.id+1).toString();return e[t].meta.subId>0&&(n+=`:${e[t].meta.subId}`),`[${n}]`}function dn(e,t,n,r,i){let a=i.rules.footnote_anchor_name(e,t,n,r,i),o=i.rules.footnote_caption(e,t,n,r,i),s=a;return e[t].meta.subId>0&&(s+=`:${e[t].meta.subId}`),`<sup class="footnote-ref"><a href="#fn${a}" id="fnref${s}">${o}</a></sup>`}function fn(e,t,n){return(n.xhtmlOut?`<hr class="footnotes-sep" />
|
|
23
|
+
`:`<hr class="footnotes-sep">
|
|
24
|
+
`)+`<section class="footnotes">
|
|
25
|
+
<ol class="footnotes-list">
|
|
26
|
+
`}function pn(){return`</ol>
|
|
27
|
+
</section>
|
|
28
|
+
`}function mn(e,t,n,r,i){let a=i.rules.footnote_anchor_name(e,t,n,r,i);return e[t].meta.subId>0&&(a+=`:${e[t].meta.subId}`),`<li id="fn${a}" class="footnote-item">`}function hn(){return`</li>
|
|
29
|
+
`}function gn(e,t,n,r,i){let a=i.rules.footnote_anchor_name(e,t,n,r,i);return e[t].meta.subId>0&&(a+=`:${e[t].meta.subId}`),` <a href="#fnref${a}" class="footnote-backref">\u21a9\uFE0E</a>`}function _n(e){let t=e.helpers.parseLinkLabel,n=e.utils.isSpace;e.renderer.rules.footnote_ref=dn,e.renderer.rules.footnote_block_open=fn,e.renderer.rules.footnote_block_close=pn,e.renderer.rules.footnote_open=mn,e.renderer.rules.footnote_close=hn,e.renderer.rules.footnote_anchor=gn,e.renderer.rules.footnote_caption=un,e.renderer.rules.footnote_anchor_name=ln;function r(e,t,r,i){let a=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(a+4>o||e.src.charCodeAt(a)!==91||e.src.charCodeAt(a+1)!==94)return!1;let s;for(s=a+2;s<o;s++){if(e.src.charCodeAt(s)===32)return!1;if(e.src.charCodeAt(s)===93)break}if(s===a+2||s+1>=o||e.src.charCodeAt(++s)!==58)return!1;if(i)return!0;s++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={});let c=e.src.slice(a+2,s-2);e.env.footnotes.refs[`:${c}`]=-1;let l=new e.Token(`footnote_reference_open`,``,1);l.meta={label:c},l.level=e.level++,e.tokens.push(l);let u=e.bMarks[t],d=e.tShift[t],f=e.sCount[t],p=e.parentType,m=s,h=e.sCount[t]+s-(e.bMarks[t]+e.tShift[t]),g=h;for(;s<o;){let t=e.src.charCodeAt(s);if(n(t))t===9?g+=4-g%4:g++;else break;s++}e.tShift[t]=s-m,e.sCount[t]=g-h,e.bMarks[t]=m,e.blkIndent+=4,e.parentType=`footnote`,e.sCount[t]<e.blkIndent&&(e.sCount[t]+=e.blkIndent),e.md.block.tokenize(e,t,r,!0),e.parentType=p,e.blkIndent-=4,e.tShift[t]=d,e.sCount[t]=f,e.bMarks[t]=u;let _=new e.Token(`footnote_reference_close`,``,-1);return _.level=--e.level,e.tokens.push(_),!0}function i(e,n){let r=e.posMax,i=e.pos;if(i+2>=r||e.src.charCodeAt(i)!==94||e.src.charCodeAt(i+1)!==91)return!1;let a=i+2,o=t(e,i+1);if(o<0)return!1;if(!n){e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]);let t=e.env.footnotes.list.length,n=[];e.md.inline.parse(e.src.slice(a,o),e.md,e.env,n);let r=e.push(`footnote_ref`,``,0);r.meta={id:t},e.env.footnotes.list[t]={content:e.src.slice(a,o),tokens:n}}return e.pos=o+1,e.posMax=r,!0}function a(e,t){let n=e.posMax,r=e.pos;if(r+3>n||!e.env.footnotes||!e.env.footnotes.refs||e.src.charCodeAt(r)!==91||e.src.charCodeAt(r+1)!==94)return!1;let i;for(i=r+2;i<n;i++){if(e.src.charCodeAt(i)===32||e.src.charCodeAt(i)===10)return!1;if(e.src.charCodeAt(i)===93)break}if(i===r+2||i>=n)return!1;i++;let a=e.src.slice(r+2,i-1);if(e.env.footnotes.refs[`:${a}`]===void 0)return!1;if(!t){e.env.footnotes.list||(e.env.footnotes.list=[]);let t;e.env.footnotes.refs[`:${a}`]<0?(t=e.env.footnotes.list.length,e.env.footnotes.list[t]={label:a,count:0},e.env.footnotes.refs[`:${a}`]=t):t=e.env.footnotes.refs[`:${a}`];let n=e.env.footnotes.list[t].count;e.env.footnotes.list[t].count++;let r=e.push(`footnote_ref`,``,0);r.meta={id:t,subId:n,label:a}}return e.pos=i,e.posMax=n,!0}function o(e){let t,n,r,i=!1,a={};if(!e.env.footnotes||(e.tokens=e.tokens.filter(function(e){return e.type===`footnote_reference_open`?(i=!0,n=[],r=e.meta.label,!1):e.type===`footnote_reference_close`?(i=!1,a[`:`+r]=n,!1):(i&&n.push(e),!i)}),!e.env.footnotes.list))return;let o=e.env.footnotes.list;e.tokens.push(new e.Token(`footnote_block_open`,``,1));for(let n=0,r=o.length;n<r;n++){let r=new e.Token(`footnote_open`,``,1);if(r.meta={id:n,label:o[n].label},e.tokens.push(r),o[n].tokens){t=[];let r=new e.Token(`paragraph_open`,`p`,1);r.block=!0,t.push(r);let i=new e.Token(`inline`,``,0);i.children=o[n].tokens,i.content=o[n].content,t.push(i);let a=new e.Token(`paragraph_close`,`p`,-1);a.block=!0,t.push(a)}else o[n].label&&(t=a[`:${o[n].label}`]);t&&(e.tokens=e.tokens.concat(t));let i;i=e.tokens[e.tokens.length-1].type===`paragraph_close`?e.tokens.pop():null;let s=o[n].count>0?o[n].count:1;for(let t=0;t<s;t++){let r=new e.Token(`footnote_anchor`,``,0);r.meta={id:n,subId:t,label:o[n].label},e.tokens.push(r)}i&&e.tokens.push(i),e.tokens.push(new e.Token(`footnote_close`,``,-1))}e.tokens.push(new e.Token(`footnote_block_close`,``,-1))}e.block.ruler.before(`reference`,`footnote_def`,r,{alt:[`paragraph`,`reference`]}),e.inline.ruler.after(`image`,`footnote_inline`,i),e.inline.ruler.after(`footnote_inline`,`footnote_ref`,a),e.core.ruler.after(`inline`,`footnote_tail`,o)}function vn(e){function t(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==43)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;if(a%2){let t=e.push(`text`,``,0);t.content=o,a--}for(let t=0;t<a;t+=2){let n=e.push(`text`,``,0);n.content=o+o,(i.can_open||i.can_close)&&e.delimiters.push({marker:r,length:0,jump:t/2,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function n(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==43||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`ins_open`,n.tag=`ins`,n.nesting=1,n.markup=`++`,n.content=``,n=e.tokens[o.token],n.type=`ins_close`,n.tag=`ins`,n.nesting=-1,n.markup=`++`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`+`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`ins_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}e.inline.ruler.before(`emphasis`,`ins`,t),e.inline.ruler2.before(`emphasis`,`ins`,function(e){let t=e.tokens_meta,r=(e.tokens_meta||[]).length;n(e,e.delimiters);for(let i=0;i<r;i++)t[i]&&t[i].delimiters&&n(e,t[i].delimiters)})}function yn(e){function t(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==61)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;if(a%2){let t=e.push(`text`,``,0);t.content=o,a--}for(let t=0;t<a;t+=2){let n=e.push(`text`,``,0);n.content=o+o,(i.can_open||i.can_close)&&e.delimiters.push({marker:r,length:0,jump:t/2,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function n(e,t){let n=[],r=t.length;for(let i=0;i<r;i++){let r=t[i];if(r.marker!==61||r.end===-1)continue;let a=t[r.end],o=e.tokens[r.token];o.type=`mark_open`,o.tag=`mark`,o.nesting=1,o.markup=`==`,o.content=``;let s=e.tokens[a.token];s.type=`mark_close`,s.tag=`mark`,s.nesting=-1,s.markup=`==`,s.content=``,e.tokens[a.token-1].type===`text`&&e.tokens[a.token-1].content===`=`&&n.push(a.token-1)}for(;n.length;){let t=n.pop(),r=t+1;for(;r<e.tokens.length&&e.tokens[r].type===`mark_close`;)r++;if(r--,t!==r){let n=e.tokens[r];e.tokens[r]=e.tokens[t],e.tokens[t]=n}}}e.inline.ruler.before(`emphasis`,`mark`,t),e.inline.ruler2.before(`emphasis`,`mark`,function(e){let t,r=e.tokens_meta,i=(e.tokens_meta||[]).length;for(n(e,e.delimiters),t=0;t<i;t++)r[t]&&r[t].delimiters&&n(e,r[t].delimiters)})}var bn=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function xn(e,t){let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==94||t||r+2>=n)return!1;e.pos=r+1;let i=!1;for(;e.pos<n;){if(e.src.charCodeAt(e.pos)===94){i=!0;break}e.md.inline.skipToken(e)}if(!i||r+1===e.pos)return e.pos=r,!1;let a=e.src.slice(r+1,e.pos);if(a.match(/(^|[^\\])(\\\\)*\s/))return e.pos=r,!1;e.posMax=e.pos,e.pos=r+1;let o=e.push(`sup_open`,`sup`,1);o.markup=`^`;let s=e.push(`text`,``,0);s.content=a.replace(bn,`$1`);let c=e.push(`sup_close`,`sup`,-1);return c.markup=`^`,e.pos=e.posMax+1,e.posMax=n,!0}function Sn(e){e.inline.ruler.after(`emphasis`,`sup`,xn)}var Cn=cn(on({"../../node_modules/.pnpm/markdown-it-task-checkbox@1.0.6/node_modules/markdown-it-task-checkbox/index.js":((e,t)=>{t.exports=function(e,t){t=Object.assign({},{disabled:!0,divWrap:!1,divClass:`checkbox`,idPrefix:`cbx_`,ulClass:`task-list`,liClass:`task-list-item`},t),e.core.ruler.after(`inline`,`github-task-lists`,function(e){for(var o=e.tokens,s=0,c=2;c<o.length;c++)i(o,c)&&(a(o[c],s,t,e.Token),s+=1,n(o[c-2],`class`,t.liClass),n(o[r(o,c-2)],`class`,t.ulClass))})};function n(e,t,n){var r=e.attrIndex(t),i=[t,n];r<0?e.attrPush(i):e.attrs[r]=i}function r(e,t){for(var n=e[t].level-1,r=t-1;r>=0;r--)if(e[r].level===n)return r;return-1}function i(e,t){return d(e[t])&&f(e[t-1])&&p(e[t-2])&&m(e[t])}function a(e,t,n,r){var i=n.idPrefix+t;e.children[0].content=e.children[0].content.slice(3),e.children.unshift(s(i,r)),e.children.push(c(r)),e.children.unshift(o(e,i,n,r)),n.divWrap&&(e.children.unshift(l(n,r)),e.children.push(u(r)))}function o(e,t,n,r){var i=new r(`checkbox_input`,`input`,0);return i.attrs=[[`type`,`checkbox`],[`id`,t]],/^\[[xX]\][ \u00A0]/.test(e.content)===!0&&i.attrs.push([`checked`,`true`]),n.disabled===!0&&i.attrs.push([`disabled`,`true`]),i}function s(e,t){var n=new t(`label_open`,`label`,1);return n.attrs=[[`for`,e]],n}function c(e){return new e(`label_close`,`label`,-1)}function l(e,t){var n=new t(`checkbox_open`,`div`,0);return n.attrs=[[`class`,e.divClass]],n}function u(e){return new e(`checkbox_close`,`div`,-1)}function d(e){return e.type===`inline`}function f(e){return e.type===`paragraph_open`}function p(e){return e.type===`list_item_open`}function m(e){return/^\[[xX \u00A0]\][ \u00A0]/.test(e.content)}})})(),1),wn=161,Tn=1114109,En=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Dn=12288,On=65510,kn=[12288,12288,65281,65376,65504,65510],An=8361,jn=65518,Mn=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Nn=32,Pn=10630,Fn=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],In=4352,Ln=262141,Rn=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],zn=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),a=i*2;if(t<e[a])r=i-1;else if(t>e[a+1])n=i+1;else return!0}return!1},Bn=19968,[Vn,Hn]=Un(Rn);function Un(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],a=e[r+1];if(Bn>=i&&Bn<=a)return[i,a];a-i>n-t&&(t=i,n=a)}return[t,n]}var Wn=e=>e<wn||e>Tn?!1:zn(En,e),Gn=e=>e<Dn||e>On?!1:zn(kn,e),Kn=e=>e<An||e>jn?!1:zn(Mn,e),qn=e=>e<Nn||e>Pn?!1:zn(Fn,e),Jn=e=>e>=Vn&&e<=Hn?!0:e<In||e>Ln?!1:zn(Rn,e);function Yn(e){return Wn(e)?`ambiguous`:Gn(e)?`fullwidth`:Kn(e)?`halfwidth`:qn(e)?`narrow`:Jn(e)?`wide`:`neutral`}function Xn(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function Zn(e){return Xn(e),Yn(e)}function Qn(e){return/^\p{Emoji_Presentation}/u.test(String.fromCodePoint(e))}function $n(e){if(e<4352)return!1;switch(Zn(e)){case`fullwidth`:case`halfwidth`:return!0;case`wide`:return!Qn(e);case`narrow`:return!1;case`ambiguous`:return null;case`neutral`:return/^\p{sc=Hangul}/u.test(String.fromCodePoint(e))}}function er(e,t){return $n(e)??(t===65025&&n(e));function n(e){return e===8216||e===8217||e===8220||e===8221}}function tr(e){return $n(e)??(917760<=e&&e<=917999)}function nr(e){return $n(e)??!1}function rr(e){return e>=65024&&e<=65038}function ir(e){let t=e.inline.State;class n extends t{scanDelims(t,n){let r=this.posMax,i=this.src.charCodeAt(t),[a,o]=v(this.src,t),s=a,c=null;rr(a)&&(c=v(this.src,o)[0],/^\p{Zs}/u.test(String.fromCodePoint(c))||(s=c));let l=t;for(;l<r&&this.src.charCodeAt(l)===i;)l++;let u=l-t,d=l<r?this.src.codePointAt(l):32,f=e.utils.isWhiteSpace(s),p=e.utils.isWhiteSpace(d);if(f||p)return{can_open:!p,can_close:!f,length:u};let m=e.utils.isMdAsciiPunct(s)||e.utils.isPunctChar(String.fromCodePoint(s)),h=e.utils.isMdAsciiPunct(d)||e.utils.isPunctChar(String.fromCodePoint(d)),g=m,_=h;if(n){let e=nr(d)||(c===null?tr(a):er(c,a));g||=e||!h,_||=e||!m}return{can_open:g,can_close:_,length:u};function v(e,t){if(t<=0)return[32,-1];let n=e.charCodeAt(t-1);if((n&64512)!=56320)return[n,t-1];let r=e.codePointAt(t-2);return r>65535?[r,t-2]:[n,t-1]}}}e.inline.State=n}var ar=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function or(e){return e>=55296&&e<=57343||e>1114111?65533:ar.get(e)??e}function sr(e){let t=atob(e),n=t.length&-2,r=new Uint16Array(n/2);for(let e=0,i=0;e<n;e+=2){let n=t.charCodeAt(e),a=t.charCodeAt(e+1);r[i++]=n|a<<8}return r}var cr=sr(`QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNmZ2xtbm9wcnN0dVQAWgBeAGUAaQBzAHcAfgCBAIQAhwCSAJoAoACsALMAbABpAGcAO4DGAMZAUAA7gCYAJkBjAHUAdABlADuAwQDBQHIiZXZlAAJhAAFpeW0AcgByAGMAO4DCAMJAEGRyAADgNdgE3XIAYQB2AGUAO4DAAMBA8CFoYZFj4SFjcgBhZAAAoFMqAAFncIsAjgBvAG4ABGFmAADgNdg43fAlbHlGdW5jdGlvbgCgYSBpAG4AZwA7gMUAxUAAAWNzpACoAHIAAOA12Jzc6SFnbgCgVCJpAGwAZABlADuAwwDDQG0AbAA7gMQAxEAABGFjZWZvcnN1xQDYANoA7QDxAPYA+QD8AAABY3LJAM8AayNzbGFzaAAAoBYidgHTANUAAKDnKmUAZAAAoAYjeQARZIABY3J0AOAA5QDrAGEidXNlAACgNSLuI291bGxpcwCgLCFhAJJjcgAA4DXYBd1wAGYAAOA12Dnd5SF2ZdhiYwDyAOoAbSJwZXEAAKBOIgAHSE9hY2RlZmhpbG9yc3UXARoBHwE6AVIBVQFiAWQBZgGCAakB6QHtAfIBYwB5ACdkUABZADuAqQCpQIABY3B5ACUBKAE1AfUhdGUGYWmg0iJ0KGFsRGlmZmVyZW50aWFsRAAAoEUhbCJleXMAAKAtIQACYWVpb0EBRAFKAU0B8iFvbgxhZABpAGwAO4DHAMdAcgBjAAhhbiJpbnQAAKAwIm8AdAAKYQABZG5ZAV0BaSJsbGEAuGB0I2VyRG90ALdg8gA5AWkAp2NyImNsZQAAAkRNUFRwAXQBeQF9AW8AdAAAoJkiaSJudXMAAKCWIuwhdXMAoJUiaSJtZXMAAKCXIm8AAAFjc4cBlAFrKndpc2VDb250b3VySW50ZWdyYWwAAKAyImUjQ3VybHkAAAFEUZwBpAFvJXVibGVRdW90ZQAAoB0gdSJvdGUAAKAZIAACbG5wdbABtgHNAdgBbwBuAGWgNyIAoHQqgAFnaXQAvAHBAcUB8iJ1ZW50AKBhIm4AdAAAoC8i7yV1ckludGVncmFsAKAuIgABZnLRAdMBAKACIe8iZHVjdACgECJuLnRlckNsb2Nrd2lzZUNvbnRvdXJJbnRlZ3JhbAAAoDMi7yFzcwCgLypjAHIAAOA12J7ccABDoNMiYQBwAACgTSKABURKU1phY2VmaW9zAAsCEgIVAhgCGwIsAjQCOQI9AnMCfwNvoEUh9CJyYWhkAKARKWMAeQACZGMAeQAFZGMAeQAPZIABZ3JzACECJQIoAuchZXIAoCEgcgAAoKEhaAB2AACg5CoAAWF5MAIzAvIhb24OYRRkbAB0oAciYQCUY3IAAOA12AfdAAFhZkECawIAAWNtRQJnAvIjaXRpY2FsAAJBREdUUAJUAl8CYwJjInV0ZQC0YG8AdAFZAloC2WJiJGxlQWN1dGUA3WJyImF2ZQBgYGkibGRlANxi7yFuZACgxCJmJWVyZW50aWFsRAAAoEYhcAR9AgAAAAAAAIECjgIAABoDZgAA4DXYO91EoagAhQKJAm8AdAAAoNwgcSJ1YWwAAKBQIuIhbGUAA0NETFJVVpkCqAK1Au8C/wIRA28AbgB0AG8AdQByAEkAbgB0AGUAZwByAGEA7ADEAW8AdAKvAgAAAACwAqhgbiNBcnJvdwAAoNMhAAFlb7kC0AJmAHQAgAFBUlQAwQLGAs0CciJyb3cAAKDQIekkZ2h0QXJyb3cAoNQhZQDlACsCbgBnAAABTFLWAugC5SFmdAABQVLcAuECciJyb3cAAKD4J+kkZ2h0QXJyb3cAoPon6SRnaHRBcnJvdwCg+SdpImdodAAAAUFU9gL7AnIicm93AACg0iFlAGUAAKCoInAAQQIGAwAAAAALA3Iicm93AACg0SFvJHduQXJyb3cAAKDVIWUlcnRpY2FsQmFyAACgJSJuAAADQUJMUlRhJAM2AzoDWgNxA3oDciJyb3cAAKGTIUJVLAMwA2EAcgAAoBMpcCNBcnJvdwAAoPUhciJldmUAEWPlIWZ00gJDAwAASwMAAFIDaSVnaHRWZWN0b3IAAKBQKWUkZVZlY3RvcgAAoF4p5SJjdG9yQqC9IWEAcgAAoFYpaSJnaHQA1AFiAwAAaQNlJGVWZWN0b3IAAKBfKeUiY3RvckKgwSFhAHIAAKBXKWUAZQBBoKQiciJyb3cAAKCnIXIAcgBvAPcAtAIAAWN0gwOHA3IAAOA12J/c8iFvaxBhAAhOVGFjZGZnbG1vcHFzdHV4owOlA6kDsAO/A8IDxgPNA9ID8gP9AwEEFAQeBCAEJQRHAEphSAA7gNAA0EBjAHUAdABlADuAyQDJQIABYWl5ALYDuQO+A/Ihb24aYXIAYwA7gMoAykAtZG8AdAAWYXIAAOA12AjdcgBhAHYAZQA7gMgAyEDlIm1lbnQAoAgiAAFhcNYD2QNjAHIAEmF0AHkAUwLhAwAAAADpA20lYWxsU3F1YXJlAACg+yVlJ3J5U21hbGxTcXVhcmUAAKCrJQABZ3D2A/kDbwBuABhhZgAA4DXYPN3zImlsb26VY3UAAAFhaQYEDgRsAFSgdSppImxkZQAAoEIi7CNpYnJpdW0AoMwhAAFjaRgEGwRyAACgMCFtAACgcyphAJdjbQBsADuAywDLQAABaXApBC0E8yF0cwCgAyLvJG5lbnRpYWxFAKBHIYACY2Zpb3MAPQQ/BEMEXQRyBHkAJGRyAADgNdgJ3WwibGVkAFMCTAQAAAAAVARtJWFsbFNxdWFyZQAAoPwlZSdyeVNtYWxsU3F1YXJlAACgqiVwA2UEAABpBAAAAABtBGYAAOA12D3dwSFsbACgACLyI2llcnRyZgCgMSFjAPIAcQQABkpUYWJjZGZnb3JzdIgEiwSOBJMElwSkBKcEqwStBLIE5QTqBGMAeQADZDuAPgA+QO0hbWFkoJMD3GNyImV2ZQAeYYABZWl5AJ0EoASjBOQhaWwiYXIAYwAcYRNkbwB0ACBhcgAA4DXYCt0AoNkicABmAADgNdg+3eUiYXRlcgADRUZHTFNUvwTIBM8E1QTZBOAEcSJ1YWwATKBlIuUhc3MAoNsidSRsbEVxdWFsAACgZyJyI2VhdGVyAACgoirlIXNzAKB3IuwkYW50RXF1YWwAoH4qaSJsZGUAAKBzImMAcgAA4DXYotwAoGsiAARBYWNmaW9zdfkE/QQFBQgFCwUTBSIFKwVSIkRjeQAqZAABY3QBBQQFZQBrAMdiXmDpIXJjJGFyAACgDCFsJWJlcnRTcGFjZQAAoAsh8AEYBQAAGwVmAACgDSHpJXpvbnRhbExpbmUAoAAlAAFjdCYFKAXyABIF8iFvayZhbQBwAEQBMQU5BW8AdwBuAEgAdQBtAPAAAAFxInVhbAAAoE8iAAdFSk9hY2RmZ21ub3N0dVMFVgVZBVwFYwVtBXAFcwV6BZAFtgXFBckFzQVjAHkAFWTsIWlnMmFjAHkAAWRjAHUAdABlADuAzQDNQAABaXlnBWwFcgBjADuAzgDOQBhkbwB0ADBhcgAAoBEhcgBhAHYAZQA7gMwAzEAAoREhYXB/BYsFAAFjZ4MFhQVyACphaSNuYXJ5SQAAoEghbABpAGUA8wD6AvQBlQUAAKUFZaAsIgABZ3KaBZ4F8iFhbACgKyLzI2VjdGlvbgCgwiJpI3NpYmxlAAABQ1SsBbEFbyJtbWEAAKBjIGkibWVzAACgYiCAAWdwdAC8Bb8FwwVvAG4ALmFmAADgNdhA3WEAmWNjAHIAAKAQIWkibGRlAChh6wHSBQAA1QVjAHkABmRsADuAzwDPQIACY2Zvc3UA4QXpBe0F8gX9BQABaXnlBegFcgBjADRhGWRyAADgNdgN3XAAZgAA4DXYQd3jAfcFAAD7BXIAAOA12KXc8iFjeQhk6yFjeQRkgANISmFjZm9zAAwGDwYSBhUGHQYhBiYGYwB5ACVkYwB5AAxk8CFwYZpjAAFleRkGHAbkIWlsNmEaZHIAAOA12A7dcABmAADgNdhC3WMAcgAA4DXYptyABUpUYWNlZmxtb3N0AD0GQAZDBl4GawZkB2gHcAd0B80H2gdjAHkACWQ7gDwAPECAAmNtbnByAEwGTwZSBlUGWwb1IXRlOWHiIWRhm2NnAACg6ifsI2FjZXRyZgCgEiFyAACgniGAAWFleQBkBmcGagbyIW9uPWHkIWlsO2EbZAABZnNvBjQHdAAABUFDREZSVFVWYXKABp4GpAbGBssG3AYDByEHwQIqBwABbnKEBowGZyVsZUJyYWNrZXQAAKDoJ/Ihb3cAoZAhQlKTBpcGYQByAACg5CHpJGdodEFycm93AKDGIWUjaWxpbmcAAKAII28A9QGqBgAAsgZiJWxlQnJhY2tldAAAoOYnbgDUAbcGAAC+BmUkZVZlY3RvcgAAoGEp5SJjdG9yQqDDIWEAcgAAoFkpbCJvb3IAAKAKI2kiZ2h0AAABQVbSBtcGciJyb3cAAKCUIeUiY3RvcgCgTikAAWVy4AbwBmUAAKGjIkFW5gbrBnIicm93AACgpCHlImN0b3IAoFopaSNhbmdsZQBCorIi+wYAAAAA/wZhAHIAAKDPKXEidWFsAACgtCJwAIABRFRWAAoHEQcYB+8kd25WZWN0b3IAoFEpZSRlVmVjdG9yAACgYCnlImN0b3JCoL8hYQByAACgWCnlImN0b3JCoLwhYQByAACgUilpAGcAaAB0AGEAcgByAG8A9wDMAnMAAANFRkdMU1Q/B0cHTgdUB1gHXwfxJXVhbEdyZWF0ZXIAoNoidSRsbEVxdWFsAACgZiJyI2VhdGVyAACgdiLlIXNzAKChKuwkYW50RXF1YWwAoH0qaSJsZGUAAKByInIAAOA12A/dZaDYIuYjdGFycm93AKDaIWkiZG90AD9hgAFucHcAege1B7kHZwAAAkxSbHKCB5QHmwerB+UhZnQAAUFSiAeNB3Iicm93AACg9SfpJGdodEFycm93AKD3J+kkZ2h0QXJyb3cAoPYn5SFmdAABYXLcAqEHaQBnAGgAdABhAHIAcgBvAPcA5wJpAGcAaAB0AGEAcgByAG8A9wDuAmYAAOA12EPdZQByAAABTFK/B8YHZSRmdEFycm93AACgmSHpJGdodEFycm93AKCYIYABY2h0ANMH1QfXB/IAWgYAoLAh8iFva0FhAKBqIgAEYWNlZmlvc3XpB+wH7gf/BwMICQgOCBEIcAAAoAUpeQAcZAABZGzyB/kHaSR1bVNwYWNlAACgXyBsI2ludHJmAACgMyFyAADgNdgQ3e4jdXNQbHVzAKATInAAZgAA4DXYRN1jAPIA/gecY4AESmFjZWZvc3R1ACEIJAgoCDUIgQiFCDsKQApHCmMAeQAKZGMidXRlAENhgAFhZXkALggxCDQI8iFvbkdh5CFpbEVhHWSAAWdzdwA7CGEIfQjhInRpdmWAAU1UVgBECEwIWQhlJWRpdW1TcGFjZQAAoAsgaABpAAABY25SCFMIawBTAHAAYQBjAOUASwhlAHIAeQBUAGgAaQDuAFQI9CFlZAABR0xnCHUIcgBlAGEAdABlAHIARwByAGUAYQB0AGUA8gDrBGUAcwBzAEwAZQBzAPMA2wdMImluZQAKYHIAAOA12BHdAAJCbnB0jAiRCJkInAhyImVhawAAoGAgwiZyZWFraW5nU3BhY2WgYGYAAKAVIUOq7CqzCMIIzQgAAOcIGwkAAAAAAAAtCQAAbwkAAIcJAACdCcAJGQoAADQKAAFvdbYIvAjuI2dydWVudACgYiJwIkNhcAAAoG0ibyh1YmxlVmVydGljYWxCYXIAAKAmIoABbHF4ANII1wjhCOUibWVudACgCSL1IWFsVKBgImkibGRlAADgQiI4A2kic3RzAACgBCJyI2VhdGVyAACjbyJFRkdMU1T1CPoIAgkJCQ0JFQlxInVhbAAAoHEidSRsbEVxdWFsAADgZyI4A3IjZWF0ZXIAAOBrIjgD5SFzcwCgeSLsJGFudEVxdWFsAOB+KjgDaSJsZGUAAKB1IvUhbXBEASAJJwnvI3duSHVtcADgTiI4A3EidWFsAADgTyI4A2UAAAFmczEJRgn0JFRyaWFuZ2xlQqLqIj0JAAAAAEIJYQByAADgzyk4A3EidWFsAACg7CJzAICibiJFR0xTVABRCVYJXAlhCWkJcSJ1YWwAAKBwInIjZWF0ZXIAAKB4IuUhc3MA4GoiOAPsJGFudEVxdWFsAOB9KjgDaSJsZGUAAKB0IuUic3RlZAABR0x1CX8J8iZlYXRlckdyZWF0ZXIA4KIqOAPlI3NzTGVzcwDgoSo4A/IjZWNlZGVzAKGAIkVTjwmVCXEidWFsAADgryo4A+wkYW50RXF1YWwAoOAiAAFlaaAJqQl2JmVyc2VFbGVtZW50AACgDCLnJWh0VHJpYW5nbGVCousitgkAAAAAuwlhAHIAAODQKTgDcSJ1YWwAAKDtIgABcXXDCeAJdSNhcmVTdQAAAWJwywnVCfMhZXRF4I8iOANxInVhbAAAoOIi5SJyc2V0ReCQIjgDcSJ1YWwAAKDjIoABYmNwAOYJ8AkNCvMhZXRF4IIi0iBxInVhbAAAoIgi4yJlZWRzgKGBIkVTVAD6CQAKBwpxInVhbAAA4LAqOAPsJGFudEVxdWFsAKDhImkibGRlAADgfyI4A+UicnNldEXggyLSIHEidWFsAACgiSJpImxkZQCAoUEiRUZUACIKJwouCnEidWFsAACgRCJ1JGxsRXF1YWwAAKBHImkibGRlAACgSSJlJXJ0aWNhbEJhcgAAoCQiYwByAADgNdip3GkAbABkAGUAO4DRANFAnWMAB0VhY2RmZ21vcHJzdHV2XgphCmgKcgp2CnoKgQqRCpYKqwqtCrsKyArNCuwhaWdSYWMAdQB0AGUAO4DTANNAAAFpeWwKcQpyAGMAO4DUANRAHmRiImxhYwBQYXIAAOA12BLdcgBhAHYAZQA7gNIA0kCAAWFlaQCHCooKjQpjAHIATGFnAGEAqWNjInJvbgCfY3AAZgAA4DXYRt3lI25DdXJseQABRFGeCqYKbyV1YmxlUXVvdGUAAKAcIHUib3RlAACgGCAAoFQqAAFjbLEKtQpyAADgNdiq3GEAcwBoADuA2ADYQGkAbAHACsUKZABlADuA1QDVQGUAcwAAoDcqbQBsADuA1gDWQGUAcgAAAUJQ0wrmCgABYXLXCtoKcgAAoD4gYQBjAAABZWvgCuIKAKDeI2UAdAAAoLQjYSVyZW50aGVzaXMAAKDcI4AEYWNmaGlsb3JzAP0KAwsFCwkLCwsMCxELIwtaC3IjdGlhbEQAAKACInkAH2RyAADgNdgT3WkApmOgY/Ujc01pbnVzsWAAAWlwFQsgC24AYwBhAHIAZQBwAGwAYQBuAOUACgVmAACgGSGAobsqZWlvACoLRQtJC+MiZWRlc4CheiJFU1QANAs5C0ALcSJ1YWwAAKCvKuwkYW50RXF1YWwAoHwiaSJsZGUAAKB+Im0AZQAAoDMgAAFkcE0LUQv1IWN0AKAPIm8jcnRpb24AYaA3ImwAAKAdIgABY2leC2ILcgAA4DXYq9yoYwACVWZvc2oLbwtzC3cLTwBUADuAIgAiQHIAAOA12BTdcABmAACgGiFjAHIAAOA12KzcAAZCRWFjZWZoaW9yc3WPC5MLlwupC7YL2AvbC90LhQyTDJoMowzhIXJyAKAQKUcAO4CuAK5AgAFjbnIAnQugC6ML9SF0ZVRhZwAAoOsncgB0oKAhbAAAoBYpgAFhZXkArwuyC7UL8iFvblhh5CFpbFZhIGR2oBwhZSJyc2UAAAFFVb8LzwsAAWxxwwvIC+UibWVudACgCyL1JGlsaWJyaXVtAKDLIXAmRXF1aWxpYnJpdW0AAKBvKXIAAKAcIW8AoWPnIWh0AARBQ0RGVFVWYewLCgwQDDIMNwxeDHwM9gIAAW5y8Av4C2clbGVCcmFja2V0AACg6SfyIW93AKGSIUJM/wsDDGEAcgAAoOUhZSRmdEFycm93AACgxCFlI2lsaW5nAACgCSNvAPUBFgwAAB4MYiVsZUJyYWNrZXQAAKDnJ24A1AEjDAAAKgxlJGVWZWN0b3IAAKBdKeUiY3RvckKgwiFhAHIAAKBVKWwib29yAACgCyMAAWVyOwxLDGUAAKGiIkFWQQxGDHIicm93AACgpiHlImN0b3IAoFspaSNhbmdsZQBCorMiVgwAAAAAWgxhAHIAAKDQKXEidWFsAACgtSJwAIABRFRWAGUMbAxzDO8kd25WZWN0b3IAoE8pZSRlVmVjdG9yAACgXCnlImN0b3JCoL4hYQByAACgVCnlImN0b3JCoMAhYQByAACgUykAAXB1iQyMDGYAAKAdIe4kZEltcGxpZXMAoHAp6SRnaHRhcnJvdwCg2yEAAWNongyhDHIAAKAbIQCgsSHsJGVEZWxheWVkAKD0KYAGSE9hY2ZoaW1vcXN0dQC/DMgMzAzQDOIM5gwKDQ0NFA0ZDU8NVA1YDQABQ2PDDMYMyCFjeSlkeQAoZEYiVGN5ACxkYyJ1dGUAWmEAorwqYWVpedgM2wzeDOEM8iFvbmBh5CFpbF5hcgBjAFxhIWRyAADgNdgW3e8hcnQAAkRMUlXvDPYM/QwEDW8kd25BcnJvdwAAoJMhZSRmdEFycm93AACgkCHpJGdodEFycm93AKCSIXAjQXJyb3cAAKCRIechbWGjY+EkbGxDaXJjbGUAoBgicABmAADgNdhK3XICHw0AAAAAIg10AACgGiLhIXJlgKGhJUlTVQAqDTINSg3uJXRlcnNlY3Rpb24AoJMidQAAAWJwNw1ADfMhZXRFoI8icSJ1YWwAAKCRIuUicnNldEWgkCJxInVhbAAAoJIibiJpb24AAKCUImMAcgAA4DXYrtxhAHIAAKDGIgACYmNtcF8Nag2ODZANc6DQImUAdABFoNAicSJ1YWwAAKCGIgABY2huDYkNZSJlZHMAgKF7IkVTVAB4DX0NhA1xInVhbAAAoLAq7CRhbnRFcXVhbACgfSJpImxkZQAAoH8iVABoAGEA9ADHCwCgESIAodEiZXOVDZ8NciJzZXQARaCDInEidWFsAACghyJlAHQAAKDRIoAFSFJTYWNmaGlvcnMAtQ27Db8NyA3ODdsN3w3+DRgOHQ4jDk8AUgBOADuA3gDeQMEhREUAoCIhAAFIY8MNxg1jAHkAC2R5ACZkAAFidcwNzQ0JYKRjgAFhZXkA1A3XDdoN8iFvbmRh5CFpbGJhImRyAADgNdgX3QABZWnjDe4N8gHoDQAA7Q3lImZvcmUAoDQiYQCYYwABY27yDfkNayNTcGFjZQAA4F8gCiDTInBhY2UAoAkg7CFkZYChPCJFRlQABw4MDhMOcSJ1YWwAAKBDInUkbGxFcXVhbAAAoEUiaSJsZGUAAKBIInAAZgAA4DXYS93pI3BsZURvdACg2yAAAWN0Jw4rDnIAAOA12K/c8iFva2Zh4QpFDlYOYA5qDgAAbg5yDgAAAAAAAAAAAAB5DnwOqA6zDgAADg8RDxYPGg8AAWNySA5ODnUAdABlADuA2gDaQHIAb6CfIeMhaXIAoEkpcgDjAVsOAABdDnkADmR2AGUAbGEAAWl5Yw5oDnIAYwA7gNsA20AjZGIibGFjAHBhcgAA4DXYGN1yAGEAdgBlADuA2QDZQOEhY3JqYQABZGl/Dp8OZQByAAABQlCFDpcOAAFhcokOiw5yAF9gYQBjAAABZWuRDpMOAKDfI2UAdAAAoLUjYSVyZW50aGVzaXMAAKDdI28AbgBQoMMi7CF1cwCgjiIAAWdwqw6uDm8AbgByYWYAAOA12EzdAARBREVUYWRwc78O0g7ZDuEOBQPqDvMOBw9yInJvdwDCoZEhyA4AAMwOYQByAACgEilvJHduQXJyb3cAAKDFIW8kd25BcnJvdwAAoJUhcSV1aWxpYnJpdW0AAKBuKWUAZQBBoKUiciJyb3cAAKClIW8AdwBuAGEAcgByAG8A9wAQA2UAcgAAAUxS+Q4AD2UkZnRBcnJvdwAAoJYh6SRnaHRBcnJvdwCglyFpAGyg0gNvAG4ApWPpIW5nbmFjAHIAAOA12LDcaSJsZGUAaGFtAGwAO4DcANxAgAREYmNkZWZvc3YALQ8xDzUPNw89D3IPdg97D4AP4SFzaACgqyJhAHIAAKDrKnkAEmThIXNobKCpIgCg5ioAAWVyQQ9DDwCgwSKAAWJ0eQBJD00Paw9hAHIAAKAWIGmgFiDjIWFsAAJCTFNUWA9cD18PZg9hAHIAAKAjIukhbmV8YGUkcGFyYXRvcgAAoFgnaSJsZGUAAKBAItQkaGluU3BhY2UAoAogcgAA4DXYGd1wAGYAAOA12E3dYwByAADgNdix3GQiYXNoAACgqiKAAmNlZm9zAI4PkQ+VD5kPng/pIXJjdGHkIWdlAKDAInIAAOA12BrdcABmAADgNdhO3WMAcgAA4DXYstwAAmZpb3OqD64Prw+0D3IAAOA12BvdnmNwAGYAAOA12E/dYwByAADgNdiz3IAEQUlVYWNmb3N1AMgPyw/OD9EP2A/gD+QP6Q/uD2MAeQAvZGMAeQAHZGMAeQAuZGMAdQB0AGUAO4DdAN1AAAFpedwP3w9yAGMAdmErZHIAAOA12BzdcABmAADgNdhQ3WMAcgAA4DXYtNxtAGwAeGEABEhhY2RlZm9z/g8BEAUQDRAQEB0QIBAkEGMAeQAWZGMidXRlAHlhAAFheQkQDBDyIW9ufWEXZG8AdAB7YfIBFRAAABwQbwBXAGkAZAB0AOgAVAhhAJZjcgAAoCghcABmAACgJCFjAHIAAOA12LXc4QtCEEkQTRAAAGcQbRByEAAAAAAAAAAAeRCKEJcQ8hD9EAAAGxEhETIROREAAD4RYwB1AHQAZQA7gOEA4UByImV2ZQADYYCiPiJFZGl1eQBWEFkQWxBgEGUQAOA+IjMDAKA/InIAYwA7gOIA4kB0AGUAO4C0ALRAMGRsAGkAZwA7gOYA5kByoGEgAOA12B7dcgBhAHYAZQA7gOAA4EAAAWVwfBCGEAABZnCAEIQQ8yF5bQCgNSHoAIMQaABhALFjAAFhcI0QWwAAAWNskRCTEHIAAWFnAACgPypkApwQAAAAALEQAKInImFkc3ajEKcQqRCuEG4AZAAAoFUqAKBcKmwib3BlAACgWCoAoFoqAKMgImVsbXJzersQvRDAEN0Q5RDtEACgpCllAACgICJzAGQAYaAhImEEzhDQENIQ1BDWENgQ2hDcEACgqCkAoKkpAKCqKQCgqykAoKwpAKCtKQCgrikAoK8pdAB2oB8iYgBkoL4iAKCdKQABcHTpEOwQaAAAoCIixWDhIXJyAKB8IwABZ3D1EPgQbwBuAAVhZgAA4DXYUt0Ao0giRWFlaW9wBxEJEQ0RDxESERQRAKBwKuMhaXIAoG8qAKBKImQAAKBLInMAJ2DyIW94ZaBIIvEADhFpAG4AZwA7gOUA5UCAAWN0eQAmESoRKxFyAADgNdi23CpgbQBwAGWgSCLxAPgBaQBsAGQAZQA7gOMA40BtAGwAO4DkAORAAAFjaUERRxFvAG4AaQBuAPQA6AFuAHQAAKARKgAITmFiY2RlZmlrbG5vcHJzdWQRaBGXEZ8RpxGrEdIR1hErEjASexKKEn0RThNbE3oTbwB0AACg7SoAAWNybBGJEWsAAAJjZXBzdBF4EX0RghHvIW5nAKBMInAjc2lsb24A9mNyImltZQAAoDUgaQBtAGWgPSJxAACgzSJ2AY0RkRFlAGUAAKC9ImUAZABnoAUjZQAAoAUjcgBrAHSgtSPiIXJrAKC2IwABb3mjEaYRbgDnAHcRMWTxIXVvAKAeIIACY21wcnQAtBG5Eb4RwRHFEeEhdXPloDUi5ABwInR5dgAAoLApcwDpAH0RbgBvAPUA6gCAAWFodwDLEcwRzhGyYwCgNiHlIWVuAKBsInIAAOA12B/dZwCAA2Nvc3R1dncA4xHyEQUSEhIhEiYSKRKAAWFpdQDpEesR7xHwAKMFcgBjAACg7yVwAACgwyKAAWRwdAD4EfwRABJvAHQAAKAAKuwhdXMAoAEqaSJtZXMAAKACKnECCxIAAAAADxLjIXVwAKAGKmEAcgAAoAUm8iNpYW5nbGUAAWR1GhIeEu8hd24AoL0lcAAAoLMlcCJsdXMAAKAEKmUA5QBCD+UAkg9hInJvdwAAoA0pgAFha28ANhJoEncSAAFjbjoSZRJrAIABbHN0AEESRxJNEm8jemVuZ2UAAKDrKXEAdQBhAHIA5QBcBPIjaWFuZ2xlgKG0JWRscgBYElwSYBLvIXduAKC+JeUhZnQAoMIlaSJnaHQAAKC4JWsAAKAjJLEBbRIAAHUSsgFxEgAAcxIAoJIlAKCRJTQAAKCTJWMAawAAoIglAAFlb38ShxJx4D0A5SD1IWl2AOBhIuUgdAAAoBAjAAJwdHd4kRKVEpsSnxJmAADgNdhT3XSgpSJvAG0AAKClIvQhaWUAoMgiAAZESFVWYmRobXB0dXayEsES0RLgEvcS+xIKExoTHxMjEygTNxMAAkxSbHK5ErsSvRK/EgCgVyUAoFQlAKBWJQCgUyUAolAlRFVkdckSyxLNEs8SAKBmJQCgaSUAoGQlAKBnJQACTFJsctgS2hLcEt4SAKBdJQCgWiUAoFwlAKBZJQCjUSVITFJobHLrEu0S7xLxEvMS9RIAoGwlAKBjJQCgYCUAoGslAKBiJQCgXyVvAHgAAKDJKQACTFJscgITBBMGEwgTAKBVJQCgUiUAoBAlAKAMJQCiACVEVWR1EhMUExYTGBMAoGUlAKBoJQCgLCUAoDQlaSJudXMAAKCfIuwhdXMAoJ4iaSJtZXMAAKCgIgACTFJsci8TMRMzEzUTAKBbJQCgWCUAoBglAKAUJQCjAiVITFJobHJCE0QTRhNIE0oTTBMAoGolAKBhJQCgXiUAoDwlAKAkJQCgHCUAAWV2UhNVE3YA5QD5AGIAYQByADuApgCmQAACY2Vpb2ITZhNqE24TcgAA4DXYt9xtAGkAAKBPIG0A5aA9IogRbAAAoVwAYmh0E3YTAKDFKfMhdWIAoMgnbAF+E4QTbABloCIgdAAAoCIgcAAAoU4iRWWJE4sTAKCuKvGgTyI8BeEMqRMAAN8TABQDFB8UAAAjFDQUAAAAAIUUAAAAAI0UAAAAANcU4xT3FPsUAACIFQAAlhWAAWNwcgCuE7ET1RP1IXRlB2GAoikiYWJjZHMAuxO/E8QTzhPSE24AZAAAoEQqciJjdXAAAKBJKgABYXXIE8sTcAAAoEsqcAAAoEcqbwB0AACgQCoA4CkiAP4AAWVv2RPcE3QAAKBBIO4ABAUAAmFlaXXlE+8T9RP4E/AB6hMAAO0TcwAAoE0qbwBuAA1hZABpAGwAO4DnAOdAcgBjAAlhcABzAHOgTCptAACgUCpvAHQAC2GAAWRtbgAIFA0UEhRpAGwAO4C4ALhAcCJ0eXYAAKCyKXQAAIGiADtlGBQZFKJAcgBkAG8A9ABiAXIAAOA12CDdgAFjZWkAKBQqFDIUeQBHZGMAawBtoBMn4SFyawCgEyfHY3IAAKPLJUVjZWZtcz8UQRRHFHcUfBSAFACgwykAocYCZWxGFEkUcQAAoFciZQBhAlAUAAAAAGAUciJyb3cAAAFsclYUWhTlIWZ0AKC6IWkiZ2h0AACguyGAAlJTYWNkAGgUaRRrFG8UcxSuYACgyCRzAHQAAKCbIukhcmMAoJoi4SFzaACgnSJuImludAAAoBAqaQBkAACg7yrjIWlyAKDCKfUhYnN1oGMmaQB0AACgYybsApMUmhS2FAAAwxRvAG4AZaA6APGgVCKrAG0CnxQAAAAAoxRhAHSgLABAYAChASJmbKcUqRTuABMNZQAAAW14rhSyFOUhbnQAoAEiZQDzANIB5wG6FAAAwBRkoEUibwB0AACgbSpuAPQAzAGAAWZyeQDIFMsUzhQA4DXYVN1vAOQA1wEAgakAO3MeAdMUcgAAoBchAAFhb9oU3hRyAHIAAKC1IXMAcwAAoBcnAAFjdeYU6hRyAADgNdi43AABYnDuFPIUZaDPKgCg0SploNAqAKDSKuQhb3QAoO8igANkZWxwcnZ3AAYVEBUbFSEVRBVlFYQV4SFycgABbHIMFQ4VAKA4KQCgNSlwAhYVAAAAABkVcgAAoN4iYwAAoN8i4SFycnCgtiEAoD0pgKIqImJjZG9zACsVMBU6FT4VQRVyImNhcAAAoEgqAAFhdTQVNxVwAACgRipwAACgSipvAHQAAKCNInIAAKBFKgDgKiIA/gACYWxydksVURVuFXMVcgByAG2gtyEAoDwpeQCAAWV2dwBYFWUVaRVxAHACXxUAAAAAYxVyAGUA4wAXFXUA4wAZFWUAZQAAoM4iZSJkZ2UAAKDPImUAbgA7gKQApEBlI2Fycm93AAABbHJ7FX8V5SFmdACgtiFpImdodAAAoLchZQDkAG0VAAFjaYsVkRVvAG4AaQBuAPQAkwFuAHQAAKAxImwiY3R5AACgLSOACUFIYWJjZGVmaGlqbG9yc3R1d3oAuBW7Fb8V1RXgFegV+RUKFhUWHxZUFlcWZRbFFtsW7xb7FgUXChdyAPIAtAJhAHIAAKBlKQACZ2xyc8YVyhXOFdAV5yFlcgCgICDlIXRoAKA4IfIA9QxoAHagECAAoKMiawHZFd4VYSJyb3cAAKAPKWEA4wBfAgABYXnkFecV8iFvbg9hNGQAoUYhYW/tFfQVAAFnciEC8RVyAACgyiF0InNlcQAAoHcqgAFnbG0A/xUCFgUWO4CwALBAdABhALRjcCJ0eXYAAKCxKQABaXIOFhIW8yFodACgfykA4DXYId1hAHIAAAFschsWHRYAoMMhAKDCIYACYWVnc3YAKBauAjYWOhY+Fm0AAKHEIm9zLhY0Fm4AZABzoMQi9SFpdACgZiZhIm1tYQDdY2kAbgAAoPIiAKH3AGlvQxZRFmQAZQAAgfcAO29KFksW90BuI3RpbWVzAACgxyJuAPgAUBZjAHkAUmRjAG8CXhYAAAAAYhZyAG4AAKAeI28AcAAAoA0jgAJscHR1dwBuFnEWdRaSFp4W7CFhciRgZgAA4DXYVd0AotkCZW1wc30WhBaJFo0WcQBkoFAibwB0AACgUSJpIm51cwAAoDgi7CF1cwCgFCLxInVhcmUAoKEiYgBsAGUAYgBhAHIAdwBlAGQAZwDlANcAbgCAAWFkaAClFqoWtBZyAHIAbwD3APUMbwB3AG4AYQByAHIAbwB3APMA8xVhI3Jwb29uAAABbHK8FsAWZQBmAPQAHBZpAGcAaAD0AB4WYgHJFs8WawBhAHIAbwD3AJILbwLUFgAAAADYFnIAbgAAoB8jbwBwAACgDCOAAWNvdADhFukW7BYAAXJ55RboFgDgNdi53FVkbAAAoPYp8iFvaxFhAAFkcvMW9xZvAHQAAKDxImkA5qC/JVsSAAFhaP8WAhdyAPIANQNhAPIA1wvhIm5nbGUAoKYpAAFjaQ4XEBd5AF9k5yJyYXJyAKD/JwAJRGFjZGVmZ2xtbm9wcXJzdHV4MRc4F0YXWxcyBF4XaRd5F40XrBe0F78X2RcVGCEYLRg1GEAYAAFEbzUXgRZvAPQA+BUAAWNzPBdCF3UAdABlADuA6QDpQPQhZXIAoG4qAAJhaW95TRdQF1YXWhfyIW9uG2FyAGOgViI7gOoA6kDsIW9uAKBVIk1kbwB0ABdhAAFEcmIXZhdvAHQAAKBSIgDgNdgi3XKhmipuF3QXYQB2AGUAO4DoAOhAZKCWKm8AdAAAoJgqgKGZKmlscwCAF4UXhxfuInRlcnMAoOcjAKATIWSglSpvAHQAAKCXKoABYXBzAJMXlheiF2MAcgATYXQAeQBzogUinxcAAAAAoRdlAHQAAKAFInAAMaADIDMBqRerFwCgBCAAoAUgAAFnc7AXsRdLYXAAAKACIAABZ3C4F7sXbwBuABlhZgAA4DXYVt2AAWFscwDFF8sXzxdyAHOg1SJsAACg4yl1AHMAAKBxKmkAAKG1A2x21RfYF28AbgC1Y/VjAAJjc3V24BfoF/0XEBgAAWlv5BdWF3IAYwAAoFYiaQLuFwAAAADwF+0ADQThIW50AAFnbPUX+Rd0AHIAAKCWKuUhc3MAoJUqgAFhZWkAAxgGGAoYbABzAD1gcwB0AACgXyJ2AESgYSJEAACgeCrwImFyc2wAoOUpAAFEYRkYHRhvAHQAAKBTInIAcgAAoHEpgAFjZGkAJxgqGO0XcgAAoC8hbwD0AIwCAAFhaDEYMhi3YzuA8ADwQAABbXI5GD0YbAA7gOsA60BvAACgrCCAAWNpcABGGEgYSxhsACFgcwD0ACwEAAFlb08YVxhjAHQAYQB0AGkAbwDuABoEbgBlAG4AdABpAGEAbADlADME4Ql1GAAAgRgAAIMYiBgAAAAAoRilGAAAqhgAALsYvhjRGAAA1xgnGWwAbABpAG4AZwBkAG8AdABzAGUA8QBlF3kARGRtImFsZQAAoEAmgAFpbHIAjRiRGJ0Y7CFpZwCgA/tpApcYAAAAAJoYZwAAoAD7aQBnAACgBPsA4DXYI93sIWlnAKAB++whaWcA4GYAagCAAWFsdACvGLIYthh0AACgbSZpAGcAAKAC+24AcwAAoLElbwBmAJJh8AHCGAAAxhhmAADgNdhX3QABYWvJGMwYbADsAGsEdqDUIgCg2SphI3J0aW50AACgDSoAAWFv2hgiGQABY3PeGB8ZsQPnGP0YBRkSGRUZAAAdGbID7xjyGPQY9xj5GAAA+xg7gL0AvUAAoFMhO4C8ALxAAKBVIQCgWSEAoFshswEBGQAAAxkAoFQhAKBWIbQCCxkOGQAAAAAQGTuAvgC+QACgVyEAoFwhNQAAoFghtgEZGQAAGxkAoFohAKBdITgAAKBeIWwAAKBEIHcAbgAAoCIjYwByAADgNdi73IAIRWFiY2RlZmdpamxub3JzdHYARhlKGVoZXhlmGWkZkhmWGZkZnRmgGa0ZxhnLGc8Z4BkjGmygZyIAoIwqgAFjbXAAUBlTGVgZ9SF0ZfVhbQBhAOSgswM6FgCghipyImV2ZQAfYQABaXliGWUZcgBjAB1hM2RvAHQAIWGAoWUibHFzAMYEcBl6GfGhZSLOBAAAdhlsAGEAbgD0AN8EgKF+KmNkbACBGYQZjBljAACgqSpvAHQAb6CAKmyggioAoIQqZeDbIgD+cwAAoJQqcgAA4DXYJN3noGsirATtIWVsAKA3IWMAeQBTZIChdyJFYWoApxmpGasZAKCSKgCgpSoAoKQqAAJFYWVztBm2Gb0ZwhkAoGkicABwoIoq8iFveACgiipxoIgq8aCIKrUZaQBtAACg5yJwAGYAAOA12FjdYQB2AOUAYwIAAWNp0xnWGXIAAKAKIW0AAKFzImVs3BneGQCgjioAoJAqAIM+ADtjZGxxco0E6xn0GfgZ/BkBGgABY2nvGfEZAKCnKnIAAKB6Km8AdAAAoNci0CFhcgCglSl1ImVzdAAAoHwqgAJhZGVscwAKGvQZFhrVBCAa8AEPGgAAFBpwAHIAbwD4AFkZcgAAoHgpcQAAAWxxxAQbGmwAZQBzAPMASRlpAO0A5AQAAWVuJxouGnIjdG5lcXEAAOBpIgD+xQAsGgAFQWFiY2Vma29zeUAaQxpmGmoabRqDGocalhrCGtMacgDyAMwCAAJpbG1yShpOGlAaVBpyAHMA8ABxD2YAvWBpAGwA9AASBQABZHJYGlsaYwB5AEpkAKGUIWN3YBpkGmkAcgAAoEgpAKCtIWEAcgAAoA8h6SFyYyVhgAFhbHIAcxp7Gn8a8iF0c3WgZSZpAHQAAKBlJuwhaXAAoCYg4yFvbgCguSJyAADgNdgl3XMAAAFld4wakRphInJvdwAAoCUpYSJyb3cAAKAmKYACYW1vcHIAnxqjGqcauhq+GnIAcgAAoP8h9CFodACgOyJrAAABbHKsGrMaZSRmdGFycm93AACgqSHpJGdodGFycm93AKCqIWYAAOA12Fnd4iFhcgCgFSCAAWNsdADIGswa0BpyAADgNdi93GEAcwDoAGka8iFvaydhAAFicNca2xr1IWxsAKBDIOghZW4AoBAg4Qr2GgAA/RoAAAgbExsaGwAAIRs7GwAAAAA+G2IbmRuVG6sbAACyG80b0htjAHUAdABlADuA7QDtQAChYyBpeQEbBhtyAGMAO4DuAO5AOGQAAWN4CxsNG3kANWRjAGwAO4ChAKFAAAFmcssCFhsA4DXYJt1yAGEAdgBlADuA7ADsQIChSCFpbm8AJxsyGzYbAAFpbisbLxtuAHQAAKAMKnQAAKAtIuYhaW4AoNwpdABhAACgKSHsIWlnM2GAAWFvcABDG1sbXhuAAWNndABJG0sbWRtyACthgAFlbHAAcQVRG1UbaQBuAOUAyAVhAHIA9AByBWgAMWFmAACgtyJlAGQAtWEAoggiY2ZvdGkbbRt1G3kb4SFyZQCgBSFpAG4AdKAeImkAZQAAoN0pZABvAPQAWxsAoisiY2VscIEbhRuPG5QbYQBsAACguiIAAWdyiRuNG2UAcgDzACMQ4wCCG2EicmhrAACgFyryIW9kAKA8KgACY2dwdJ8boRukG6gbeQBRZG8AbgAvYWYAAOA12FrdYQC5Y3UAZQBzAHQAO4C/AL9AAAFjabUbuRtyAADgNdi+3G4AAKIIIkVkc3bCG8QbyBvQAwCg+SJvAHQAAKD1Inag9CIAoPMiaaBiIOwhZGUpYesB1hsAANkbYwB5AFZkbAA7gO8A70AAA2NmbW9zdeYb7hvyG/Ub+hsFHAABaXnqG+0bcgBjADVhOWRyAADgNdgn3eEhdGg3YnAAZgAA4DXYW93jAf8bAAADHHIAAOA12L/c8iFjeVhk6yFjeVRkAARhY2ZnaGpvcxUcGhwiHCYcKhwtHDAcNRzwIXBhdqC6A/BjAAFleR4cIRzkIWlsN2E6ZHIAAOA12CjdciJlZW4AOGFjAHkARWRjAHkAXGRwAGYAAOA12FzdYwByAADgNdjA3IALQUJFSGFiY2RlZmdoamxtbm9wcnN0dXYAXhxtHHEcdRx5HN8cBx0dHTwd3B3tHfEdAR4EHh0eLB5FHrwewx7hHgkfPR9LH4ABYXJ0AGQcZxxpHHIA8gBvB/IAxQLhIWlsAKAbKeEhcnIAoA4pZ6BmIgCgiyphAHIAAKBiKWMJjRwAAJAcAACVHAAAAAAAAAAAAACZHJwcAACmHKgcrRwAANIc9SF0ZTph7SJwdHl2AKC0KXIAYQDuAFoG4iFkYbtjZwAAoegnZGyhHKMcAKCRKeUAiwYAoIUqdQBvADuAqwCrQHIAgKOQIWJmaGxwc3QAuhy/HMIcxBzHHMoczhxmoOQhcwAAoB8pcwAAoB0p6wCyGnAAAKCrIWwAAKA5KWkAbQAAoHMpbAAAoKIhAKGrKmFl1hzaHGkAbAAAoBkpc6CtKgDgrSoA/oABYWJyAOUc6RztHHIAcgAAoAwpcgBrAACgcicAAWFr8Rz4HGMAAAFla/Yc9xx7YFtgAAFlc/wc/hwAoIspbAAAAWR1Ax0FHQCgjykAoI0pAAJhZXV5Dh0RHRodHB3yIW9uPmEAAWRpFR0YHWkAbAA8YewAowbiAPccO2QAAmNxcnMkHScdLB05HWEAAKA2KXUAbwDyoBwgqhEAAWR1MB00HeghYXIAoGcpcyJoYXIAAKBLKWgAAKCyIQCiZCJmZ3FzRB1FB5Qdnh10AIACYWhscnQATh1WHWUdbB2NHXIicm93AHSgkCFhAOkAzxxhI3Jwb29uAAABZHVeHWId7yF3bgCgvSFwAACgvCHlJGZ0YXJyb3dzAKDHIWkiZ2h0AIABYWhzAHUdex2DHXIicm93APOglCGdBmEAcgBwAG8AbwBuAPMAzgtxAHUAaQBnAGEAcgByAG8A9wBlGugkcmVldGltZXMAoMsi8aFkIk0HAACaHWwAYQBuAPQAXgcAon0qY2Rnc6YdqR2xHbcdYwAAoKgqbwB0AG+gfypyoIEqAKCDKmXg2iIA/nMAAKCTKoACYWRlZ3MAwB3GHcod1h3ZHXAAcAByAG8A+ACmHG8AdAAAoNYicQAAAWdxzx3SHXQA8gBGB2cAdADyAHQcdADyAFMHaQDtAGMHgAFpbHIA4h3mHeod8yFodACgfClvAG8A8gDKBgDgNdgp3UWgdiIAoJEqYQH1Hf4dcgAAAWR1YB35HWygvCEAoGopbABrAACghCVjAHkAWWQAomoiYWNodAweDx4VHhkecgDyAGsdbwByAG4AZQDyAGAW4SFyZACgaylyAGkAAKD6JQABaW8hHiQe5CFvdEBh9SFzdGGgsCPjIWhlAKCwIwACRWFlczMeNR48HkEeAKBoInAAcKCJKvIhb3gAoIkqcaCHKvGghyo0HmkAbQAAoOYiAARhYm5vcHR3elIeXB5fHoUelh6mHqsetB4AAW5yVh5ZHmcAAKDsJ3IAAKD9IXIA6wCwBmcAgAFsbXIAZh52Hnse5SFmdAABYXKIB2weaQBnAGgAdABhAHIAcgBvAPcAkwfhInBzdG8AoPwnaQBnAGgAdABhAHIAcgBvAPcAmgdwI2Fycm93AAABbHKNHpEeZQBmAPQAxhxpImdodAAAoKwhgAFhZmwAnB6fHqIecgAAoIUpAOA12F3ddQBzAACgLSppIm1lcwAAoDQqYQGvHrMecwB0AACgFyLhAIoOZaHKJbkeRhLuIWdlAKDKJWEAcgBsoCgAdAAAoJMpgAJhY2htdADMHs8e1R7bHt0ecgDyAJ0GbwByAG4AZQDyANYWYQByAGSgyyEAoG0pAKAOIHIAaQAAoL8iAANhY2hpcXTrHu8e1QfzHv0eBh/xIXVvAKA5IHIAAOA12MHcbQDloXIi+h4AAPweAKCNKgCgjyoAAWJ19xwBH28AcqAYIACgGiDyIW9rQmEAhDwAO2NkaGlscXJCBhcfxh0gHyQfKB8sHzEfAAFjaRsfHR8AoKYqcgAAoHkqcgBlAOUAkx3tIWVzAKDJIuEhcnIAoHYpdSJlc3QAAKB7KgABUGk1HzkfYQByAACglillocMlAgdfEnIAAAFkdUIfRx9zImhhcgAAoEop6CFhcgCgZikAAWVuTx9WH3IjdG5lcXEAAOBoIgD+xQBUHwAHRGFjZGVmaGlsbm9wc3VuH3Ifoh+rH68ftx+7H74f5h/uH/MfBwj/HwsgxCFvdACgOiIAAmNscHJ5H30fiR+eH3IAO4CvAK9AAAFldIEfgx8AoEImZaAgJ3MAZQAAoCAnc6CmIXQAbwCAoaYhZGx1AJQfmB+cH28AdwDuAHkDZQBmAPQA6gbwAOkO6yFlcgCgriUAAW95ph+qH+0hbWEAoCkqPGThIXNoAKAUIOElc3VyZWRhbmdsZQCgISJyAADgNdgq3W8AAKAnIYABY2RuAMQfyR/bH3IAbwA7gLUAtUBhoiMi0B8AANMf1x9zAPQAKxFpAHIAAKDwKm8AdAA7gLcAt0B1AHMA4qESIh4TAADjH3WgOCIAoCoqYwHqH+0fcAAAoNsq8gB+GnAAbAB1APMACAgAAWRw9x/7H+UhbHMAoKciZgAA4DXYXt0AAWN0AyAHIHIAAOA12MLc8CFvcwCgPiJsobwDECAVIPQiaW1hcACguCJhAPAAEyAADEdMUlZhYmNkZWZnaGlqbG1vcHJzdHV2dzwgRyBmIG0geSCqILgg2iDeIBEhFSEyIUMhTSFQIZwhnyHSIQAiIyKLIrEivyIUIwABZ3RAIEMgAODZIjgD9uBrItIgBwmAAWVsdABNIF8gYiBmAHQAAAFhclMgWCByInJvdwAAoM0h6SRnaHRhcnJvdwCgziEA4NgiOAP24Goi0iBfCekkZ2h0YXJyb3cAoM8hAAFEZHEgdSDhIXNoAKCvIuEhc2gAoK4igAJiY25wdACCIIYgiSCNIKIgbABhAACgByL1IXRlRGFnAADgICLSIACiSSJFaW9wlSCYIJwgniAA4HAqOANkAADgSyI4A3MASWFyAG8A+AAyCnUAcgBhoG4mbADzoG4mmwjzAa8gAACzIHAAO4CgAKBAbQBwAOXgTiI4AyoJgAJhZW91eQDBIMogzSDWINkg8AHGIAAAyCAAoEMqbwBuAEhh5CFpbEZhbgBnAGSgRyJvAHQAAOBtKjgDcAAAoEIqPWThIXNoAKATIACjYCJBYWRxc3jpIO0g+SD+IAIhDCFyAHIAAKDXIXIAAAFocvIg9SBrAACgJClvoJch9wAGD28AdAAA4FAiOAN1AGkA9gC7CAABZWkGIQohYQByAACgKCntAN8I6SFzdPOgBCLlCHIAAOA12CvdAAJFZXN0/wgcISshLiHxoXEiIiEAABMJ8aFxIgAJAAAnIWwAYQBuAPQAEwlpAO0AGQlyoG8iAKBvIoABQWFwADghOyE/IXIA8gBeIHIAcgAAoK4hYQByAACg8ipzogsiSiEAAAAAxwtkoPwiAKD6ImMAeQBaZIADQUVhZGVzdABcIV8hYiFmIWkhkyGWIXIA8gBXIADgZiI4A3IAcgAAoJohcgAAoCUggKFwImZxcwBwIYQhjiF0AAABYXJ1IXohcgByAG8A9wBlIWkAZwBoAHQAYQByAHIAbwD3AD4h8aFwImAhAACKIWwAYQBuAPQAZwlz4H0qOAMAoG4iaQDtAG0JcqBuImkA5aDqIkUJaQDkADoKAAFwdKMhpyFmAADgNdhf3YCBrAA7aW4AriGvIcchrEBuAIChCSJFZHYAtyG6Ib8hAOD5IjgDbwB0AADg9SI4A+EB1gjEIcYhAKD3IgCg9iJpAHagDCLhAagJzyHRIQCg/iIAoP0igAFhb3IA2CHsIfEhcgCAoSYiYXN0AOAh5SHpIWwAbABlAOwAywhsAADg/SrlIADgAiI4A2wiaW50AACgFCrjoYAi9yEAAPohdQDlAJsJY+CvKjgDZaCAIvEAkwkAAkFhaXQHIgoiFyIeInIA8gBsIHIAcgAAoZshY3cRIhQiAOAzKTgDAOCdITgDZyRodGFycm93AACgmyFyAGkA5aDrIr4JgANjaGltcHF1AC8iPCJHIpwhTSJQIloigKGBImNlcgA2Iv0JOSJ1AOUABgoA4DXYw9zvIXJ0bQKdIQAAAABEImEAcgDhAOEhbQBloEEi8aBEIiYKYQDyAMsIcwB1AAABYnBWIlgi5QDUCeUA3wmAAWJjcABgInMieCKAoYQiRWVzAGci7glqIgDgxSo4A2UAdABl4IIi0iBxAPGgiCJoImMAZaCBIvEA/gmAoYUiRWVzAH8iFgqCIgDgxio4A2UAdABl4IMi0iBxAPGgiSKAIgACZ2lscpIilCKaIpwi7AAMCWwAZABlADuA8QDxQOcAWwlpI2FuZ2xlAAABbHKkIqoi5SFmdGWg6iLxAEUJaSJnaHQAZaDrIvEAvgltoL0DAKEjAGVzuCK8InIAbwAAoBYhcAAAoAcggARESGFkZ2lscnMAziLSItYi2iLeIugi7SICIw8j4SFzaACgrSLhIXJyAKAEKXAAAOBNItIg4SFzaACgrCIAAWV04iLlIgDgZSLSIADgPgDSIG4iZmluAACg3imAAUFldADzIvci+iJyAHIAAKACKQDgZCLSIHLgPADSIGkAZQAA4LQi0iAAAUF0BiMKI3IAcgAAoAMp8iFpZQDgtSLSIGkAbQAA4Dwi0iCAAUFhbgAaIx4jKiNyAHIAAKDWIXIAAAFociMjJiNrAACgIylvoJYh9wD/DuUhYXIAoCcpUxJqFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVCMAAF4jaSN/I4IjjSOeI8AUAAAAAKYjwCMAANoj3yMAAO8jHiQvJD8kRCQAAWNzVyNsFHUAdABlADuA8wDzQAABaXlhI2cjcgBjoJoiO4D0APRAPmSAAmFiaW9zAHEjdCN3I3EBeiNzAOgAdhTsIWFjUWF2AACgOCrvIWxkAKC8KewhaWdTYQABY3KFI4kjaQByAACgvykA4DXYLN1vA5QjAAAAAJYjAACcI24A22JhAHYAZQA7gPIA8kAAoMEpAAFibaEjjAphAHIAAKC1KQACYWNpdKwjryO6I70jcgDyAFkUAAFpcrMjtiNyAACgvinvIXNzAKC7KW4A5QDZCgCgwCmAAWFlaQDFI8gjyyNjAHIATWFnAGEAyWOAAWNkbgDRI9Qj1iPyIW9uv2MAoLYpdQDzAHgBcABmAADgNdhg3YABYWVsAOQj5yPrI3IAAKC3KXIAcAAAoLkpdQDzAHwBAKMoImFkaW9zdvkj/CMPJBMkFiQbJHIA8gBeFIChXSplZm0AAyQJJAwkcgBvoDQhZgAAoDQhO4CqAKpAO4C6ALpA5yFvZgCgtiJyAACgVipsIm9wZQAAoFcqAKBbKoABY2xvACMkJSQrJPIACCRhAHMAaAA7gPgA+EBsAACgmCJpAGwBMyQ4JGQAZQA7gPUA9UBlAHMAYaCXInMAAKA2Km0AbAA7gPYA9kDiIWFyAKA9I+EKXiQAAHokAAB8JJQkAACYJKkkAAAAALUkEQsAAPAkAAAAAAQleiUAAIMlcgCAoSUiYXN0AGUkbyQBCwCBtgA7bGokayS2QGwAZQDsABgDaQJ1JAAAAAB4JG0AAKDzKgCg/Sp5AD9kcgCAAmNpbXB0AIUkiCSLJJkSjyRuAHQAJWBvAGQALmBpAGwAAKAwIOUhbmsAoDEgcgAA4DXYLd2AAWltbwCdJKAkpCR2oMYD1WNtAGEA9AD+B24AZQAAoA4m9KHAA64kAAC0JGMjaGZvcmsAAKDUItZjAAFhdbgkxCRuAAABY2u9JMIkawBooA8hAKAOIfYAaRpzAACkKwBhYmNkZW1zdNMkIRPXJNsk4STjJOck6yTjIWlyAKAjKmkAcgAAoCIqAAFvdYsW3yQAoCUqAKByKm4AO4CxALFAaQBtAACgJip3AG8AAKAnKoABaXB1APUk+iT+JO4idGludACgFSpmAADgNdhh3W4AZAA7gKMAo0CApHoiRWFjZWlub3N1ABMlFSUYJRslTCVRJVklSSV1JQCgsypwAACgtyp1AOUAPwtjoK8qgKJ6ImFjZW5zACclLSU0JTYlSSVwAHAAcgBvAPgAFyV1AHIAbAB5AGUA8QA/C/EAOAuAAWFlcwA8JUElRSXwInByb3gAoLkqcQBxAACgtSppAG0AAKDoImkA7QBEC20AZQDzoDIgIguAAUVhcwBDJVclRSXwAEAlgAFkZnAATwtfJXElgAFhbHMAZSVpJW0l7CFhcgCgLiPpIW5lAKASI/UhcmYAoBMjdKAdIu8AWQvyIWVsAKCwIgABY2l9JYElcgAA4DXYxdzIY24iY3NwAACgCCAAA2Zpb3BzdZElKxuVJZolnyWkJXIAAOA12C7dcABmAADgNdhi3XIiaW1lAACgVyBjAHIAAOA12MbcgAFhZW8AqiW6JcAldAAAAWVpryW2JXIAbgBpAG8AbgDzABkFbgB0AACgFipzAHQAZaA/APEACRj0AG0LgApBQkhhYmNkZWZoaWxtbm9wcnN0dXgA4yXyJfYl+iVpJpAmpia9JtUm5ib4JlonaCdxJ3UnnietJ7EnyCfiJ+cngAFhcnQA6SXsJe4lcgDyAJkM8gD6AuEhaWwAoBwpYQByAPIA3BVhAHIAAKBkKYADY2RlbnFydAAGJhAmEyYYJiYmKyZaJgABZXUKJg0mAOA9IjEDdABlAFVhaQDjACAN7SJwdHl2AKCzKWcAgKHpJ2RlbAAgJiImJCYAoJIpAKClKeUA9wt1AG8AO4C7ALtAcgAApZIhYWJjZmhscHN0dz0mQCZFJkcmSiZMJk4mUSZVJlgmcAAAoHUpZqDlIXMAAKAgKQCgMylzAACgHinrALka8ACVHmwAAKBFKWkAbQAAoHQpbAAAoKMhAKCdIQABYWleJmImaQBsAACgGilvAG6gNiJhAGwA8wB2C4ABYWJyAG8mciZ2JnIA8gAvEnIAawAAoHMnAAFha3omgSZjAAABZWt/JoAmfWBdYAABZXOFJocmAKCMKWwAAAFkdYwmjiYAoI4pAKCQKQACYWV1eZcmmiajJqUm8iFvbllhAAFkaZ4moSZpAGwAV2HsAA8M4gCAJkBkAAJjbHFzrSawJrUmuiZhAACgNylkImhhcgAAoGkpdQBvAPKgHSCjAWgAAKCzIYABYWNnAMMm0iaUC2wAgKEcIWlwcwDLJs4migxuAOUAoAxhAHIA9ADaC3QAAKCtJYABaWxyANsm3ybjJvMhaHQAoH0pbwBvAPIANgwA4DXYL90AAWFv6ib1JnIAAAFkde8m8SYAoMEhbKDAIQCgbCl2oMED8WOAAWducwD+Jk4nUCdoAHQAAANhaGxyc3QKJxInISc1Jz0nRydyInJvdwB0oJIhYQDpAFYmYSNycG9vbgAAAWR1GiceJ28AdwDuAPAmcAAAoMAh5SFmdAABYWgnJy0ncgByAG8AdwDzAAkMYQByAHAAbwBvAG4A8wATBGklZ2h0YXJyb3dzAACgySFxAHUAaQBnAGEAcgByAG8A9wBZJugkcmVldGltZXMAoMwiZwDaYmkAbgBnAGQAbwB0AHMAZQDxABwYgAFhaG0AYCdjJ2YncgDyAAkMYQDyABMEAKAPIG8idXN0AGGgsSPjIWhlAKCxI+0haWQAoO4qAAJhYnB0fCeGJ4knmScAAW5ygCeDJ2cAAKDtJ3IAAKD+IXIA6wAcDIABYWZsAI8nkieVJ3IAAKCGKQDgNdhj3XUAcwAAoC4qaSJtZXMAAKA1KgABYXCiJ6gncgBnoCkAdAAAoJQp7yJsaW50AKASKmEAcgDyADwnAAJhY2hxuCe8J6EMwCfxIXVvAKA6IHIAAOA12MfcAAFidYAmxCdvAPKgGSCoAYABaGlyAM4n0ifWJ3IAZQDlAE0n7SFlcwCgyiJpAIChuSVlZmwAXAxjEt4n9CFyaQCgzinsInVoYXIAoGgpAKAeIWENBSgJKA0oSyhVKIYoAACLKLAoAAAAAOMo5ygAABApJCkxKW0pcSmHKaYpAACYKgAAAACxKmMidXRlAFthcQB1AO8ABR+ApHsiRWFjZWlucHN5ABwoHignKCooLygyKEEoRihJKACgtCrwASMoAAAlKACguCpvAG4AYWF1AOUAgw1koLAqaQBsAF9hcgBjAF1hgAFFYXMAOCg6KD0oAKC2KnAAAKC6KmkAbQAAoOki7yJsaW50AKATKmkA7QCIDUFkbwB0AGKixSKRFgAAAABTKACgZiqAA0FhY21zdHgAYChkKG8ocyh1KHkogihyAHIAAKDYIXIAAAFocmkoayjrAJAab6CYIfcAzAd0ADuApwCnQGkAO2D3IWFyAKApKW0AAAFpbn4ozQBuAHUA8wDOAHQAAKA2J3IA7+A12DDdIxkAAmFjb3mRKJUonSisKHIAcAAAoG8mAAFoeZkonChjAHkASWRIZHIAdABtAqUoAAAAAKgoaQDkAFsPYQByAGEA7ABsJDuArQCtQAABZ22zKLsobQBhAAChwwNmdroouijCY4CjPCJkZWdsbnByAMgozCjPKNMo1yjaKN4obwB0AACgairxoEMiCw5FoJ4qAKCgKkWgnSoAoJ8qZQAAoEYi7CF1cwCgJCrhIXJyAKByKWEAcgDyAPwMAAJhZWl07Sj8KAEpCCkAAWxz8Sj4KGwAcwBlAHQAbQDpAH8oaABwAACgMyrwImFyc2wAoOQpAAFkbFoPBSllAACgIyNloKoqc6CsKgDgrCoA/oABZmxwABUpGCkfKfQhY3lMZGKgLwBhoMQpcgAAoD8jZgAA4DXYZN1hAAABZHIoKRcDZQBzAHWgYCZpAHQAAKBgJoABY3N1ADYpRilhKQABYXU6KUApcABzoJMiAOCTIgD+cABzoJQiAOCUIgD+dQAAAWJwSylWKQChjyJlcz4NUCllAHQAZaCPIvEAPw0AoZAiZXNIDVspZQB0AGWgkCLxAEkNAKGhJWFmZilbBHIAZQFrKVwEAKChJWEAcgDyAAMNAAJjZW10dyl7KX8pgilyAADgNdjI3HQAbQDuAM4AaQDsAAYpYQByAOYAVw0AAWFyiimOKXIA5qAGJhESAAFhbpIpoylpImdodAAAAWVwmSmgKXAAcwBpAGwAbwDuANkXaADpAKAkcwCvYIACYmNtbnAArin8KY4NJSooKgCkgiJFZGVtbnByc7wpvinCKcgpzCnUKdgp3CkAoMUqbwB0AACgvSpkoIYibwB0AACgwyr1IWx0AKDBKgABRWXQKdIpAKDLKgCgiiLsIXVzAKC/KuEhcnIAoHkpgAFlaXUA4inxKfQpdAAAoYIiZW7oKewpcQDxoIYivSllAHEA8aCKItEpbQAAoMcqAAFicPgp+ikAoNUqAKDTKmMAgKJ7ImFjZW5zAAcqDSoUKhYqRihwAHAAcgBvAPgAIyh1AHIAbAB5AGUA8QCDDfEAfA2AAWFlcwAcKiIqPShwAHAAcgBvAPgAPChxAPEAOShnAACgaiYApoMiMTIzRWRlaGxtbnBzPCo/KkIqRSpHKlIqWCpjKmcqaypzKncqO4C5ALlAO4CyALJAO4CzALNAAKDGKgABb3NLKk4qdAAAoL4qdQBiAACg2CpkoIcibwB0AACgxCpzAAABb3VdKmAqbAAAoMknYgAAoNcq4SFycgCgeyn1IWx0AKDCKgABRWVvKnEqAKDMKgCgiyLsIXVzAKDAKoABZWl1AH0qjCqPKnQAAKGDImVugyqHKnEA8aCHIkYqZQBxAPGgiyJwKm0AAKDIKgABYnCTKpUqAKDUKgCg1iqAAUFhbgCdKqEqrCpyAHIAAKDZIXIAAAFocqYqqCrrAJUab6CZIfcAxQf3IWFyAKAqKWwAaQBnADuA3wDfQOELzyrZKtwq6SrsKvEqAAD1KjQrAAAAAAAAAAAAAEwrbCsAAHErvSsAAAAAAADRK3IC1CoAAAAA2CrnIWV0AKAWI8RjcgDrAOUKgAFhZXkA4SrkKucq8iFvbmVh5CFpbGNhQmRvAPQAIg5sInJlYwAAoBUjcgAA4DXYMd0AAmVpa2/7KhIrKCsuK/IBACsAAAkrZQAAATRm6g0EK28AcgDlAOsNYQBzorgDECsAAAAAEit5AG0A0WMAAWNuFislK2sAAAFhcxsrIStwAHAAcgBvAPgAFw5pAG0AAKA8InMA8AD9DQABYXMsKyEr8AAXDnIAbgA7gP4A/kDsATgrOyswG2QA5QBnAmUAcwCAgdcAO2JkAEMrRCtJK9dAYaCgInIAAKAxKgCgMCqAAWVwcwBRK1MraSvhAAkh4qKkIlsrXysAAAAAYytvAHQAAKA2I2kAcgAAoPEqb+A12GXdcgBrAACg2irhAHgociJpbWUAAKA0IIABYWlwAHYreSu3K2QA5QC+DYADYWRlbXBzdACFK6MrmiunK6wrsCuzK24iZ2xlAACitSVkbHFykCuUK5ornCvvIXduAKC/JeUhZnRloMMl8QACBwCgXCJpImdodABloLkl8QBdDG8AdAAAoOwlaSJudXMAAKA6KuwhdXMAoDkqYgAAoM0p6SFtZQCgOyrlInppdW0AoOIjgAFjaHQAwivKK80rAAFyecYrySsA4DXYydxGZGMAeQBbZPIhb2tnYQABaW/UK9creAD0ANERaCJlYWQAAAFsct4r5ytlAGYAdABhAHIAcgBvAPcAXQbpJGdodGFycm93AKCgIQAJQUhhYmNkZmdobG1vcHJzdHV3CiwNLBEsHSwnLDEsQCxLLFIsYix6LIQsjyzLLOgs7Sz/LAotcgDyAAkDYQByAACgYykAAWNyFSwbLHUAdABlADuA+gD6QPIACQ1yAOMBIywAACUseQBeZHYAZQBtYQABaXkrLDAscgBjADuA+wD7QENkgAFhYmgANyw6LD0scgDyANEO7CFhY3FhYQDyAOAOAAFpckQsSCzzIWh0AKB+KQDgNdgy3XIAYQB2AGUAO4D5APlAYQFWLF8scgAAAWxyWixcLACgvyEAoL4hbABrAACggCUAAWN0Zix2LG8CbCwAAAAAcyxyAG4AZaAcI3IAAKAcI28AcAAAoA8jcgBpAACg+CUAAWFsfiyBLGMAcgBrYTuAqACoQAABZ3CILIssbwBuAHNhZgAA4DXYZt0AA2FkaGxzdZksniynLLgsuyzFLHIAcgBvAPcACQ1vAHcAbgBhAHIAcgBvAPcA2A5hI3Jwb29uAAABbHKvLLMsZQBmAPQAWyxpAGcAaAD0AF0sdQDzAKYOaQAAocUDaGzBLMIs0mNvAG4AxWPwI2Fycm93cwCgyCGAAWNpdADRLOEs5CxvAtcsAAAAAN4scgBuAGWgHSNyAACgHSNvAHAAAKAOI24AZwBvYXIAaQAAoPklYwByAADgNdjK3IABZGlyAPMs9yz6LG8AdAAAoPAi7CFkZWlhaQBmoLUlAKC0JQABYW0DLQYtcgDyAMosbAA7gPwA/EDhIm5nbGUAoKcpgAdBQkRhY2RlZmxub3Byc3oAJy0qLTAtNC2bLZ0toS2/LcMtxy3TLdgt3C3gLfwtcgDyABADYQByAHag6CoAoOkqYQBzAOgA/gIAAW5yOC08LechcnQAoJwpgANla25wcnN0AJkpSC1NLVQtXi1iLYItYQBwAHAA4QAaHG8AdABoAGkAbgDnAKEXgAFoaXIAoSmzJFotbwBwAPQAdCVooJUh7wD4JgABaXVmLWotZwBtAOEAuygAAWJwbi14LXMjZXRuZXEAceCKIgD+AODLKgD+cyNldG5lcQBx4IsiAP4A4MwqAP4AAWhyhi2KLWUAdADhABIraSNhbmdsZQAAAWxyki2WLeUhZnQAoLIiaSJnaHQAAKCzInkAMmThIXNoAKCiIoABZWxyAKcttC24LWKiKCKuLQAAAACyLWEAcgAAoLsicQAAoFoi7CFpcACg7iIAAWJ0vC1eD2EA8gBfD3IAAOA12DPddAByAOkAlS1zAHUAAAFicM0t0C0A4IIi0iAA4IMi0iBwAGYAAOA12GfdcgBvAPAAWQt0AHIA6QCaLQABY3XkLegtcgAA4DXYy9wAAWJw7C30LW4AAAFFZXUt8S0A4IoiAP5uAAABRWV/LfktAOCLIgD+6SJnemFnAKCaKYADY2Vmb3BycwANLhAuJS4pLiMuLi40LukhcmN1YQABZGkULiEuAAFiZxguHC5hAHIAAKBfKmUAcaAnIgCgWSLlIXJwAKAYIXIAAOA12DTdcABmAADgNdho3WWgQCJhAHQA6ABqD2MAcgAA4DXYzNzjCuQRUC4AAFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg`),lr;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(lr||={});var ur;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(ur||={});var dr=32;function fr(e){return e>=ur.ZERO&&e<=ur.NINE}function pr(e){return e>=ur.UPPER_A&&e<=ur.UPPER_F||e>=ur.LOWER_A&&e<=ur.LOWER_F}function mr(e){return e>=ur.UPPER_A&&e<=ur.UPPER_Z||e>=ur.LOWER_A&&e<=ur.LOWER_Z||fr(e)}function hr(e){return e===ur.EQUALS||mr(e)}var gr;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(gr||={});var _r;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(_r||={});var vr=class{decodeTree;emitCodePoint;errors;constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n}state=gr.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=_r.Strict;runConsumed=0;startEntity(e){this.decodeMode=e,this.state=gr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(e,t){switch(this.state){case gr.EntityStart:return e.charCodeAt(t)===ur.NUM?(this.state=gr.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=gr.NamedEntity,this.stateNamedEntity(e,t));case gr.NumericStart:return this.stateNumericStart(e,t);case gr.NumericDecimal:return this.stateNumericDecimal(e,t);case gr.NumericHex:return this.stateNumericHex(e,t);case gr.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|dr)===ur.LOWER_X?(this.state=gr.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=gr.NumericDecimal,this.stateNumericDecimal(e,t))}stateNumericHex(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(fr(n)||pr(n)){let e=n<=ur.NINE?n-ur.ZERO:(n|dr)-ur.LOWER_A+10;this.result=this.result*16+e,this.consumed++,t++}else return this.emitNumericEntity(n,3)}return-1}stateNumericDecimal(e,t){for(;t<e.length;){let n=e.charCodeAt(t);if(fr(n))this.result=this.result*10+(n-ur.ZERO),this.consumed++,t++;else return this.emitNumericEntity(n,2)}return-1}emitNumericEntity(e,t){if(this.consumed<=t)return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===ur.SEMI)this.consumed+=1;else if(this.decodeMode===_r.Strict)return 0;return this.emitCodePoint(or(this.result),this.consumed),this.errors&&(e!==ur.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&lr.VALUE_LENGTH)>>14;for(;t<e.length;){if(i===0&&(r&lr.FLAG13)!==0){let a=(r&lr.BRANCH_LENGTH)>>7;if(this.runConsumed===0){let n=r&lr.JUMP_TABLE;if(e.charCodeAt(t)!==n)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed<a;){if(t>=e.length)return-1;let r=this.runConsumed-1,i=n[this.treeIndex+1+(r>>1)],a=r%2==0?i&255:i>>8&255;if(e.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(a>>1),r=n[this.treeIndex],i=(r&lr.VALUE_LENGTH)>>14}if(t>=e.length)break;let a=e.charCodeAt(t);if(a===ur.SEMI&&i!==0&&(r&lr.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);if(this.treeIndex=br(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===_r.Attribute&&(i===0||hr(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&lr.VALUE_LENGTH)>>14,i!==0){if(a===ur.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==_r.Strict&&(r&lr.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){let{result:e,decodeTree:t}=this,n=(t[e]&lr.VALUE_LENGTH)>>14;return this.emitNamedEntityData(e,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~(lr.VALUE_LENGTH|lr.FLAG13):r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){switch(this.state){case gr.NamedEntity:return this.result!==0&&(this.decodeMode!==_r.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case gr.NumericDecimal:return this.emitNumericEntity(0,2);case gr.NumericHex:return this.emitNumericEntity(0,3);case gr.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case gr.EntityStart:return 0}}};function yr(e){let t=``,n=new vr(e,e=>t+=String.fromCodePoint(e));return function(e,r){let i=0,a=0;for(;(a=e.indexOf(`&`,a))>=0;){t+=e.slice(i,a),n.startEntity(r);let o=n.write(e,a+1);if(o<0){i=a+n.end();break}i=a+o,a=o===0?i+1:i}let o=t+e.slice(i);return t=``,o}}function br(e,t,n,r){let i=(t&lr.BRANCH_LENGTH)>>7,a=t&lr.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=i+1>>1,s=0,c=i-1;for(;s<=c;){let t=s+c>>>1,i=e[n+(t>>1)]>>(t&1)*8&255;if(i<r)s=t+1;else if(i>r)c=t-1;else return e[n+o+t]}return-1}var xr=yr(cr);function Sr(e,t=_r.Legacy){return xr(e,t)}var Cr={};function wr(e){let t=Cr[e];if(t)return t;t=Cr[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);t.push(n)}for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t[r]=`%`+(`0`+r.toString(16).toUpperCase()).slice(-2)}return t}function Tr(e,t){typeof t!=`string`&&(t=Tr.defaultChars);let n=wr(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(e){let t=``;for(let r=0,i=e.length;r<i;r+=3){let a=parseInt(e.slice(r+1,r+3),16);if(a<128)t+=n[a];else{if((a&224)==192&&r+3<i){let n=parseInt(e.slice(r+4,r+6),16);if((n&192)==128){let e=a<<6&1984|n&63;t+=e<128?`��`:String.fromCharCode(e),r+=3;continue}}if((a&240)==224&&r+6<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16);if((n&192)==128&&(i&192)==128){let e=a<<12&61440|n<<6&4032|i&63;t+=e<2048||e>=55296&&e<=57343?`���`:String.fromCharCode(e),r+=6;continue}}if((a&248)==240&&r+9<i){let n=parseInt(e.slice(r+4,r+6),16),i=parseInt(e.slice(r+7,r+9),16),o=parseInt(e.slice(r+10,r+12),16);if((n&192)==128&&(i&192)==128&&(o&192)==128){let e=a<<18&1835008|n<<12&258048|i<<6&4032|o&63;e<65536||e>1114111?t+=`����`:(e-=65536,t+=String.fromCharCode(55296+(e>>10),56320+(e&1023))),r+=9;continue}}t+=`�`}}return t})}Tr.defaultChars=`;/?:@&=+$,#`,Tr.componentChars=``;var Er=Tr,Dr={};function Or(e){let t=Dr[e];if(t)return t;t=Dr[e]=[];for(let e=0;e<128;e++){let n=String.fromCharCode(e);/^[0-9a-z]$/i.test(n)?t.push(n):t.push(`%`+(`0`+e.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function kr(e,t,n){typeof t!=`string`&&(n=t,t=kr.defaultChars),n===void 0&&(n=!0);let r=Or(t),i=``;for(let t=0,a=e.length;t<a;t++){let o=e.charCodeAt(t);if(n&&o===37&&t+2<a&&/^[0-9a-f]{2}$/i.test(e.slice(t+1,t+3)))i+=e.slice(t,t+3),t+=2;else if(o<128)i+=r[o];else if(o>=55296&&o<=57343){if(o>=55296&&o<=56319&&t+1<a){let n=e.charCodeAt(t+1);if(n>=56320&&n<=57343){i+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}i+=`%EF%BF%BD`}else i+=encodeURIComponent(e[t])}return i}kr.defaultChars=`;/?:@&=+$,-_.!~*'()#`,kr.componentChars=`-_.!~*'()`;var Ar=kr;function jr(e){let t=``;return t+=e.protocol||``,t+=e.slashes?`//`:``,t+=e.auth?e.auth+`@`:``,e.hostname&&e.hostname.indexOf(`:`)!==-1?t+=`[`+e.hostname+`]`:t+=e.hostname||``,t+=e.port?`:`+e.port:``,t+=e.pathname||``,t+=e.search||``,t+=e.hash||``,t}function Mr(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var Nr=/^([a-z0-9.+-]+:)/i,Pr=/:[0-9]*$/,Fr=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Ir=[`%`,`/`,`?`,`;`,`#`,`'`,`{`,`}`,`|`,`\\`,`^`,"`",`<`,`>`,`"`,"`",` `,`\r`,`
|
|
30
|
+
`,` `],Lr=[`/`,`?`,`#`],Rr=255,zr=/^[+a-z0-9A-Z_-]{0,63}$/,Br=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Vr={javascript:!0,"javascript:":!0},Hr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Ur(e,t){if(e&&e instanceof Mr)return e;let n=new Mr;return n.parse(e,t),n}Mr.prototype.parse=function(e,t){let n,r,i,a=e;if(a=a.trim(),!t&&e.split(`#`).length===1){let e=Fr.exec(a);if(e)return this.pathname=e[1],e[2]&&(this.search=e[2]),this}let o=Nr.exec(a);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,a=a.substr(o.length)),(t||o||a.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=a.substr(0,2)===`//`,i&&!(o&&Vr[o])&&(a=a.substr(2),this.slashes=!0)),!Vr[o]&&(i||o&&!Hr[o])){let e=-1;for(let t=0;t<Lr.length;t++)r=a.indexOf(Lr[t]),r!==-1&&(e===-1||r<e)&&(e=r);let t,n;n=e===-1?a.lastIndexOf(`@`):a.lastIndexOf(`@`,e),n!==-1&&(t=a.slice(0,n),a=a.slice(n+1),this.auth=t),e=-1;for(let t=0;t<Ir.length;t++)r=a.indexOf(Ir[t]),r!==-1&&(e===-1||r<e)&&(e=r);e===-1&&(e=a.length),a[e-1]===`:`&&e--;let i=a.slice(0,e);a=a.slice(e),this.parseHost(i),this.hostname=this.hostname||``;let o=this.hostname[0]===`[`&&this.hostname[this.hostname.length-1]===`]`;if(!o){let e=this.hostname.split(/\./);for(let t=0,n=e.length;t<n;t++){let n=e[t];if(n&&!n.match(zr)){let r=``;for(let e=0,t=n.length;e<t;e++)n.charCodeAt(e)>127?r+=`x`:r+=n[e];if(!r.match(zr)){let r=e.slice(0,t),i=e.slice(t+1),o=n.match(Br);o&&(r.push(o[1]),i.unshift(o[2])),i.length&&(a=i.join(`.`)+a),this.hostname=r.join(`.`);break}}}}this.hostname.length>Rr&&(this.hostname=``),o&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let s=a.indexOf(`#`);s!==-1&&(this.hash=a.substr(s),a=a.slice(0,s));let c=a.indexOf(`?`);return c!==-1&&(this.search=a.substr(c),a=a.slice(0,c)),a&&(this.pathname=a),Hr[n]&&this.hostname&&!this.pathname&&(this.pathname=``),this},Mr.prototype.parseHost=function(e){let t=Pr.exec(e);t&&(t=t[0],t!==`:`&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var Wr=Ur,Gr=sn({decode:()=>Er,encode:()=>Ar,format:()=>jr,parse:()=>Wr}),Kr=Object.defineProperty,qr=e=>{let t={};for(var n in e)Kr(t,n,{get:e[n],enumerable:!0});return t},Jr=class{type;tag;attrs;map;nesting;level;children;content;markup;info;meta;block;hidden;constructor(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}attrIndex(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1}attrPush(e){this.attrs?this.attrs.push(e):this.attrs=[e]}attrSet(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r}attrGet(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},Yr=qr({arrayReplaceAt:()=>li,assign:()=>ti,countLines:()=>Ei,escapeHtml:()=>Si,escapeRE:()=>wi,fromCodePoint:()=>di,has:()=>ei,isMdAsciiPunct:()=>si,isPunctChar:()=>ii,isPunctCode:()=>oi,isSpace:()=>ni,isString:()=>Qr,isValidEntityCode:()=>ui,isWhiteSpace:()=>ri,lib:()=>Ti,mdurl:()=>Gr,normalizeReference:()=>ci,ucmicro:()=>Xr,unescapeAll:()=>_i,unescapeMd:()=>gi}),Xr={Any:/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Cc:/[\0-\x1F\x7F-\x9F]/,Cf:/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,P:/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,S:/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Z:/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/};function Zr(e){return Object.prototype.toString.call(e)}function Qr(e){return Zr(e)===`[object String]`}var $r=Object.prototype.hasOwnProperty;function ei(e,t){return $r.call(e,t)}function ti(e,...t){return t.forEach(t=>{if(t){if(typeof t!=`object`)throw TypeError(`${String(t)}must be object`);Object.keys(t).forEach(n=>{e[n]=t[n]})}}),e}function ni(e){return e===9||e===32}function ri(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function ii(e){return Xr.P.test(e)||Xr.S.test(e)}var ai=new Map;function oi(e){if(si(e))return!0;if(e>=0&&e<128)return!1;let t=ai.get(e);if(t!==void 0)return t;let n=ii(String.fromCharCode(e));return ai.set(e,n),n}function si(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function ci(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function li(e,t,n){return[...e.slice(0,t),...n,...e.slice(t+1)]}function ui(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function di(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var fi=/\\([!"#$%&'()*+,\-\./:;<=>?@[\\\]^_`{|}~])/g,pi=RegExp(`${fi.source}|&([a-z#][a-z0-9]{1,31});`,`gi`),mi=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function hi(e,t){if(t.charCodeAt(0)===35&&mi.test(t)){let n=t[1].toLowerCase()===`x`?Number.parseInt(t.slice(2),16):Number.parseInt(t.slice(1),10);return ui(n)?di(n):e}let n=Sr(e);return n===e?e:n}function gi(e){return e.includes(`\\`)?e.replace(fi,`$1`):e}function _i(e){return!e.includes(`\\`)&&!e.includes(`&`)?e:e.replace(pi,(e,t,n)=>t||hi(e,n))}var vi=/[&<>"]/,yi=/[&<>"]/g,bi={"&":`&`,"<":`<`,">":`>`,'"':`"`};function xi(e){return bi[e]}function Si(e){return vi.test(e)?e.replace(yi,xi):e}var Ci=/[.?*+^$[\]\\(){}|-]/g;function wi(e){return e.replace(Ci,`\\$&`)}var Ti={mdurl:Gr,ucmicro:Xr};function Ei(e){if(e.length===0)return 0;let t=0,n=-1;for(;(n=e.indexOf(`
|
|
31
|
+
`,n+1))!==-1;)t++;return t}var Di=/(?:^|\n)[ \t]{0,3}\[\^[^\]\n]+\]:/m,Oi=/(?:^|\n)[ \t]{0,3}\*\[[^\]\n]+\]:/m,ki=[`references`,`footnotes`,`abbreviations`,`abbr`,`abbrs`],Ai=Symbol.for(`markdown-it-ts.global-state`),ji=Object.prototype.hasOwnProperty;function Mi(e){let t=e.length,n=0;for(;n<t;){let r=e.indexOf(`[`,n);if(r===-1)return!1;let i=0,a=r-1;for(;a>=0&&e.charCodeAt(a)!==10;){let t=e.charCodeAt(a);if(t===32||t===9)i++,a--;else break}if((a<0||e.charCodeAt(a)===10)&&i<=3&&e.charCodeAt(r+1)!==94){let i=r+1;if(i>=t||e.charCodeAt(i)===93){n=r+1;continue}for(;i<t;){let n=e.charCodeAt(i);if(n===93){let n=i+1;for(;n<t&&(e.charCodeAt(n)===32||e.charCodeAt(n)===9);)n++;if(n<t&&e.charCodeAt(n)===58)return!0;break}if(n===91)break;n===92?i+=2:i++}}n=r+1}return!1}function Ni(e){return e===`reference-definition`||e===`footnote-definition`||e===`abbreviation-definition`}function Pi(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Fi(e){if(Array.isArray(e))return e.map(e=>Fi(e));if(Pi(e)){let t={};for(let n of Object.keys(e))t[n]=Fi(e[n]);return t}return e}function Ii(e){return Array.isArray(e)?e.map((e,t)=>String(t)):Pi(e)?Object.keys(e):[]}function Li(e,t){if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Li(e[n],t[n]))return!1;return!0}if(Pi(e)||Pi(t)){if(!Pi(e)||!Pi(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!ji.call(t,r)||!Li(e[r],t[r]))return!1;return!0}return Object.is(e,t)}function Ri(e,t){if(Array.isArray(e))return e[Number(t)];if(Pi(e))return e[t]}function zi(e,t){if(Array.isArray(e)&&Array.isArray(t)){e.length=t.length;for(let n=0;n<t.length;n++)e[n]=Fi(t[n]);return e}if(Pi(e)&&Pi(t)){for(let n of Object.keys(e))ji.call(t,n)||delete e[n];for(let n of Object.keys(t))e[n]=Fi(t[n]);return e}return Fi(t)}function Bi(e,t,n){let r=n.ownedKeys??[],i=e[t];if(Pi(i)||Array.isArray(i)){let a=new Set(Ii(n.value));for(let e of r)n.existed&&a.has(e)?i[e]=Fi(Ri(n.value,e)):delete i[e];!n.existed&&Ii(i).length===0&&delete e[t]}else n.existed?e[t]=Fi(n.value):delete e[t]}function Vi(e){let t=e[Ai];return Ni(t)?{reason:t,snapshot:{}}:t&&typeof t==`object`&&Ni(t.reason)&&t.snapshot&&typeof t.snapshot==`object`?t:null}function Hi(e,t){Object.defineProperty(e,Ai,{value:t,enumerable:!1,configurable:!0,writable:!0})}function Ui(e){return!e||!e.includes(`]:`)&&!e.includes(`*[`)?null:Di.test(e)?`footnote-definition`:Oi.test(e)?`abbreviation-definition`:Mi(e)?`reference-definition`:null}function Wi(e){return Vi(e)?.reason??null}function Gi(e,t,n){if(Wi(e)&&Ji(e),!t)return n();Ki(e,t);try{let t=n();return qi(e),t}catch(t){throw Ji(e),t}}function Ki(e,t){try{Ji(e);let n={};for(let t of ki)n[t]=ji.call(e,t)?{existed:!0,value:Fi(e[t])}:{existed:!1};Hi(e,{reason:t,snapshot:n})}catch{}}function qi(e){let t=Vi(e);if(t)for(let n of ki){let r=t.snapshot[n];if(!r)continue;r.ownedKeys=[];let i=e[n];if(!Pi(i)&&!Array.isArray(i))continue;let a=new Set(Ii(r.existed?r.value:void 0));r.ownedKeys=Ii(i).filter(e=>!a.has(e)||!Li(i[e],Ri(r.value,e)))}}function Ji(e){let t=Vi(e);if(t){for(let n of ki){let r=t.snapshot[n];r?r.ownedKeys?Bi(e,n,r):r.existed?e[n]=zi(e[n],r.value):delete e[n]:delete e[n]}delete e[Ai]}}function Yi(e){return{area:e,attempted:!0,matched:!1,attemptMs:0,blocks:0,headings:0,paragraphs:0,lists:0,fences:0,paragraphCacheHits:0,paragraphCacheMisses:0,paragraphCacheBypasses:0,listCacheHits:0,listCacheMisses:0,fenceCacheHits:0,fenceCacheMisses:0}}var Xi=Symbol.for(`markdown-it-ts.diagnostics`);function Zi(e,t){if(e)try{let n=e[Xi];if(n&&typeof n==`object`)return n;if(!t)return;let r={};return e[Xi]=r,r}catch{return}}function J(e){return Zi(e,!1)}function Qi(e){if(e)try{let t=e[Xi];t&&typeof t==`object`&&(delete t.strategy,delete t.chunk,delete t.unbounded,delete t.editable,delete t.stockFast)}catch{}}function $i(e){Qi(e)}function ea(e,t){let n=Zi(e,!0);n&&(n.stockFast=t)}function ta(e,t){let n=Zi(e,!0);n&&(n.strategy=t)}function na(e,t){let n=Zi(e,!0);n&&(n.chunk=t)}function ra(e,t){let n=Zi(e,!0);n&&(n.unbounded=t)}var ia=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,aa=/[\0-\x1F\x7F-\x9F]/,oa=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDD6E\uDEAD\uDED0\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9\uDFD4\uDFD5\uDFD7\uDFD8]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09\uDFE1]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDD6D-\uDD6F\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD839\uDDFF|\uD83A[\uDD5E\uDD5F]/,sa=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,ca=class{src_Any=ia.source;src_Cc=aa.source;src_Z=sa.source;src_P=oa.source;src_ZPCc=[this.src_Z,this.src_P,this.src_Cc].join(`|`);src_ZCc=[this.src_Z,this.src_Cc].join(`|`);cache={};opts={maxLength:1e4,urlAuth:!1,schema_names:[]};constructor(e={}){this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}nestedPairRE(e,t,n=4){let r=this.escapeRE(e),i=this.escapeRE(t),a=`(?:(?!${this.src_ZCc}|${r}|${i}).)`,o=`${r}${a}{0,1000}${i}`;for(let e=2;e<=n;e++)o=`${r}(?:${a}|${o}){0,1000}${i}`;return o}get_text_separators(){return this.cache.text_separators??=/[><\uff5c]/}get_pseudo_letter(){return this.cache.src_pseudo_letter??=RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`)}get_ipv4_addr(){return this.cache.src_ip4??=RegExp(`(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])`)}get_ipv6_addr(){let e=`[0-9A-Fa-f]{1,4}`,t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return this.cache.src_ip6_addr??=RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`)}get_ipv6_url_host(){return this.cache.src_ip6_host??=RegExp(`\\[${this.get_ipv6_addr().source}\\]`)}get_ipv6_mail_host(){return this.cache.src_ipv6_mail_host??=RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`)}get_auth(){return this.cache.src_auth??=RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`)}get_port(){return this.cache.src_port??=RegExp(`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`)}get_host_terminator(){return this.cache.src_host_terminator??=RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`)}get_path_terminator(){return this.cache.src_path_terminator??=RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`)}get_path(){return this.cache.src_path??=RegExp(`(?:[/?#](?:${this.nestedPairRE(`[`,`]`)}|${this.nestedPairRE(`(`,`)`)}|${this.nestedPairRE(`{`,`}`)}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts[`---`]?`\\-(?!--(?:[^-]|$))(?:-{0,19})|`:`\\-{1,20}|`)+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`)}get_mail_name(){return this.cache.src_mail_name??=RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}")}get_xn(){return this.cache.src_xn??=RegExp(`xn--[a-z0-9\\-]{1,59}`)}get_tld(){if(this.cache.tld)return this.cache.tld;let e=[...new Set(this.opts.tlds||[])].sort().reverse().join(`|`);return this.cache.tld=RegExp(`${e||`$#none#$`}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){return this.cache.src_domain_root??=RegExp(`(?:`+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`)}get_domain(){return this.cache.src_domain??=RegExp(`(?:`+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`)}get_url_host_port(){return this.cache.url_host_port??=RegExp(`(?:`+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source)}get_fuzzy_url_host_port(){return this.cache.fuzzy_url_host_port??=RegExp(`(?:`+(this.opts.fuzzyIP?this.get_ipv4_addr().source+`|`:``)+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source)}get_mail_host(){return this.cache.src_mail_host??=RegExp(`(?:`+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source)}get_fuzzy_mail_host(){return this.cache.src_fuzzy_mail_host??=RegExp(`(?:`+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source)}get_path_extra(){return this.cache.src_path_extra??=RegExp(``)}get_fuzzy_mail_host_search(){return this.cache.mail_fuzzy_host_search??=RegExp(`@${this.get_fuzzy_mail_host().source}`,`ig`)}get_fuzzy_link_search(){return this.cache.link_fuzzy_search??=RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${this.src_ZPCc}))(?:(?![$+<=>^\`|\uff5c])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,`ig`)}get_http_validator(){return this.cache.http_validator??=RegExp(`\\/\\/`+(this.opts.urlAuth?this.get_auth().source:``)+this.get_url_host_port().source+this.get_path().source,`iy`)}get_relative_proto_validator(){return this.cache.relative_proto_validator??=RegExp((this.opts.urlAuth?this.get_auth().source:``)+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,`iy`)}get_mail_name_validator(){return this.cache.mail_name_validator??=RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`)}get_mailto_validator(){return this.cache.mailto_validator??=RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,`iy`)}get_schema_names(){return this.cache.schema_names??=new RegExp((this.opts.schema_names||[]).map(e=>this.escapeRE(e)).join(`|`))}get_schema_search(){return this.cache.schema_search??=RegExp(`(^|(?!_)(?:[><\uff5c]|${this.src_ZPCc}))(${this.get_schema_names().source})`,`ig`)}get_schema_at_start(){return this.cache.schema_at_start??=RegExp(`^${this.get_schema_search().source}`,`i`)}},la={validate:(e,t,n)=>{let r=n.re.get_http_validator();r.lastIndex=t;let i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)},ua={"http:":la,"https:":la,"ftp:":la,"//":{validate:function(e,t,n){let r=n.re.get_relative_proto_validator();r.lastIndex=t;let i=r.exec(e);return i?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:i[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){let r=n.re.get_mailto_validator();r.lastIndex=t;let i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)}},da=`a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw`,fa=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф`;function pa(){let e=fa.split(`|`);return da.split(`|`).forEach(t=>{let n=t.indexOf(`:`),r=t.slice(0,n);for(let i of t.slice(n+1))e.push(r+i)}),e}var ma={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:pa(),urlAuth:!1,maxLength:1e4},ha=class{schema;index;lastIndex;raw;text;url;constructor(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}},ga=class{__opts__;__schemas__;re;constructor(e={}){let{rebuilder:t,...n}=e;this.__opts__={...ma,...n},this.__schemas__={...ua},this.re=t||new ca,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{let n={normalize:(e,t)=>t.normalize(e),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__[`http:`]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__[`mailto:`]&&e.indexOf(`@`)>=0){let n=this.re.get_fuzzy_mail_host_search(),r=this.re.get_mail_name_validator();for(n.lastIndex=0;(t=n.exec(e))!==null;){let n=e.slice(Math.max(0,t.index-65),t.index);if(r.test(n))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){let t=[],n=this.re.get_schema_search(),r,i,a,o,s,c,l=!1,u=!1,d=!1,f=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__[`http:`]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__[`mailto:`]&&(i=this.re.get_fuzzy_mail_host_search(),i.lastIndex=0,a=this.re.get_mail_name_validator());;){let p=Math.max(f-1,0);if(i&&a&&!d&&(!s||s.index<f))for(i.lastIndex<p&&(i.lastIndex=p);;){let t=i.exec(e);if(!t){d=!0,s=void 0;break}let n=a.exec(e.slice(Math.max(0,t.index-65),t.index));if(n){if(s={schema:`mailto:`,index:t.index-n[1].length,lastIndex:t.index+t[0].length},s.index>=f)break;i.lastIndex<p&&(i.lastIndex=p)}}if(r&&!u&&(!o||o.index<f))for(r.lastIndex<p&&(r.lastIndex=p);;){let t=r.exec(e);if(!t){u=!0,o=void 0;break}if(o={schema:``,index:t.index+t[1].length,lastIndex:t.index+t[0].length},o.index>=f)break;r.lastIndex<p&&(r.lastIndex=p)}let m=s;(!m||o&&(o.index<m.index||o.index===m.index&&o.lastIndex>m.lastIndex))&&(m=o);let h;if(!l)for(;;){if(!c){n.lastIndex<p&&(n.lastIndex=p);let t=n.exec(e);if(!t){l=!0;break}c={schema:t[2],index:t.index+t[1].length,lastIndex:t.index+t[0].length}}if(c.index<f){c=void 0;continue}if(m&&c.index>m.index)break;let t=c;c=void 0;let r=this.testSchemaAt(e,t.schema,t.lastIndex);if(r){h={schema:t.schema,index:t.index,lastIndex:t.lastIndex+r};break}}let g=h;if((!g||s&&(s.index<g.index||s.index===g.index&&s.lastIndex>g.lastIndex))&&(g=s),(!g||o&&(o.index<g.index||o.index===g.index&&o.lastIndex>g.lastIndex))&&(g=o),!g)break;g===s?s=void 0:g===o&&(o=void 0);let _=new ha(e,g.schema,g.index,g.lastIndex);_.schema?this.__schemas__[_.schema].normalize(_,this):this.normalize(_),t.push(_),f=g.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;let t=this.re.get_schema_at_start().exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new ha(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}},_a=cn(on({"../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.js":((e,t)=>{let n=2147483647,r=/^xn--/,i=/[^\0-\x7F]/,a=/[\x2E\u3002\uFF0E\uFF61]/g,o={overflow:`Overflow: input needs wider integers to process`,"not-basic":`Illegal input >= 0x80 (not a basic code point)`,"invalid-input":`Invalid input`},s=Math.floor,c=String.fromCharCode;function l(e){throw RangeError(o[e])}function u(e,t){let n=[],r=e.length;for(;r--;)n[r]=t(e[r]);return n}function d(e,t){let n=e.split(`@`),r=``;n.length>1&&(r=n[0]+`@`,e=n[1]),e=e.replace(a,`.`);let i=u(e.split(`.`),t).join(`.`);return r+i}function f(e){let t=[],n=0,r=e.length;for(;n<r;){let i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){let r=e.charCodeAt(n++);(r&64512)==56320?t.push(((i&1023)<<10)+(r&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}let p=e=>String.fromCodePoint(...e),m=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:36},h=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},g=function(e,t,n){let r=0;for(e=n?s(e/700):e>>1,e+=s(e/t);e>455;r+=36)e=s(e/35);return s(r+36*e/(e+38))},_=function(e){let t=[],r=e.length,i=0,a=128,o=72,c=e.lastIndexOf(`-`);c<0&&(c=0);for(let n=0;n<c;++n)e.charCodeAt(n)>=128&&l(`not-basic`),t.push(e.charCodeAt(n));for(let u=c>0?c+1:0;u<r;){let c=i;for(let t=1,a=36;;a+=36){u>=r&&l(`invalid-input`);let c=m(e.charCodeAt(u++));c>=36&&l(`invalid-input`),c>s((n-i)/t)&&l(`overflow`),i+=c*t;let d=a<=o?1:a>=o+26?26:a-o;if(c<d)break;let f=36-d;t>s(n/f)&&l(`overflow`),t*=f}let d=t.length+1;o=g(i-c,d,c==0),s(i/d)>n-a&&l(`overflow`),a+=s(i/d),i%=d,t.splice(i++,0,a)}return String.fromCodePoint(...t)},v=function(e){let t=[];e=f(e);let r=e.length,i=128,a=0,o=72;for(let n of e)n<128&&t.push(c(n));let u=t.length,d=u;for(u&&t.push(`-`);d<r;){let r=n;for(let t of e)t>=i&&t<r&&(r=t);let f=d+1;r-i>s((n-a)/f)&&l(`overflow`),a+=(r-i)*f,i=r;for(let r of e)if(r<i&&++a>n&&l(`overflow`),r===i){let e=a;for(let n=36;;n+=36){let r=n<=o?1:n>=o+26?26:n-o;if(e<r)break;let i=e-r,a=36-r;t.push(c(h(r+i%a,0))),e=s(i/a)}t.push(c(h(e,0))),o=g(a,f,d===u),a=0,++d}++a,++i}return t.join(``)};t.exports={version:`2.3.1`,ucs2:{decode:f,encode:p},decode:_,encode:v,toASCII:function(e){return d(e,function(e){return i.test(e)?`xn--`+v(e):e})},toUnicode:function(e){return d(e,function(e){return r.test(e)?_(e.slice(4).toLowerCase()):e})}}})})(),1);function va(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=_i(e.slice(t+1,i)),a.ok=!0,a;r===92&&i+1<n?i+=2:i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));)if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2}else{if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0||(a.str=_i(e.slice(t,i)),a.pos=i,a.ok=!0),a}var ya=va,ba=-2;function xa(e,t,n,r){let i=1,a=t+1;for(;a<n;){let t=e.charCodeAt(a);if(t===93){if(i--,i===0)return a;if(r){let t=a+1<n?e.charCodeAt(a+1):0;if(t===40||t===91)return ba}a++}else if(t===92)a+=2;else{if(t===96||t===60||t===33&&a+1<n&&e.charCodeAt(a+1)===91)return ba;t===91&&i++,a++}}return-1}function Sa(e,t,n){let r=1,i=!1,a,o,s=e.src,c=e.posMax,l=e.pos,u=e.linkLabelNoCloseFrom;if(u>=0&&t+1>=u)return-1;let d=s.indexOf(`]`,t+1);if(d<0||d>=c)return e.linkLabelNoCloseFrom=t+1,-1;let f=xa(s,t,c,n);if(f!==ba)return f;for(e.pos=t+1;e.pos<c;){if(a=s.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=l,-1}}let p=-1;return i&&(p=e.pos),e.pos=l,p}var Ca=Sa;function wa(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=_i(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=_i(e.slice(t,a)),o}var Ta=wa;function Ea(e,t){if(!e.attrs)return-1;for(let n=0;n<e.attrs.length;n++)if(e.attrs[n][0]===t)return n;return-1}function Da(e,t){e.attrs||=[],e.attrs.push(t)}function Oa(e,t,n){let r=Ea(e,t),i=[t,n];r<0?Da(e,i):e.attrs[r]=i}function ka(e,t){let n=Ea(e,t);return n>=0?e.attrs[n][1]:null}function Aa(e,t,n){let r=Ea(e,t);r<0?Da(e,[t,n]):e.attrs[r][1]=`${e.attrs[r][1]} ${n}`}var ja=qr({attrGet:()=>ka,attrIndex:()=>Ea,attrJoin:()=>Aa,attrPush:()=>Da,attrSet:()=>Oa,parseLinkDestination:()=>va,parseLinkLabel:()=>Sa,parseLinkTitle:()=>wa});function Ma(e){return e.includes(`\r`)||e.includes(`\0`)}function Na(e){return typeof e==`string`?e:e.toString()}function Pa(e){if(e.inlineMode){let t=new Jr(`inline`,``,0);t.content=Na(e.src),t.map=[0,1],t.children=[],t.level=0,e.tokens.push(t)}else e.md&&e.md.block&&e.md.block.parse(e.src,e.md,e.env,e.tokens)}var Fa=/^([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])?)*)$/,Ia=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function La(e,t){let n=e.pos,r=e.src;if(r.charCodeAt(n)!==60)return!1;let i=n,a=e.posMax;for(;;){if(++n>=a)return!1;let e=r.charCodeAt(n);if(e===60)return!1;if(e===62)break}let o=r.slice(i+1,n);if(Ia.test(o)){let n=e.md.normalizeLink(o);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(o);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=o.length+2,!0}if(Fa.test(o)){let n=e.md.normalizeLink(`mailto:${o}`);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(o);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=o.length+2,!0}return!1}var Ra=La;function za(e,t){let n=e.src,r=e.pos;if(n.charCodeAt(r)!==96)return!1;let i=r;r++;let a=e.posMax;for(;r<a&&n.charCodeAt(r)===96;)r++;let o=n.slice(i,r),s=o.length;if(e.backticksScanned&&(e.backticks[s]||0)<=i)return t||(e.pending+=o),e.pos+=s,!0;let c=r,l;for(;(l=n.indexOf("`",c))!==-1;){for(c=l+1;c<a&&n.charCodeAt(c)===96;)c++;let i=c-l;if(i===s){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=o;let i=n.slice(r,l);i.includes(`
|
|
32
|
+
`)&&(i=i.replace(/\n/g,` `)),i.length>2&&i.charCodeAt(0)===32&&i.charCodeAt(i.length-1)===32&&(i=i.slice(1,-1)),t.content=i}return e.pos=c,!0}e.backticks[i]=l}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=s,!0}var Ba=za;function Va(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;Object.prototype.hasOwnProperty.call(t,n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function Ha(e){let t=e.tokens_meta,n=e.tokens_meta.length;Va(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&Va(t[e].delimiters)}var Ua=Ha,Wa=`*`,Ga=`_`;function Ka(e,t){if(t)return!1;let n=e.src.charCodeAt(e.pos);if(n!==95&&n!==42)return!1;let r=e.scanDelims(e.pos,n===42);if(!r||r.length===0)return!1;let i=n===42?Wa:Ga,a=r.length,o=r.can_open,s=r.can_close,c=e.tokens,l=e.delimiters;for(let t=0;t<a;t++){let t=e.push(`text`,``,0);t.content=i,l.push({marker:n,length:a,token:c.length-1,end:-1,open:o,close:s})}return e.pos+=a,!0}function qa(e,t){let n=t.length,r=e.tokens;for(let e=n-1;e>=0;e--){let n=t[e],i=n.marker;if(i!==95&&i!==42||n.end===-1)continue;let a=t[n.end],o=n.token,s=a.token,c=e>0&&t[e-1].end===n.end+1&&t[e-1].marker===i&&t[e-1].token===o-1&&t[n.end+1].token===s+1,l=i===42?Wa:Ga,u=r[o];c?(u.type=`strong_open`,u.tag=`strong`,u.nesting=1,u.markup=l+l,u.content=``):(u.type=`em_open`,u.tag=`em`,u.nesting=1,u.markup=l,u.content=``);let d=r[s];c?(d.type=`strong_close`,d.tag=`strong`,d.nesting=-1,d.markup=l+l,d.content=``):(d.type=`em_close`,d.tag=`em`,d.nesting=-1,d.markup=l,d.content=``),c&&(r[t[e-1].token].content=``,r[t[n.end+1].token].content=``,e--)}}function Ja(e){let t=e.tokens_meta,n=e.tokens_meta.length;qa(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&qa(e,t[r].delimiters)}var Ya={tokenize:Ka,postProcess:Ja};function Xa(e){return Sr(e)}function Za(e){return e>=48&&e<=57}function Qa(e){let t=e|32;return Za(e)||t>=97&&t<=102}function $a(e){let t=e|32;return t>=97&&t<=122}function eo(e){return $a(e)||Za(e)}function to(e,t,n){let r=t+2;if(r>=n)return null;let i=!1,a=7,o=r;for((e.charCodeAt(r)|32)==120&&(i=!0,a=6,r++,o=r);r<n&&r-o<a;){let t=e.charCodeAt(r);if(!(i?Qa(t):Za(t)))break;r++}return r===o||r>=n||e.charCodeAt(r)!==59?null:e.slice(t,r+1)}function no(e,t,n){let r=t+1;if(r>=n||!$a(e.charCodeAt(r)))return null;for(r++;r<n&&r-t-1<32&&eo(e.charCodeAt(r));)r++;if(r-t-1<2||r>=n||e.charCodeAt(r)!==59)return null;let i=e.slice(t,r+1);return Xa(i)===i?null:i}function ro(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let i=to(e.src,n,r);if(i){if(!t){let t=(i.charCodeAt(2)|32)==120?Number.parseInt(i.slice(3,-1),16):Number.parseInt(i.slice(2,-1),10),n=e.push(`text_special`,``,0);n.content=ui(t)?di(t):di(65533),n.markup=i,n.info=`entity`}return e.pos+=i.length,!0}}else{let i=no(e.src,n,r);if(i){let n=Xa(i);if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=i,t.info=`entity`}return e.pos+=i.length,!0}}return!1}var io=ro,ao=(()=>{let e=Array(256).fill(0);for(let t=0;t<32;t++)e[`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.charCodeAt(t)]=1;return e})(),oo=Array(128),so=Array(128);for(let e=0;e<128;e++){let t=String.fromCharCode(e);oo[e]=`\\${t}`,so[e]=ao[e]?t:oo[e]}function co(e,t,n){e.pending&&e.pushPending();let r=new Jr(`text_special`,``,0);r.level=e.level,r.content=t,r.markup=n,r.info=`escape`,e.pendingLevel=e.level,e.tokens.push(r),e.tokens_meta.push(null)}function lo(e,t){let n=e.pos,r=e.posMax,i=e.src;if(i.charCodeAt(n)!==92||(n++,n>=r))return!1;let a=i.charCodeAt(n);if(a===10){for(t||e.push(`hardbreak`,`br`,0),n++;n<r&&(a=i.charCodeAt(n),a===9||a===32);)n++;return e.pos=n,!0}if(a<128)return t?(e.pos=n+1,!0):(co(e,so[a],oo[a]),e.pos=n+1,!0);if(t){if(a>=55296&&a<=56319&&n+1<r){let e=i.charCodeAt(n+1);e>=56320&&e<=57343&&n++}return e.pos=n+1,!0}let o=i.charAt(n);if(a>=55296&&a<=56319&&n+1<r){let e=i.charCodeAt(n+1);e>=56320&&e<=57343&&(o+=i.charAt(n+1),n++)}let s=`\\${o}`;return co(e,a<256&&ao[a]?o:s,s),e.pos=n+1,!0}var uo=lo;function fo(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++){let e=i[t];e&&(e.nesting&&e.nesting<0&&r--,e.level=r,e.nesting&&e.nesting>0&&r++,e.type===`text`&&t+1<a&&i[t+1]?.type===`text`?i[t+1].content=e.content+i[t+1].content:(t!==n&&(i[n]=e),n++))}t!==n&&(i.length=n)}var po=fo,mo=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,ho=`<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>`,go=RegExp(`^(?:${mo}|${ho}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<\\?[\\s\\S]*?\\?>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),_o=RegExp(`^(?:${mo}|${ho})`);function vo(e){return e===32||e===9||e===10||e===12||e===13}function yo(e){if(e.length<3||e.charCodeAt(0)!==60||(e.charCodeAt(1)|32)!=97)return!1;let t=e.charCodeAt(2);return t===62||vo(t)}function bo(e){if(e.length<4||e.charCodeAt(0)!==60||e.charCodeAt(1)!==47||(e.charCodeAt(2)|32)!=97)return!1;for(let t=3;t<e.length;t++){let n=e.charCodeAt(t);if(n===62)return!0;if(!vo(n))return!1}return!1}function xo(e){let t=e|32;return t>=97&&t<=122}function So(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos,i=e.src;if(i.charCodeAt(r)!==60||r+2>=n)return!1;let a=i.charCodeAt(r+1);if(a!==33&&a!==63&&a!==47&&!xo(a))return!1;let o=i.slice(r).match(go);if(!o)return!1;let s=o[0];if(!t){let t=e.pushSimple(`html_inline`,``);t.content=s,yo(s)&&e.linkLevel++,bo(s)&&e.linkLevel--}return e.pos+=s.length,!0}var Co=So;function wo(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=Ca(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),n===32||n===10);a++);if(a>=f)return!1;if(s=ya(e.src,a,e.posMax),s.ok){for(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``,l=a;a<f&&(n=e.src.charCodeAt(a),n===32||n===10);a++);if(s=Ta(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),n===32||n===10);a++);else c=``}if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=Ca(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[ci(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0);n.attrs=[[`src`,u],[`alt`,``]],n.children=t,n.content=r,c&&n.attrs.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var To=wo;function Eo(e,t,n){for(;t<n;){let n=e.charCodeAt(t);if(n!==32&&n!==10)break;t++}return t}function Do(e,t){if(e.src.charCodeAt(e.pos)!==91)return!1;let n=e.src,r=e.pos,i=e.posMax,a=e.pos+1,o=Ca(e,e.pos,!0);if(o<0)return!1;let s=o+1,c=``,l=``,u=!0;if(s<i&&n.charCodeAt(s)===40){s=Eo(n,s+1,i);let t=ya(n,s,i);if(t.ok){let n=e.md.normalizeLink(t.str);e.md.validateLink(n)&&(c=n,s=t.pos,u=!1)}else s<i&&n.charCodeAt(s)===41&&(c=``,u=!1);if(!u){if(s=Eo(n,s,i),s<i&&n.charCodeAt(s)!==41){let e=Ta(n,s,i);e.ok&&(l=e.str,s=Eo(n,e.pos,i))}s<i&&n.charCodeAt(s)===41?s++:u=!0}}if(u){if(e.env.references===void 0)return!1;let t;if(s=o+1,s<i&&n.charCodeAt(s)===91){let r=s+1,i=Ca(e,s);i>=0?(t=n.slice(r,i),t||=n.slice(a,o),s=i+1):t=n.slice(a,o)}else t=n.slice(a,o);let u=e.env.references[ci(t)];if(!u)return e.pos=r,!1;c=u.href,l=u.title}if(!t){e.pos=a,e.posMax=o;let t=e.push(`link_open`,`a`,1);t.attrs=l?[[`href`,c],[`title`,l]]:[[`href`,c]],e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=s,e.posMax=i,!0}var Oo=Do;function ko(e){let t=e|32;return t>=97&&t<=122}function Ao(e){return e>=48&&e<=57}function jo(e){return ko(e)||Ao(e)||e===43||e===45||e===46}function Mo(e){if(e.length===0)return null;let t=e.length-1;for(;t>=0&&jo(e.charCodeAt(t));)t--;return t++,t>=e.length||!ko(e.charCodeAt(t))?null:e.slice(t)}function No(e,t,n){let r=t;for(;r<n;){let t=e.charCodeAt(r);if(t<=32||t===127||t===60)break;r++}return e.slice(t,r)}function Po(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=Mo(e.pending);if(!i)return!1;let a=No(e.src,n-i.length,r),o=e.md.linkify.matchAtStart(a);if(!o)return!1;let s=o.url;if(s.length<=i.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-i.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-i.length,!0}function Fo(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t){if(r>=0&&e.pending.charCodeAt(r)===32){if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.pushSimple(`hardbreak`,`br`)}else e.pending=e.pending.slice(0,-1),e.pushSimple(`softbreak`,`br`)}else e.pushSimple(`softbreak`,`br`)}for(n++;n<i;){let t=e.src.charCodeAt(n);if(t!==9&&t!==32)break;n++}return e.pos=n,!0}var Io=Fo;function Lo(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0);if(!i)return!1;let a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function Ro(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function zo(e){let t=e.delimiters;Ro(e,t);let n=e.tokens_meta;if(n)for(let t=0;t<n.length;t++)n[t]&&n[t].delimiters&&Ro(e,n[t].delimiters)}var Bo={tokenize:Lo,postProcess:zo},Vo=new Uint8Array(256);for(let e of[10,33,35,36,37,38,42,43,45,58,60,61,62,64,91,92,93,94,95,96,123,125,126])Vo[e]=1;function Ho(e){return e<256&&Vo[e]===1}function Uo(e,t){let n=e.src,r=e.pos,i=e.posMax;if(r>=i||Ho(n.charCodeAt(r)))return!1;let a=r+1;for(;a<i&&!Ho(n.charCodeAt(a));)a++;return t||(e.pending+=a===r+1?n.charAt(r):n.slice(r,a)),e.pos=a,!0}var Wo=Uo;function Go(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Ko(e){if(e.length===0)return 0;let t=e.slice().sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==0?(t[n-1]+t[n])/2:t[n]}function qo(e,t){return{chain:e,name:t,calls:0,hits:0,inclusiveMs:0,medianMs:0,maxMs:0,normalCalls:0,normalHits:0,silentCalls:0,silentHits:0,samples:[]}}function Jo(e){let t=e;if(!t)return null;if(t.__mdtsRuleProfile)return t.__mdtsRuleProfile;if(!t.__mdtsProfileRules)return null;let n=t.__mdtsProfileRules===!0?{}:t.__mdtsProfileRules,r={enabled:!0,fixture:n.fixture,mode:n.mode,startedAt:Go(),records:Object.create(null)};return t.__mdtsRuleProfile=r,r}function Yo(e,t,n,r,i,a){let o=Jo(e);if(!o)return;let s=`${t}:${n}`,c=o.records[s]??(o.records[s]=qo(t,n));c.calls++,c.inclusiveMs+=r,r>c.maxMs&&(c.maxMs=r),c.samples.push(r),a?(c.silentCalls++,i&&c.silentHits++):(c.normalCalls++,i&&c.normalHits++),i&&c.hits++,o.completedAt=Go()}function Xo(e){let t=Jo(e);if(!t)return null;let n=Object.keys(t.records);for(let e=0;e<n.length;e++){let r=t.records[n[e]];r.medianMs=Ko(r.samples)}return t.completedAt=Go(),t}var Zo=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){let r=this.rules.findIndex(t=>t.name===e);r>=0&&this.rules.splice(r,1),this.rules.push({name:e,fn:t,alt:n?.alt||[],enabled:!0}),this.invalidateCache()}at(e,t,n){let r=this.rules.findIndex(t=>t.name===e);if(t===void 0){if(r<0)return;let e=this.rules[r];return Object.freeze({name:e.name,fn:e.fn,alt:e.alt?Object.freeze(e.alt.slice()):void 0,enabled:e.enabled})}if(r<0)throw Error(`Parser rule not found: ${e}`);this.rules[r].fn=t,n?.alt!==void 0&&(this.rules[r].alt=n.alt),this.invalidateCache()}before(e,t,n,r){let i=this.rules.findIndex(t=>t.name===e);if(i<0)throw Error(`Parser rule not found: ${e}`);let a=this.rules.findIndex(e=>e.name===t);a>=0&&this.rules.splice(a,1),this.rules.splice(i,0,{name:t,fn:n,alt:r?.alt||[],enabled:!0}),this.invalidateCache()}after(e,t,n,r){let i=this.rules.findIndex(t=>t.name===e);if(i<0)throw Error(`Parser rule not found: ${e}`);let a=this.rules.findIndex(e=>e.name===t);a>=0&&this.rules.splice(a,1),this.rules.splice(i+1,0,{name:t,fn:n,alt:r?.alt||[],enabled:!0}),this.invalidateCache()}enable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;for(let e of n){let n=this.rules.findIndex(t=>t.name===e);if(n<0){if(!t)throw Error(`Rules manager: invalid rule name ${e}`)}else r.push(e),this.rules[n].enabled||(this.rules[n].enabled=!0,i=!0)}return i&&this.invalidateCache(),r}disable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;for(let e of n){let n=this.rules.findIndex(t=>t.name===e);if(n<0){if(!t)throw Error(`Rules manager: invalid rule name ${e}`)}else r.push(e),this.rules[n].enabled&&(this.rules[n].enabled=!1,i=!0)}return i&&this.invalidateCache(),r}enableOnly(e){let t=new Set(e),n=!1;for(let e of this.rules){let r=t.has(e.name);e.enabled!==r&&(e.enabled=r,n=!0)}n&&this.invalidateCache()}getRules(e){let t=e||``;return this.cache||this.compileCache(),this.cache.get(t)??[]}getNamedRules(e){let t=e||``;return this.namedCache||this.compileCache(),this.namedCache.get(t)??[]}compileCache(){let e=new Set([``]);for(let t of this.rules)if(t.enabled&&t.alt)for(let n of t.alt)e.add(n);let t=new Map,n=new Map;for(let r of e){let e=[],i=[];for(let t of this.rules)t.enabled&&(r===``||t.alt?.includes(r))&&(e.push(t.fn),i.push({name:t.name,fn:t.fn}));t.set(r,e),n.set(r,i)}this.cache=t,this.namedCache=n}},Qo=class{src;md;env;tokens;tokens_meta;pos;posMax;level;pending;pendingLevel;cache;delimiters;_prev_delimiters;backticks;backticksScanned;linkLevel;linkLabelNoCloseFrom;maxNesting;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=e.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache=[],this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0,this.linkLabelNoCloseFrom=-1,this.maxNesting=t.options.maxNesting}pushPending(){let e=new Jr(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e}pushSimple(e,t){this.pending&&this.pushPending();let n=new Jr(e,t,0);return n.level=this.level,this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(null),n}push(e,t,n){if(this.pending&&this.pushPending(),n===0)return this.pushSimple(e,t);let r=new Jr(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){let{src:n,posMax:r}=this,i=n.charCodeAt(e),a=e;for(;a<r&&n.charCodeAt(a)===i;)a++;let o=a-e,s=e>0?n.charCodeAt(e-1):32,c=a<r?n.charCodeAt(a):32,l=ri(s),u=ri(c),d=oi(s),f=oi(c),p=!u&&(!f||l||d),m=!l&&(!d||u||f);return{can_open:p&&(t||!m||d),can_close:m&&(t||!p||f),length:o}}};Qo.prototype.Token=Jr;var $o=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function es(e,t){switch(e.src.charCodeAt(e.pos)){case 10:return Io(e,t);case 33:return To(e,t);case 38:return io(e,t);case 42:case 95:return Ya.tokenize(e,t);case 58:return e.md.options.linkify&&Po(e,t);case 60:return Ra(e,t)||Co(e,t);case 91:return Oo(e,t);case 92:return uo(e,t);case 96:return Ba(e,t);case 126:return Bo.tokenize(e,t);default:return Wo(e,t)}}function ts(e){return!$o.test(e)}var ns=class{ruler;ruler2;State=Qo;cachedRulesVersion=-1;cachedRules=[];cachedRules2Version=-1;cachedRules2=[];defaultRulerVersion;defaultRuler2Version;constructor(){this.ruler=new Zo,this.ruler2=new Zo,this.ruler.push(`text`,Wo),this.ruler.push(`linkify`,Po),this.ruler.push(`newline`,Io),this.ruler.push(`escape`,uo),this.ruler.push(`backticks`,Ba),this.ruler.push(`strikethrough`,Bo.tokenize),this.ruler.push(`emphasis`,Ya.tokenize),this.ruler.push(`link`,Oo),this.ruler.push(`image`,To),this.ruler.push(`autolink`,Ra),this.ruler.push(`html_inline`,Co),this.ruler.push(`entity`,io),this.ruler2.push(`balance_pairs`,Ua),this.ruler2.push(`strikethrough`,Bo.postProcess),this.ruler2.push(`emphasis`,Ya.postProcess),this.ruler2.push(`fragments_join`,po),this.defaultRulerVersion=this.ruler.version,this.defaultRuler2Version=this.ruler2.version}skipToken(e){let t=e.pos,n=this.getRules(),r=n.length,i=e.cache,a=i[t],o=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(e.env,`__mdtsProfileRules`));if(a!==void 0){e.pos=a;return}let s=!1;if(e.level<e.maxNesting){if(o){let n=this.ruler.getNamedRules(``);for(let i=0;i<r;i++){e.level++;let r=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();s=n[i].fn(e,!0);let a=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();if(Yo(e.env,`inline`,n[i].name,a-r,!!s,!0),e.level--,s){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}}else if(this.isDefaultRuleset()){if(e.level++,s=es(e,!0),e.level--,s&&t>=e.pos)throw Error(`inline rule didn't increment state.pos`)}else for(let i=0;i<r;i++)if(e.level++,s=n[i](e,!0),e.level--,s){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;s||e.pos++,i[t]=e.pos}tokenize(e){let t=this.getRules(),n=t.length,r=e.posMax;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(e.env,`__mdtsProfileRules`)))){let i=this.isDefaultRuleset();for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<e.maxNesting){if(i)o=es(e,!1);else for(let r=0;r<n&&(o=t[r](e,!1),!o);r++);if(o&&a>=e.pos)throw Error(`inline rule didn't increment state.pos`)}if(o){if(e.pos>=r)break}else e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending();return}let i=this.ruler.getNamedRules(``);for(;e.pos<r;){let t=e.pos,a=!1;if(e.level<e.maxNesting)for(let r=0;r<n;r++){let n=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();a=i[r].fn(e,!1);let o=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();if(Yo(e.env,`inline`,i[r].name,o-n,!!a,!1),a){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(a){if(e.pos>=r)break}else e.pending+=e.src.charAt(e.pos++)}e.pending&&e.pushPending()}isDefaultRuleset(){return this.ruler.version===this.defaultRulerVersion&&this.ruler2.version===this.defaultRuler2Version}usesDefaultState(){return this.State===Qo}parseSource(e,t,n,r){if(typeof e==`string`&&e.length>0&&this.isDefaultRuleset()&&this.usesDefaultState()&&ts(e)){let t=new Jr(`text`,``,0);t.content=e,r.push(t);return}let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.getRules2(),o=a.length;if(!(i.env&&(Object.prototype.hasOwnProperty.call(i.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(i.env,`__mdtsProfileRules`)))){for(let e=0;e<o;e++)a[e](i,!1);return}let s=this.ruler2.getNamedRules(``);for(let e=0;e<o;e++){let t=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();s[e].fn(i,!1);let n=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();Yo(i.env,`inline2`,s[e].name,n-t,!0,!1)}}parse(e,t,n,r){this.parseSource(e,t,n,r)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(``),this.cachedRulesVersion=this.ruler.version),this.cachedRules}getRules2(){return this.cachedRules2Version!==this.ruler2.version&&(this.cachedRules2=this.ruler2.getRules(``),this.cachedRules2Version=this.ruler2.version),this.cachedRules2}};function rs(e){let t=e.tokens,n=e.md?.inline,r=!!n?.isDefaultRuleset?.()&&n?.usesDefaultState?.()!==!1;for(let n=0,i=t.length;n<i;n++){let i=t[n];if(i.type===`inline`&&e.md){if(i.children||=[],r&&i.content.length>0&&ts(i.content)){let e=new Jr(`text`,``,0);e.content=i.content,i.children.push(e);continue}e.md.inline.parse(i.content,e.md,e.env,i.children)}}}var is=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}]/u,as=/[0-9a-z]/i;function os(e){return e.includes(`.`)||e.includes(`@`)||e.includes(`:`)}var ss=new WeakMap;function cs(e){let t=e.re?.get_schema_search?.();if(!t)return!1;let n=ss.get(e);if(n&&n.schemaSearch===t)return n.safe;let r=e.__schemas__,i=!0;if(r){for(let e in r)if(e.charCodeAt(e.length-1)!==58){i=!1;break}}return ss.set(e,{schemaSearch:t,safe:i}),i}function ls(e){return/^<a[>\s]/i.test(e)}function us(e){return/^<\/a\s*>/i.test(e)}function ds(e,t){if(t.schema||t.index!==0||!t.raw)return t;for(let n=1;n<t.raw.length;n++){let r=t.raw[n-1],i=t.raw[n];if(!is.test(r)||!as.test(i))continue;let a=t.raw.slice(n),o=e.match(a)?.[0];if(o&&o.index===0&&o.lastIndex===a.length)return{...o,index:t.index+n,lastIndex:t.index+n+o.lastIndex}}return t}function fs(e){let t=e.tokens;if(!e.md?.options?.linkify)return;let n=cs(e.md.linkify),r=e=>!n||os(e);for(let n=0;n<t.length;n++){let i=t[n];if(i.type!==`inline`||!r(i.content))continue;let a=i.children;a||(a=[],i.children=a);let o=0;for(let t=a.length-1;t>=0;t--){let n=a[t];if(n.type===`link_close`){for(t--;t>=0&&a[t].level!==n.level&&a[t].type!==`link_open`;)t--;continue}if(n.type===`html_inline`&&(ls(n.content)&&o>0&&o--,us(n.content)&&o++),o>0||n.type!==`text`||!r(n.content))continue;let i=n.content,s=(e.md.linkify.match(i)||[]).map(t=>ds(e.md.linkify,t));if(s.length===0)continue;let c=[],l=n.level,u=0;s.length>0&&s[0].index===0&&t>0&&a[t-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t],r=e.md.normalizeLink(n.url);if(!e.md.validateLink(r))continue;let a=n.text;a=n.schema?n.schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:${a}`).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://${a}`).replace(/^http:\/\//,``);let o=n.index;if(o>u){let e=new Jr(`text`,``,0);e.content=i.slice(u,o),e.level=l,c.push(e)}let d=new Jr(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new Jr(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new Jr(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=n.lastIndex}if(u!==0){if(u<i.length){let e=new Jr(`text`,``,0);e.content=i.slice(u),e.level=l,c.push(e)}a.splice(t,1,...c)}}}}var ps=/\r\n?|\n/g,ms=/\0/g;function hs(e){if(!e||typeof e.src!=`string`)return;let t=e.src,n=t.includes(`\r`),r=t.includes(`\0`);if(!n&&!r)return;let i=t;n&&(i=i.replace(ps,`
|
|
33
|
+
`)),r&&(i=i.replace(ms,`�`)),e.src=i}var gs=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,_s=/\((?:c|tm|r)\)/i,vs=/\((c|tm|r)\)/gi,ys={c:`©`,r:`®`,tm:`™`};function bs(e,t){return ys[t.toLowerCase()]}function xs(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(vs,bs)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function Ss(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&gs.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`…`).replace(/([?!])…/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1—`).replace(/(^|\s)--(?=\s|$)/gm,`$1–`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1–`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function Cs(e){if(e.md?.options?.typographer)for(let t=e.tokens.length-1;t>=0;t--){let n=e.tokens[t];if(n.type!==`inline`)continue;let r=n.content||(Array.isArray(n.children)?n.children.map(e=>e.type===`text`?e.content:``).join(``):``);_s.test(r)&&xs(n.children||[]),gs.test(r)&&Ss(n.children||[])}}var ws=class{rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t){let n=this.rules.findIndex(t=>t.name===e);n>=0&&this.rules.splice(n,1),this.rules.push({name:e,fn:t,enabled:!0}),this.invalidateCache()}at(e,t){let n=this.rules.findIndex(t=>t.name===e);if(n<0)throw Error(`Parser rule not found: ${e}`);this.rules[n].fn=t,this.invalidateCache()}before(e,t,n){let r=this.rules.findIndex(t=>t.name===e);if(r<0)throw Error(`Parser rule not found: ${e}`);let i=this.rules.findIndex(e=>e.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(r,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}after(e,t,n){let r=this.rules.findIndex(t=>t.name===e);if(r<0)throw Error(`Parser rule not found: ${e}`);let i=this.rules.findIndex(e=>e.name===t);i>=0&&this.rules.splice(i,1),this.rules.splice(r+1,0,{name:t,fn:n,enabled:!0}),this.invalidateCache()}enable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;for(let e of n){let n=this.rules.findIndex(t=>t.name===e);if(n<0){if(!t)throw Error(`Rules manager: invalid rule name ${e}`)}else r.push(e),this.rules[n].enabled||(this.rules[n].enabled=!0,i=!0)}return i&&this.invalidateCache(),r}disable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;for(let e of n){let n=this.rules.findIndex(t=>t.name===e);if(n<0){if(!t)throw Error(`Rules manager: invalid rule name ${e}`)}else r.push(e),this.rules[n].enabled&&(this.rules[n].enabled=!1,i=!0)}return i&&this.invalidateCache(),r}enableOnly(e){let t=new Set(e),n=!1;for(let e of this.rules){let r=t.has(e.name);e.enabled!==r&&(e.enabled=r,n=!0)}n&&this.invalidateCache()}compileCache(){this.cache=this.rules.filter(e=>e.enabled).map(e=>e.fn),this.namedCache=this.rules.filter(e=>e.enabled).map(e=>({name:e.name,fn:e.fn}))}getRules(e=``){return this.cache||this.compileCache(),this.cache}getNamedRules(e=``){return this.namedCache||this.compileCache(),this.namedCache}},Ts=/['"]/,Es=/['"]/g,Ds=`’`;function Os(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function ks(e,t){let n,r=[],i=t.md&&t.md.options&&t.md.options.quotes||`“”‘’`;for(let t=0;t<e.length;t++){let a=e[t],o=e[t].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,a.type!==`text`)continue;let s=a.content,c=0,l=s.length;OUTER:for(;c<l;){Es.lastIndex=c;let u=Es.exec(s);if(!u)break;let d=!0,f=!0;c=u.index+1;let p=u[0]===`'`,m=32;if(u.index-1>=0)m=s.charCodeAt(u.index-1);else for(n=t-1;n>=0&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(c<l)h=s.charCodeAt(c);else for(n=t+1;n<e.length&&e[n].type!==`softbreak`&&e[n].type!==`hardbreak`;n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=oi(m),_=oi(h),v=ri(m),y=ri(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&u[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f)p&&(a.content=Os(a.content,u.index,Ds));else{if(f)for(n=r.length-1;n>=0;n--){let d=r[n];if(r[n].level<o)break;if(d.single===p&&r[n].level===o){d=r[n];let o,f;p?(o=i[2]||`‘`,f=i[3]||`’`):(o=i[0]||`“`,f=i[1]||`”`),a.content=Os(a.content,u.index,f),e[d.token].content=Os(e[d.token].content,d.pos,o),c+=f.length-1,d.token===t&&(c+=o.length-1),s=a.content,l=s.length,r.length=n;continue OUTER}}d?r.push({token:t,pos:u.index,single:p,level:o}):f&&p&&(a.content=Os(a.content,u.index,Ds))}}}}function As(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--){let n=e.tokens[t];if(n.type!==`inline`)continue;let r=typeof n.content==`string`?n.content:(n.children||[]).map(e=>e.content||``).join(``);Ts.test(r)&&n.children&&ks(n.children,e)}}function js(e){let t=e.tokens||[],n=t.length;for(let e=0;e<n;e++){let n=t[e];if(n.type!==`inline`||!Array.isArray(n.children))continue;let r=n.children,i=r.length;for(let e=0;e<i;e++)r[e].type===`text_special`&&(r[e].type=`text`);let a=0,o=0;for(;o<i;o++)r[o].type===`text`&&o+1<i&&r[o+1].type===`text`?r[o+1].content=r[o].content+r[o+1].content:(o!==a&&(r[a]=r[o]),a++);o!==a&&(r.length=a)}}var Ms=/^(?:vbscript|javascript|file|data):/,Ns=/^data:image\/(?:gif|png|jpeg|webp);/,Ps=[`http:`,`https:`,`mailto:`],Fs=/[^\0-\x7F]/,Is=/xn--/,Ls=/%(?![0-9a-f]{2})|[^\w;/?:@&=+$,\-.!~*'()#%]/i,Rs=/%[0-9a-f]{2}/i;function zs(e){let t=e.trim().toLowerCase();return!Ms.test(t)||Ns.test(t)}function Bs(e){let t=Wr(e,!0);if(t.hostname&&(!t.protocol||Ps.includes(t.protocol))&&Fs.test(t.hostname))try{t.hostname=_a.default.toASCII(t.hostname)}catch{}let n=jr(t);return Ls.test(n)?Ar(n):n}function Vs(e){let t=Wr(e,!0);if(t.hostname&&(!t.protocol||Ps.includes(t.protocol))&&(Fs.test(t.hostname)||Is.test(t.hostname)))try{t.hostname=_a.default.toUnicode(t.hostname)}catch{}let n=jr(t);return Rs.test(n)?Er(n,`${Er.defaultChars}%`):n}function Hs(e){switch(e){case 9:case 32:return!0}return!1}function Us(e,t,n,r){let i=e.src,a=e.bMarks,o=e.eMarks,s=e.tShift,c=e.sCount,l=e.bsCount,u=a[t]+s[t],d=o[t],f=e.lineMax;if(c[t]-e.blkIndent>=4||i.charCodeAt(u)!==62)return!1;if(r)return!0;let p=[],m=[],h=[],g=[],_=e.md.block.ruler.getRulesForState(e,`blockquote`),v=e.parentType;e.parentType=`blockquote`;let y=!1,b;for(b=t;b<n;b++){let t=c[b]<e.blkIndent;if(u=a[b]+s[b],d=o[b],u>=d)break;if(i.charCodeAt(u++)===62&&!t){let e=c[b]+1,t,n;i.charCodeAt(u)===32?(u++,e++,n=!1,t=!0):i.charCodeAt(u)===9?(t=!0,(l[b]+e)%4==3?(u++,e++,n=!1):n=!0):t=!1;let r=e;for(p.push(a[b]),a[b]=u;u<d;){let e=i.charCodeAt(u);if(Hs(e))e===9?r+=4-(r+l[b]+ +!!n)%4:r++;else break;u++}y=u>=d,m.push(l[b]),l[b]=c[b]+1+ +!!t,h.push(c[b]),c[b]=r-e,g.push(s[b]),s[b]=u-a[b];continue}if(y)break;let r=!1;for(let t=0,i=_.length;t<i;t++)if(_[t](e,b,n,!0)){r=!0;break}if(r){e.lineMax=b,e.blkIndent!==0&&(p.push(a[b]),m.push(l[b]),g.push(s[b]),h.push(c[b]),c[b]-=e.blkIndent);break}p.push(a[b]),m.push(l[b]),g.push(s[b]),h.push(c[b]),c[b]=-1}let x=e.blkIndent;e.blkIndent=0;let S=e.push(`blockquote_open`,`blockquote`,1);S.markup=`>`;let C=[t,0];S.map=C,e.md.block.tokenize(e,t,b);let w=e.push(`blockquote_close`,`blockquote`,-1);w.markup=`>`,e.lineMax=f,e.parentType=v,C[1]=e.line;for(let e=0;e<g.length;e++)a[e+t]=p[e],s[e+t]=g[e],c[e+t]=h[e],l[e+t]=m[e];return e.blkIndent=x,!0}function Ws(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;)if(e.isEmpty(r))r++;else if(e.sCount[r]-e.blkIndent>=4)r++,i=r;else break;e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=`${e.getLines(t,i,4+e.blkIndent,!1)}\n`,a.map=[t,e.line],!0}function Gs(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.includes(String.fromCharCode(o)))return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}var Ks=[``,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],qs=[``,`#`,`##`,`###`,`####`,`#####`,`######`];function Js(e){switch(e){case 9:case 32:return!0}return!1}function Ys(e,t,n,r){let i=e.src,a=e.bMarks,o=e.tShift,s=e.eMarks,c=a[t]+o[t],l=s[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let u=i.charCodeAt(c);if(u!==35||c>=l)return!1;let d=1;for(u=i.charCodeAt(++c);u===35&&c<l&&d<=6;)d++,u=i.charCodeAt(++c);if(d>6||c<l&&!Js(u))return!1;if(r)return!0;l=e.skipSpacesBack(l,c);let f=e.skipCharsBack(l,35,c);f>c&&Js(i.charCodeAt(f-1))&&(l=f),e.line=t+1;let p=e.push(`heading_open`,Ks[d],1);p.markup=qs[d],p.map=[t,e.line];let m=e.push(`inline`,``,0);m.content=i.slice(c,l).trim(),m.map=[t,e.line],m.children=[];let h=e.push(`heading_close`,Ks[d],-1);return h.markup=qs[d],!0}function Xs(e){switch(e){case 9:case 32:return!0}return!1}function Zs(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!Xs(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=String.fromCharCode(o).repeat(s),!0}var Qs=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(${`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`).join(`|`)})(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(`${_o.source}\\s*$`),/^$/,!1]];function $s(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<Qs.length&&!Qs[s][0].test(o);s++);if(s===Qs.length)return!1;if(r)return Qs[s][2];let c=t+1;if(!Qs[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),Qs[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let l=e.push(`html_block`,``,0);return l.map=[t,c],l.content=e.getLines(t,c,e.blkIndent,!0),!0}function ec(e){switch(e){case 9:case 32:return!0}return!1}var tc={Pipe:1,ParagraphTerminator:2},nc=new Uint8Array(256);for(let e of[35,42,43,45,60,62,95,96,124,126,48,49,50,51,52,53,54,55,56,57])nc[e]=1;var rc=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];lineFlags=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType=`root`;level=0;constructor(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r;let i=this.src,a=i.length,o=this.bMarks,s=this.eMarks,c=this.tShift,l=this.sCount,u=this.bsCount,d=this.lineFlags,f=0,p=i.indexOf(`|`);for(;f<a;){let e=f;for(;e<a&&e-f<4&&i.charCodeAt(e)!==10;)e++;if(e-f===4&&e<a){let t=i.indexOf(`
|
|
34
|
+
`,e);e=t===-1?a:t}let t=0,n=0,r=f;for(;r<e;){let e=i.charCodeAt(r);if(e===32)t++,n++,r++;else if(e===9)t++,n+=4-n%4,r++;else break}let m=0;r<e&&(nc[i.charCodeAt(r)]===1&&(m|=tc.ParagraphTerminator),p<f&&(p=i.indexOf(`|`,f)),p!==-1&&p<e&&(m|=tc.Pipe|tc.ParagraphTerminator),p===-1&&(p=a)),o.push(f),s.push(e),c.push(t),l.push(n),u.push(0),d.push(m),f=e+1}o.push(a),s.push(a),c.push(0),l.push(0),u.push(0),d.push(0),this.lineMax=o.length-1}push(e,t,n){if(n===0){let n=new Jr(e,t,0);return n.block=!0,n.level=this.level,this.tokens.push(n),n}let r=new Jr(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){let t=this.bMarks,n=this.tShift,r=this.eMarks;for(let i=this.lineMax;e<i&&!(t[e]+n[e]<r[e]);e++);return e}skipSpaces(e){let t=this.src;for(let n=t.length;e<n;e++){let n=t.charCodeAt(e);if(n!==9&&n!==32)break}return e}skipSpacesBack(e,t){if(e<=t)return e;let n=this.src;for(;e>t;){let t=n.charCodeAt(--e);if(t!==9&&t!==32)return e+1}return e}skipChars(e,t){let n=this.src;for(let r=n.length;e<r&&n.charCodeAt(e)===t;e++);return e}skipCharsBack(e,t,n){if(e<=n)return e;let r=this.src;for(;e>n;)if(t!==r.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return``;if(e+1===t){let t=e,i=this.bMarks[t],a=i,o=r?this.eMarks[t]+1:this.eMarks[t],s=0,c=this.src,l=this.bsCount,u=this.tShift;for(;a<o&&s<n;){let e=c.charCodeAt(a);if(e===9||e===32)e===9?s+=4-(s+l[t])%4:s++;else if(a-i<u[t])s++;else break;a++}return s>n?` `.repeat(s-n)+c.slice(a,o):c.slice(a,o)}let i=Array(t-e),a=this.src,o=this.bMarks,s=this.eMarks,c=this.bsCount,l=this.tShift;for(let u=0,d=e;d<t;d++,u++){let e=0,f=o[d],p=f,m;for(m=d+1<t||r?s[d]+1:s[d];p<m&&e<n;){let t=a.charCodeAt(p);if(ec(t))t===9?e+=4-(e+c[d])%4:e++;else if(p-f<l[d])e++;else break;p++}e>n?i[u]=` `.repeat(e-n)+a.slice(p,m):i[u]=a.slice(p,m)}return i.join(``)}};rc.prototype.Token=Jr;function ic(e,t,n){for(let r=t;r<n;r++)if(e.charCodeAt(r)===124)return!0;return!1}function ac(e){let t=e?.md?.block?.ruler;return t?t.version===t.__mdtsDefaultVersion:!1}function oc(e,t,n,r,i){if(e.lineFlags&&(e.lineFlags[t]&tc.ParagraphTerminator)===0||r>=i)return!1;let a=n.charCodeAt(r);switch(a){case 35:case 42:case 43:case 45:case 60:case 62:case 95:case 96:case 126:return!0}return a>=48&&a<=57||ic(n,r,i)}var sc=[``,`h1`,`h2`];function cc(e,t,n){let r=e.md.block.ruler.getRulesForState(e,`paragraph`),i=e.src,a=e.bMarks,o=e.tShift,s=e.eMarks,c=e.sCount,l=e.blkIndent,u=ac(e);if(c[t]-l>=4)return!1;let d=e.parentType;e.parentType=`paragraph`;let f=0,p,m=t+1;for(;m<n;m++){let t=a[m]+o[m],d=s[m];if(t>=d)break;if(c[m]-l>3)continue;if(c[m]>=l&&(p=i.charCodeAt(t),p===45||p===61)){let e=t+1,n=e;for(;e<d&&i.charCodeAt(e)===p;)e++;for(n=e;e<d;){let t=i.charCodeAt(e);if(t!==9&&t!==32)break;e++}if(e>=d){f=p===61?1:2;break}if(n-t>1)continue}if(c[m]<0||u&&!oc(e,m,i,t,d))continue;let h=!1;for(let t=0,i=r.length;t<i;t++)if(r[t](e,m,n,!0)){h=!0;break}if(h)break}if(!f)return!1;let h;if(m===t+1){let e=a[t]+o[t],n=s[t];for(;n>e;){let e=i.charCodeAt(n-1);if(e!==9&&e!==32)break;n--}h=i.slice(e,n)}else h=e.getLines(t,m,l,!1).trim();e.line=m+1;let g=p===61?`=`:`-`,_=e.push(`heading_open`,sc[f],1);_.markup=g,_.map=[t,e.line];let v=e.push(`inline`,``,0);v.content=h,v.map=[t,e.line-1],v.children=[];let y=e.push(`heading_close`,sc[f],-1);return y.markup=g,e.parentType=d,!0}function lc(e){switch(e){case 9:case 32:return!0}return!1}function uc(e,t){let n=e.eMarks,r=e.bMarks,i=e.tShift,a=e.src,o=n[t],s=r[t]+i[t],c=a.charCodeAt(s++);return c!==42&&c!==45&&c!==43||s<o&&!lc(a.charCodeAt(s))?-1:s}function dc(e,t){let n=e.bMarks,r=e.tShift,i=e.eMarks,a=e.src,o=n[t]+r[t],s=i[t],c=o;if(c+1>=s)return-1;let l=a.charCodeAt(c++);if(l<48||l>57)return-1;for(;;){if(c>=s)return-1;if(l=a.charCodeAt(c++),l>=48&&l<=57){if(c-o>=10)return-1}else{if(l===41||l===46)break;return-1}}return c<s&&(l=a.charCodeAt(c),!lc(l))?-1:c}function fc(e,t,n){let r=e.bMarks,i=e.tShift,a=e.src,o=r[t]+i[t],s=0;for(let e=o;e<n-1;e++)s=s*10+a.charCodeAt(e)-48;return s}var pc=[`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`];function mc(e,t){let n=e.level+2,r=e.tokens;for(let e=t+2,i=r.length-2;e<i;e++){let t=r[e];if(t.level===n){if(t.type===`paragraph_open`)t.hidden=!0,r[e+2].hidden=!0,e+=2;else if(t.nesting===1){let t=1;for(;t>0&&++e<i;)t+=r[e].nesting}}}}function hc(e,t,n,r){let i,a,o=0,s=t,c=!0;if(e.sCount[s]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[s]-e.listIndent>=4&&e.sCount[s]<e.blkIndent)return!1;let l=!1;r&&e.parentType===`paragraph`&&e.sCount[s]>=e.blkIndent&&(l=!0);let u,d,f,p=e.src,m=e.bMarks,h=e.tShift,g=e.eMarks,_=e.sCount,v=e.bsCount,y=m[s]+h[s];if(y>=g[s])return!1;let b=p.charCodeAt(y);if(b>=48&&b<=57){if(f=dc(e,s),f<0||(u=!0,o=y,d=fc(e,s,f),l&&d!==1))return!1}else if(b===42||b===45||b===43){if(f=uc(e,s),f<0)return!1;u=!1}else return!1;if(l&&e.skipSpaces(f)>=g[s])return!1;if(r)return!0;let x=p.charCodeAt(f-1),S=String.fromCharCode(x);if(u){let t=e.push(`ordered_list_open`,`ol`,1);d!==void 0&&d!==1&&(t.attrs=[[`start`,String(d)]])}else e.push(`bullet_list_open`,`ul`,1);let C=[s,0];e.tokens[e.tokens.length-1].map=C,e.tokens[e.tokens.length-1].markup=S;let w=!1,T=e.tokens.length-1,E=e.md.block.ruler.getRulesForState(e,`list`),D=e.parentType;for(e.parentType=`list`;s<n;){a=f,i=g[s];let t=_[s]+f-(m[s]+h[s]),r=t;for(;a<i;){let e=p.charCodeAt(a);if(e===9)r+=4-(r+v[s])%4;else if(e===32)r++;else break;a++}let l=a,d;d=l>=i?1:r-t,d>4&&(d=1);let y=t+d,b=e.push(`list_item_open`,`li`,1);b.markup=S;let C=[s,0];b.map=C,u&&(b.info=f-o-1==1?pc[p.charCodeAt(o)-48]:p.slice(o,f-1));let T=e.tight,D=e.tShift[s],O=e.sCount[s],k=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=y,e.tight=!0,e.tShift[s]=l-m[s],e.sCount[s]=r,l>=i&&e.isEmpty(s+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,s,n,!0),(!e.tight||w)&&(c=!1),w=e.line-s>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=k,e.tShift[s]=D,e.sCount[s]=O,e.tight=T,e.push(`list_item_close`,`li`,-1).markup=S,s=e.line,C[1]=s,s>=n||e.sCount[s]<e.blkIndent||e.sCount[s]-e.blkIndent>=4)break;let A=!1;for(let t=0,r=E.length;t<r;t++)if(E[t](e,s,n,!0)){A=!0;break}if(A)break;if(u){if(f=dc(e,s),f<0)break;o=m[s]+h[s]}else if(f=uc(e,s),f<0)break;if(x!==p.charCodeAt(f-1))break}return u?e.push(`ordered_list_close`,`ol`,-1).markup=S:e.push(`bullet_list_close`,`ul`,-1).markup=S,C[1]=s,e.line=s,e.parentType=D,c&&mc(e,T),!0}function gc(e){return e===9||e===32}function _c(e,t,n){let r=e.md.block.ruler.getRulesForState(e,`paragraph`),i=e.parentType,a=e.src,o=e.bMarks,s=e.tShift,c=e.eMarks,l=e.sCount,u=e.blkIndent,d=ac(e),f=t+1;for(e.parentType=`paragraph`;f<n&&!e.isEmpty(f);f++){if(l[f]-u>3||l[f]<0)continue;if(i===`list`&&l[f]>=u){let e=o[f]+s[f],t=c[f];if(e<t){let n=a.charCodeAt(e);if(n===42||n===45||n===43){if(e+1>=t||gc(a.charCodeAt(e+1)))break}else if(n>=48&&n<=57&&e+1<t){let n=e+1;for(;;){if(n>=t){n=-1;break}let r=a.charCodeAt(n++);if(r>=48&&r<=57){if(n-e>=10){n=-1;break}}else{if((r===41||r===46)&&(n>=t||gc(a.charCodeAt(n))))break;n=-1;break}}if(n>=0)break}}}let t=o[f]+s[f],p=c[f];if(d&&!oc(e,f,a,t,p))continue;let m=!1;for(let t=0,i=r.length;t<i;t++)if(r[t](e,f,n,!0)){m=!0;break}if(m)break}let p=e.getLines(t,f,u,!1).trim();e.line=f;let m=e.push(`paragraph_open`,`p`,1);m.map=[t,e.line];let h=e.push(`inline`,``,0);return h.content=p,h.map=[t,e.line],h.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}function vc(e){switch(e){case 9:case 32:return!0}return!1}function yc(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1,s=e.md.block.ruler.getRulesForState(e,`reference`);if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function c(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.parentType;e.parentType=`reference`;let i=!1;for(let r=0,a=s.length;r<a;r++)if(s[r](e,t,n,!0)){i=!0;break}if(e.parentType=r,i)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let l=e.src.slice(i,a+1);a=l.length;let u=-1;for(i=1;i<a;i++){let e=l.charCodeAt(i);if(e===91)return!1;if(e===93){u=i;break}if(e===10){let e=c(o);e!==null&&(l+=e,a=l.length,o++)}else if(e===92&&(i++,i<a&&l.charCodeAt(i)===10)){let e=c(o);e!==null&&(l+=e,a=l.length,o++)}}if(u<0||l.charCodeAt(u+1)!==58)return!1;for(i=u+2;i<a;i++){let e=l.charCodeAt(i);if(e===10){let e=c(o);e!==null&&(l+=e,a=l.length,o++)}else if(!vc(e))break}let d=e.md.helpers.parseLinkDestination(l,i,a);if(!d.ok)return!1;let f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;i=d.pos;let p=i,m=o,h=i;for(;i<a;i++){let e=l.charCodeAt(i);if(e===10){let e=c(o);e!==null&&(l+=e,a=l.length,o++)}else if(!vc(e))break}let g=e.md.helpers.parseLinkTitle(l,i,a);for(;g.can_continue;){let t=c(o);if(t===null)break;l+=t,i=a,a=l.length,o++,g=e.md.helpers.parseLinkTitle(l,i,a,g)}let _;for(i<a&&h!==i&&g.ok?(_=g.str,i=g.pos):(_=``,i=p,o=m);i<a&&vc(l.charCodeAt(i));)i++;if(i<a&&l.charCodeAt(i)!==10&&_)for(_=``,i=p,o=m;i<a&&vc(l.charCodeAt(i));)i++;if(i<a&&l.charCodeAt(i)!==10)return!1;let v=ci(l.slice(1,u));return v?(r||(e.env.references===void 0&&(e.env.references={}),e.env.references[v]===void 0&&(e.env.references[v]={title:_,href:f}),e.line=o),!0):!1}function bc(e){switch(e){case 9:case 32:return!0}return!1}var xc=65536;function Sc(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Cc(e,t){if(e.lineFlags)return(e.lineFlags[t]&tc.Pipe)!==0;for(let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];n<r;n++)if(e.src.charCodeAt(n)===124)return!0;return!1}function wc(e){if(!e.includes(`\\`))return e.split(`|`);let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function Tc(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!bc(s)||o===45&&bc(s)||!Cc(e,t))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!bc(t))return!1;a++}let c=Sc(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=Sc(e,t).trim(),e.sCount[t]-e.blkIndent>=4)return!1;l=wc(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRulesForState(e,`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=Sc(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=wc(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>xc))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:${u[t]}`]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}var Ec=class{_rules=[];cache=null;namedCache=null;version=0;invalidateCache(){this.cache=null,this.namedCache=null,this.version++}push(e,t,n){this._rules.push({name:e,enabled:!0,fn:t,alt:n?.alt||[]}),this.invalidateCache()}before(e,t,n,r){let i=this._rules.findIndex(t=>t.name===e);if(i<0)throw Error(`Parser rule not found: ${e}`);let a=this._rules.findIndex(e=>e.name===t);a>=0&&this._rules.splice(a,1),this._rules.splice(i,0,{name:t,enabled:!0,fn:n,alt:r?.alt||[]}),this.invalidateCache()}after(e,t,n,r){let i=this._rules.findIndex(t=>t.name===e);if(i<0)throw Error(`Parser rule not found: ${e}`);let a=this._rules.findIndex(e=>e.name===t);a>=0&&this._rules.splice(a,1),this._rules.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:r?.alt||[]}),this.invalidateCache()}getRules(e){let t=e||``;return this.cache||this.compileCache(),this.cache[t]??[]}getNamedRules(e){let t=e||``;return this.namedCache||this.compileCache(),this.namedCache[t]??[]}getRulesForState(e,t){let n=e?.env;return n&&(Object.prototype.hasOwnProperty.call(n,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(n,`__mdtsProfileRules`))?this.getNamedRules(t).map(({name:e,fn:t})=>(n,r,i,a)=>{let o=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),s=t(n,r,i,a),c=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();return Yo(n?.env,`block`,e,c-o,s,!!a),s}):this.getRules(t)}at(e,t,n){let r=this._rules.findIndex(t=>t.name===e);if(r===-1)throw Error(`Parser rule not found: ${e}`);this._rules[r].fn=t,n?.alt&&(this._rules[r].alt=n.alt),this.invalidateCache()}enable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;return n.forEach(e=>{let n=this._rules.findIndex(t=>t.name===e);if(n===-1){if(t)return;throw Error(`Rules manager: invalid rule name ${e}`)}r.push(e),this._rules[n].enabled||(this._rules[n].enabled=!0,i=!0)}),i&&this.invalidateCache(),r}disable(e,t){let n=Array.isArray(e)?e:[e],r=[],i=!1;return n.forEach(e=>{let n=this._rules.findIndex(t=>t.name===e);if(n===-1){if(t)return;throw Error(`Rules manager: invalid rule name ${e}`)}r.push(e),this._rules[n].enabled&&(this._rules[n].enabled=!1,i=!0)}),i&&this.invalidateCache(),r}enableOnly(e){let t=new Set(e),n=!1;for(let e of this._rules){let r=t.has(e.name);e.enabled!==r&&(e.enabled=r,n=!0)}n&&this.invalidateCache()}compileCache(){let e=new Set([``]);for(let t of this._rules)if(t.enabled)for(let n of t.alt)e.add(n);let t=Object.create(null),n=Object.create(null);for(let r of e){let e=[],i=[];for(let t of this._rules)t.enabled&&(r===``||t.alt.includes(r))&&(e.push(t.fn),i.push({name:t.name,fn:t.fn}));t[r]=e,n[r]=i}this.cache=t,this.namedCache=n}},Dc=[[`table`,Tc,[`paragraph`,`reference`]],[`code`,Ws],[`fence`,Gs,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Us,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,Zs,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,hc,[`paragraph`,`reference`,`blockquote`]],[`reference`,yc],[`html_block`,$s,[`paragraph`,`reference`,`blockquote`]],[`heading`,Ys,[`paragraph`,`reference`,`blockquote`]],[`lheading`,cc],[`paragraph`,_c]],Oc=class{ruler;cachedRulesVersion=-1;cachedRules=[];constructor(){this.ruler=new Ec;for(let e=0;e<Dc.length;e++)this.ruler.push(Dc[e][0],Dc[e][1],{alt:(Dc[e][2]||[]).slice()});this.ruler.__mdtsDefaultVersion=this.ruler.version}tokenize(e,t,n){let r=this.getRules(),i=r.length,a=e.md.options.maxNesting,o=e.bMarks,s=e.tShift,c=e.eMarks,l=e.sCount,u=t,d=!1;if(!(e.env&&(Object.prototype.hasOwnProperty.call(e.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(e.env,`__mdtsProfileRules`)))){for(;u<n;){for(;u<n&&o[u]+s[u]>=c[u];)u++;if(e.line=u,u>=n||l[u]<e.blkIndent)break;if(e.level>=a){e.line=n;break}let t=e.line,f=!1;for(let a=0;a<i;a++)if(f=r[a](e,u,n,!1),f){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!f)throw Error(`none of the block rules matched`);e.tight=!d,o[e.line-1]+s[e.line-1]>=c[e.line-1]&&(d=!0),u=e.line,u<n&&o[u]+s[u]>=c[u]&&(d=!0,u++,e.line=u)}return}let f=this.ruler.getNamedRules(``);for(;u<n;){for(;u<n&&o[u]+s[u]>=c[u];)u++;if(e.line=u,u>=n||l[u]<e.blkIndent)break;if(e.level>=a){e.line=n;break}let t=e.line,r=!1;for(let a=0;a<i;a++){let i=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();r=f[a].fn(e,u,n,!1);let o=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();if(Yo(e.env,`block`,f[a].name,o-i,r,!1),r){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}}if(!r)throw Error(`none of the block rules matched`);e.tight=!d,o[e.line-1]+s[e.line-1]>=c[e.line-1]&&(d=!0),u=e.line,u<n&&o[u]+s[u]>=c[u]&&(d=!0,u++,e.line=u)}}parse(e,t,n,r){if(!e||e.length===0)return;let i=new rc(e,t,n,r);this.tokenize(i,i.line,i.lineMax)}getRules(){return this.cachedRulesVersion!==this.ruler.version&&(this.cachedRules=this.ruler.getRules(``),this.cachedRulesVersion=this.ruler.version),this.cachedRules}},kc=class{src;env;tokens;inlineMode;md;constructor(e,t,n={}){this.src=typeof e==`string`?e||``:e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}};kc.prototype.Token=Jr;var Ac=[[`normalize`,hs],[`block`,Pa],[`inline`,rs],[`linkify`,fs],[`replacements`,Cs],[`smartquotes`,As],[`text_join`,js]],jc={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,maxNesting:100},Mc={parseLinkLabel:Sa,parseLinkDestination:va,parseLinkTitle:wa};function Nc(){return{...jc}}function Pc(){return{...Mc}}var Fc=class{fallbackParser;lastState=null;block;inline;ruler;linkifyInstance=null;cachedCoreRulesVersion=-1;cachedCoreRules=[];cachedCoreNamedRulesVersion=-1;cachedCoreNamedRules=[];constructor(){this.block=new Oc,this.inline=new ns,this.ruler=new ws;for(let e=0;e<Ac.length;e++){let[t,n]=Ac[e];this.ruler.push(t,n)}this.fallbackParser={block:this.block,inline:this.inline,core:this,options:Nc(),helpers:Pc(),normalizeLink:Bs,normalizeLinkText:Vs,validateLink:zs,linkify:null}}resolveParser(e){return e||(this.linkifyInstance||=new ga({fuzzyLink:!0}),this.fallbackParser.block!==this.block&&(this.fallbackParser.block=this.block),this.fallbackParser.inline!==this.inline&&(this.fallbackParser.inline=this.inline),this.fallbackParser.core=this,this.fallbackParser.linkify=this.linkifyInstance,this.fallbackParser)}createState(e,t={},n){return new kc(e,this.resolveParser(n),t)}getCoreRules(){return this.cachedCoreRulesVersion!==this.ruler.version&&(this.cachedCoreRules=this.ruler.getRules(``),this.cachedCoreRulesVersion=this.ruler.version),this.cachedCoreRules}getCoreNamedRules(){return this.cachedCoreNamedRulesVersion!==this.ruler.version&&(this.cachedCoreNamedRules=this.ruler.getNamedRules(``),this.cachedCoreNamedRulesVersion=this.ruler.version),this.cachedCoreNamedRules}process(e,t){let n=!!e.env&&(Object.prototype.hasOwnProperty.call(e.env,`__mdtsRuleProfile`)||Object.prototype.hasOwnProperty.call(e.env,`__mdtsProfileRules`));if(!n&&!t){let t=this.getCoreRules();for(let n=0;n<t.length;n++)t[n](e);return}let r=this.getCoreNamedRules();for(let i=0;i<r.length;i++){let a=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();r[i].fn(e);let o=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now();n&&Yo(e.env,`core`,r[i].name,o-a,!0,!1),t?.(r[i],e)}n&&Xo(e.env)}parseSource(e,t={},n){if(typeof e!=`string`&&Ma(e))return this.parse(Na(e),t,n);let r=this.createState(e,t,n);return this.process(r),this.lastState=r,r}parse(e,t={},n){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);return this.parseSource(e,t,n)}getTokens(){return this.lastState?this.lastState.tokens:[]}},Ic=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/;function Lc(e){return!Ic.test(e)}function Rc(e,t){let n=e.indexOf(`
|
|
35
|
+
`,t);return n===-1?e.length:n}function zc(e,t,n){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9)return!1}return!0}function Bc(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Vc(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}function Hc(e){if(e.length>3)return Lc(e);for(let t=0;t<e.length;t++)switch(e.charCodeAt(t)){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!1}return!0}var Uc=[``,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],Wc=[``,`#`,`##`,`###`,`####`,`#####`,`######`],Gc=0,Kc=1,qc=2;function Jc(e,t,n,r){let i=new Jr(e,t,n);return i.level=r,i.block=!0,i}function Yc(e,t,n){let r=Jc(`inline`,``,0,n);r.map=[t,t+1],r.content=e;let i=new Jr(`text`,``,0);return i.content=e,r.children=[i],r}function Xc(e,t,n,r,i){let a=0,o=n;for(;o<r&&t.charCodeAt(o)===35&&a<6;)o++,a++;if(a===0||o>=r||t.charCodeAt(o)!==32)return!1;let s=o+1;for(;s<r&&t.charCodeAt(s)===32;)s++;let c=r;for(;c>s&&t.charCodeAt(c-1)===32;)c--;let l=c;for(;l>s&&t.charCodeAt(l-1)===35;)l--;if(l>s&&t.charCodeAt(l-1)===32)for(c=l-1;c>s&&t.charCodeAt(c-1)===32;)c--;let u=t.slice(s,c);if(!Lc(u))return!1;let d=Uc[a],f=Wc[a],p=Jc(`heading_open`,d,1,0);p.map=[i,i+1],p.markup=f,e.push(p),e.push(Yc(u,i,1));let m=Jc(`heading_close`,d,-1,0);return m.markup=f,e.push(m),!0}function Zc(e,t,n){let r=Jc(`paragraph_open`,`p`,1,0);r.map=[n,n+1],e.push(r),e.push(Yc(t,n,1)),e.push(Jc(`paragraph_close`,`p`,-1,0))}function Qc(e,t,n){let r=e.charCodeAt(n-1);return r===32||r===9?e.slice(t,n).trim():e.slice(t,n)}function $c(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function el(e,t){let n=Jc(`bullet_list_open`,`ul`,1,0);return n.map=[t,t],n.markup=`-`,e.push(n),n}function tl(e,t,n){let r=Jc(`list_item_open`,`li`,1,1);r.map=[n,n+1],r.markup=`-`,e.push(r);let i=Jc(`paragraph_open`,`p`,1,2);i.map=[n,n+1],i.hidden=!0,e.push(i),e.push(Yc(t,n,3));let a=Jc(`paragraph_close`,`p`,-1,2);a.hidden=!0,e.push(a);let o=Jc(`list_item_close`,`li`,-1,1);return o.markup=`-`,e.push(o),r}function nl(e){let t=Jc(`bullet_list_close`,`ul`,-1,0);t.markup=`-`,e.push(t)}function rl(e,t,n,r){if(!Bc(e,t,n))return null;let i=e.slice(t+3,n);if(i.includes("`"))return null;let a=n<e.length?n+1:n,o=a,s=a,c=r+1;for(;s<e.length;){let t=Rc(e,s);if(Bc(e,s,t)&&zc(e,s+3,t)){let n=Jc(`fence`,`code`,0,0);return n.map=[r,c+1],n.markup="```",n.info=i,n.content=e.slice(a,o),{token:n,nextPos:t<e.length?t+1:t,nextLine:c+1}}s=t<e.length?t+1:t,o=s,c++}return null}function il(e,t){if(e.length===0)return t&&(t.matched=!0),[];if(e.includes(`\r`)||e.includes(`\0`))return null;let n=[],r=e.length>=1e5?Gc:qc,i=``,a=!1,o=!1,s=0,c=0;for(;s<e.length;){let l=Rc(e,s);if(s===l){s=l<e.length?l+1:l,c++;continue}let u=e.charCodeAt(s);if(u===32||u===9){if(!zc(e,s,l))return null;s=l<e.length?l+1:l,c++;continue}if(u===35){if(!Xc(n,e,s,l,c))return null;t&&(t.blocks++,t.headings++);let r=l<e.length?l+1:l;s=$c(e,r),c+=1+s-r;continue}if(u===45){if(!Vc(e,s,l))return null;let r=c,i=s,a=c,o=null,u=null;for(;i<e.length;){let t=Rc(e,i);if(!Vc(e,i,t))break;let s=i+2,c=t===s+1?e[s]:e.slice(s,t);if(!Hc(c))return null;o===null&&(o=el(n,r)),u=tl(n,c,a),i=t<e.length?t+1:t,a++}if(o===null||u===null)return null;let d=i,f=a;for(;d<e.length;){if(e.charCodeAt(d)===10){d++,f++;continue}let t=Rc(e,d);if(!zc(e,d,t)){if(Vc(e,d,t))return null;break}d=t<e.length?t+1:t,f++}o.map[1]=f,u.map[1]=f,nl(n),t&&(t.blocks++,t.lists++),s=d,c=f;continue}if(u===96){let r=rl(e,s,l,c);if(!r)return null;n.push(r.token),t&&(t.blocks++,t.fences++),s=$c(e,r.nextPos),c=r.nextLine+s-r.nextPos;continue}let d=Qc(e,s,l),f;if(r===qc?(t&&t.paragraphCacheBypasses++,f=Lc(d)):r===Kc&&d===i?(t&&t.paragraphCacheHits++,f=a):(t&&t.paragraphCacheMisses++,f=Lc(d),r===Gc?(o&&(r=d===i?Kc:qc),i=d,a=f,o=!0):r===Kc&&(i=d,a=f)),!f)return null;let p=l<e.length?l+1:l;if(p<e.length&&e.charCodeAt(p)!==10&&!zc(e,p,Rc(e,p)))return null;Zc(n,d,c),t&&(t.blocks++,t.paragraphs++),s=$c(e,p),c+=1+s-p}return t&&(t.matched=!0),n}var al=/[&<>"]/,ol=/[&<>"]/g,sl=/&/g,cl=/[<>"]/g,ll={"&":`&`,"<":`<`,">":`>`,'"':`"`};function ul(e){return ll[e]||e}function dl(e){if(e.length===0)return``;if(e.length<32)return al.test(e)?e.replace(ol,ul):e;let t=e.includes(`&`),n=e.includes(`<`),r=e.includes(`>`),i=e.includes(`"`);return!t&&!n&&!r&&!i?e:t&&!n&&!r&&!i?e.replace(sl,`&`):t?e.replace(ol,ul):e.replace(cl,ul)}var fl=RegExp(`\\\\([!"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_\`{|}~])|&([a-z#][a-z0-9]{1,31});`,`gi`),pl=/^#(?:x[a-f0-9]{1,8}|\d{1,8})$/i;function ml(e){return!e.includes(`\\`)&&!e.includes(`&`)?e:e.replace(fl,(e,t,n)=>{if(t)return t;if(pl.test(n)){let e=n[1].toLowerCase()===`x`?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return ui(e)?di(e):`�`}let r=Sr(e);return r===e?e:r})}var hl=/[\n!#$%&*+\-:<=>@[\]\\^_`{}~]/,gl=/[\n!"#$%&*+\-:<=>@[\]\\^_`{}~]/,_l=/"/g;function vl(e,t){let n=e.indexOf(`
|
|
36
|
+
`,t);return n===-1?e.length:n}function yl(e,t,n){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9)return!1}return!0}function bl(e,t){for(;t<e.length&&e.charCodeAt(t)===10;)t++;return t}function xl(e,t){return t>=e.length||e.charCodeAt(t)===10?!1:!yl(e,t,vl(e,t))}function Sl(e,t,n){return t+2<n&&e.charCodeAt(t)===96&&e.charCodeAt(t+1)===96&&e.charCodeAt(t+2)===96}function Cl(e,t,n){let r=e.charCodeAt(n-1);return r===32||r===9?e.slice(t,n).trim():e.slice(t,n)}function wl(e){return gl.test(e)?hl.test(e)?null:e.replace(_l,`"`):e}function Tl(e,t,n){let r=0,i=t;for(;i<n&&e.charCodeAt(i)===35&&r<6;)i++,r++;if(r===0||i>=n||e.charCodeAt(i)!==32)return null;let a=i+1;for(;a<n&&e.charCodeAt(a)===32;)a++;let o=n;for(;o>a&&e.charCodeAt(o-1)===32;)o--;let s=o;for(;s>a&&e.charCodeAt(s-1)===35;)s--;if(s>a&&e.charCodeAt(s-1)===32)for(o=s-1;o>a&&e.charCodeAt(o-1)===32;)o--;let c=wl(e.slice(a,o));return c===null?null:`<h${r}>${c}</h${r}>\n`}function El(e,t,n){return t+1<n&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===32}var Dl=new Uint8Array(256).fill(1);for(let e of[10,33,35,36,37,38,42,43,45,58,60,61,62,64,91,92,93,94,95,96,123,125,126])Dl[e]=0;Dl[34]=0;function Ol(e,t){let n=e.charCodeAt(t);return n===34?`<li>"</li>
|
|
37
|
+
`:n<256&&Dl[n]===0?null:`<li>${e[t]}</li>\n`}function kl(e,t,n){let r=t+2;if(n===r+1)return Ol(e,r);let i=wl(e.slice(t+2,n));return i===null?null:`<li>${i}</li>\n`}function Al(e,t,n){for(;t<n;){let n=e.charCodeAt(t);if(n!==32&&n!==9)break;t++}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==32&&t!==9)break;n--}let r=n;for(let i=t;i<n;i++){let t=e.charCodeAt(i);if(t===96)return null;if(t===32||t===9){r=i;break}}return e.slice(t,r)}function jl(e,t,n,r,i){if(!Sl(e,t,n))return null;let a=Al(e,t+3,n);if(a===null)return null;let o=n<e.length?n+1:n,s=o,c=o;for(;c<e.length;){let t=vl(e,c);if(Sl(e,c,t)&&yl(e,c+3,t)){let n=e.slice(o,s),c;return a===r.lang?(i&&i.fenceCacheHits++,c=r.open):(i&&i.fenceCacheMisses++,c=a?`<pre><code class="language-${dl(a)}">`:`<pre><code>`,r.lang=a,r.open=c),{html:`${c}${dl(n)}</code></pre>\n`,nextPos:t<e.length?t+1:t}}c=t<e.length?t+1:t,s=c}return null}function Ml(e,t){if(e.length===0)return t&&(t.matched=!0),``;if(e.includes(`\r`)||e.includes(`\0`))return null;let n=0,r=``,i=e.length>=25e4,a=[],o={lang:null,open:``},s=``,c=``,l=``,u=``;for(;n<e.length;){let d=vl(e,n);if(n===d){n=d<e.length?d+1:d;continue}let f=e.charCodeAt(n);if(f===32||f===9){if(!yl(e,n,d))return null;n=d<e.length?d+1:d;continue}if(f===35){let o=Tl(e,n,d);if(o===null)return null;t&&(t.blocks++,t.headings++),i?a.push(o):r+=o,n=bl(e,d<e.length?d+1:d);continue}if(f===45){let o=n;for(;o<e.length;){let t=vl(e,o);if(!El(e,o,t))break;o=t<e.length?t+1:t}if(o===n)return null;let l=e.slice(n,o),u;if(l===s)t&&t.listCacheHits++,u=c;else{t&&t.listCacheMisses++;let r=n;for(u=`<ul>
|
|
38
|
+
`;r<o;){let t=vl(e,r),n=kl(e,r,t);if(n===null)return null;u+=n,r=t<e.length?t+1:t}u+=`</ul>
|
|
39
|
+
`,s=l,c=u}let d=bl(e,o);for(;d<e.length;){if(e.charCodeAt(d)===10){d++;continue}let t=vl(e,d);if(!yl(e,d,t)){if(El(e,d,t))return null;break}d=t<e.length?t+1:t}t&&(t.blocks++,t.lists++),i?a.push(u):r+=u,n=d;continue}if(f===96){let s=jl(e,n,d,o,t);if(!s)return null;t&&(t.blocks++,t.fences++),i?a.push(s.html):r+=s.html,n=bl(e,s.nextPos);continue}let p=Cl(e,n,d),m;if(p===l)t&&t.paragraphCacheHits++,m=u;else{t&&t.paragraphCacheMisses++;let e=wl(p);if(e===null)return null;m=`<p>${e}</p>\n`,l=p,u=m}let h=d<e.length?d+1:d;if(h<e.length&&e.charCodeAt(h)!==10&&xl(e,h))return null;t&&(t.blocks++,t.paragraphs++),i?a.push(m):r+=m,n=bl(e,h)}return t&&(t.matched=!0),i?a.join(``):r}function Nl(e){return Ml(e)}function Pl(e,t){return Ml(e,t)}var Fl={maxChunkChars:1e4,maxChunkLines:200,fenceAware:!0,maxChunks:void 0,fallbackOnGlobalState:!0};function Il(e,t,n={},r){$i(n);let i={...Fl,...r||{}},a=Ui(t);if(i.fallbackOnGlobalState!==!1&&a)return na(n,{count:1,fallback:!0,fallbackReason:a,globalStateDetected:a,maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines}),Gi(n,a,()=>e.core.parse(t,n,e).tokens);let o=Ll(t,i);if(i.maxChunks&&o.length>i.maxChunks&&(o=Hl(o,i.maxChunks)),Rl(t,o))return na(n,{count:1,fallback:!0,fallbackReason:`unsafe-chunk-boundary`,maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines}),Gi(n,a,()=>e.core.parse(t,n,e).tokens);let s=0,c=[];return na(n,{count:o.length,maxChunkChars:i.maxChunkChars,maxChunkLines:i.maxChunkLines,globalStateDetected:a||void 0,globalStateFallbackDisabled:i.fallbackOnGlobalState===!1&&!!a}),Gi(n,a,()=>{for(let r=0;r<o.length;r++){let i=o[r],a=t.slice(i.start,i.end),l=e.core.parse(a,n,e).tokens;s!==0&&l.length&&Bl(l,s),Vl(c,l),s+=i.lineCount}return c})}function Ll(e,t,n=!0){let r=[],i=0,a=0,o=0,s=0,c=0,l=0,u=null;function d(e){e<=o||(r.push({start:o,end:e,lineCount:s}),o=e,i=0,a=0,s=0)}for(let n=0;n<e.length;){let r=e.indexOf(`
|
|
40
|
+
`,n),o=r;r===-1?(r=e.length,o=e.length):o=r+1;let f=Ul(e,n,r);if(t.fenceAware){let t=n;for(;t<r;){let n=e.charCodeAt(t);if(n===32||n===9)t++;else break}let i=e[t];if(i==="`"||i===`~`){let n=t;for(;n<r&&e[n]===i;)n++;let a=n-t;a>=3&&(u?u.marker===i&&a>=u.length&&(u=null):u={marker:i,length:a})}}let p=o-n;i+=p,a+=1,s+=1,f?(c=0,l=0):(c+=1,l+=p);let m=f;if((i>=t.maxChunkChars||a>=t.maxChunkLines)&&!u){if(m)d(o);else{let e=Math.max(10,Math.floor(t.maxChunkLines*.5)),n=Math.max(t.maxChunkChars,8e3);(c>=e||l>=n)&&d(o)}}n=o}return n&&d(e.length),r}function Rl(e,t,n={rangesCoverWholeSource:!0}){let r=n.rangesCoverWholeSource?t.length-1:t.length;for(let n=0;n<r;n++)if(!zl(e,t[n].end))return!0;return!1}function zl(e,t){if(t<=0||t>e.length||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;for(let r=n+1;r<t-1;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9&&t!==13)return!1}return!0}function Bl(e,t){if(t===0)return;let n=[];for(let t=e.length-1;t>=0;t--)n.push(e[t]);for(;n.length;){let e=n.pop();if(e.map&&(e.map[0]+=t,e.map[1]+=t),e.children)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}}function Vl(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Hl(e,t){if(e.length<=t)return e;let n=[],r=0;for(let i=0;i<t;i++){let a=t-i,o=e.length-r,s=Math.ceil(o/a),c=e.slice(r,r+s),l=0;for(let e=0;e<c.length;e++)l+=c[e].lineCount;n.push({start:c[0].start,end:c[c.length-1].end,lineCount:l}),r+=s}return n}function Ul(e,t,n){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9&&t!==13)return!1}return!0}var Wl=4e6,Gl=8e4,Kl=1e4,ql=200,Jl=1e4,Yl=200;function Xl(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function Zl(e,t){if(t===0)return;let n=[];for(let t=e.length-1;t>=0;t--)n.push(e[t]);for(;n.length;){let e=n.pop();if(e.map&&(e.map[0]+=t,e.map[1]+=t),e.children)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}}function Ql(e){return e.length===0?0:Ei(e)+(e.charCodeAt(e.length-1)===10?0:1)}function $l(e,t,n){for(let r=t;r<n;r++){let t=e.charCodeAt(r);if(t!==32&&t!==9&&t!==13)return!1}return!0}function eu(e,t){if(!t||e.length===0)return!1;let n=null;for(let t=0;t<e.length;){let r=e.indexOf(`
|
|
41
|
+
`,t);r===-1&&(r=e.length);let i=t;for(;i<r;){let t=e.charCodeAt(i);if(t===32||t===9)i++;else break}let a=e[i];if(a==="`"||a===`~`){let t=i;for(;t<r&&e[t]===a;)t++;let o=t-i;o>=3&&(n?n.marker===a&&o>=n.length&&(n=null):n={marker:a,length:o})}t=r===e.length?e.length:r+1}return n!==null}function tu(e,t){if(e.length===0||e.charCodeAt(e.length-1)!==10)return!1;let n=e.length-2;for(;n>=0&&e.charCodeAt(n)!==10;)n--;return $l(e,n+1,e.length-1)?!eu(e,t):!1}function nu(e,t,n,r={}){let i=r.mode??`full`,a=r.fenceAware??(i===`stream`?e.options.streamChunkFenceAware??!0:e.options.fullChunkFenceAware??!0);if(r.maxChunkChars!==void 0||r.maxChunkLines!==void 0||r.autoTune===!1){let t=r.maxChunkChars??(i===`stream`?e.options.streamChunkSizeChars??Jl:e.options.fullChunkSizeChars??Kl),n=r.maxChunkLines??(i===`stream`?e.options.streamChunkSizeLines??Yl:e.options.fullChunkSizeLines??ql);return{maxChunkChars:t,maxChunkLines:n,holdBelowChars:t,holdBelowLines:n,fenceAware:a}}return i===`stream`?t<=5e3?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:a}:t<=2e4?{maxChunkChars:16e3,maxChunkLines:200,holdBelowChars:16e3,holdBelowLines:200,fenceAware:a}:t<=5e4?{maxChunkChars:16e3,maxChunkLines:250,holdBelowChars:16e3,holdBelowLines:250,fenceAware:a}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:a}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:a}:t<=1e5&&n<=2500?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:1e5,holdBelowLines:2500,fenceAware:a}:t<=2e5?{maxChunkChars:2e4,maxChunkLines:150,holdBelowChars:2e4,holdBelowLines:150,fenceAware:a}:t<=5e5?{maxChunkChars:32e3,maxChunkLines:350,holdBelowChars:32e3,holdBelowLines:350,fenceAware:a}:{maxChunkChars:64e3,maxChunkLines:700,holdBelowChars:64e3,holdBelowLines:700,fenceAware:a}}var ru=class{md;options;pending=``;tokens=[];committedChars=0;committedLines=0;fedChunks=0;parsedChunks=0;globalStateEnv=null;markedGlobalStateReason=null;constructor(e,t={}){if(this.md=e,this.options={mode:`full`,autoTune:!0,retainTokens:!0,...t},this.options.retainTokens===!1&&!this.options.onChunkTokens)throw Error(`UnboundedBuffer with retainTokens=false requires onChunkTokens`)}feed(e){e&&(this.pending+=e,this.fedChunks+=1)}flushAvailable(e={}){if(!this.pending)return null;let t=this.resolveWindow(),n=Ql(this.pending);if(this.pending.length<t.holdBelowChars&&n<t.holdBelowLines)return this.updateEnvDiagnostics(e,t,n),null;let r=Ll(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware,maxChunks:void 0},!1);if(!r.length||Rl(this.pending,r,{rangesCoverWholeSource:!1}))return this.updateEnvDiagnostics(e,t,n),null;let i=this.commitRanges(r,e);return this.pending=this.pending.slice(i),this.updateEnvDiagnostics(e,t,Ql(this.pending)),this.tokens}flushIfBoundary(e={}){if(!this.pending)return null;let t=this.resolveWindow();if(!tu(this.pending,t.fenceAware))return this.updateEnvDiagnostics(e,t,Ql(this.pending)),null;let n=Ll(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware,maxChunks:void 0},!0);if(!n.length)return this.updateEnvDiagnostics(e,t,Ql(this.pending)),null;let r=Rl(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ql(this.pending)}]:n;return this.commitRanges(r,e),this.pending=``,this.updateEnvDiagnostics(e,t,0),this.tokens}flushForce(e={}){if(!this.pending){this.prepareGlobalStateEnv(e,``);let t=this.resolveWindow();return this.updateEnvDiagnostics(e,t,0),this.tokens}let t=this.resolveWindow(),n=Ll(this.pending,{maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,fenceAware:t.fenceAware,maxChunks:void 0},!0);if(n.length){let t=Rl(this.pending,n,{rangesCoverWholeSource:!0})?[{start:0,end:this.pending.length,lineCount:Ql(this.pending)}]:n;this.commitRanges(t,e),this.pending=``}return this.updateEnvDiagnostics(e,t,0),this.tokens}reset(){this.pending=``,this.tokens=[],this.committedChars=0,this.committedLines=0,this.fedChunks=0,this.parsedChunks=0,this.globalStateEnv=null,this.markedGlobalStateReason=null}peek(){return this.tokens}pendingText(){return this.pending}stats(){return{mode:this.options.mode??`full`,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:Ql(this.pending),retainedTokens:this.options.retainTokens!==!1}}resolveWindow(){let e=this.committedChars+this.pending.length,t=this.committedLines+Ql(this.pending);return nu(this.md,e,t,this.options)}prepareGlobalStateEnv(e,t){if(this.globalStateEnv!==e&&(Wi(e)&&Ji(e),this.globalStateEnv=e,this.markedGlobalStateReason=null),this.markedGlobalStateReason)return;let n=Ui(t);n&&(Ki(e,n),this.markedGlobalStateReason=n)}commitRanges(e,t){if(!e.length)return 0;this.prepareGlobalStateEnv(t,this.pending);let n=0;try{for(let r=0;r<e.length;r++){let i=e[r],a=this.pending.slice(i.start,i.end),o=this.md.core.parse(a,t,this.md).tokens,s=this.committedChars,c=this.committedLines;c!==0&&o.length&&Zl(o,c),this.options.retainTokens!==!1&&Xl(this.tokens,o),this.committedChars+=a.length,this.committedLines+=i.lineCount,this.parsedChunks+=1,this.options.onChunkTokens&&this.options.onChunkTokens(o,{chunkIndex:this.parsedChunks,chunkChars:a.length,chunkLines:i.lineCount,tokenCount:o.length,startOffset:s,endOffset:this.committedChars,startLine:c,endLine:this.committedLines}),n=i.end}return this.markedGlobalStateReason&&qi(t),n}catch(e){throw this.markedGlobalStateReason&&=(Ji(t),this.globalStateEnv=null,null),e}}updateEnvDiagnostics(e,t,n){ra(e,{mode:this.options.mode??`full`,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,committedChars:this.committedChars,committedLines:this.committedLines,pendingChars:this.pending.length,pendingLines:n,fedChunks:this.fedChunks,parsedChunks:this.parsedChunks,globalStateDetected:this.markedGlobalStateReason||void 0})}};function iu(e,t,n={},r={}){$i(n);let i=new ru(e,{mode:`full`,...r});for(let e of t)i.feed(e),i.flushAvailable(n);return i.flushForce(n)}async function au(e,t,n={},r={}){$i(n);let i=new ru(e,{mode:`full`,...r});for await(let e of t)i.feed(e),i.flushAvailable(n);return i.flushForce(n)}function ou(e,t,n,r={},i={}){$i(r);let a=new ru(e,{mode:`full`,...i,retainTokens:!1,onChunkTokens:n});for(let e of t)a.feed(e),a.flushAvailable(r);return a.flushForce(r),a.stats()}async function su(e,t,n,r={},i={}){$i(r);let a=new ru(e,{mode:`full`,...i,retainTokens:!1,onChunkTokens:n});for await(let e of t)a.feed(e),a.flushAvailable(r);return a.flushForce(r),a.stats()}function cu(e,t,n){if(e.options.autoUnbounded===!1)return!1;let r=e.options.autoUnboundedThresholdChars??Wl,i=e.options.autoUnboundedThresholdLines??Gl;return t>=r||n>=i}function lu(e,t,n){if(e.options.autoUnbounded===!1)return`no`;if(t>=(e.options.autoUnboundedThresholdChars??Wl))return`yes`;let r=e.options.autoUnboundedThresholdLines??Gl;return n===void 0?t<2*r-1?`no`:`need-lines`:n>=r?`yes`:`no`}function uu(e,t,n={},r={}){$i(n);let i=Ui(t);if(Wi(n)&&Ji(n),r.fallbackOnGlobalState!==!1&&i)return ra(n,{mode:`full`,fallback:!0,fallbackReason:i,committedChars:t.length,committedLines:Ei(t),pendingChars:0,pendingLines:0,fedChunks:1,parsedChunks:1,globalStateDetected:i}),Gi(n,i,()=>e.core.parse(t,n,e).tokens);let a=[],o=new ru(e,{mode:`full`,...r,retainTokens:!1,onChunkTokens(e){Xl(a,e)}});if(i&&Ki(n,i),o.feed(t),o.flushForce(n),i&&(qi(n),r.fallbackOnGlobalState===!1)){let e=J(n)?.unbounded;e&&(e.globalStateDetected=i,e.globalStateFallbackDisabled=!0)}return a}var du=(e,t,n)=>e<t?t:e>n?n:e;function fu(e){return e.experimental?{...e,...e.experimental}:e}var pu=[{max:5e3,strategy:`discrete`,maxChunkChars:32e3,maxChunkLines:150,maxChunks:8,notes:`<=5k`},{max:2e4,strategy:`discrete`,maxChunkChars:24e3,maxChunkLines:200,maxChunks:12,notes:`<=20k`},{max:1e5,strategy:`plain`,notes:`<=100k plain`},{max:2e5,strategy:`discrete`,maxChunkChars:2e4,maxChunkLines:150,maxChunks:12,notes:`<=200k`},{max:5e5,strategy:`discrete`,maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:`<=500k`},{max:5e6,strategy:`discrete`,maxChunkChars:64e3,maxChunkLines:700,maxChunks:16,notes:`<=5M`}],mu=[{max:5e3,strategy:`discrete`,maxChunkChars:16e3,maxChunkLines:250,maxChunks:8,notes:`<=5k`},{max:2e4,strategy:`discrete`,maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:`<=20k`},{max:1e5,strategy:`discrete`,maxChunkChars:2e4,maxChunkLines:200,maxChunks:24,notes:`<=100k`},{max:5e5,strategy:`discrete`,maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:`<=500k`},{max:5e6,strategy:`discrete`,maxChunkChars:64e3,maxChunkLines:700,maxChunks:32,notes:`<=5M`}];function hu(e,t){return{strategy:t.strategy,maxChunkChars:t.maxChunkChars,maxChunkLines:t.maxChunkLines,maxChunks:t.maxChunks,fenceAware:e,notes:t.notes}}function gu(e,t=Math.max(0,e/40|0),n={}){let r=fu(n),i=r.fullChunkFenceAware??!0,a=r.fullChunkTargetChunks??8,o=r.fullChunkAdaptive!==!1;for(let t=0;t<pu.length;t++){let n=pu[t];if(e<=n.max){if(n.strategy!==`adaptive`)return hu(i,n);break}}return e>5e6?{strategy:`plain`,fenceAware:i,notes:`>5M plain`}:o?{strategy:`adaptive`,maxChunkChars:du(Math.ceil(e/a),8e3,64e3),maxChunkLines:du(Math.ceil(t/a),150,700),maxChunks:du(Math.ceil(e/64e3),a,16),fenceAware:i,notes:`adaptive fallback`}:{strategy:`discrete`,maxChunkChars:r.fullChunkSizeChars??1e4,maxChunkLines:r.fullChunkSizeLines??200,fenceAware:i,maxChunks:r.fullChunkMaxChunks}}function _u(e,t=Math.max(0,e/40|0),n={}){let r=fu(n),i=r.streamChunkFenceAware??!0,a=r.streamChunkTargetChunks??8,o=r.streamChunkAdaptive!==!1;for(let t=0;t<mu.length;t++){let n=mu[t];if(e<=n.max){if(n.strategy!==`adaptive`)return hu(i,n);break}}return e>5e6?{strategy:`plain`,fenceAware:i,notes:`>5M plain`}:o?{strategy:`adaptive`,maxChunkChars:du(Math.ceil(e/a),8e3,64e3),maxChunkLines:du(Math.ceil(t/a),150,700),maxChunks:du(Math.ceil(e/64e3),a,32),fenceAware:i,notes:`adaptive fallback`}:{strategy:`discrete`,maxChunkChars:r.streamChunkSizeChars??1e4,maxChunkLines:r.streamChunkSizeLines??200,maxChunks:r.streamChunkMaxChunks,fenceAware:i}}var vu={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`]},inline2:{rules:[`balance_pairs`,`emphasis`,`fragments_join`]}}},yu={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},bu={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`]},inline2:{rules:[`balance_pairs`,`fragments_join`]}}};function xu(e){return!!e&&(typeof e==`object`||typeof e==`function`)&&typeof e.then==`function`}function Su(e,t){if(xu(e))throw TypeError(`Renderer rule "${t}" returned a Promise. Use renderAsync() instead.`);return e}var Cu=e=>xu(e)?e:Promise.resolve(e);function wu(e){switch(e){case`alt`:case`class`:case`href`:case`id`:case`lang`:case`rel`:case`src`:case`start`:case`style`:case`target`:case`title`:return e;default:return dl(e)}}function Tu(e){if(!e||e.length===0)return``;let t=e[0],n=` ${wu(t[0])}="${dl(t[1])}"`;for(let t=1;t<e.length;t++){let r=e[t];n+=` ${wu(r[0])}="${dl(r[1])}"`}return n}function Eu(e){if(!e)return{langName:``,langAttrs:``};let t=0;for(;t<e.length;){let n=e.charCodeAt(t);if(n===32||n===9||n===10)break;t++}if(t>=e.length)return{langName:e,langAttrs:``};let n=t;for(;n<e.length;){let t=e.charCodeAt(n);if(t!==32&&t!==9&&t!==10)break;n++}return{langName:e.slice(0,t),langAttrs:n<e.length?e.slice(n):``}}function Du(e,t,n,r,i){if(t.indexOf(`<pre`)===0)return`${t}\n`;if(n){if(!e.attrs||e.attrs.length===0)return`<pre><code class="${dl(`${i.langPrefix??`language-`}${r}`)}">${t}</code></pre>\n`;let n=e.attrIndex(`class`),a=e.attrs?e.attrs.slice():[],o=`${i.langPrefix??`language-`}${r}`;return n<0?a.push([`class`,o]):(a[n]=a[n].slice(),a[n][1]+=` ${o}`),`<pre><code${Tu(a)}>${t}</code></pre>\n`}return`<pre><code${Tu(e.attrs)}>${t}</code></pre>\n`}function Ou(e){return!e.attrs||e.attrs.length===0?`<code>${dl(e.content)}</code>`:`<code${Tu(e.attrs)}>${dl(e.content)}</code>`}function ku(e){let t=dl(e.content);return e.attrs?`<pre${Tu(e.attrs)}><code>${t}</code></pre>\n`:`<pre><code>${t}</code></pre>\n`}function Au(e,t){let n=e.attrs;if(!n||n.length===0)switch(e.type){case`paragraph_open`:return`${t}<p>`;case`heading_open`:return`<${e.tag}>`;case`td_open`:return`${t}<td>`;case`th_open`:return`${t}<th>`;default:return null}if(n.length===1&&n[0][0]===`style`){if(e.type===`td_open`)return`${t}<td style="${dl(n[0][1])}">`;if(e.type===`th_open`)return`${t}<th style="${dl(n[0][1])}">`}return null}function ju(e){let t=e.attrs;return!t||t.length===0?`<a>`:t.length===1?`<a ${wu(t[0][0])}="${dl(t[0][1])}">`:t.length===2?`<a ${wu(t[0][0])}="${dl(t[0][1])}" ${wu(t[1][0])}="${dl(t[1][1])}">`:`<a${Tu(t)}>`}function Mu(e){switch(e.type){case`text`:case`text_special`:case`softbreak`:case`hardbreak`:case`html_inline`:case`code_inline`:case`image`:return!0;default:return!1}}function Nu(e){switch(e.type){case`text`:case`text_special`:case`softbreak`:case`hardbreak`:case`html_inline`:case`code_inline`:return!0;default:return!1}}function Pu(e,t){if(e.hidden)return``;let n=e.attrs,r=e.nesting,i=e.tag;if(!n||n.length===0)return r===0?t?`<${i} />`:`<${i}>`:r===-1?`</${i}>`:`<${i}>`;let a=(r===-1?`</`:`<`)+i+Tu(n);return r===0&&t&&(a+=` /`),`${a}>`}var Fu={langPrefix:`language-`,xhtmlOut:!1,breaks:!1},Iu=Object.prototype.hasOwnProperty,Y={code_inline(e,t){return Ou(e[t])},code_block(e,t){return ku(e[t])},fence(e,t,n,r,i){let a=e[t],o=a.info?ml(a.info).trim():``,{langName:s,langAttrs:c}=Eu(o),l=n.highlight,u=dl(a.content);if(!l)return Du(a,u,o,s,n);let d=l(a.content,s,c);return xu(d)?d.then(e=>Du(a,e||u,o,s,n)):Du(a,d||u,o,s,n)},image(e,t,n,r,i){let a=e[t],o=i.renderInlineAsText(a.children||[],n,r),s=a.attrIndex(`alt`);return s>=0&&a.attrs?a.attrs[s][1]=o:a.attrs?a.attrs.push([`alt`,o]):a.attrs=[[`alt`,o]],Pu(a,n.xhtmlOut===!0)},hardbreak(e,t,n){return n.xhtmlOut?`<br />
|
|
42
|
+
`:`<br>
|
|
43
|
+
`},softbreak(e,t,n){return n.breaks?n.xhtmlOut?`<br />
|
|
44
|
+
`:`<br>
|
|
45
|
+
`:`
|
|
46
|
+
`},text(e,t){return dl(e[t].content)},text_special(e,t){return dl(e[t].content)},html_block(e,t){return e[t].content},html_inline(e,t){return e[t].content}};function Lu(e,t,n){let r=e.info?ml(e.info).trim():``,{langName:i,langAttrs:a}=Eu(r),o=t.highlight,s=dl(e.content);if(!o)return Du(e,s,r,i,t);let c=o(e.content,i,a);if(xu(c))throw TypeError(`Renderer rule "fence" returned a Promise. Use renderAsync() instead.`);return Du(e,c||s,r,i,t)}function Ru(e,t,n,r){switch(e.type){case`text`:return t.text===Y.text?e.content.length===0?``:dl(e.content):null;case`text_special`:return t.text_special===Y.text_special?e.content.length===0?``:dl(e.content):null;case`softbreak`:return t.softbreak===Y.softbreak?r:null;case`hardbreak`:return t.hardbreak===Y.hardbreak?n:null;case`html_inline`:return t.html_inline===Y.html_inline?e.content:null;case`code_inline`:return t.code_inline===Y.code_inline?Ou(e):null;default:return null}}function zu(e,t,n,r,i){let a=e[0];switch(a.type){case`text`:if(i.text===Y.text)return a.content.length===0?``:dl(a.content);break;case`text_special`:if(i.text_special===Y.text_special)return a.content.length===0?``:dl(a.content);break;case`softbreak`:if(i.softbreak===Y.softbreak)return t.breaks?t.xhtmlOut?`<br />
|
|
47
|
+
`:`<br>
|
|
48
|
+
`:`
|
|
49
|
+
`;break;case`hardbreak`:if(i.hardbreak===Y.hardbreak)return t.xhtmlOut?`<br />
|
|
50
|
+
`:`<br>
|
|
51
|
+
`;break;case`html_inline`:if(i.html_inline===Y.html_inline)return a.content;break;case`code_inline`:if(i.code_inline===Y.code_inline)return Ou(a)}let o=i[a.type];if(!o)return Pu(a,t.xhtmlOut===!0);let s=o(e,0,t,n,r);return typeof s==`string`?s:Su(s,a.type)}var Bu=class{rules;baseOptions;normalizedBase;constructor(e={}){this.baseOptions={...e},this.normalizedBase=this.buildNormalizedBase(),this.rules={...Y}}set(e){return this.baseOptions={...this.baseOptions,...e},this.normalizedBase=this.buildNormalizedBase(),this}render(e,t,n){if(!Array.isArray(e))throw TypeError(`render expects token array as first argument`);if(e.length===1)return this.renderSingleToken(e,e[0],t,n);let r=this.mergeOptions(t),i=n??{},a=this.rules,o=r.xhtmlOut===!0,s,c,l,u,d,f,p=``,m=``,h=!1,g=``;for(let t=0;t<e.length;t++){let n=e[t],_=n.type,v=t>0&&e[t-1].hidden?`
|
|
52
|
+
`:``;if(_===`list_item_open`&&(!n.attrs||n.attrs.length===0)&&t+3<e.length){let n=e[t+1],a=e[t+2],o=e[t+3];if(n.type===`paragraph_open`&&n.hidden&&a.type===`inline`&&o.type===`paragraph_close`&&o.hidden){g+=`${v}<li>${this.renderInlineTokens(a.children||[],r,i)}`,t+=3;continue}}if(t+2<e.length){let a=e[t+1],o=e[t+2];if(a.type===`inline`&&o.nesting===-1&&o.tag===n.tag&&!o.hidden){let e=Au(n,v);if(e!==null){g+=`${e+this.renderInlineTokens(a.children||[],r,i)}</${n.tag}>\n`,t+=2;continue}}}if(_===`inline`){let e=n.children||[];if(e.length===1){h||=(s=a.text,c=a.text_special,l=a.softbreak,u=a.hardbreak,d=a.html_inline,f=a.code_inline,p=r.xhtmlOut?`<br />
|
|
53
|
+
`:`<br>
|
|
54
|
+
`,m=r.breaks?p:`
|
|
55
|
+
`,!0);let t=e[0];switch(t.type){case`text`:if(s===Y.text){g+=dl(t.content);continue}break;case`text_special`:if(c===Y.text_special){g+=dl(t.content);continue}break;case`softbreak`:if(l===Y.softbreak){g+=m;continue}break;case`hardbreak`:if(u===Y.hardbreak){g+=p;continue}break;case`html_inline`:if(d===Y.html_inline){g+=t.content;continue}break;case`code_inline`:if(f===Y.code_inline){g+=Ou(t);continue}}}g+=this.renderInlineTokens(e,r,i);continue}let y=a[_];if(!y){let i=n.attrs;if(!n.hidden){if(!i||i.length===0)switch(_){case`hr`:g+=o?`<hr />
|
|
56
|
+
`:`<hr>
|
|
57
|
+
`;continue;case`heading_open`:g+=`<${n.tag}>`;continue;case`heading_close`:g+=`</${n.tag}>\n`;continue;case`paragraph_open`:g+=`${v}<p>`;continue;case`paragraph_close`:g+=`</p>
|
|
58
|
+
`;continue;case`list_item_open`:{let n=e[t+1];g+=v+(n&&(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===`li`)?`<li>`:`<li>
|
|
59
|
+
`);continue}case`list_item_close`:g+=`</li>
|
|
60
|
+
`;continue;case`bullet_list_open`:g+=`${v}<ul>\n`;continue;case`bullet_list_close`:g+=`</ul>
|
|
61
|
+
`;continue;case`blockquote_open`:g+=v+(e[t+1]&&e[t+1].nesting===-1&&e[t+1].tag===`blockquote`?`<blockquote>`:`<blockquote>
|
|
62
|
+
`);continue;case`blockquote_close`:g+=`</blockquote>
|
|
63
|
+
`;continue;case`ordered_list_open`:g+=`${v}<ol>\n`;continue;case`ordered_list_close`:g+=`</ol>
|
|
64
|
+
`;continue;case`table_open`:g+=`${v}<table>\n`;continue;case`table_close`:g+=`</table>
|
|
65
|
+
`;continue;case`thead_open`:g+=`${v}<thead>\n`;continue;case`thead_close`:g+=`</thead>
|
|
66
|
+
`;continue;case`tbody_open`:g+=`${v}<tbody>\n`;continue;case`tbody_close`:g+=`</tbody>
|
|
67
|
+
`;continue;case`tr_open`:g+=`${v}<tr>\n`;continue;case`tr_close`:g+=`</tr>
|
|
68
|
+
`;continue;case`td_open`:g+=`${v}<td>`;continue;case`td_close`:g+=`</td>
|
|
69
|
+
`;continue;case`th_open`:g+=`${v}<th>`;continue;case`th_close`:g+=`</th>
|
|
70
|
+
`;continue}else if(i.length===1){let e=i[0];if(_===`ordered_list_open`&&e[0]===`start`){g+=`${v}<ol start="${dl(e[1])}">\n`;continue}if(_===`td_open`&&e[0]===`style`){g+=`${v}<td style="${dl(e[1])}">`;continue}if(_===`th_open`&&e[0]===`style`){g+=`${v}<th style="${dl(e[1])}">`;continue}}}g+=this.renderToken(e,t,r);continue}if(_===`code_block`&&y===Y.code_block){g+=ku(n);continue}if(_===`fence`&&y===Y.fence){g+=Lu(n,r,this);continue}if(_===`html_block`&&y===Y.html_block){g+=n.content;continue}let b=y(e,t,r,i,this);g+=typeof b==`string`?b:Su(b,n.type)}return g}async renderAsync(e,t,n){if(!Array.isArray(e))throw TypeError(`render expects token array as first argument`);let r=this.mergeOptions(t),i=n??{},a=this.rules,o=``;for(let t=0;t<e.length;t++){let n=e[t];if(n.type===`inline`){o+=await this.renderInlineTokensAsync(n.children||[],r,i);continue}let s=a[n.type];o+=s?await Cu(s(e,t,r,i,this)):this.renderToken(e,t,r)}return o}renderInline(e,t,n){let r=this.mergeOptions(t),i=n??{};return this.renderInlineTokens(e,r,i)}async renderInlineAsync(e,t,n){let r=this.mergeOptions(t),i=n??{};return this.renderInlineTokensAsync(e,r,i)}renderInlineAsText(e,t,n){let r=this.mergeOptions(t),i=n??{};return this.renderInlineAsTextInternal(e,r,i)}renderAttrs(e){return Tu(e.attrs)}renderToken(e,t,n){let r=e[t];if(r.hidden)return``;let i=r.block,a=r.nesting,o=r.tag,s=r.attrs,c=!1;if(i&&(c=!0,a===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===o)&&(c=!1)}let l=i&&a!==-1&&t>0&&e[t-1].hidden?`
|
|
71
|
+
`:``,u=c?`>
|
|
72
|
+
`:`>`;if(!s||s.length===0)return a===0?n.xhtmlOut?`${l}<${o} /${u}`:`${l}<${o}${u}`:a===-1?`${l}</${o}${u}`:`${l}<${o}${u}`;let d=l+(a===-1?`</`:`<`)+o+Tu(s);return a===0&&n.xhtmlOut&&(d+=` /`),d+u}mergeOptions(e){let t=this.normalizedBase;if(!e||e.highlight===t.highlight&&e.langPrefix===t.langPrefix&&e.xhtmlOut===t.xhtmlOut&&e.breaks===t.breaks)return t;let n=null,r=()=>(n||={...t},n);if(Iu.call(e,`highlight`)&&e.highlight!==t.highlight&&(r().highlight=e.highlight),Iu.call(e,`langPrefix`)){let n=e.langPrefix;n!==t.langPrefix&&(r().langPrefix=n)}if(Iu.call(e,`xhtmlOut`)){let n=e.xhtmlOut;n!==t.xhtmlOut&&(r().xhtmlOut=n)}if(Iu.call(e,`breaks`)){let n=e.breaks;n!==t.breaks&&(r().breaks=n)}return n||t}buildNormalizedBase(){return Object.freeze({...Fu,...this.baseOptions})}renderSingleToken(e,t,n,r){let i=this.rules,a=t.type;if(a===`code_block`&&i.code_block===Y.code_block)return ku(t);if(a===`html_block`&&i.html_block===Y.html_block)return t.content;let o=this.mergeOptions(n),s=r??{};if(a===`inline`)return this.renderInlineTokens(t.children||[],o,s);let c=i[a];if(!c)return t.block?this.renderToken(e,0,o):Pu(t,o.xhtmlOut===!0);if(a===`fence`&&c===Y.fence)return Lu(t,o,this);let l=c(e,0,o,s,this);return typeof l==`string`?l:Su(l,a)}renderInlineTokens(e,t,n){if(!e||e.length===0)return``;let r=this.rules;if(e.length===1)return zu(e,t,n,this,r);let i=t.xhtmlOut===!0,a=i?`<br />
|
|
73
|
+
`:`<br>
|
|
74
|
+
`,o=t.breaks?a:`
|
|
75
|
+
`,s=r.text,c=r.text_special,l=r.softbreak,u=r.hardbreak,d=r.html_inline,f=r.code_inline,p=r.link_open,m=r.link_close,h=r.em_open,g=r.em_close,_=r.strong_open,v=r.strong_close,y=``;for(let b=0;b<e.length;b++){let x=e[b];if(x.type===`link_open`&&!p&&!m&&b+2<e.length){let t=e[b+1];if(e[b+2].type===`link_close`&&Mu(t)){let n=Ru(t,r,a,o);if(n!==null){let t=`${ju(x)+n}</a>`;if(l===Y.softbreak&&b+3<e.length&&e[b+3].type===`softbreak`){y+=t+o,b+=3;continue}y+=t,b+=2;continue}}}if(x.type===`link_open`&&!p&&!m&&b+1<e.length&&e[b+1].type===`link_close`){y+=`${ju(x)}</a>`,b+=1;continue}if(x.type===`em_open`&&!h&&!g&&b+2<e.length){let t=e[b+1];if(e[b+2].type===`em_close`&&Nu(t)){let e=Ru(t,r,a,o);if(e!==null){y+=`<em>${e}</em>`,b+=2;continue}}}if(x.type===`strong_open`&&!_&&!v&&b+2<e.length){let t=e[b+1];if(e[b+2].type===`strong_close`&&Nu(t)){let e=Ru(t,r,a,o);if(e!==null){y+=`<strong>${e}</strong>`,b+=2;continue}}}switch(x.type){case`text`:if(s===Y.text){let t=x.content.length===0?``:dl(x.content);if(d===Y.html_inline&&b+1<e.length&&e[b+1].type===`html_inline`){for(y+=t+e[++b].content;b+1<e.length&&e[b+1].type===`html_inline`;)y+=e[++b].content;continue}y+=t;continue}break;case`text_special`:if(c===Y.text_special){x.content.length!==0&&(y+=dl(x.content));continue}break;case`softbreak`:if(l===Y.softbreak){y+=o;continue}break;case`hardbreak`:if(u===Y.hardbreak){y+=a;continue}break;case`html_inline`:if(d===Y.html_inline){for(y+=x.content;b+1<e.length&&e[b+1].type===`html_inline`;)y+=e[++b].content;continue}break;case`code_inline`:if(f===Y.code_inline){y+=Ou(x);continue}}let S=r[x.type];if(!S){y+=x.block?this.renderToken(e,b,t):Pu(x,i);continue}let C=S(e,b,t,n,this);y+=typeof C==`string`?C:Su(C,x.type)}return y}async renderInlineTokensAsync(e,t,n){if(!e||e.length===0)return``;let r=this.rules,i=``;for(let a=0;a<e.length;a++){let o=r[e[a].type];i+=o?await Cu(o(e,a,t,n,this)):this.renderToken(e,a,t)}return i}renderInlineAsTextInternal(e,t,n){if(!e||e.length===0)return``;let r=``;for(let i=0;i<e.length;i++){let a=e[i];switch(a.type){case`text`:case`text_special`:r+=a.content;break;case`image`:r+=this.renderInlineAsTextInternal(a.children||[],t,n);break;case`html_inline`:case`html_block`:r+=a.content;break;case`softbreak`:case`hardbreak`:r+=`
|
|
76
|
+
`}}return r}},Vu=[],Hu=4096;function Uu(e){let t={...e};return Array.isArray(e.quotes)&&(t.quotes=[...e.quotes]),e.experimental&&(t.experimental={...e.experimental}),t}function Wu(e,t){let n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(n=>{if(!Object.hasOwn(e,n))return!1;let r=e[n],i=t[n];if(Array.isArray(r)&&Array.isArray(i))return r.length===i.length&&r.every((e,t)=>Object.is(e,i[t]));if(n===`experimental`&&r&&i){let e=r,t=i,n=Object.keys(t);return Object.keys(e).length===n.length&&n.every(n=>Object.hasOwn(e,n)&&Object.is(e[n],t[n]))}return Object.is(r,i)})}function Gu(e){return{options:Uu(e.options),coreVersion:e.core.ruler.version,blockVersion:e.block.ruler.version,inlineVersion:e.inline.ruler.version,inline2Version:e.inline.ruler2.version}}function Ku(e,t){return Wu(e.options,t.options)&&e.coreVersion===t.core.ruler.version&&e.blockVersion===t.block.ruler.version&&e.inlineVersion===t.inline.ruler.version&&e.inline2Version===t.inline.ruler2.version}function qu(e){let t=e.length,n=0;for(;n<=t;){let r=e.indexOf(`
|
|
77
|
+
`,n);r===-1&&(r=t);let i=r<t,a=n,o=0;for(;a<r;){let t=e.charCodeAt(a);if(t===32){if(o++,a++,o>=4)return!0}else if(t===9){if(o+=4-o%4,a++,o>=4)return!0}else break}if(a<r){let t=e.charCodeAt(a);switch(t){case 35:{let t=a;for(;t<r&&e.charCodeAt(t)===35;)t++;let n=t-a;if(n>0&&n<=6){if(t<r){let n=e.charCodeAt(t);if(n===32||n===9||n===13)return!0}else if(t===r&&i)return!0}break}case 62:{let t=a+1;if(t<r){let n=e.charCodeAt(t);if(n===32||n===9||n===13)return!0}else if(t===r&&i)return!0;break}case 45:case 42:case 43:{let t=a+1;if(t<r){let n=e.charCodeAt(t);if(n===32||n===9||n===13)return!0}else if(t===r&&i)return!0;break}case 96:case 126:{let n=a;for(;n<r&&e.charCodeAt(n)===t;)n++;if(n-a>=3)return!0;break}default:if(t>=48&&t<=57){let t=a+1;for(;t<r;){let n=e.charCodeAt(t);if(n<48||n>57)break;t++}if(t<r&&e.charCodeAt(t)===46){let n=t+1;if(n<r){let t=e.charCodeAt(n);if(t===32||t===9||t===13)return!0}else if(n===r&&i)return!0}}}}if(r===t)break;n=r+1}return!1}function Ju(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n][0]!==t[n][0]||e[n][1]!==t[n][1])return!1;return!0}function Yu(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Xu(e[n],t[n]))return!1;return!0}function Xu(e,t){if(!e||!t||e.type!==t.type)return!1;let n=e.map,r=t.map;return!!n!=!!r||n&&r&&(n[0]!==r[0]||n[1]!==r[1])||e.tag!==t.tag||e.nesting!==t.nesting||e.markup!==t.markup||e.info!==t.info||e.block!==t.block||e.hidden!==t.hidden||!Ju(e.attrs,t.attrs)||!Yu(e.children,t.children)?!1:(e.content||``)===(t.content||``)}function Zu(){return{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:`idle`}}var Qu=class{core;anchorBlock=new Oc;cache=null;snapshots=new WeakSet;stats=Zu();normalizeLineEndings=!0;tokenMapsTrusted=!0;allowUntrustedTailReuse=!1;MIN_SIZE_FOR_OPTIMIZATION=1e3;DEFAULT_SKIP_CACHE_CHARS=1e6;DEFAULT_SKIP_CACHE_LINES=1e5;IMPLICIT_STREAM_CHUNK_MIN_CHARS=16e4;MIN_LIST_LINES_FOR_MERGE=80;MIN_LIST_CHARS_FOR_MERGE=800;MIN_TABLE_LINES_FOR_MERGE=48;MIN_TABLE_CHARS_FOR_MERGE=1200;MIN_UNBOUNDED_APPEND_TOTAL_CHARS=5e5;MIN_UNBOUNDED_APPEND_CHARS=64e3;MIN_UNBOUNDED_APPEND_LINES=700;constructor(e){this.core=e}reset(){this.cache=null,this.stats.resets+=1,this.stats.lastMode=`reset`}resetStats(){let{resets:e}=this.stats;this.stats=Zu(),this.stats.resets=e}snapshot(){let e=this.cache;if(!e)return null;let t=e.snapshotState??{cache:e};e.snapshotState=t;let n={state:t,get sourceLength(){return this.state.cache.src.length},get tokenCount(){return this.state.cache.tokens.length}};return this.snapshots.add(n),n}restore(e,t){if(!this.snapshots.has(e))throw TypeError(`Invalid stream snapshot`);let n=e.state.cache;return this.cache=n,Ku(n.config,t)?n.tokens:this.parse(n.src,n.env,t)}append(e,t,n){let r=this.cache;if(!r)throw Error(`Stream append requires cached history; call stream.parse(fullSource) first`);return this.ensureBoundaryState(r),this.parse(r.src+e,t,n,e)}parse(e,t,n,r){let i=this.cache,a=i?.env,o=n.core.ruler.getNamedRules(``),s=o.findIndex(e=>e.fn===hs),c=o.findIndex(e=>e.fn===Pa),l=o.find(e=>e.name===`normalize`);this.normalizeLineEndings=s>=0&&c>=0&&s<c;let u=t,d=!!i&&!Ku(i.config,n),f=l&&l.fn!==hs,p=l&&!this.normalizeLineEndings&&e.includes(`\r`),m=c<0||o.slice(0,c).some(e=>e.fn!==hs);this.tokenMapsTrusted=!(c<0||o.slice(c+1).some(e=>e.fn!==rs&&e.fn!==fs&&e.fn!==Cs&&e.fn!==As&&e.fn!==js)),this.allowUntrustedTailReuse=this.tokenMapsTrusted||n.options?.streamTailLocalPostBlockRules===!0;let h=d||f||p||m?null:i;if($i(u??i?.env??a),!h||u&&u!==h.env){let t=u??i?.env??a??{},o=!!n.__explicitStreamChunkFallbackSetting,s=typeof n.__canUseImplicitLargeInputStrategy!=`function`||n.__canUseImplicitLargeInputStrategy(),c=!!n.options?.streamChunkedFallback,l=!o&&s,d=c||l,f=n.options?.streamChunkAdaptive!==!1,p=n.options?.streamChunkTargetChunks??8,m=n.options?.streamChunkSizeChars,h=n.options?.streamChunkSizeLines,g=n.options?.streamChunkMaxChunks,_=!!n.__explicitStreamChunkConfig,v=n.options?.autoTuneChunks!==!1,y=n.options?.streamChunkFenceAware??!0,b=n.options?.streamLargeCachePolicy??`retain`,x=n.options?.streamSkipCacheAboveChars??this.DEFAULT_SKIP_CACHE_CHARS,S=n.options?.streamSkipCacheAboveLines??this.DEFAULT_SKIP_CACHE_LINES,C,w=!1;if(b===`skip`&&(w=e.length>=x,!w&&S!==void 0&&(C=Ei(e),w=C>=S)),w&&r===void 0&&!i?.snapshotState){let r=this.parseFullDocument(e,t,n,C,!1);return this.cache=null,this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,ta(t,{area:`stream`,path:`stream-full`,reason:`skip-cache-large-one-shot`,unbounded:!!J(t)?.unbounded}),r.tokens}if(d){let r=(e,t,n)=>e<t?t:e>n?n:e;C===void 0&&(C=Ei(e));let i=v&&!_?_u(e.length,C,n.options):null,a=i?.maxChunkChars??(f?r(Math.ceil(e.length/p),8e3,64e3):m??1e4),o=i?.maxChunkLines??(f?r(Math.ceil(C/p),150,700):h??200),s=i?.maxChunks??(f?r(Math.ceil(e.length/64e3),p,32):g),u=e.length>0&&e.charCodeAt(e.length-1)===10,d=l&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&i?.strategy!==`plain`;if((c||d)&&(e.length>=a*2||C>=o*2)&&u){let r=Il(n,e,t,{maxChunkChars:a,maxChunkLines:o,fenceAware:i?.fenceAware??y,maxChunks:s}),l=J(t)?.chunk?.globalStateDetected??null,u=this.setCache({src:e,tokens:r,env:t,lineCount:C,lastSegment:void 0,globalStateReason:l},n);return this.updateCacheLineCount(u,C),this.recordChunkedParseResult(t,c?`explicit-initial-large-doc`:`default-initial-large-doc`),r}}let T=this.parseFullDocument(e,t,n,C);C=T.lineCount;let E=this.setCache({src:e,tokens:T.tokens,env:t,lineCount:C,lastSegment:void 0,globalStateReason:T.globalStateReason},n);return this.updateCacheLineCount(E,C),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,ta(t,{area:`stream`,path:`stream-full`,reason:`initial-parse`,unbounded:!!J(t)?.unbounded}),T.tokens}if(e===h.src)return this.stats.total+=1,this.stats.cacheHits+=1,this.stats.lastMode=`cache`,ta(h.env,{area:`stream`,path:`stream-cache`,reason:`same-source`}),h.tokens;let g=r===void 0?e.startsWith(h.src)?e.slice(h.src.length):null:r,_=h.globalStateReason;_===void 0&&(_=Ui(h.src),h.globalStateReason=_);let v=_?null:g===null?Ui(e):this.detectGlobalStateForAppend(h,g),y=_||v;if(y){let t=u??h.env;Ji(t);let r=this.parseFullDocument(e,t,n),i=r.tokens,a=r.lineCount,o=this.setCache({src:e,tokens:i,env:t,lineCount:a,lastSegment:void 0,globalStateReason:r.globalStateReason},n);return this.updateCacheLineCount(o,a),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,ta(t,{area:`stream`,path:`stream-full`,reason:`global-state:${y}`,unbounded:!!J(t)?.unbounded}),i}let b=n.options?.streamOptimizationMinSize??this.MIN_SIZE_FOR_OPTIMIZATION;if(h.src.length<b&&e.length<b*1.5&&g===null){let t=u??h.env,r=this.parseFullDocument(e,t,n),i=r.tokens,a=r.lineCount,o=this.setCache({src:e,tokens:i,env:t,lineCount:a,lastSegment:void 0,globalStateReason:r.globalStateReason},n);return this.updateCacheLineCount(o,a),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,ta(t,{area:`stream`,path:`stream-full`,reason:`small-non-append`,unbounded:!!J(t)?.unbounded}),i}let x=this.ensureLastSegment(h,r!==void 0),S=this.tokenMapsTrusted||this.allowUntrustedTailReuse&&(h.lastSegmentVerified===!0||!!(x&&this.hasVerifiedSegmentAnchor(h,x,n))),C=g!==null&&this.shouldPreferTailReparseForAppend(h,S)||!this.tokenMapsTrusted?null:this.getAppendedSegment(h,e,g);if(C){let t=h.lineCount??Ei(h.src),r=3;C.length>5e3?r=8:C.length>1e3?r=6:C.length>200&&(r=4),r=Math.min(r,t);let i=null,a=n.options?.streamContextParseStrategy??`chars`,o=n.options?.streamContextParseMinChars??200,s=n.options?.streamContextParseMinLines??2,c,l=()=>(c===void 0&&(c=Ei(C)),c),u=this.canDirectlyParseAppend(h),d=u&&this.shouldUseUnboundedAppend(e,h,C),f=!1;if(!u)switch(a){case`lines`:f=l()>=s;break;case`constructs`:if(C.length>=o||qu(C)){f=!0;break}f=l()>=s;break;default:f=C.length>=o}if(r>0&&f){let e=this.getTailLines(h.src,r)+C;try{let a=this.core.parse(e,h.env,n).tokens,o=a.findIndex(e=>e.map&&typeof e.map[1]==`number`&&e.map[1]>r);if(o!==-1){let e=a.slice(o),n=t-r;n!==0&&this.shiftTokenLines(e,n),i={tokens:e}}}catch{i=null}}else i=null;if(!i){let e=t;if(d)i={tokens:uu(n,C,h.env,{mode:`stream`})},e>0&&this.shiftTokenLines(i.tokens,e);else{let t=this.core.parse(C,h.env,n);e>0&&this.shiftTokenLines(t.tokens,e),i=t}}let p=0;if(h.tokens.length>0&&i.tokens.length>0){let e=h.tokens[h.tokens.length-1],t=i.tokens[0];try{e.type===`inline`&&t.type===`inline`&&(t.children&&t.children.length>0&&(e.children||=[],this.appendTokens(e.children,t.children)),e.content=(e.content||``)+(t.content||``),p=1)}catch{p=0}}let m=h.tokens.length;if(i.tokens.length>p){let e=h.tokens,t=i.tokens,n=Math.min(e.length,t.length-p),r=0;for(let i=n;i>0;i--){let n=!0;for(let r=0;r<i;r++){let a=e[e.length-i+r],o=t[p+r];if(!Xu(a,o)){n=!1;break}}if(n){r=i;break}}r>0&&(p+=r),t.length>p&&this.appendTokens(h.tokens,t,p)}if(h.boundary?this.updateBoundaryStateForAppend(h,C):this.updateFenceMarkerCacheForAppend(h,C),h.src=e,h.globalStateReason=null,h.lineCount=t+(c??l()),h.tokens.length>m){let n=this.getLastSegment(h.tokens,e,m,h.tokens.length,e.length-C.length,t);if(n){h.lastSegment=n;let t=e.length-C.length;h.lastSegmentSource=C.slice(Math.max(0,n.srcOffset-t))}else h.lastSegment=void 0,h.lastSegmentSource=void 0}else h.lastSegment=void 0,h.lastSegmentSource=void 0;return h.lastSegmentVerified=void 0,this.stats.total+=1,this.stats.appendHits+=1,d&&(this.stats.unboundedAppendHits=(this.stats.unboundedAppendHits||0)+1),this.stats.lastMode=`append`,ta(h.env,{area:`stream`,path:d?`stream-unbounded-append`:`stream-append`,reason:d?`large-delta`:`safe-append`,unbounded:d}),h.tokens}let w=u??h.env,T=S?this.tryTailSegmentReparse(e,h,w,n,x??void 0,g??void 0):this.allowUntrustedTailReuse?this.tryUntrustedParagraphTailReparse(e,h,w,n):null;if(T)return this.stats.total+=1,this.stats.tailHits+=1,this.stats.lastMode=`tail`,ta(w,{area:`stream`,path:`stream-tail`,reason:`tail-reparse`}),T;let E=!!n.__explicitStreamChunkFallbackSetting,D=typeof n.__canUseImplicitLargeInputStrategy!=`function`||n.__canUseImplicitLargeInputStrategy(),O=!!n.options?.streamChunkedFallback,k=!E&&!C&&D,A=O||k,j=n.options?.streamChunkAdaptive!==!1,M=n.options?.streamChunkTargetChunks??8,N=n.options?.streamChunkSizeChars,ee=n.options?.streamChunkSizeLines,te=n.options?.streamChunkMaxChunks,P=!!n.__explicitStreamChunkConfig,ne=n.options?.autoTuneChunks!==!1,F=n.options?.streamChunkFenceAware??!0,I=C&&h.lineCount!==void 0?h.lineCount+Ei(C):void 0;if(A){I===void 0&&(I=Ei(e));let t=(e,t,n)=>e<t?t:e>n?n:e,r=ne&&!P?_u(e.length,I,n.options):null,i=r?.maxChunkChars??(j?t(Math.ceil(e.length/M),8e3,64e3):N??1e4),a=r?.maxChunkLines??(j?t(Math.ceil(I/M),150,700):ee??200),o=r?.maxChunks??(j?t(Math.ceil(e.length/64e3),M,32):te),s=e.length>0&&e.charCodeAt(e.length-1)===10,c=k&&e.length>=this.IMPLICIT_STREAM_CHUNK_MIN_CHARS&&r?.strategy!==`plain`;if((O||c)&&(e.length>=i*2||I>=a*2)&&s){let t=Il(n,e,w,{maxChunkChars:i,maxChunkLines:a,fenceAware:r?.fenceAware??F,maxChunks:o}),s=J(w)?.chunk?.globalStateDetected??null,c=this.setCache({src:e,tokens:t,env:w,lineCount:I,lastSegment:void 0,globalStateReason:s},n);return this.updateCacheLineCount(c,I),this.recordChunkedParseResult(w,O?`explicit-fallback-large-doc`:`default-fallback-large-doc`),t}}let L=this.parseFullDocument(e,w,n,I),re=L.tokens;I=L.lineCount;let R=this.setCache({src:e,tokens:re,env:w,lineCount:I,lastSegment:void 0,globalStateReason:L.globalStateReason},n);return this.updateCacheLineCount(R,I),this.stats.total+=1,this.stats.fullParses+=1,this.stats.lastMode=`full`,ta(w,{area:`stream`,path:`stream-full`,reason:`fallback-full`,unbounded:!!J(w)?.unbounded}),re}recordChunkedParseResult(e,t){let n=J(e)?.chunk,r=n?.fallback?String(n.fallbackReason||`global-state`):null;this.stats.total+=1,r?(this.stats.fullParses+=1,this.stats.lastMode=`full`,ta(e,{area:`stream`,path:`stream-full`,reason:`global-state:${r}`,unbounded:!!J(e)?.unbounded})):(this.stats.chunkedParses=(this.stats.chunkedParses||0)+1,this.stats.lastMode=`chunked`,ta(e,{area:`stream`,path:`stream-chunked`,chunked:!0,reason:t}))}parseFullDocument(e,t,n,r,i=!0){Wi(t)&&Ji(t);let a=typeof n.__canUseImplicitLargeInputStrategy!=`function`||n.__canUseImplicitLargeInputStrategy()?lu(n,e.length,r):`no`;if(a===`yes`){let a=uu(n,e,t),o=J(t)?.unbounded?.globalStateDetected??null;return ta(t,{area:`stream`,path:`stream-full`,reason:`auto-unbounded-char-threshold`,unbounded:!0}),{tokens:a,lineCount:r??(i?Ei(e):0),globalStateReason:o}}let o=r;if(a===`need-lines`&&(o=Ei(e),cu(n,e.length,o))){let r=uu(n,e,t),i=J(t)?.unbounded?.globalStateDetected??null;return ta(t,{area:`stream`,path:`stream-full`,reason:`auto-unbounded-line-threshold`,unbounded:!0}),{tokens:r,lineCount:o,globalStateReason:i}}o===void 0&&(o=i?Ei(e):0);let s=Ui(e);return{tokens:Gi(t,s,()=>this.core.parse(e,t,n).tokens),lineCount:o,globalStateReason:s}}shouldUseUnboundedAppend(e,t,n){return!n||e.length<this.MIN_UNBOUNDED_APPEND_TOTAL_CHARS&&n.length<this.MIN_UNBOUNDED_APPEND_CHARS?!1:n.length>=this.MIN_UNBOUNDED_APPEND_CHARS||Ei(n)>=this.MIN_UNBOUNDED_APPEND_LINES}getAppendedSegment(e,t,n){let r=e.src;if(n===null||n===void 0&&!t.startsWith(r)||(n===void 0?!r.endsWith(`
|
|
78
|
+
`):!this.ensureBoundaryState(e).endsWithNewline))return null;let i=n??t.slice(r.length);if(!i)return null;let a=i.length;if(i.charCodeAt(a-1)!==10)return null;let o=0,s=-1;for(let e=0;e<a&&!(i.charCodeAt(e)===10&&(s===-1&&(s=e),o++,o>=2));e++);if(o<2)return null;let c=(s===-1?i:i.slice(0,s)).trim();if(c.length===0)return null;if(/^[-=]+$/.test(c)){let t;if(n!==void 0)t=this.ensureBoundaryState(e).previousLineNonBlank;else{let e=r.slice(0,-1),n=e.lastIndexOf(`
|
|
79
|
+
`);t=e.slice(n+1).trim().length>0}if(t)return null}if(n!==void 0){let t=this.ensureLastSegment(e);if(t&&this.segmentHasFence(e,t)){let n=this.tokenMapsTrusted?this.ensureSegmentSourceOffset(e,t):0;if(this.endsInsideOpenFence(r,n))return null}}else{let t=this.tokenMapsTrusted?this.ensureLastSegment(e)?.srcOffset??0:0;if((this.tokenMapsTrusted||this.cacheHasFenceMarker(e))&&this.endsInsideOpenFence(r,t))return null}return this.mayContainReferenceDefinition(i)?null:i}tryTailSegmentReparse(e,t,n,r,i,a){let o=i??this.ensureLastSegment(t);if(!o)return null;let s=a!==void 0;if(s&&this.ensureSegmentSourceOffset(t,o),o.srcOffset<=0&&o.tokenStart<=0)return null;if(!s){let n=t.src.slice(0,o.srcOffset);if(!e.startsWith(n))return null}let c=s?t.lastSegmentSource??t.src.slice(o.srcOffset):t.src.slice(o.srcOffset),l=s?c+a:e.slice(o.srcOffset);if(l===c)return null;let u=s?a:e.startsWith(t.src)?e.slice(t.src.length):null,d=s&&this.tokenMapsTrusted?e:this.getNormalizedUpdatedSource(t,e,a);if(u){let i=this.tryContainerTailAppendMerge(e,t,n,r,o,u,d);if(i)return t.lastSegmentSource=s?l:void 0,i}if(this.mayContainReferenceDefinition(c)||this.mayContainReferenceDefinition(l))return null;try{let i=this.parseAtLineOffset(l,n,r,o.lineStart,d),a=i.state,c=this.getLastSegment(a.tokens,l,0,a.tokens.length,i.mapsShifted?0:void 0,i.mapsShifted?o.lineStart:void 0);return o.lineStart>0&&!i.mapsShifted&&this.shiftTokenLines(a.tokens,o.lineStart),u?s?this.updateBoundaryStateForAppend(t,u):this.updateFenceMarkerCacheForAppend(t,u):(t.boundary=void 0,t.hasFenceMarker=void 0),t.src=e,t.normalizedSrc=d,t.env=n,t.globalStateReason=null,s&&u||(t.globalStateCarry=void 0),t.tokens.length=o.tokenStart,this.appendTokens(t.tokens,a.tokens),t.lineCount=o.lineStart+Ei(l),c?(t.lastSegment={tokenStart:o.tokenStart+c.tokenStart,tokenEnd:o.tokenStart+c.tokenEnd,lineStart:i.mapsShifted?c.lineStart:o.lineStart+c.lineStart,lineEnd:i.mapsShifted?c.lineEnd:o.lineStart+c.lineEnd,srcOffset:o.srcOffset+c.srcOffset},t.lastSegmentSource=s?l.slice(c.srcOffset):void 0):(t.lastSegment=null,t.lastSegmentSource=void 0),t.lastSegmentVerified=void 0,t.tokens}catch{return null}}tryUntrustedParagraphTailReparse(e,t,n,r){if(t.boundary?t.boundary.endsWithBlankLine:this.endsWithBlankLine(t.src))return null;let i=this.ensureLastSegment(t);if(!i||t.tokens[i.tokenStart]?.type!==`paragraph_open`)return null;let a=t.tokens.slice(i.tokenStart,i.tokenEnd).find(e=>e.type===`inline`);if(!a?.content)return null;let o=t.src.length;for(;o>0;){let e=t.src.charCodeAt(o-1);if(e!==10&&e!==13)break;o--}let s=t.src.lastIndexOf(a.content,o-a.content.length);return s<0||s+a.content.length!==o?null:this.tryTailSegmentReparse(e,t,n,r,{...i,lineStart:this.countSourceLineBreaks(t.src,s),srcOffset:s})}countSourceLineBreaks(e,t){let n=0;for(let r=0;r<t;r++){let t=e.charCodeAt(r);t===10?n++:this.normalizeLineEndings&&t===13&&(n++,e.charCodeAt(r+1)===10&&r++)}return n}hasVerifiedSegmentAnchor(e,t,n){t.srcOffset<0&&this.ensureSegmentSourceOffset(e,t);let r=e.lineCount??Ei(e.src),i=this.getDocLineCount(e.src,r);if(!(t.lineStart>=0&&t.lineStart<=t.lineEnd&&t.lineEnd<=i&&t.srcOffset<e.src.length))return!1;let a=e.src.slice(t.srcOffset);try{let r=Object.create(n);Object.defineProperty(r,"block",{value:this.anchorBlock});let i=this.core.createState(a,{},r);this.normalizeLineEndings&&hs(i),this.anchorBlock.parse(i.src,r,i.env,i.tokens);let o=this.getLastSegment(i.tokens,a);if(!o||o.tokenStart!==0)return!1;let s=typeof i.src==`string`?i.src:a,c=i.tokens[0]?.type,l=e.tokens[t.tokenStart]?.type,u=l===`table_open`&&c===`paragraph_open`&&/^\s*\|/.test(s)||l===`inline`&&c===`html_block`||l===`math_block`&&c===`paragraph_open`&&/^\s*\$\$\s*(?:\n|$)/.test(s);if(c!==l&&!u)return!1;let d=e.tokens.slice(t.tokenStart,t.tokenEnd).map(e=>e.content).filter(Boolean),f=0;for(let e of d){if(f=s.indexOf(e,f),f<0)return!1;f+=e.length}return!0}catch{return!1}}normalizeSource(e){return e.replace(/\r\n?/g,`
|
|
80
|
+
`).replace(/\0/g,`�`)}cacheHasFenceMarker(e){return e.hasFenceMarker===void 0&&(e.hasFenceMarker=e.src.includes("```")||e.src.includes(`~~~`)),e.hasFenceMarker}updateFenceMarkerCacheForAppend(e,t){if(this.cacheHasFenceMarker(e))return;let n=e.src.slice(-2)+t;e.hasFenceMarker=n.includes("```")||n.includes(`~~~`)}getNormalizedUpdatedSource(e,t,n){if(!this.normalizeLineEndings)return t;if(n===void 0&&!t.startsWith(e.src))return this.normalizeSource(t);let r=e.normalizedSrc??this.normalizeSource(e.src),i=n??t.slice(e.src.length),a=this.normalizeSource(i);return e.src.endsWith(`\r`)&&i.startsWith(`
|
|
81
|
+
`)&&(a=a.slice(1)),r+a}parseAtLineOffset(e,t,n,r,i){if(this.tokenMapsTrusted||r<=0)return{state:this.core.parse(e,t,n),mapsShifted:!1};let a=this.core.createState(e,t,n),o=!1;return this.core.process(a,(e,t)=>{!o&&e.fn===Pa&&(this.shiftTokenLines(t.tokens,r),i!==void 0&&(t.src=i),o=!0)}),{state:a,mapsShifted:o}}getTailLines(e,t){if(t<=0)return``;let n=t;for(let t=e.length-1;t>=0;t--)if(e.charCodeAt(t)===10&&(n--,n===0))return e.slice(t+1);return e}endsInsideOpenFence(e,t){let n=e.slice(t),r=n.length,i=null,a=0;for(;a<r;){let e=n.indexOf(`
|
|
82
|
+
`,a);if(this.normalizeLineEndings){let t=n.indexOf(`\r`,a);t>=0&&(e===-1||t<e)&&(e=t)}e===-1&&(e=r);let t=a,o=0;for(;t<e;){let e=n.charCodeAt(t);if(e===32){if(t++,o++,o>=4)break}else if(e===9){o=4;break}else break}if(o<4&&t<e){let r=n.charCodeAt(t);if(r===96||r===126){let a=t;for(;a<e&&n.charCodeAt(a)===r;)a++;let o=a-t;if(o>=3){if(!i){let t=r===96?n.indexOf("`",a):-1;t>=0&&t<e||(i={marker:r,length:o})}else if(i.marker===r&&o>=i.length){let t=a;for(;t<e;){let e=n.charCodeAt(t);if(e===32||e===9)t++;else break}t===e&&(i=null)}}}}if(e===r)break;a=e+(this.normalizeLineEndings&&n.charCodeAt(e)===13&&n.charCodeAt(e+1)===10?2:1)}return i!==null}peek(){return this.cache?.tokens??Vu}hasCache(){return this.cache!==null}getStats(){return{...this.stats}}setCache(e,t){let n=this.cache?.snapshotState,r={...e,config:Gu(t),snapshotState:n};return n&&(n.cache=r),this.cache=r,r}appendTokens(e,t,n=0,r=t.length){for(let i=n;i<r;i++)e.push(t[i])}updateCacheLineCount(e,t){e.lineCount=t??Ei(e.src),e.lastSegment=void 0,e.lastSegmentVerified=void 0,e.normalizedSrc=void 0,e.globalStateCarry=e.src.slice(-4096),e.boundary=void 0,e.lastSegmentSource=void 0}detectGlobalStateForAppend(e,t){if(e.globalStateReason)return e.globalStateReason;let n=(e.globalStateCarry??e.src.slice(-4096))+t,r=Ui(n);return e.globalStateCarry=n.length>Hu?n.slice(n.length-Hu):n,r&&(e.globalStateReason=r),r}ensureLastSegment(e,t=!1){return e.lastSegment===void 0&&(e.lastSegment=this.getLastSegment(e.tokens,e.src,0,e.tokens.length,void 0,void 0,t)),e.lastSegment}getLastSegment(e,t,n=0,r=e.length,i,a,o=!1){if(r<=n)return null;let s=1/0,c=-1,l=0;for(let u=r-1;u>=n;u--){let n=e[u];if(n.map&&(n.map[0]<s&&(s=n.map[0]),n.map[1]>c&&(c=n.map[1])),n.nesting<0)l+=-n.nesting;else if(n.nesting>0){if(l-=n.nesting,n.level===0&&l<=0){let e=Number.isFinite(s)?s:n.map?.[0]??0,l=c>=e?c:n.map?.[1]??e;return{tokenStart:u,tokenEnd:r,lineStart:e,lineEnd:l,srcOffset:o?-1:this.getLineStartOffset(t,e,i,a)}}}else if(n.level===0&&l===0){let e=Number.isFinite(s)?s:n.map?.[0]??0,l=c>=e?c:n.map?.[1]??e;return{tokenStart:u,tokenEnd:r,lineStart:e,lineEnd:l,srcOffset:o?-1:this.getLineStartOffset(t,e,i,a)}}}return null}segmentHasFence(e,t){let n=Math.min(t.tokenEnd,e.tokens.length);for(let r=t.tokenStart;r<n;r++)if(e.tokens[r].type===`fence`)return!0;return!1}ensureSegmentSourceOffset(e,t){if(t.srcOffset<0){let n=e.lineCount;t.srcOffset=n!==void 0&&t.lineStart<=n&&t.lineEnd<=n+1?this.getLineStartOffsetFromEnd(e.src,t.lineStart,n):this.getLineStartOffset(e.src,t.lineStart)}return t.srcOffset}getLineStartOffsetFromEnd(e,t,n){if(t<=0)return 0;let r=n-t+1,i=e.length;for(;r>0;){if(i=e.lastIndexOf(`
|
|
83
|
+
`,i-1),i<0)return 0;r--}return i+1}getLineStartOffset(e,t,n,r){return n!==void 0&&r!==void 0&&t>=r?this.getLineStartOffsetFrom(e,n,t-r):this.getLineStartOffsetFrom(e,0,t)}getLineStartOffsetFrom(e,t,n){if(n<=0)return t;let r=n,i=t;for(;i<e.length;){let t=e.charCodeAt(i);if(t===10)i++,r--;else if(this.normalizeLineEndings&&t===13)i++,i<e.length&&e.charCodeAt(i)===10&&i++,r--;else{i++;continue}if(r===0)return i}return e.length}mayContainReferenceDefinition(e){return e.includes(`]:`)?/(?:^|\n)[ \t]{0,3}\[[^\]\n]+\]:/.test(e):!1}canDirectlyParseAppend(e){if(!this.tokenMapsTrusted||!(e.boundary?e.boundary.endsWithBlankLine:this.endsWithBlankLine(e.src)))return!1;let t=this.ensureLastSegment(e);if(!t)return!1;switch(e.tokens[t.tokenStart]?.type){case`paragraph_open`:case`heading_open`:case`fence`:case`code_block`:case`html_block`:case`hr`:case`table_open`:return!0;default:return!1}}tryContainerTailAppendMerge(e,t,n,r,i,a,o){if(!a||this.mayContainReferenceDefinition(a))return null;let s=t.tokens[i.tokenStart];switch(s?.type){case`bullet_list_open`:case`ordered_list_open`:return this.tryListTailAppendMerge(e,t,n,r,i,a,s,o);case`table_open`:return this.tryTableTailAppendMerge(e,t,n,r,i,a,s,o);default:return null}}tryListTailAppendMerge(e,t,n,r,i,a,o,s){if(t.src.length===0||!(t.boundary?t.boundary.endsWithNewline:t.src.charCodeAt(t.src.length-1)===10))return null;this.ensureSegmentSourceOffset(t,i);let c=i.lineEnd-i.lineStart,l=t.src.length-i.srcOffset;if(c<this.MIN_LIST_LINES_FOR_MERGE&&l<this.MIN_LIST_CHARS_FOR_MERGE)return null;let u=o.type===`bullet_list_open`?`bullet_list_close`:`ordered_list_close`,d=t.lineCount??Ei(t.src),f,p=!1;try{let e=this.parseAtLineOffset(a,n,r,d,s);f=e.state.tokens,p=e.mapsShifted}catch{return null}if(!this.isSingleTopLevelContainer(f,o.type,u,o.markup))return null;let m=f.slice(1,-1);if(m.length===0)return null;d>0&&!p&&this.shiftTokenLines(m,d);let h=this.getListParagraphMode(t.tokens,i.tokenStart,t.tokens.length,o.level),g=this.getListParagraphMode(f,0,f.length,0);(h===`loose`||g===`loose`||(t.boundary?t.boundary.endsWithBlankLine:this.endsWithBlankLine(t.src))||(f[0]?.map?.[0]??0)-(p?d:0)>0)&&(this.setListParagraphVisibility(t.tokens,i.tokenStart,t.tokens.length,o.level,!1),this.setListParagraphVisibility(m,0,m.length,o.level,!1)),t.tokens.splice(t.tokens.length-1,0,...m),t.boundary?this.updateBoundaryStateForAppend(t,a):this.updateFenceMarkerCacheForAppend(t,a),t.src=e,t.normalizedSrc=s,t.env=n,t.globalStateReason=null;let _=d+Ei(a);t.lineCount=_;let v=this.getCachedDocLineCount(t,_);return o.map&&(o.map[1]=v),t.lastSegment={tokenStart:i.tokenStart,tokenEnd:t.tokens.length,lineStart:i.lineStart,lineEnd:v,srcOffset:i.srcOffset},t.lastSegmentVerified=!0,t.tokens}tryTableTailAppendMerge(e,t,n,r,i,a,o,s){if(t.src.length===0||!(t.boundary?t.boundary.endsWithNewline:t.src.charCodeAt(t.src.length-1)===10)||/(?:^|\n)[ \t]*\n/.test(a))return null;this.ensureSegmentSourceOffset(t,i);let c=i.lineEnd-i.lineStart,l=t.src.length-i.srcOffset;if(c<this.MIN_TABLE_LINES_FOR_MERGE&&l<this.MIN_TABLE_CHARS_FOR_MERGE)return null;let u=this.getTableHeaderContext(t.src.slice(i.srcOffset));if(!u)return null;let d=`${u}${a}`,f=i.lineEnd-2,p,m=!1;try{let e=this.parseAtLineOffset(d,n,r,f,s);p=e.state.tokens,m=e.mapsShifted}catch{return null}if(!this.isSingleTopLevelContainer(p,`table_open`,`table_close`)||(p[0]?.map?.[1]??-1)!==this.getDocLineCount(d))return null;let h=this.getTableBodySection(p,0,p.length,0),g=this.getTableBodySection(t.tokens,i.tokenStart,t.tokens.length,o.level);if(!h||!g||h.tbodyOpenIndex<0||h.tbodyCloseIndex<0)return null;let _=g.tbodyOpenIndex>=0?p.slice(h.tbodyOpenIndex+1,h.tbodyCloseIndex):p.slice(h.tbodyOpenIndex,h.tbodyCloseIndex+1);if(_.length===0)return null;f!==0&&!m&&this.shiftTokenLines(_,f);let v=g.tbodyCloseIndex>=0?g.tbodyCloseIndex:g.tableCloseIndex,y=t.lineCount??Ei(t.src);t.tokens.splice(v,0,..._),t.boundary?this.updateBoundaryStateForAppend(t,a):this.updateFenceMarkerCacheForAppend(t,a),t.src=e,t.normalizedSrc=s,t.env=n,t.globalStateReason=null;let b=y+Ei(a);t.lineCount=b;let x=this.getCachedDocLineCount(t,b);if(o.map&&(o.map[1]=x),g.tbodyOpenIndex>=0){let e=t.tokens[g.tbodyOpenIndex];e?.map&&(e.map[1]=x)}return t.lastSegment={tokenStart:i.tokenStart,tokenEnd:t.tokens.length,lineStart:i.lineStart,lineEnd:x,srcOffset:i.srcOffset},t.lastSegmentVerified=!0,t.tokens}getTableHeaderContext(e){let t=e.indexOf(`
|
|
84
|
+
`);if(t<0)return null;let n=e.indexOf(`
|
|
85
|
+
`,t+1);return n<0?null:e.slice(0,n+1)}getTableBodySection(e,t,n,r){if(t<0||t>=n||e[t]?.type!==`table_open`)return null;let i=-1;for(let a=n-1;a>t;a--){let t=e[a];if(t.type===`table_close`&&t.level===r){i=a;break}}if(i<0)return null;let a=-1,o=-1;for(let n=t+1;n<i;n++){let t=e[n];if(t.type===`tbody_open`&&t.level===r+1){a=n;break}}if(a>=0){for(let t=i-1;t>a;t--){let n=e[t];if(n.type===`tbody_close`&&n.level===r+1){o=t;break}}if(o<0)return null}return{tableCloseIndex:i,tbodyOpenIndex:a,tbodyCloseIndex:o}}isSingleTopLevelContainer(e,t,n,r){if(e.length<2)return!1;let i=e[0],a=e[e.length-1];if(i.type!==t||a.type!==n||i.level!==0||a.level!==0||r!==void 0&&i.markup!==r)return!1;let o=0;for(let t=0;t<e.length;t++){let n=e[t];if(n.level===0&&t>0&&t<e.length-1&&o===0)return!1;(n.nesting>0||n.nesting<0)&&(o+=n.nesting)}return o===0}getListParagraphMode(e,t,n,r){let i=!1,a=!1,o=r+2;for(let r=t;r<n;r++){let t=e[r];if(t.type===`paragraph_open`&&t.level===o&&(t.hidden?i=!0:a=!0,i&&a))return`loose`}return a?`loose`:i?`tight`:`none`}setListParagraphVisibility(e,t,n,r,i){let a=r+2;for(let r=t;r<n;r++){let t=e[r];(t.type===`paragraph_open`||t.type===`paragraph_close`)&&t.level===a&&(t.hidden=i)}}shouldPreferTailReparseForAppend(e,t){let n=this.ensureLastSegment(e);if(!n)return!1;let r=e.tokens[n.tokenStart];if(!this.tokenMapsTrusted)return t;switch(r?.type){case`bullet_list_open`:case`ordered_list_open`:case`blockquote_open`:case`table_open`:return!0;case`paragraph_open`:case`code_block`:case`html_block`:return!(e.boundary?e.boundary.endsWithBlankLine:this.endsWithBlankLine(e.src));default:return r?.nesting===1}}endsWithBlankLine(e){let t=e.length;if(t<2||e.charCodeAt(t-1)!==10)return!1;let n=t-2;for(;n>=0;){let t=e.charCodeAt(n);if(t===32||t===9)n--;else return t===10}return!0}ensureBoundaryState(e){if(e.boundary)return e.boundary;let t=e.src,n=t.length,r=n>0&&t.charCodeAt(n-1)===10,i=r?n-1:n,a=i-1;for(;a>=0&&t.charCodeAt(a)!==10;)a--;let o=!1;for(let e=a+1;e<i;e++){let n=t.charCodeAt(e);if(n!==32&&n!==9){o=!0;break}}return e.boundary={currentLineNonBlank:!r&&o,previousLineNonBlank:r?o:!1,endsWithNewline:r,endsWithBlankLine:this.endsWithBlankLine(t)},e.boundary}updateBoundaryStateForAppend(e,t){let n=this.ensureBoundaryState(e),r=n.currentLineNonBlank,i=n.previousLineNonBlank;for(let e=0;e<t.length;e++){let n=t.charCodeAt(e);n===10?(i=r,r=!1):n!==32&&n!==9&&(r=!0)}n.currentLineNonBlank=r,n.previousLineNonBlank=i,n.endsWithNewline=t.length>0?t.charCodeAt(t.length-1)===10:n.endsWithNewline,n.endsWithBlankLine=e.src.length+t.length>=2&&n.endsWithNewline&&!i}getDocLineCount(e,t=Ei(e)){return e.length===0?0:e.charCodeAt(e.length-1)===10?t:t+1}getCachedDocLineCount(e,t){return e.src.length===0?0:e.boundary?e.boundary.endsWithNewline?t:t+1:this.getDocLineCount(e.src,t)}shiftTokenLines(e,t){if(t===0)return;let n=null;for(let r=0;r<e.length;r++){let i=e[r];if(i.map&&(i.map[0]+=t,i.map[1]+=t),i.children){n??=[];for(let e=i.children.length-1;e>=0;e--)n.push(i.children[e]);for(;n.length>0;){let e=n.pop();if(e.map&&(e.map[0]+=t,e.map[1]+=t),e.children)for(let t=e.children.length-1;t>=0;t--)n.push(e.children[t])}}}}},$u={default:yu,zero:bu,commonmark:vu};function ed(e){return{core:e.core.ruler.version,block:e.block.ruler.version,inline:e.inline.ruler.version,inline2:e.inline.ruler2.version,inlineState:e.inline.State}}function td(e,t){return e.core.ruler.version!==t.core||e.block.ruler.version!==t.block||e.inline.ruler.version!==t.inline||e.inline.ruler2.version!==t.inline2||e.inline.State!==t.inlineState}function nd(e){return e.experimental?{...e,...e.experimental}:e}function rd(e,t){if(!e)return!1;if(Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0)return!0;let n=e.experimental;return!!n&&Object.prototype.hasOwnProperty.call(n,t)&&n[t]!==void 0}function id(e,t,n){for(let r=0;r<n.length;r++){let i=n[r];if(rd(t,i)||rd(e,i))return!0}return!1}function ad(e,t,n){return rd(t,n)||rd(e,n)}function od(e,t){let n=J(e)?.chunk;n?.fallback?ta(e,{area:`parse`,path:`plain`,reason:`global-state:${n.fallbackReason||`unknown`}`}):ta(e,{area:`parse`,path:`full-chunk`,chunked:!0,reason:t})}function sd(){return typeof performance<`u`?performance.now():Date.now()}function cd(e,t){let n={html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`“”‘’`,highlight:null,maxNesting:100,stream:!1,streamOptimizationMinSize:1e3,streamTailLocalPostBlockRules:!1,streamChunkedFallback:!1,streamChunkSizeChars:1e4,streamChunkSizeLines:200,streamChunkFenceAware:!0,streamChunkAdaptive:!0,streamChunkTargetChunks:8,streamChunkMaxChunks:void 0,streamLargeCachePolicy:`retain`,streamSkipCacheAboveChars:1e6,streamSkipCacheAboveLines:1e5,fullChunkedFallback:!1,fullChunkThresholdChars:2e4,fullChunkThresholdLines:400,fullChunkSizeChars:1e4,fullChunkSizeLines:200,fullChunkFenceAware:!0,fullChunkAdaptive:!0,fullChunkTargetChunks:8,fullChunkMaxChunks:void 0,autoTuneChunks:!0,autoUnbounded:!0,autoUnboundedThresholdChars:4e6,autoUnboundedThresholdLines:8e4},r=`default`,i;!t&&typeof e!=`string`?(i=e,r=`default`):typeof e==`string`&&(r=e,i=t);let a=$u[r];if(!a)throw Error(`Wrong \`markdown-it\` preset "${r}", check name`);if(a?.options&&(n={...n,...a.options}),i&&(n={...n,...i}),n=nd(n),typeof n.quotes==`string`){let e=n.quotes;e.length>=4?n.quotes=[e[0],e[1],e[2],e[3]]:n.quotes=[`“`,`”`,`‘`,`’`]}let o=id(a?.options,i,[`fullChunkSizeChars`,`fullChunkSizeLines`,`fullChunkMaxChunks`]),s=id(a?.options,i,[`streamChunkSizeChars`,`streamChunkSizeLines`,`streamChunkMaxChunks`]),c=ad(a?.options,i,`fullChunkedFallback`),l=ad(a?.options,i,`streamChunkedFallback`),u=!1,d=null,f=null,p=new Fc,m=null,h=()=>(m||=new Bu(n),m),g=null,_=()=>(g||=new Qu(p),g),v=null,y=()=>(v||=new ga({fuzzyLink:!0}),v),b=e=>!u&&!!d&&!td(e,d),x=(e,t)=>r==="default"&&!u&&m===null&&f!==null&&e.parse===f&&b(e)&&!e.stream.enabled&&t<(e.options.autoUnboundedThresholdChars??4e6)&&e.options.html===!1&&e.options.xhtmlOut===!1&&e.options.breaks===!1&&e.options.langPrefix===`language-`&&e.options.linkify===!1&&e.options.typographer===!1&&e.options.highlight===null,S=(e,t)=>r==="default"&&!u&&b(e)&&!e.stream.enabled&&!e.options.fullChunkedFallback&&t<(e.options.autoUnboundedThresholdChars??4e6)&&e.options.html===!1&&e.options.linkify===!1&&e.options.typographer===!1,C={core:p,block:p.block,inline:p.inline,get linkify(){let e=y();return Object.defineProperty(this,"linkify",{value:e,writable:!0,configurable:!0}),e},get renderer(){let e=h();return Object.defineProperty(this,"renderer",{value:e,writable:!0,configurable:!0}),e},options:n,__explicitFullChunkConfig:o,__explicitStreamChunkConfig:s,__explicitFullChunkFallbackSetting:c,__explicitStreamChunkFallbackSetting:l,__canUseImplicitLargeInputStrategy(){return b(this)},set(e){let t=nd(e);return this.options={...this.options,...t},(rd(e,`fullChunkSizeChars`)||rd(e,`fullChunkSizeLines`)||rd(e,`fullChunkMaxChunks`))&&(o=!0,this.__explicitFullChunkConfig=!0),(rd(e,`streamChunkSizeChars`)||rd(e,`streamChunkSizeLines`)||rd(e,`streamChunkMaxChunks`))&&(s=!0,this.__explicitStreamChunkConfig=!0),rd(e,`fullChunkedFallback`)&&(c=!0,this.__explicitFullChunkFallbackSetting=!0),rd(e,`streamChunkedFallback`)&&(l=!0,this.__explicitStreamChunkFallbackSetting=!0),m&&m.set(t),typeof t.stream==`boolean`&&(this.stream.enabled=t.stream,g&&(g.reset(),g.resetStats())),this},configure(e){let t=typeof e==`string`?$u[e]:e;if(!t)throw Error("Wrong `markdown-it` preset, can't be empty");if(t.options&&this.set(t.options),t.components){let e=t.components;e.core?.rules&&this.core.ruler.enableOnly(e.core.rules),e.block?.rules&&this.block.ruler.enableOnly(e.block.rules),e.inline?.rules&&this.inline.ruler.enableOnly(e.inline.rules),e.inline2?.rules&&this.inline.ruler2.enableOnly(e.inline2.rules)}return this},enable(e,t){let n=Array.isArray(e)?e:[e],r=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],i=new Set;for(let e of r){if(!e)continue;let t=e.enable(n,!0);for(let e=0;e<t.length;e++)i.add(t[e])}if(!t){let e=n.filter(e=>!i.has(e));if(e.length)throw Error(`Rules manager: invalid rule name ${e.join(`, `)}`)}return this},disable(e,t){let n=Array.isArray(e)?e:[e],r=[this.core?.ruler,this.block?.ruler,this.inline?.ruler,this.inline?.ruler2],i=new Set;for(let e of r){if(!e)continue;let t=e.disable(n,!0);for(let e=0;e<t.length;e++)i.add(t[e])}if(!t){let e=n.filter(e=>!i.has(e));if(e.length)throw Error(`Rules manager: invalid rule name ${e.join(`, `)}`)}return this},use(e,...t){let n=typeof e==`function`?e:e&&typeof e.default==`function`?e.default:void 0;if(!n)throw TypeError(`MarkdownIt.use: plugin must be a function`);let r=[this,...t],i=e;return u=!0,n.apply(i,r),this},render(e,t){let n;if(x(this,e.length)){t!==void 0&&($i(t),n=Yi(`render`));let r=n?sd():0,i=n?Pl(e,n):Nl(e);if(n&&(n.attemptMs=sd()-r,i===null&&(n.fallbackReason=`unsupported-stock-subset`),ea(t,n)),i!==null)return t!==void 0&&ta(t,{area:`render`,path:`stock-fast`,reason:`stock-subset`}),i}let r=t??{},i=this.parse(e,r);return n&&ea(r,n),h().render(i,this.options,r)},async renderAsync(e,t){let n;if(x(this,e.length)){t!==void 0&&($i(t),n=Yi(`render`));let r=n?sd():0,i=n?Pl(e,n):Nl(e);if(n&&(n.attemptMs=sd()-r,i===null&&(n.fallbackReason=`unsupported-stock-subset`),ea(t,n)),i!==null)return t!==void 0&&ta(t,{area:`render`,path:`stock-fast`,reason:`stock-subset`}),i}let r=t??{},i=this.parse(e,r);return n&&ea(r,n),h().renderAsync(i,this.options,r)},renderIterable(e,t={}){let n=this.parseIterable(e,t);return h().render(n,this.options,t)},async renderAsyncIterable(e,t={}){let n=await this.parseAsyncIterable(e,t);return h().renderAsync(n,this.options,t)},renderInline(e,t={}){let n=this.parseInline(e,t);return h().render(n,this.options,t)},validateLink:zs,normalizeLink:Bs,normalizeLinkText:Vs,utils:Yr,helpers:{...ja},parse(e,t){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);if(t!==void 0&&$i(t),S(this,e.length)){let n=t===void 0?void 0:Yi(`parse`),r=n?sd():0,i=il(e,n);if(n&&(n.attemptMs=sd()-r,i===null&&(n.fallbackReason=`unsupported-stock-subset`),ea(t,n)),i!==null)return t!==void 0&&ta(t,{area:`parse`,path:`stock-fast`,reason:`stock-subset`}),i}let n=t??{},r;if(!this.stream.enabled&&!this.options.fullChunkedFallback&&b(this)){let i=lu(this,e.length);if(i===`yes`){let r=uu(this,e,n);return ta(t,{area:`parse`,path:`auto-unbounded`,unbounded:!0,reason:`char-threshold`}),r}i===`need-lines`&&(r=Ei(e))}if(!this.stream.enabled){let i=e.length,a=this.options.autoTuneChunks!==!1,s=o,l=!c&&b(this),u=!!this.options.fullChunkedFallback,d=l&&i>=2e5,f;(u||d||r!==void 0)&&(f=r??Ei(e));let p=(u||d)&&a&&!s?gu(i,f,this.options):null;if(u||d){let r=f??0;if(u?i>=(this.options.fullChunkThresholdChars??2e4)||r>=(this.options.fullChunkThresholdLines??400):d){if(p&&p.strategy!==`plain`){let r=Il(this,e,n,{maxChunkChars:p.maxChunkChars,maxChunkLines:p.maxChunkLines,fenceAware:p.fenceAware,maxChunks:p.maxChunks});return t&&od(t,u?`explicit-full-chunk`:`default-large-string`),r}if(u){let a=(e,t,n)=>e<t?t:e>n?n:e,o=this.options.fullChunkAdaptive!==!1,s=this.options.fullChunkTargetChunks??8,c=a(Math.ceil(i/s),8e3,64e3),l=a(Math.ceil(r/s),150,700),u=o?c:this.options.fullChunkSizeChars??1e4,d=o?l:this.options.fullChunkSizeLines??200,f=o?a(Math.ceil(i/64e3),s,32):this.options.fullChunkMaxChunks,p=Il(this,e,n,{maxChunkChars:u,maxChunkLines:d,fenceAware:this.options.fullChunkFenceAware??!0,maxChunks:f});return t&&od(t,`explicit-full-chunk`),p}}}if(r!==void 0&&b(this)&&cu(this,i,f??r)){let r=uu(this,e,n);return ta(t,{area:`parse`,path:`auto-unbounded`,unbounded:!0,reason:`line-threshold`}),r}}let i=Ui(e);return ta(t,{area:`parse`,path:`plain`,reason:`default-plain`}),Gi(n,i,()=>p.parse(e,n,this).tokens)},parseIterable(e,t={}){return $i(t),iu(this,e,t)},parseAsyncIterable(e,t={}){return $i(t),au(this,e,t)},parseIterableToSink(e,t,n={}){return $i(n),ou(this,e,t,n)},parseAsyncIterableToSink(e,t,n={}){return $i(n),su(this,e,t,n)},parseInline(e,t={}){if(typeof e!=`string`)throw TypeError(`Input data should be a String`);$i(t),Wi(t)&&Ji(t);let n=p.createState(e,t,this);return n.inlineMode=!0,p.process(n),n.tokens}};if(C.stream={enabled:!!n.stream,parse(e,t){return C.stream.enabled?_().parse(e,t,C):C.parse(e,t??{})},append(e,t){if(!C.stream.enabled)throw Error(`Stream append requires stream mode`);return _().append(e,t,C)},snapshot(){return g?g.snapshot():null},restore(e){if(!C.stream.enabled)throw Error(`Stream restore requires stream mode`);return _().restore(e,C)},reset(){_().reset()},hasCache(){return g?.hasCache()??!1},peek(){return g?g.peek():[]},stats(){return g?g.getStats():{total:0,cacheHits:0,appendHits:0,unboundedAppendHits:0,tailHits:0,fullParses:0,resets:0,chunkedParses:0,lastMode:`idle`}},resetStats(){g&&g.resetStats()}},a?.components){let e=a.components;e.core?.rules&&C.core.ruler.enableOnly(e.core.rules),e.block?.rules&&C.block.ruler.enableOnly(e.block.rules),e.inline?.rules&&C.inline.ruler.enableOnly(e.inline.rules),e.inline2?.rules&&C.inline.ruler2.enableOnly(e.inline2.rules)}return d=ed(C),f=C.parse,C}var ld=cd,ud=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`],dd=`a.abbr.b.bdi.bdo.button.cite.code.data.del.dfn.em.font.i.ins.kbd.label.mark.q.s.samp.small.span.strong.sub.sup.time.u.var`.split(`.`),fd=`article.aside.blockquote.details.div.figcaption.figure.footer.header.h1.h2.h3.h4.h5.h6.li.main.nav.ol.p.pre.section.summary.table.tbody.td.th.thead.tr.ul`.split(`.`),pd=[`svg`,`g`,`path`],md=`address.audio.body.canvas.caption.colgroup.datalist.dd.dialog.dl.dt.fieldset.form.head.hgroup.html.iframe.legend.map.menu.meter.noscript.object.optgroup.option.output.picture.progress.rp.rt.ruby.script.select.style.template.textarea.tfoot.title.video`.split(`.`),hd=`onclick.onerror.onload.onmouseover.onmouseout.onmousedown.onmouseup.onkeydown.onkeyup.onfocus.onblur.onsubmit.onreset.onchange.onselect.ondblclick.ontouchstart.ontouchend.ontouchmove.ontouchcancel.onwheel.onscroll.oncopy.oncut.onpaste.oninput.oninvalid.onsearch.innerhtml.outerhtml.textcontent.innertext.srcdoc.ping`.split(`.`),gd=[`action`,`data`,`href`,`src`,`srcset`,`poster`,`xlink:href`,`formaction`],_d=[`script`],vd=[`pre`,`iframe`,`picture`,`script`,`style`,`table`,`tbody`,`td`,`tfoot`,`th`,`thead`,`textarea`,`tr`,`title`,`video`],yd=new Set(ud),bd=new Set(fd),xd=new Set([...ud,...dd,...fd,...pd]),Sd=new Set([...xd,...md]),Cd=new Set(hd),wd=new Set(gd),Td=new Set(_d),Ed=new Set(vd);function Dd(e){let t=``;for(let n of e){let e=n.charCodeAt(0);e<=31||e>=127&&e<=159||/\s/u.test(n)||(t+=n)}return t}var Od={amp:`&`,bsol:`\\`,colon:`:`,newline:`
|
|
86
|
+
`,sol:`/`,tab:` `};function kd(e){return e.replace(/&(?:#(\d+)|#x([0-9a-f]+)|([a-z][a-z0-9]+));?/gi,(e,t,n,r)=>{let i=t??n;if(i){let e=Number.parseInt(i,t?10:16);try{return Number.isFinite(e)?String.fromCodePoint(e):``}catch{return``}}return Od[String(r??``).toLowerCase()]??e})}var Ad=new Set([`http`,`https`,`mailto`,`tel`]),jd=new Set([`javascript`,`vbscript`,`data`,`file`,`ftp`,`blob`,`filesystem`,`intent`,`chrome`,`chrome-extension`,`moz-extension`,`ms-browser-extension`,`view-source`]),Md=new Set([`http`,`https`]);function Nd(e){return e.match(/^([a-z][a-z0-9+.-]*):/i)?.[1]?.toLowerCase()??``}var Pd=/^https?:\/\//i;function Fd(e){if(!Pd.test(e))return!1;for(let t of e){let e=t.charCodeAt(0);if(t===`&`||e<=32||e>=127&&e<=159||e>127&&/\s/u.test(t))return!1}return!0}function Id(e,t,n){if(!Ld(t,n)||!e.startsWith(`file:///`))return!1;let r=e.charAt(8);return r!==`/`&&r!==`\\`}function Ld(e,t){return e?(e===`a`||e===`area`)&&(!t||t===`href`||t===`xlink:href`):!t||t===`href`}function Rd(e,t){return t===`href`||t===`xlink:href`?Ld(e,t)?Ad:Md:t===`src`||t===`srcset`||t===`poster`||t===`action`||t===`formaction`||t===`data`?Md:Ad}function zd(e,t={}){if(Fd(e))return!1;let n=Dd(kd(e)).toLowerCase(),r=String(t.tagName??``).toLowerCase(),i=String(t.attrName??``).toLowerCase();if(!n)return!1;if(n.startsWith(`data:`)){let e=/^data:image\/(?:png|gif|jpe?g|webp|avif|bmp);/i.test(n);return r===`img`&&i===`src`?!e:!0}if(/^[\\/]{2}/.test(n))return!0;if(n.startsWith(`/`)||n.startsWith(`./`)||n.startsWith(`../`)||n.startsWith(`#`)||n.startsWith(`?`))return!1;let a=Nd(n);return a?a===`file`?!Id(n,r,i):Ld(r,i)?jd.has(a):!Rd(r,i).has(a):!1}function Bd(e){let t=kd(String(e??``)).trim();if(!t||t.startsWith(`#`)||t.startsWith(`/`)||t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`?`))return!1;let n=Nd(Dd(t).toLowerCase());return n===`http`||n===`https`}function Vd(e,t={}){let n=String(e??``).trim();return n?zd(n,t)?``:n:``}function Hd(e){return Vd(e,{tagName:`img`,attrName:`src`})}function Ud(e,t,n){function r(e){return e.trim().split(` `,2)[0]===t}function i(e,n,r,i,a){return e[n].nesting===1&&e[n].attrJoin(`class`,t),a.renderToken(e,n,r,i,a)}n||={};let a=n.marker||`:`,o=a.charCodeAt(0),s=a.length,c=n.validate||r,l=n.render||i;function u(e,n,r,i){let l,u=!1,d=e.bMarks[n]+e.tShift[n],f=e.eMarks[n];if(o!==e.src.charCodeAt(d))return!1;for(l=d+1;l<=f&&a[(l-d)%s]===e.src[l];l++);let p=Math.floor((l-d)/s);if(p<3)return!1;l-=(l-d)%s;let m=e.src.slice(d,l),h=e.src.slice(l,f);if(!c(h,m))return!1;if(i)return!0;let g=n;for(;g++,!(g>=r||(d=e.bMarks[g]+e.tShift[g],f=e.eMarks[g],d<f&&e.sCount[g]<e.blkIndent));)if(o===e.src.charCodeAt(d)&&!(e.sCount[g]-e.blkIndent>=4)){for(l=d+1;l<=f&&a[(l-d)%s]===e.src[l];l++);if(!(Math.floor((l-d)/s)<p)&&(l-=(l-d)%s,l=e.skipSpaces(l),!(l<f))){u=!0;break}}let _=e.parentType,v=e.lineMax;e.parentType=`container`,e.lineMax=g;let y=e.push(`container_`+t+`_open`,`div`,1);y.markup=m,y.block=!0,y.info=h,y.map=[n,g],e.md.block.tokenize(e,n+1,g);let b=e.push(`container_`+t+`_close`,`div`,-1);return b.markup=e.src.slice(d,l),b.block=!0,e.parentType=_,e.lineMax=v,e.line=g+ +!!u,!0}e.block.ruler.before(`fence`,`container_`+t,u,{alt:[`paragraph`,`reference`,`blockquote`,`list`]}),e.renderer.rules[`container_`+t+`_open`]=l,e.renderer.rules[`container_`+t+`_close`]=l}function Wd(e){let t=String(e??``).trim();if(!t.startsWith(`{`)||!t.endsWith(`}`))return null;let n=t.slice(1,-1).trim();if(!n)return{};if(n.includes(`{`)||n.includes(`[`)||n.includes(`]`))return null;let r=[],i=``,a=!1,o=!1;for(let e=0;e<n.length;e++){let t=n[e];t===`\\`?(i+=t,e+1<n.length&&(i+=n[e+1],e++)):!o&&t===`'`?(a=!a,i+=t):!a&&t===`"`?(o=!o,i+=t):!a&&!o&&t===`,`?(r.push(i.trim()),i=``):i+=t}i.trim()&&r.push(i.trim());let s={};for(let e of r){if(!e)continue;let t=!1,n=!1,r=-1;for(let i=0;i<e.length;i++){let a=e[i];if(a===`\\`)i++;else if(!n&&a===`'`)t=!t;else if(!t&&a===`"`)n=!n;else if(!t&&!n&&a===`:`){r=i;break}}if(r===-1)return null;let i=e.slice(0,r).trim(),a=e.slice(r+1).trim();if(!i)return null;let o=i;if(o.startsWith(`"`)&&o.endsWith(`"`)||o.startsWith(`'`)&&o.endsWith(`'`))try{o=JSON.parse(o.replace(/^'/,`"`).replace(/'$/,`"`))}catch{return null}if(!/^[_$A-Z][\w$-]*$/i.test(o))return null;let c;if(!a)c=``;else if(a.startsWith(`"`)&&a.endsWith(`"`)||a.startsWith(`'`)&&a.endsWith(`'`))try{c=JSON.parse(a.replace(/^'/,`"`).replace(/'$/,`"`))}catch{c=a}else c=/^-?\d+(?:\.\d+)?$/.test(a)?Number(a):a===`true`||a===`false`?a===`true`:a===`null`?null:a;s[o]=c}return s}function Gd(e,t,n){for(let r of e){let e=r,i=e.map;if(Array.isArray(i)&&i.length>=2){let r=Number(i[0]),a=Number(i[1]);Number.isFinite(r)&&Number.isFinite(a)&&(e.map=[r+t,Math.min(a+t,n)])}Array.isArray(e.children)&&Gd(e.children,t,n)}}function Kd(e){[`admonition`,`info`,`warning`,`error`,`tip`,`danger`,`note`,`caution`].forEach(t=>{e.use(Ud,t,{render(e,n){return e[n].nesting===1?`<div class="vmr-container vmr-container-${t}">`:`</div>
|
|
87
|
+
`}})}),e.block.ruler.before(`fence`,`vmr_container_fallback`,(e,t,n,r)=>{let i=e,a=i.bMarks[t]+i.tShift[t],o=i.eMarks[t],s=i.src.slice(a,o),c=s.match(/^:::\s*([^\s{]+)/);if(!c)return!1;let l=c[1];if(!l.trim())return!1;let u=s.slice(c[0].length).trim(),d,f,p=u.indexOf(`{`),m=p>=0?u.slice(p).trimStart():void 0;if(p===-1)d=u||void 0;else{if(d=u.slice(0,p).trim()||void 0,m?.startsWith(`{`)){let e=0,t=-1;for(let n=0;n<m.length;n++)if(m[n]===`{`?e++:m[n]===`}`&&e--,e===0){t=n+1;break}t>0&&(f=m.slice(0,t))}f||(d=u||void 0)}if(r)return!0;let h=!!i.env.__markstreamFinal,g=t+1,_=!1;for(;g<=n;){let e=i.bMarks[g]+i.tShift[g],t=i.eMarks[g];if(i.src.slice(e,t).trim()===`:::`){_=!0;break}g++}_||(g=n);let v=i.push(`vmr_container_open`,`div`,1);if(v.attrSet(`class`,`vmr-container vmr-container-${l}`),v.map=[t,_?g:n],v.meta={...v.meta??{},unclosed:!_&&!h},d&&v.attrSet(`data-args`,d),f)try{let e=JSON.parse(f);for(let[t,n]of Object.entries(e)){let e=typeof n==`object`&&!!n;v.attrSet(`data-${t}`,e?JSON.stringify(n):String(n))}}catch{let e=Wd(f);if(e)for(let[t,n]of Object.entries(e)){let e=typeof n==`object`&&!!n;v.attrSet(`data-${t}`,e?JSON.stringify(n):String(n))}else v.attrSet(`data-attrs`,f)}let y=[];for(let e=t+1;e<g;e++){let t=i.bMarks[e]+i.tShift[e],n=i.eMarks[e];y.push(i.src.slice(t,n))}if(y.some(e=>e.trim().length>0)){let e=y.join(`
|
|
88
|
+
`);e.endsWith(`
|
|
89
|
+
`)||(e+=`
|
|
90
|
+
`),e.endsWith(`
|
|
91
|
+
|
|
92
|
+
`)||(e+=`
|
|
93
|
+
`);let n=i.tokens[i.tokens.length-1];n&&(n.raw=e);let r=[];i.md.block.parse(e,i.md,i.env,r),Gd(r,t+1,t+1+y.length),i.tokens.push(...r)}let b=i.push(`vmr_container_close`,`div`,-1);return _||(b.hidden=!0,b.map=[n,n]),i.line=_?g+1:g,!0},{alt:[`paragraph`,`reference`,`blockquote`,`list`]})}function qd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Jd(e,t=0){let n=!1,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t===`\\`)i++;else if(!r&&t===`'`)n=!n;else if(!n&&t===`"`)r=!r;else if(!n&&!r&&t===`>`)return i}return-1}function Yd(e){let t=[],n=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,r;for(;(r=n.exec(e))!==null;){let e=r[1];if(!e)continue;let n=r[2]||r[3]||r[4]||``;t.push([e,n])}return t}var Xd=/^[a-z][a-z0-9_-]*$/;function Zd(e){return Xd.test(String(e??``).trim().toLowerCase())}function Qd(e){let t=String(e??``).trim();if(!t)return``;if(!t.startsWith(`<`))return Zd(t)?t.toLowerCase():``;let n=1;for(;n<t.length&&/\s/.test(t[n]);)n++;if(t[n]===`/`)for(n++;n<t.length&&/\s/.test(t[n]);)n++;let r=n;for(;n<t.length&&/[\w-]/.test(t[n]);)n++;let i=t.slice(r,n).toLowerCase(),a=t[n]??``;return a&&!/[\s/>]/.test(a)?``:Zd(i)?i:``}function $d(e){if(!e||e.length===0)return[];let t=new Set,n=[];for(let r of e){let e=Qd(r);e&&!t.has(e)&&(t.add(e),n.push(e))}return n}function ef(...e){let t=new Set,n=[];for(let r of e)for(let e of $d(r))t.has(e)||(t.add(e),n.push(e));return n}function tf(e){let t=$d(e);return{key:t.join(`,`),tags:t}}function nf(e){return Qd(e)}function rf(e,t){let n=String(e??``),r=Qd(t);if(!r)return!1;let i=qd(r),a=n.match(new RegExp(String.raw`^\s*<\s*${i}(?:\s[^>]*)?(\s*\/)?>`,`i`));return a?a[1]?!0:new RegExp(String.raw`<\s*\/\s*${i}\s*>`,`i`).test(n):!1}function af(e,t){let n=Qd(t);return!!n&&!xd.has(n)&&!rf(e,n)}function of(e,t){let n=String(e??``),r=Qd(t);if(!r)return n;let i=qd(r),a=new RegExp(String.raw`^\s*<\s*${i}(?:\s[^>]*)?>\s*`,`i`),o=new RegExp(String.raw`\s*<\s*\/\s*${i}\s*>\s*$`,`i`);return n.replace(a,``).replace(o,``)}var sf=yd,cf=xd,lf=new Set(bd);lf.delete(`details`);var uf=/^<\s*(?:\/\s*)?([A-Z][\w-]*)/i,df=/^<\s*([A-Z][\w:-]*)(?=[\s/>]|$)/i;function ff(e){return(e.match(uf)?.[1]??``).toLowerCase()}function pf(e){return/^\s*<\s*\//.test(e)}function mf(e,t){return sf.has(t)||/\/\s*>\s*$/.test(e)}function hf(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(!i||i.type!==`html_inline`)continue;let a=String(i.content??``),o=ff(a);if(o===t){if(pf(a)){if(n===0)return r;n--}else mf(a,o)||n++}}return-1}function gf(e,t){let n=0;for(let r of e){if(!r||r.type!==`html_inline`)continue;let e=String(r.content??``),i=ff(e);i===t&&(pf(e)?n>0&&n--:mf(e,i)||n++)}return n}function _f(e,t,n=0){let r=new RegExp(String.raw`<\s*(\/?)\s*${qd(t)}(?=[\s>/])[^>]*>`,`gi`);r.lastIndex=Math.max(0,n);let i=0,a;for(;(a=r.exec(e))!==null;){let e=a[0]??``,t=!!a[1],n=!t&&/\/\s*>$/.test(e);if(t){if(i===0)return{start:a.index,end:a.index+e.length};i--}else n||i++}return null}function vf(e,t){let n=new RegExp(String.raw`<\s*(\/?)\s*${qd(t)}(?=[\s>/])[^>]*>`,`gi`),r=0,i;for(;(i=n.exec(e))!==null;){let e=i[0]??``,t=!!i[1],n=!t&&/\/\s*>$/.test(e);t?r>0&&r--:n||r++}return r}function yf(e){let t=e;return String(t.raw??t.content??t.markup??``)}function bf(e){let t=e;return t.meta||={},t.meta}function xf(e,t,n){let r=bf(e);r.markstreamCustomHtmlRaw=t,r.markstreamCustomHtmlInner=n}function Sf(e,t){if(!t.size)return;let n=Array.from(t,e=>new RegExp(String.raw`<\s*${qd(e)}(?=[\s>/])`,`i`)),r=[],i=!1,a=e=>e?n.some(t=>t.test(e)):!1,o=e=>{if(e&&r.length)for(let t of r)t.raw+=e,t.inner+=e},s=()=>{r.length&&i&&(o(`
|
|
94
|
+
`),i=!1)},c=e=>{o(e)},l=e=>{for(let t=0;t<r.length;t++)r[t].raw+=e,t<r.length-1&&(r[t].inner+=e);let t=r.pop();xf(t.token,t.raw,t.inner)},u=e=>{let t=r[r.length-1]?.tag;if(!t)return null;let n=new RegExp(String.raw`^\s*<\s*\/\s*${qd(t)}\s*>`,`i`);return e.match(n)?.[0]??null},d=e=>!!u(e),f=(e,n,i)=>{let a=i??(e.type===`html_inline`?ff(n):``);if(!(a&&t.has(a))){o(n);return}let s=pf(n),c=!s&&mf(n,a);if(s){if(!r.length||r[r.length-1].tag!==a){o(n);return}l(n)}else o(n),c?xf(e,n,``):r.push({tag:a,token:e,raw:n,inner:``})};for(let n of e)if(n.type===`inline`&&Array.isArray(n.children)){let e=String(n.content??``);if(d(e)?i=!1:s(),!r.length&&!a(e)){i=!1;continue}let o=0,l=!0;for(let i of n.children){let n=yf(i),a=i.type===`html_inline`?ff(n):``,s=a&&t.has(a),u=n;if(l&&e&&n&&(r.length||s)){let t=e.indexOf(n,o);if(t!==-1)c(e.slice(o,t)),u=e.slice(t,t+n.length),o=t+n.length;else{if(r.length&&!s)continue;l=!1}}f(i,u,a)}l&&e&&o<e.length&&r.length&&c(e.slice(o)),i=r.length>0}else if(r.length&&typeof n.content==`string`){let e=yf(n),t=n.type===`html_block`?u(e):null;if(t){l(`${i?`
|
|
95
|
+
`:``}${t}`),i=r.length>0;continue}if(!n.content)continue;s(),o(n.content),i=!0}for(let e of r)xf(e.token,e.raw,e.inner)}function Cf(e){return/^\s*<\s*[!?]/.test(e)}function wf(e){let t=new Set(cf);if(e&&Array.isArray(e))for(let n of e){let e=String(n??``).trim();if(!e)continue;let r=e.match(/^[<\s/]*([A-Z][\w-]*)/i);r&&t.add(r[1].toLowerCase())}return t}var Tf=/^([A-Z][\w-]*)/i,Ef=/[\t\n\f\r ]/,Df=/[A-Z_:]/i;function Of(e,t){for(let n of t)if(n.startsWith(e))return!0;return!1}function kf(e,t){let n=t;for(;n<e.length&&Ef.test(e[n]??``);)n++;return n}function Af(e,t,n){if(e[t]!==`<`)return null;let r=t+1,i=!1;if(e[r]===`/`&&(i=!0,r++,e[r]!==void 0&&Ef.test(e[r])))return null;let a=e.slice(r).match(Tf)?.[1]??``,o=a.toLowerCase();if(!o)return null;let s=r+a.length,c=e[s];if(!n.has(o))return c!==void 0||!Of(o,n)?null:{index:t,tag:o,closing:i,closeIndex:-1};if(c===void 0)return{index:t,tag:o,closing:i,closeIndex:-1};if(c!==`>`&&c!==`/`&&!Ef.test(c))return null;if(c===`/`){let n=e[s+1];if(n===void 0)return{index:t,tag:o,closing:i,closeIndex:-1};if(n!==`>`)return null}if(Ef.test(c)){let n=kf(e,s),r=e[n];if(r===void 0)return{index:t,tag:o,closing:i,closeIndex:-1};if(r===`/`){let r=e[n+1];if(r===void 0)return{index:t,tag:o,closing:i,closeIndex:-1};if(r!==`>`)return null}else if(r!==`>`&&!Df.test(r))return null}return{index:t,tag:o,closing:i,closeIndex:Jd(e,t)}}function jf(e,t){let n=null;for(let r=0;r<e.length;r++){if(e[r]!==`<`)continue;let i=Af(e,r,t);if(i&&i.closeIndex===-1){n={index:i.index,tag:i.tag,closing:i.closing};break}}let r=/<\/\s*$/.exec(e);if(r&&typeof r.index==`number`){let t=r.index;!e.slice(t).includes(`>`)&&(!n||t<n.index)&&(n={index:t,tag:``,closing:!0})}let i=/<\s*$/.exec(e);if(i&&typeof i.index==`number`){let t=i.index,r=e.slice(t);!r.startsWith(`</`)&&!r.includes(`>`)&&(!n||t<n.index)&&(n={index:t,tag:``,closing:!1})}return n}function Mf(e,t){let n=e;return Object.assign(Object.create(Object.getPrototypeOf(n)),n,{type:`text`,content:t,raw:t})}function Nf(e,t,n=!0){if(!e.length)return{children:e};let r=[],i=null,a=null;function o(e,t){return t?Mf(t,e):{type:`text`,content:e,raw:e}}function s(e,t){e&&r.push(o(e,t))}function c(){if(!i)return;let e=i.tokens;i=null,a=null;let t=e[e.length-1];if(e.length>1&&r.push(...e.slice(0,-1)),t?.type===`text`){let e=String(t.content??``);e&&u(e,t)}else t&&r.push(t)}function l(e,n){let i=0,a=0;for(;i<e.length;){let o=e.indexOf(`<`,i);if(o===-1)break;let c=Af(e,o,t);if(!c||c.closeIndex===-1){i=o+1;continue}let l=e.slice(o,c.closeIndex+1);t.has(c.tag)?(s(e.slice(a,o),n),r.push({type:`html_inline`,tag:``,content:l,raw:l}),i=o+l.length,a=i):i=o+l.length}a<e.length&&s(e.slice(a),n)}function u(e,r){if(!e)return;let s=n?jf(e,t):null;if(!s){l(e,r);return}let c=e.slice(0,s.index);c&&l(c,r),i={tag:s.tag,buffer:e.slice(s.index),closing:s.closing,tokens:[o(e.slice(s.index),r)],fromText:!0},a=i.buffer}for(let o of e)if(i){i.buffer+=yf(o),i.tokens.push(o),a=i.buffer;let e=Jd(i.buffer);if(e===-1)continue;let n=Af(i.buffer,0,t),s=i.fromText&&i.tokens.some(e=>e.type!==`text`);if(!n||n.closeIndex===-1||s){c();continue}let l=i.buffer.slice(0,e+1),d=i.buffer.slice(e+1);r.push({type:`html_inline`,tag:``,content:l,raw:l}),i=null,a=null,d&&u(d)}else{if(o.type===`html_inline`){let e=yf(o),r=(e.match(uf)?.[1]??``).toLowerCase();if(n&&r&&t.has(r)&&Jd(e)===-1){i={tag:r,buffer:e,closing:/^<\s*\//.test(e),tokens:[o],fromText:!1},a=i.buffer;continue}}if(o.type===`text`){let e=String(o.content??``);if(!e.includes(`<`)){r.push(o);continue}u(e,o)}else r.push(o)}return{children:r,pendingBuffer:a??void 0}}var Pf=[`a`,`span`,`strong`,`em`,`b`,`i`,`u`];function Ff(e,t={}){let n=new Set;if(t.customHtmlTags?.length)for(let e of t.customHtmlTags){let t=Qd(e);t&&n.add(t)}let r=e=>{let t=e,r=new Set(n),i=Array.isArray(t.env?.__markstreamCustomHtmlTags)?t.env.__markstreamCustomHtmlTags:[];for(let e of i){let t=Qd(String(e??``));t&&r.add(t)}let a=wf(Array.from(r)),o=new Set(Pf);for(let e of r)o.add(e);return{autoCloseInlineTagSet:o,commonHtmlTags:a,customTagSet:r,shouldMergeHtmlBlockTag:e=>r.has(e)||!a.has(e)||lf.has(e)}},i=e=>{if(e.type===`html_block`)return String(e.content??``);if(e.type!==`inline`||!Array.isArray(e.children)||e.children.length!==1)return``;let t=e.children[0];return t?.type===`html_block`?String(e.content??t.content??``):``},a=(e,t)=>{e.type=`html_block`,e.content=t,e.raw=t,e.children=[]},o=e=>e.replace(/^(?:\r?\n)+/,``),s=e=>/^(?: {4}|\t)/.test(e),c=e=>e.replace(/^(?: {4}|\t)/gm,``),l=(e,t)=>{let n=o(e);if(!/\S/.test(n))return[];if(s(n))return[{type:`code_block`,content:c(n),raw:n}];let r=n.replace(/^[\t ]+/,``);if(!r)return[];if(r.startsWith(`<`))return[{type:`html_block`,content:r}];let i={type:`inline`,tag:``,nesting:0,content:r,children:[{type:`text`,content:r,raw:r}]};return t===`paragraph`?[{type:`paragraph_open`,tag:`p`,nesting:1},i,{type:`paragraph_close`,tag:`p`,nesting:-1}]:t===`text`?[{type:`text`,content:r,raw:r}]:[i]},u=(e,t,n)=>e[t-1]?.type===`paragraph_open`&&e[t+1]?.type===`paragraph_close`?`inline`:n,d=(e,t)=>{let n=o(t);return!/\S/.test(n)||e.type!==`inline`||!Array.isArray(e.children)?!1:(e.content=`${String(e.content??``)}${n}`,e.children.push({type:`text`,content:n,raw:n}),!0)};e.core.ruler.after(`inline`,`fix_html_inline_streaming`,e=>{let t=e,n=t.tokens??[],{commonHtmlTags:i,customTagSet:a}=r(e),o=t.env?.__markstreamFinal!==!0;for(let e of n){let t=e;if(t.type!==`inline`||!Array.isArray(t.children))continue;let n=String(t.content??``),r=t.children.length?t.children:n.includes(`<`)?[{type:`text`,content:n,raw:n}]:null;if(r)try{let e=Nf(r,i,o);if(t.children=e.children,e.pendingBuffer){let r=n.lastIndexOf(e.pendingBuffer);if(r!==-1){let e=n.slice(0,r);t.content=e,typeof t.raw==`string`&&(t.raw=e)}}}catch(e){console.error(`[applyFixHtmlInlineTokens] failed to fix streaming html inline`,e)}}Sf(n,a)}),e.core.ruler.push(`fix_html_inline_tokens`,e=>{let t=e.tokens??[],{autoCloseInlineTagSet:n,customTagSet:o,shouldMergeHtmlBlockTag:s}=r(e),c=[];for(let e=0;e<t.length;e++){let n=t[e];if(c.length>0){let[r,i]=c[c.length-1];if(e!==i){if(n.type===`paragraph_open`||n.type===`paragraph_close`){t.splice(e,1),e--;continue}let a=String(n.content??n.raw??``);if(a){let n=t[i],o=`${String(n.content||``)}\n${a}`,s=Jd(o),f=s===-1?null:_f(o,r,s+1);if(f){let r=o.slice(0,f.end),i=o.slice(f.end);n.content=r,n.loading=!1,t.splice(e,1),c.pop();let a=d(n,i)?[]:l(i,u(t,e,`paragraph`));a.length&&t.splice(e,0,...a),e--;continue}n.content=o,n.loading!==!1&&(n.loading=!0)}t.splice(e,1),e--;continue}}let r=i(n);if(r){if(Cf(r))continue;let i=(r.match(/<\s*(?:\/\s*)?([^\s>/]+)/)?.[1]??``).toLowerCase(),o=/^\s*<\s*\//.test(r);if(!i||!s(i))continue;if(a(n,r),!o)i&&!RegExp(`^\\s*<\\s*${i}\\b[^>]*\\/\\s*>`,`i`).test(r)&&vf(r,i)>0&&c.push([i,e]);else if(c.length>0&&i&&c[c.length-1][0]===i){let[,n]=c[c.length-1],i=t[n];i.content=`${String(i.content||``)}\n${r}`,i.loading=!1,c.pop(),t.splice(e,1),e--}}else if(c.length>0){if(n.type===`paragraph_open`||n.type===`paragraph_close`){t.splice(e,1),e--;continue}let r=n.content||``,i=RegExp(`<\\s*\\/\\s*${c[c.length-1][0]}\\s*>`,`i`).test(r);if(r){let[,e]=c[c.length-1],n=t[e];n.content=`${n.content||``}\n${r}`,n.loading!==!1&&(n.loading=!i)}i&&c.pop(),t.splice(e,1),e--}else continue}if(o.size>0){let e=new Map,n=new Map,r=t=>{let n=e.get(t);return n||(n=RegExp(`<\\s*${t}\\b`,`i`),e.set(t,n)),n},i=e=>{let t=n.get(e);return t||(t=RegExp(`<\\s*\\/\\s*${e}\\s*>`,`i`),n.set(e,t)),t},a=[];for(let e=0;e<t.length;e++){let n=t[e],s=String(n.content??``);if(a.length>0){let r=a[a.length-1],o=t[r.index],c=n.type===`html_block`?i(r.tag).exec(s):null;if(c){let n=c.index+c[0].length,i=s.slice(0,n),f=s.slice(n);o.content=`${String(o.content??``)}\n${i}`,Array.isArray(o.children)&&o.children.push({type:`html_inline`,content:`</${r.tag}>`,raw:`</${r.tag}>`}),a.pop();let p=d(o,f)?[]:l(f,u(t,e,`paragraph`));p.length?t.splice(e,1,...p):(t.splice(e,1),e--);continue}if(n.type!==`inline`)continue;let f=Array.isArray(n.children)?n.children:[],p=hf(f,r.tag);if(p!==-1){let n=f.slice(0,p+1),r=f.slice(p+1),i=n.map(e=>String(e?.content??e?.raw??``)).join(``);if(o.content=`${String(o.content??``)}\n${i}`,Array.isArray(o.children)&&o.children.push(...n),r.length){let n=r.map(e=>String(e.content??e.raw??``)).join(``);if(n.trim()){let r=n.replace(/^\s+/,``);if(d(o,n))t.splice(e,1),e--;else if(r.startsWith(`<`))t.splice(e,1,{type:`html_block`,content:r});else{let r=l(n,u(t,e,`paragraph`));t.splice(e,1,...r)}}else t.splice(e,1),e--}else t.splice(e,1),e--;a.pop();continue}o.content=`${String(o.content??``)}\n${s}`,Array.isArray(o.children)&&o.children.push(...f),t.splice(e,1),e--;continue}if(n.type!==`inline`)continue;let c=Array.isArray(n.children)?n.children:[];for(let t of o)if((c.length?gf(c,t):r(t).test(s)&&!i(t).test(s)?1:0)>0){a.push({tag:t,index:e});break}}}{let e=0;for(let n=0;n<t.length;n++){let r=t[n];r.type===`paragraph_open`?e++:r.type===`paragraph_close`&&(e>0?e--:(t.splice(n,1),n--))}}for(let e=0;e<t.length;e++){let r=t[e];if(r.type===`html_block`){let n=(r.content?.match(/<([^\s>/]+)/)?.[1]??``).toLowerCase();if(n.startsWith(`!`)||n.startsWith(`?`)){r.loading=!1;continue}if(o.has(n)){let i=String(r.content??``),a=Jd(i),o=a===-1?null:_f(i,n,a+1);r.loading=o?!1:r.loading===void 0||r.loading;let s=o?.start??-1,c=o?o.end-o.start:0;if(s!==-1){let o=i.slice(0,s+c),u=``;a!==-1&&a<s&&(u=i.slice(a+1,s)),r.children=[{type:n,content:u,raw:o,attrs:[],tag:n,loading:!1}],r.content=o,r.raw=o;let d=l(i.slice(s+c)||``,`text`);d.length&&t.splice(e+1,0,...d)}else r.children=[{type:n,content:``,raw:i,attrs:[],tag:n,loading:!0}];continue}if([`br`,`hr`,`img`,`input`,`link`,`meta`,`div`,`p`,`ul`,`li`].includes(n))continue;r.type=`inline`;let i=[],a=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,s;for(;(s=a.exec(r.content||``))!==null;){let e=s[1],t=s[2]||s[3]||s[4]||``;i.push([e,t])}let c=String(r.content??``),u=RegExp(`<\\/\\s*${n}\\s*>`,`i`).exec(c),d=u?u.index:-1,f=u?u[0].length:0;if(d!==-1){let i=c.slice(0,d+f),a=(c.slice(d+f)||``).replace(/^\s+/,``);r.children=[{type:`html_block`,content:i,tag:n,loading:!1}],r.content=i,r.raw=i,a&&t.splice(e+1,0,a.startsWith(`<`)?{type:`html_block`,content:a}:{type:`text`,content:a,raw:a})}else r.children=[{type:`html_block`,content:r.content,tag:n,loading:!0}];continue}if(!r||r.type!==`inline`)continue;if(r.children.length===2&&r.children[0].type===`html_inline`){let e=(r.children[0].content?.match(/<([^\s>/]+)/)?.[1]??``).toLowerCase(),t=r.children[1],i=String(t?.content??``).match(/^<\s*\/\s*([^\s>]+)/)?.[1]?.toLowerCase()??``;if(t?.type===`html_inline`&&i===e)continue;n.has(e)?(r.children[0].loading=!0,r.children[0].tag=e,r.children.push({type:`html_inline`,tag:e,loading:!0,content:`</${e}>`})):r.children=[{type:`html_block`,loading:!0,tag:e,content:String(r.children[0]?.content??``)+String(r.children[1]?.content??``)}];continue}if(r.children.length===3&&r.children[0].type===`html_inline`&&r.children[2].type===`html_inline`){let e=(r.children[0].content?.match(/<([^\s>/]+)/)?.[1]??``).toLowerCase();if(n.has(e))continue;r.children=[{type:`html_block`,loading:!1,tag:e,content:r.children.map(e=>e.content).join(``)}];continue}if(!r.content?.startsWith(`<`)||r.children?.length!==1)continue;let i=String(r.content),a=r,s=a.children[0];if(s?.type!==`html_inline`){/^<\s*(?:\/\s*)?[A-Z][\w:-]*\s*$/i.test(i)&&(a.children.length=0);continue}let c=String(s.content??i).match(df)?.[1]?.toLowerCase()??``;c&&(/\/\s*>\s*$/.test(i)||sf.has(c)?a.children=[{type:`html_inline`,content:i}]:a.children.length=0)}})}function If(e){let t=e.trim();return!t||/^&[a-z0-9#]+;/i.test(t)?!1:!!(/^(?:const|let|var|function|class|import|export|if|for|while|return|await|async|yield|try|catch|throw|new|typeof|instanceof|switch|case|break|continue|def|ruby|perl|print|echo|true|false|null|undefined|NaN|Infinity|this)\b/.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[\d+\])*\s*\(/i.test(t)||/[a-z_$][\w$]*(?:\.[a-z_$][\w$]*|\['[^']*'\]|\["[^"]*"\]|\[[\d+\]])+/i.test(t)||/\w+\s*(?:===?|!==?|<=?|>=?|\+\+|--|&&|\|\||\?\.)/.test(t)||/^(?:!!|\+\+|--)\s*\w/.test(t)||/[\w$]+\s*(?:\+=|-=|\*=|\/=|%=|\*\*=|=)/.test(t)||/^(?:https?:\/\/|ftp:\/\/|file:\/\/|\/\/|www\.)/i.test(t)||/`[^`]*\$\{[^}]*\}[^`]*`/.test(t)||/<\/?[A-Z][a-zA-Z0-9]*/.test(t)||/<[a-z][a-z0-9]*\s[^>]+>/.test(t)||/^(["'`]).*\1\s*[;,]?$/.test(t)||/^\[[\s\S]*\]$/.test(t)||/^\{[\s\S]*\}$/.test(t)||/^\(\s*\)$/.test(t)||/[\w$]+(?:\s*[+\-*/%<>=!&|^~:]+\s*[\w$]+|\s*\.\s*[\w$]+)/.test(t)||/=>|->|::/.test(t)||/^@[\w.$]+$/.test(t)||/^(?:0x[0-9a-fA-F]+|0b[01]+|0o[0-7]+|\d+(?:\.\d*)?(?:px|em|rem|%|vh|vw|deg|s|ms)?)$/.test(t)||/^\$[\w$]+\s*[=:]/.test(t)||/\|\s*\w+|\w+\s*\|/.test(t)||/^(?:git|npm|yarn|pnpm|bun|pip|cargo|go|rust|python|node|java|mvn|gradle|docker|kubectl)\s+/.test(t)||/(?:console|window|document|Math|JSON|Date|Array|Object|String|Number|Boolean)\.[a-zA-Z]/.test(t)||/^(?:\/\/|#|\/\*|\*\/|<!--|-->)/.test(t)||/^(?:<<<|<<\s*['"]?\w+['"]?)/.test(t))}function Lf(e,t={}){t.enabled!==!1&&e.core.ruler.after(`inline`,`fix_indented_code_block`,e=>{let t=e.tokens??[];for(let e=0;e<t.length;e++){let n=t[e];if(n.type!==`code_block`)continue;let r=String(n.content??``).trim();if(!r)continue;let i=r.split(/\r?\n/).filter(e=>e.trim().length>0);if(i.length===1&&!If(i[0]??``)){let r=i[0]??``,a=n.level??0;t.splice(e,1,{type:`paragraph_open`,tag:`p`,nesting:1,level:a},{type:`inline`,tag:``,nesting:0,level:a,content:r,children:[{type:`text`,content:r,level:a+1,raw:r}],block:!0},{type:`paragraph_close`,tag:`p`,nesting:-1,level:a}),e+=2}}})}var Rf=Symbol(`markstream.parse-context`);function zf(e){return!!(e&&e[Rf]===!0)}function Bf(e={},t={}){return{...e,[Rf]:!0,customHtmlBlockCursor:0,disableStreamParse:!1,disableStructuredReuse:!1,insideStrong:!1,isFragment:!1,...t}}function Vf(e){return zf(e)?e:Bf(e)}function Hf(e,t=e,n={}){return Bf(t,{runtime:e.runtime,markdownIt:e.markdownIt,...n})}var Uf=/\.([a-z0-9]{1,15})$/i,Wf=/[_()[\]{}<>]/u,Gf=/^(?:https?:\/\/|ftp:\/\/|mailto:|www\.)/i,Kf=/[?#@]/u,qf=/[\\/]/u,Jf=/^[\p{L}\p{N}./\\-]+$/u,Yf=/^[A-Za-z0-9-]{1,63}$/u,Xf=/^xn--[a-z0-9-]{2,59}$/i,Zf=/^(?:[A-Z]{1,6}|\d{1,8})$/u,Qf=/^(?=.{1,12}$)[A-Z0-9]+(?:[-.][A-Z0-9]+)*$/iu,$f=/文件名\s*[::]?|附件\s*[::]?|路径\s*[::]?|路徑\s*[::]?|文件列表\s*[::]?|文档列表\s*[::]?|文檔列表\s*[::]?|\bfile\s*names?\b\s*[::]?|\battachments?\b\s*[::]?|\bpaths?\b\s*[::]?|\bfile\s+lists?\b\s*[::]?|\bdocument\s+lists?\b\s*[::]?/iu,ep=/文件名\s*[::]?|文件\s*[::]?|附件\s*[::]?|档案\s*[::]?|檔案\s*[::]?|文档\s*[::]?|文檔\s*[::]?|资料\s*[::]?|資料\s*[::]?|路径\s*[::]?|路徑\s*[::]?|\bfile\s*name\b\s*[::]?|\battachments?\b\s*[::]?|\bfiles?\b\s*[::]?|\bdocuments?\b\s*[::]?|\bdocs?\b\s*[::]?|\bpaths?\b\s*[::]?/iu,tp=/股票代码|股票代碼|证券代码|證券代碼|(?:代码|代碼|交易所|后缀|後綴|市场|市場)(?=$|[\s::/|,,、()()])|\btickers?\b|\bsymbols?\b|\bexchanges?\b/iu,np=2e3,rp=16384,ip=512*np,ap={},op=new Set([`ai`,`md`,`py`,`rs`,`sh`,`zip`]),sp=new Set([`as`,`bj`,`de`,`hk`,`l`,`ln`,`ny`,`pa`,`sh`,`ss`,`sz`,`t`,`us`]),cp=new Set([...sp,`at`,`ax`,`cn`,`co`,`it`,`jp`,`ks`,`mc`,`mx`,`nz`,`pl`,`sa`,`si`,`to`,`tw`]),lp=new Set([`com`,`dev`,`io`,`page`,`site`]),up=new Set([`app`,`apk`,`dmg`,`exe`,`ipa`,`lock`,`log`,`markdown`,`webmanifest`]),dp=new Set(`7z.ai.astro.avi.bash.bz2.c.cjs.cpp.cs.csv.doc.docx.fish.flac.gif.go.gz.h.hpp.html.java.jpeg.jpg.js.json.jsx.kt.md.mdx.mjs.mov.mp3.mp4.pdf.php.png.ppt.pptx.ps1.py.rar.rb.rs.sh.sql.svg.swift.svelte.tar.tgz.toml.ts.tsx.txt.vue.wav.webp.xls.xlsx.xml.yaml.yml.zip.zsh`.split(`.`)),fp=new Map,pp=0;function mp(e,t){if(!e||e.length>rp)return t;for(fp.has(e)||(pp+=e.length),fp.set(e,t);fp.size>np||pp>ip;){let e=fp.keys().next().value;if(!e)break;fp.delete(e),pp-=e.length}return t}function hp(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function gp(e,t){let n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return hp(n)?n:void 0}function _p(e,t){if(!hp(t))return e;let n=Vf(e),r=n.linkifyDemotionContext;return{...n,linkifyDemotionContext:{filename:r?.filename||t?.filename,explicitFilename:r?.explicitFilename||t?.explicitFilename,marketTicker:r?.marketTicker||t?.marketTicker}}}function vp(e){let t=kp(e);return hp(t)?t:void 0}function yp(e){return e.replace(/^[\s>*_`[\]((【《"'“‘]+/u,``).replace(/[\s<*_`\]))】》"'.。;;,,、::!?!?]+$/u,``)}function bp(e,t){if(!hp(t))return;let n=String(e??``).trim().split(/\s+/u).map(yp).filter(Boolean);if(n.length===0)return;let r={};return t?.filename&&n.every(e=>Pp(e,{filename:!0,explicitFilename:t.explicitFilename}))&&(r.filename=!0),t?.explicitFilename&&r.filename&&(r.explicitFilename=!0),t?.marketTicker&&n.every(e=>Pp(e,{marketTicker:!0}))&&(r.marketTicker=!0),hp(r)?r:void 0}function xp(e,t=!1){let n=Vf(e).linkifyDemotionSeedContext;return{options(r){return t||r==null?_p(e,n):_p(e,gp(vp(r),bp(r,n)))},remember(e){let r=vp(e);n=t?gp(n,r):gp(r,bp(e,n))},reset(){n=void 0},snapshot(){return n}}}function Sp(e){return Yf.test(e)&&!e.startsWith(`-`)&&!e.endsWith(`-`)}function Cp(e){let t=e.split(`.`);if(t.length<2)return!1;let n=t[t.length-1]?.toLowerCase()??``;return Sp(n)||Xf.test(n)?t.every(Sp):!1}function wp(e){return Array.from(e).some(e=>e.charCodeAt(0)>127)}function Tp(e){return e.replace(/^[a-z][a-z0-9+.-]*:\/\//i,``).split(/[/?#]/,1)[0]??``}function Ep(e){return e.split(`.`).some(e=>e.toLowerCase().startsWith(`xn--`))}function Dp(e,t,n){let r=Tp(t);return wp(e)&&Ep(r)&&String(n??``).toLowerCase().includes(r.toLowerCase())}function Op(e){if(!e)return!1;if(e.includes(`文件`)||e.includes(`附件`)||e.includes(`路径`)||e.includes(`路徑`)||e.includes(`文档`)||e.includes(`文檔`)||e.includes(`档案`)||e.includes(`檔案`)||e.includes(`资料`)||e.includes(`資料`)||e.includes(`股票`)||e.includes(`证券`)||e.includes(`證券`)||e.includes(`代码`)||e.includes(`代碼`)||e.includes(`交易所`)||e.includes(`后缀`)||e.includes(`後綴`)||e.includes(`市场`)||e.includes(`市場`))return!0;let t=e.toLowerCase();return t.includes(`file`)||t.includes(`attachment`)||t.includes(`document`)||t.includes(`doc`)||t.includes(`path`)||t.includes(`ticker`)||t.includes(`symbol`)||t.includes(`exchange`)}function kp(e){let t=String(e??``);return fp.get(t)||(Op(t)?mp(t,{explicitFilename:$f.test(t),filename:ep.test(t),marketTicker:tp.test(t)}):mp(t,ap))}function Ap(e){return Cp(e.split(/[\\/]/)[0]??``)}function jp(e){let t=e.replace(/[^a-z]/gi,``);return t.length>=2&&t===t.toUpperCase()}function Mp(e){if(Wf.test(e)||!Jf.test(e))return!0;if(qf.test(e))return!Ap(e);let t=e.replace(Uf,``);return wp(t)?!0:t.split(`.`).filter(Boolean).some(jp)}function Np(e,t,n){if(!(n?cp:sp).has(t))return!1;let r=e.slice(0,-(t.length+1));return r===``?e.startsWith(`.`):(n?Qf:Zf).test(r)}function Pp(e,t={}){if(!e||Gf.test(e)||Kf.test(e))return!1;let n=e.match(Uf);if(!n)return!1;let r=String(n[1]??``).toLowerCase();return Np(e,r,t.marketTicker===!0)?!0:dp.has(r)?!op.has(r)||t.filename?!0:Mp(e):!!(t.explicitFilename&&lp.has(r)||t.filename&&up.has(r))}var Fp=new WeakMap,Ip=new WeakSet;function Lp(e,t){return Fp.set(e,t),e}function Rp(e){return Fp.get(e)}function zp(e){if(!e)return``;let t=Rp(e);if(t===`linkify`||t===`autolink`)return t;let n=typeof e.markup==`string`?e.markup:``;return n===`linkify`||n===`autolink`?n:``}function Bp(e,t){if(!e||!t)return;let n=Rp(e);n&&Fp.set(t,n)}function Vp(e){Ip.add(e)}function Hp(e){return e===void 0||Ip.has(e)}var Up=[`!`];function Wp(e){return e===`linkify`||e===`autolink`?e:`recovery`}function Gp(e){return{type:`text`,content:e,raw:e}}function Kp(e,t){t===1?e.push({type:`em_open`,tag:`em`,nesting:1}):t===2?e.push({type:`strong_open`,tag:`strong`,nesting:1}):t===3&&(e.push({type:`strong_open`,tag:`strong`,nesting:1}),e.push({type:`em_open`,tag:`em`,nesting:1}))}function qp(e,t){t===1?e.push({type:`em_close`,tag:`em`,nesting:-1}):t===2?e.push({type:`strong_close`,tag:`strong`,nesting:-1}):t===3&&(e.push({type:`em_close`,tag:`em`,nesting:-1}),e.push({type:`strong_close`,tag:`strong`,nesting:-1}))}function Jp(e,t,n,r=`recovery`){let i=``;if(t.includes(`"`)){let e=t.split(`"`);t=e[0].trim(),i=e[1].trim()}return Lp({type:`link`,loading:n,href:t,title:i,text:e,children:[{type:`text`,content:e,raw:e}],raw:String(`[${e}](${t})`)},r)}function Yp(e,t){if(e&&t&&(e.href=String(e.href??``)+t,e.text=String(e.text??``)+t,e.raw=String(`[${e.text}](${e.href})`),Array.isArray(e.children)&&e.children.length)){let n=e.children[e.children.length-1];n?.type===`text`?(n.content=String(n.content??``)+t,n.raw=String(n.raw??``)+t):e.children.push(Gp(t))}}function Xp(e,t){let n=-1;for(let r of t){let t=e.indexOf(r);t!==-1&&(n===-1||t<n)&&(n=t)}return n}function Zp(e){let t=e.attrs?.find(e=>e?.[0]===`href`)?.[1];return typeof t==`string`?t:``}function Qp(e,t){if(!e)return;e.attrs=Array.isArray(e.attrs)?e.attrs:[];let n=e.attrs.findIndex(e=>e?.[0]===`href`);n>=0?e.attrs[n][1]=t:e.attrs.push([`href`,t])}function $p(e,t,n){let r=``;for(let i=t+1;i<n;i++){let t=e[i];if(t?.type!==`text`||typeof t.content!=`string`)return null;r+=t.content}return r||null}function em(e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r===`(`)t++;else if(r===`)`){if(t===0)return n;t--}}return-1}function tm(e){e.core.ruler.after(`inline`,`fix_link_tokens`,e=>{let t=e.tokens??[];for(let e=0;e<t.length;e++){let n=t[e];if(n&&n.type===`inline`&&Array.isArray(n.children))try{n.children=nm(n.children,typeof n.content==`string`?n.content:void 0)}catch(e){console.error(`[applyFixLinkTokens] failed to fix inline children`,e)}}})}function nm(e,t){if(e.length<3)return e;let n=e.some(e=>e.type===`code_inline`),r=new Map,i=0;for(let t=0;t<e.length;t++){let n=e[t];if(n.type===`link_open`){let a=-1;for(let n=t+1;n<e.length;n++)if(e[n]?.type===`link_close`){a=n;break}if(a!==-1&&n.markup===`linkify`){r.set(n,i);let o=$p(e,t,a),s=i>0&&o?em(o):-1;if(s!==-1&&o)for(let e of o.slice(s))e===`(`?i++:e===`)`&&i>0&&i--}a!==-1&&(t=a)}else if(n.type===`text`&&typeof n.content==`string`)for(let e of n.content)e===`(`?i++:e===`)`&&i>0&&i--}let a=kp(t);for(let i=0;i<=e.length-1;i++){i<0&&(i=0);let o=e[i];if(!o)break;if(o.type===`link_open`&&(o.markup===`linkify`||o.markup===`autolink`)){let s=-1;for(let t=i+1;t<e.length;t++)if(e[t]?.type===`link_close`){s=t;break}if(s!==-1){let c=$p(e,i,s),l=Zp(o);if(!n&&o.markup===`linkify`&&c&&!Dp(c,l,t)&&Pp(c,a)){e.splice(i,s-i+1,Gp(c));continue}let u=Xp(c??``,Up);if(o.markup===`linkify`&&c?.includes(`)`)&&(r.get(o)??0)>0){let e=em(c);e!==-1&&(u===-1||e<u)&&(u=e)}let d=Xp(l,Up),f=u;for(let t=i+1;t<s;t++){let n=e[t];if(n?.type!==`text`||typeof n.content!=`string`)continue;if(f>=n.content.length){f-=n.content.length;continue}if(f<0)break;let r=n.content[f],i=n.content.slice(0,f),a=n.content.slice(f);for(let n=t+1;n<s;n++){let t=e[n];t?.type===`text`&&typeof t.content==`string`&&(a+=t.content)}n.content=i,n.raw=i;let c=s-(t+1);c>0&&(e.splice(t+1,c),s=t+1);let u=l;if(r===`!`&&d!==-1)u=l.slice(0,d);else if(a){let e=encodeURI(a);if(e&&l.endsWith(e))u=l.slice(0,l.length-e.length);else{let e=r?encodeURI(r):``,t=e?l.indexOf(e):-1;t!==-1&&(u=l.slice(0,t))}}u!==l&&Qp(o,u),a&&e.splice(s+1,0,Gp(a));break}}}if(!n){if(o?.type===`em_open`&&e[i-1]?.type===`text`&&e[i-1].content?.endsWith(`*`)){let t=e[i-1].content?.replace(/(\*+)$/,``)||``;e[i-1].content=t,o.type=`strong_open`,o.tag=`strong`,o.markup=`**`;for(let t=i+1;t<e.length;t++)if(e[t]?.type===`em_close`){e[t].type=`strong_close`,e[t].tag=`strong`,e[t].markup=`**`;break}}else if(o?.type===`text`&&o.content?.endsWith(`(`)&&e[i+1]?.type===`link_open`){let t=o.content.match(/\[([^\]]+)\]/);if(t){let n=o.content.slice(0,t.index),r=n.match(/(\*+)$/),a=e[i+1]?.markup,s=(a===`linkify`||a===`autolink`)&&(t.index??0)+t[0].length===o.content.length-1?`explicit`:Wp(a),c=[];if(r){n=n.slice(0,r.index),n&&c.push(Gp(n));let a=t[1],o=r[1].length;Kp(c,o);let l=e[i+2]?.content||``;if(e[i+4]?.type===`text`&&!e[i+4].content?.startsWith(`)`)&&(l+=e[i+4]?.content||``,e[i+4].content=``),c.push(Jp(a,l,!e[i+4]?.content?.startsWith(`)`),s)),qp(c,o),e[i+4]?.type===`text`){let t=e[i+4].content?.replace(/^\)\**/,``);t&&c.push(Gp(t)),e.splice(i,5,...c)}else e.splice(i,4,...c)}else{n&&c.push(Gp(n));let r=t[1],a=r.match(/^\*+/);if(a){let t=a[0].length;r=r.replace(/^\*+/,``).replace(/\*+$/,``);let n=e[i+2]?.content||``;if(e[i+4]?.type===`text`&&!e[i+4].content?.startsWith(`)`)&&(n+=e[i+4]?.content||``,e[i+4].content=``),Kp(c,t),c.push(Jp(r,n,!e[i+4]?.content?.startsWith(`)`),s)),qp(c,t),e[i+4]?.type===`text`){let t=e[i+4].content?.replace(/^\)/,``);t&&c.push(Gp(t)),e.splice(i,5,...c)}else e.splice(i,4,...c);i===0?i=c.length-1:i-=c.length+1;continue}let o=e[i+2]?.content||``;if(e[i+4]?.type===`text`&&!e[i+4].content?.startsWith(`)`)&&(o+=e[i+4]?.content||``,e[i+4].content=``),c.push(Jp(r,o,!e[i+4]?.content?.startsWith(`)`),s)),e[i+4]?.type===`text`){let t=e[i+4].content?.replace(/^\)/,``);t&&c.push(Gp(t)),e.splice(i,5,...c)}else e.splice(i,4,...c)}i-=c.length+1;continue}}else if(o.type===`link_open`&&o.markup===`linkify`&&e[i-1]?.type===`text`&&e[i-1].content?.endsWith(`(`)){if(e[i-2]?.type===`link_close`){let t=[],n=e[i-3].content||``,r=o.attrs?.find(e=>e[0]===`href`)?.[1]||``;if(e[i+3]?.type===`text`){let a=(e[i+3]?.content??``).indexOf(`)`),o=a===-1;a===-1&&(r+=e[i+3]?.content?.slice(0,a)||``,e[i+3].content=``),t.push(Jp(n,r,o,`linkify`));let s=e[i+3].content?.replace(/^\)\**/,``);s&&t.push(Gp(s)),e.splice(i-4,8,...t)}else t.push(Lp({type:`link`,loading:!0,href:r,title:``,text:n,children:[{type:`text`,content:r,raw:r}],raw:String(`[${n}](${r})`)},`linkify`)),e.splice(i-4,7,...t);continue}if(e[i-1].content===`](`&&e[i-3]?.type===`text`&&e[i-3].content?.endsWith(`)`)){if(e[i-2]?.type===`strong_open`){let[t,n]=e[i-3].content?.split(`[**`)||[];e[i+1].content=n||``,e[i-3].content=t||``,e[i-1].content=``}else if(e[i-2]?.type===`em_open`){let[t,n]=e[i-3].content?.split(`[*`)||[];e[i+1].content=n||``,e[i-3].content=t||``,e[i-1].content=``}else{let[t,n]=e[i-3].content?.split(`[`)||[];e[i+1].content=n||``,e[i-3].content=t||``,e[i-1].content=``}}}if(o.type===`link_close`&&o.nesting===-1&&e[i-2]?.type===`link_open`&&e[i+1]?.type===`text`&&e[i-1]?.type===`text`){let t=e[i-1].content||``,n=e[i-2].attrs||[],r=n.find(e=>e[0]===`href`)?.[1]||``,a=n.find(e=>e[0]===`title`)?.[1]||``,s=3,c=2,l=(e[i-3]?.content||``).match(/^(\*+)$/),u=[];if(l){c+=1;let e=l[1].length;Kp(u,e)}if(o.markup!==`linkify`&&e[i+1].type===`text`&&e[i+1]?.content?.startsWith(`](`)){s+=1;for(let t=i+1;t<e.length;t++){let n=l?l[1].length:e[i-3].markup.length,r=e[t];if(n===1&&r.type===`em_close`||n===2&&r.type===`strong_close`||n===3&&(r.type===`em_close`||r.type===`strong_close`))break;s+=1}}let d=Lp({type:`link`,loading:!1,href:r,title:a,text:t,children:[{type:`text`,content:t,raw:t}],raw:String(`[${t}](${r})`)},o.markup?Wp(o.markup):`explicit`);if(u.push(d),l){let e=l[1].length;qp(u,e)}e.splice(i-c,s,...u),i-=u.length+1}else if(o.content?.startsWith(`](`)&&e[i-1].markup?.includes(`*`)&&e[i-4]?.type===`text`&&e[i-4].content?.endsWith(`[`)){let t=e[i-1].markup.length,n=[],r=e[i-4].content.slice(0,e[i-4].content.length-t);r&&n.push(Gp(r)),Kp(n,t);let a=e[i-2].content||``,s=o.content.slice(2),c=!0;if(e[i+1]?.type===`text`){let t=(e[i+1]?.content??``).indexOf(`)`);c=t===-1,t===-1&&(s+=e[i+1]?.content?.slice(0,t)||``,e[i+1].content=``)}if(n.push(Jp(a,s,c)),qp(n,t),e[i+1]?.type===`text`){let t=e[i+1].content?.replace(/^\)\**/,``);t&&n.push(Gp(t)),e.splice(i-4,8,...n)}else e[i+1]?.type===`link_open`?e.splice(i-4,10,...n):e.splice(i-4,7,...n);i-=n.length+1}else if(o.content?.startsWith(`](`)&&e[i-1].type===`strong_close`&&e[i-4]?.type===`text`&&e[i-4]?.content?.includes(`**[`)){let t=[],n=e[i-4].content.split(`**[`)[0];n&&t.push(Gp(n)),Kp(t,2);let r=e[i-2].content||``,a=o.content.slice(2),s=!0;if(e[i+1]?.type===`text`){let t=(e[i+1]?.content??``).indexOf(`)`);s=t===-1,t===-1&&(a+=e[i+1]?.content?.slice(0,t)||``,e[i+1].content=``)}if(t.push(Jp(r,a,s)),qp(t,2),e[i+1]?.type===`text`){let n=e[i+1].content?.replace(/^\)\**/,``);n&&t.push(Gp(n)),e.splice(i-4,8,...t)}else e[i+1]?.type===`link_open`?e.splice(i-4,10,...t):e.splice(i-4,7,...t);i-=t.length+1}else{if(o.type===`strong_close`&&e[i+1]?.type===`text`&&e[i+1].content?.includes(`](`)&&e[i-1].type===`text`&&/\[.*$/.test(e[i-1].content||``)){let t=[],[n,r]=e[i-1].content?.split(`[`)||[``,``];n&&t.push(Gp(n)),Kp(t,2);let[a,s]=e[i+1].content.split(`](`);a=r+a;let c=4;if(e[i+2]?.type===`link_open`){let t=e[i+2].attrs?.find(e=>e[0]===`href`)?.[1];e[i+5]?.type===`text`&&e[i+5].content===`.`?(s=(t||s)+e[i+5].content,e[i+5].content=``):s=t||s,c+=3}let l=!0;if(o.nesting===-1&&(a=a.replace(/\*+$/,``)),e[i+2]?.type===`text`){let t=(e[i+2]?.content??``).indexOf(`)`);l=t===-1,t===-1&&(s+=e[i+2]?.content?.slice(0,t)||``,e[i+2].content=``)}t.push(Jp(a,s,l)),qp(t,2),e.splice(i-2,c,...t)}if(o.type===`text`&&/\*+\[[^\]]*$/.test(o.content||``)&&e[i+1]?.type===`strong_open`&&e[i+2]?.type===`text`&&e[i+2].content===`](`&&e[i+3]?.type===`link_open`&&e[i+5]?.type===`link_close`&&e[i+6]?.type===`text`&&e[i+6].content===`)`&&e[i+7]?.type===`strong_close`){let t=(o.content||``).match(/^(\*+)\[(.*)$/);if(t){let n=(t[2]||``)+t[1],r=e[i+3]?.attrs?.find(e=>e[0]===`href`)?.[1]||``;!r&&e[i+4]?.type===`text`&&(r=e[i+4].content||``);let a=[];Kp(a,2),a.push(Jp(n,r,!1)),qp(a,2),e.splice(i,9,...a),i-=a.length-1;continue}}}}}if(n)return e;for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(n?.type!==`link`||r?.type!==`text`||typeof r.content!=`string`||!r.content.startsWith(`!`))continue;let i=String(n.href??``);if(String(n.text??``)!==i||!i.endsWith(`=`)&&!i.endsWith(`#`))continue;Yp(n,`!`);let a=r.content.slice(1);a?(r.content=a,r.raw=a):e.splice(t+1,1)}return e}function rm(e){e.core.ruler.after(`inline`,`fix_list_item_tokens`,e=>{let t=e.tokens??[];for(let e=0;e<t.length;e++){let n=t[e];if(n&&n.type===`inline`&&Array.isArray(n.children))try{n.children=im(n.children)}catch(e){console.error(`[applyFixListItem] failed to fix inline children`,e)}}})}function im(e){let t=e[e.length-1],n=String(t?.content??``);return t?.type===`text`&&/^\s*\d+\.\s*$/.test(n)&&e[e.length-2]?.tag===`br`&&e.splice(e.length-1,1),e}function am(e){e.core.ruler.after(`inline`,`fix_strong_tokens`,e=>{let t=e.tokens??[];for(let e=0;e<t.length;e++){let n=t[e];if(n&&n.type===`inline`&&Array.isArray(n.children))try{n.children=om(n.children)}catch(e){console.error(`[applyFixStrongTokens] failed to fix inline children`,e)}}})}function om(e){let t=0,n=new Set,r=new Set,i=0;for(let a=0;a<e.length;a++){let o=e[a],s=o.type;if(s===`strong_open`){t++;let r=String(o.markup??``),i=a-1;for(;i>=0&&e[i].type===`text`&&e[i].content===``;)i--;let s=e[i],c=a+1;for(;c<e.length&&e[c].type===`text`&&e[c].content===``;)c++;let l=e[c];r===`__`&&(s?.content?.endsWith(`_`)||l?.content?.startsWith(`_`))&&(o.type=`text`,o.tag=``,o.content=r,o.raw=r,o.markup=``,o.attrs=null,o.map=null,o.info=``,o.meta=null,n.add(t))}else if(s===`strong_close`)n.has(t)&&o.markup===`__`&&(o.type=`text`,o.content=o.markup,o.raw=String(o.markup??``),o.tag=``,o.markup=``,o.attrs=null,o.map=null,o.info=``,o.meta=null),t--,t<0&&(t=0);else if(s===`em_open`){i++;let t=String(o.markup??``),n=a-1;for(;n>=0&&e[n].type===`text`&&e[n].content===``;)n--;let s=e[n],c=a+1;for(;c<e.length&&e[c].type===`text`&&e[c].content===``;)c++;let l=e[c];t===`_`&&(s?.content?.endsWith(`_`)||l?.content?.startsWith(`_`))&&(o.type=`text`,o.tag=``,o.content=t,o.raw=t,o.markup=``,o.attrs=null,o.map=null,o.info=``,o.meta=null,r.add(i))}else s===`em_close`&&(r.has(i)&&o.markup===`_`&&(o.type=`text`,o.content=o.markup,o.raw=String(o.markup??``),o.tag=``,o.markup=``,o.attrs=null,o.map=null,o.info=``,o.meta=null),i--,i<0&&(i=0))}if(e.length<5)return e;let a=e.length-4,o=e[a],s=[...e],c=e[a+1],l=String(o.content??``);if(o.type===`link_open`&&e[a-1]?.type===`em_open`&&e[a-2]?.type===`text`&&e[a-2].content?.endsWith(`*`)){let t=String(e[a-2].content??``).slice(0,-1),n=[{type:`strong_open`,tag:`strong`,attrs:null,map:null,children:null,content:``,markup:`**`,info:``,meta:null,raw:``},e[a],e[a+1],e[a+2],{type:`strong_close`,tag:`strong`,attrs:null,map:null,children:null,content:``,markup:`**`,info:``,meta:null,raw:``}];t&&n.unshift({type:`text`,content:t,raw:t}),s.splice(a-2,6,...n)}else if(o.type===`text`&&l.endsWith(`*`)&&c.type===`em_open`){let t=e[a+2],n=t?.type===`text`?4:3,r=[{type:`strong_open`,tag:`strong`,attrs:null,map:null,children:null,content:``,markup:`**`,info:``,meta:null,raw:``},{type:`text`,content:t?.type===`text`?String(t.content??``):``,raw:t?.type===`text`?String(t.content??``):``},{type:`strong_close`,tag:`strong`,attrs:null,map:null,children:null,content:``,markup:`**`,info:``,meta:null,raw:``}],i=l.slice(0,-1);i&&r.unshift({type:`text`,content:i,raw:i}),s.splice(a,n,...r)}return s=sm(s),s}function sm(e){if(e.length<7)return e;let t=[];for(let n=0;n<e.length;n++){let r=e[n],i=e[n+1],a=e[n+2],o=e[n+3],s=e[n+4],c=e[n+5],l=e[n+6];if(r?.type===`strong_open`&&i?.type===`text`&&a?.type===`strong_close`&&o?.type===`strong_open`&&s?.type===`math_inline`&&c?.type===`strong_close`&&l?.type===`text`){let e=String(l.content??``),a=e.indexOf(`**`);if(a!==-1){let o=e.slice(0,a),u=e.slice(a+2);t.push(r),t.push(i),t.push(s),o&&t.push({...l,type:`text`,content:o,raw:o}),t.push(c),u&&t.push({...l,type:`text`,content:u,raw:u}),n+=6;continue}}if(r?.type===`strong_open`&&i?.type===`text`&&a?.type===`strong_close`&&o?.type===`strong_open`&&s?.type===`math_inline`&&c?.type===`strong_close`){let a=cm(e,n+6);if(a){t.push(r),t.push(i),t.push(s);for(let r=n+6;r<a.index;r++)t.push(e[r]);a.beforeClose&&t.push({...e[a.index],type:`text`,content:a.beforeClose,raw:a.beforeClose}),t.push(c),a.afterClose&&t.push({...e[a.index],type:`text`,content:a.afterClose,raw:a.afterClose}),n=a.index;continue}}t.push(r)}return t}function cm(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.type===`strong_open`)return null;if(t?.type!==`text`)continue;let r=String(t.content??``),i=r.indexOf(`**`);if(i!==-1)return{index:n,beforeClose:r.slice(0,i),afterClose:r.slice(i+2)}}return null}function lm(e){e.core.ruler.after(`block`,`fix_table_tokens`,e=>{let t=e;try{let e=xm(t.tokens??[],!!t.env?.__markstreamFinal,t.src??``);Array.isArray(e)&&(t.tokens=e)}catch(e){console.error(`[applyFixTableTokens] failed to fix table tokens`,e)}})}function um(e){let t=Array.isArray(e)?[...e]:null,n=t?[t[0],t[0]+1]:null;return[{type:`table_open`,tag:`table`,attrs:null,map:t,children:null,content:``,markup:``,info:``,level:0,nesting:1,block:!0,loading:!0,meta:null},{type:`thead_open`,tag:`thead`,attrs:null,block:!0,level:1,map:n,nesting:1,children:null},{type:`tr_open`,tag:`tr`,attrs:null,block:!0,level:2,map:n,nesting:1,children:null}]}function dm(){return[{type:`tr_close`,tag:`tr`,attrs:null,block:!0,level:2,map:null,nesting:-1,children:null},{type:`thead_close`,tag:`thead`,attrs:null,block:!0,level:1,map:null,nesting:-1,children:null},{type:`table_close`,tag:`table`,attrs:null,map:null,children:null,content:``,markup:``,info:``,level:0,nesting:-1,block:!0,meta:null}]}function fm(e){return[{type:`th_open`,tag:`th`,attrs:null,block:!0,level:3,map:null,nesting:1,children:null},{type:`inline`,tag:``,children:null,content:e,level:4,attrs:null,map:null,nesting:0,block:!0},{type:`th_close`,tag:`th`,attrs:null,block:!0,level:3,map:null,nesting:-1,children:null}]}function pm(e,t){if(!e.startsWith(`|`)||e.includes(`
|
|
96
|
+
`)||t&&!e.endsWith(`|`))return null;let n=e.slice(1).split(`|`);return n.at(-1)===``&&n.pop(),n.length>0&&n.every(e=>e.trim().length>0)?n:null}function mm(e){return pm(e,!0)!==null}function hm(e){return/^:?-+:?$/.test(e.trim())}function gm(e){if(!e.startsWith(`|`))return!1;let t=e.slice(1).split(`|`);return t.at(-1)===``&&t.pop(),t.length>0&&t.every(hm)}function _m(e){return/^(?:[::]-*|:?-+:?)?$/.test(e.trim())}function vm(e){if(e===``)return!0;if(!e.startsWith(`|`))return!1;let t=e.slice(1).split(`|`),n=t.at(-1)??``;return t.slice(0,-1).every(hm)&&_m(n)}function ym(e){return e===`|`||e===`|:`}function bm(e){let t=pm(e,!0);return t!==null&&t.every(e=>!e.includes(`:`))}function xm(e,t=!1,n=``){if(e.length<3)return e;let r=e.length-2,i=e[r];if(i.type!==`inline`)return e;let a=e[r-1]?.map,o=String(i.content??``),s=o.split(`
|
|
97
|
+
`)[0]??``,[c=``,l=``,...u]=o.split(`
|
|
98
|
+
`),d=!t&&!o.includes(`
|
|
99
|
+
`)&&/\r?\n$/.test(n)&&mm(o),f=null;if(!t&&(o.includes(`
|
|
100
|
+
`)&&u.length===0&&mm(c)&&vm(l)||d)){let t=s.slice(1,-1).split(`|`).map(e=>e.trim()).flatMap(e=>fm(e)),n=[...um(a),...t,...dm()];f=[...e],f.splice(r-1,3,...n)}else if(o.includes(`
|
|
101
|
+
`)&&u.length===0&&mm(c)&&gm(l)){let t=s.slice(1,-1).split(`|`).map(e=>e.trim()).flatMap(e=>fm(e)),n=[...um(a),...t,...dm()];f=[...e],f.splice(r-1,3,...n)}else if(o.includes(`
|
|
102
|
+
`)&&u.length===0&&bm(c)&&ym(l))return i.content=o.slice(0,-2),i.children.splice(2,1),e;return f??e}function Sm(e,t,n,r){let i=e.length;if(n===`$$`&&r===`$$`){let n=t;for(;n<i-1;){if(e[n]===`$`&&e[n+1]===`$`){let t=n-1,r=0;for(;t>=0&&e[t]===`\\`;)r++,t--;if(r%2==0)return n}n++}return-1}let a=n[n.length-1],o=r,s=0,c=t;for(;c<i;){if(e.slice(c,c+o.length)===o){let t=c-1,n=0;for(;t>=0&&e[t]===`\\`;)n++,t--;if(n%2==0){if(s===0)return c;s--,c+=o.length;continue}}let t=e[c];t===`\\`?c+=2:(t===a?s++:t===o[o.length-1]&&s>0&&s--,c++)}return-1}var Cm=Sm,wm=[`boldsymbol`,`mathbb`,`mathcal`,`mathfrak`,`mathrm`,`mathit`,`mathsf`,`vec`,`hat`,`bar`,`tilde`,`overline`,`underline`,`mathscr`,`mathnormal`,`operatorname`,`mathbf*`].map(e=>e.replace(/[.*+?^${}()|[\\]"\]/g,`\\$&`)).join(`|`),Tm=/\\[a-z]+/i,Em=`(?:\\\\|\\u0008)`,Dm=new RegExp(String.raw`${Em}(?:${wm})\s*\{[^}]+\}`,`i`),Om=new RegExp(String.raw`(?:${Em})?(?:${wm})\s*\{`,`i`),km=/\\(?:text|frac|left|right|times)/,Am=/(?:^|[^+])\+(?!\+)|[=\-*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/,jm=/\b[A-Z]{2,}-[A-Z]{2,}\b/i,Mm=/[A-Z]+\s*\([^)]+\)/i,Nm=/^\(\s*[a-z](?:\s*,\s*[a-z])+\s*\)$/i,Pm=/\b(?:sin|cos|tan|log|ln|exp|sqrt|frac|sum|lim|int|prod)\b/,Fm=/\b\d{4}\/\d{1,2}\/\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2})?)?\b/,Im={"\b":`\\b`,"\v":`\\v`,"\f":`\\f`};function Lm(e){let t=``;for(let n of e)t+=Im[n]??n;return t}function Rm(e){if(!e)return!1;let t=Lm(e),n=t.trim();if(Fm.test(n)||n.includes(`**`))return!1;if(n.length>2e3)return!0;let r=Tm.test(t),i=Dm.test(t),a=Om.test(t),o=km.test(t),s=/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)_(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t)||/(?:^|[^\w\\])(?:[A-Z]|\\[A-Z]+)\^(?:\{[^}]+\}|[A-Z0-9\\])/i.test(t),c=Am.test(t)&&!jm.test(t),l=Mm.test(t),u=Nm.test(n),d=Pm.test(t),f=/^\([a-z]\)$/i.test(n)||/^(?:[a-z]|pi)$/i.test(n),p=/^(?:[A-Z][a-z]?(?:_\{?\d+\}?|\^\{?\d+\}?)?)+$/.test(n);return r||i||a||o||s||c||l||u||d||f||p}var zm=`__markstreamMathPluginApplied`,Bm=80,Vm=2e4,Hm=24096;function Um(e){return!!e[zm]}function Wm(e){e[zm]=!0}var Gm=`ldots.cdots.quad.in.displaystyle.int_.lim.lim_.ce.pu.end.infty.perp.mid.operatorname.to.rightarrow.leftarrow.math.mathrm.mathit.mathbb.mathcal.mathfrak.implies.alpha.beta.gamma.delta.epsilon.lambda.sum.sum_.prod.sqrt.fbox.boxed.color.rule.edef.fcolorbox.hline.hdashline.cdot.times.pm.le.ge.neq.sin.cos.tan.log.ln.exp.frac.text.left.right`.split(`.`),Km=[`cdot`,`mathbf{`,`partial`,`mu_{`],qm=Gm.slice().sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,`\\$&`)).join(`|`),Jm=`[ \r\b\f\v]`,Ym=RegExp(`([^\\\\])(${Km.map(e=>e).join(`|`)})+`,`g`),Xm=/span\{([^}]+)\}/,Zm=/\\operatorname\{span\}\{((?:[^{}]|\{[^}]*\})+)\}/,Qm=/(^|[^\\])\\\r?\n/g,$m=/(^|[^\\])\\$/g,eh=/[\p{L}\p{M}\p{N}\p{Pe}\p{Pf}'′″‴|‖]/u,th=RegExp(`(${Jm})|(${qm})\\b`,`g`),nh=new Map,rh=new Map;function ih(e){if(!e)return th;let t=[...e];t.sort((e,t)=>t.length-e.length);let n=t.join(``),r=nh.get(n);if(r)return r;let i=`(?:${t.map(e=>e.replace(/[.*+?^${}()|[\\]\\"\]/g,`\\$&`)).join(`|`)})`,a=RegExp(`(${Jm})|(${i})\\b`,`g`);return nh.set(n,a),a}function ah(e,t){let n=e?[]:[...t??[]];e||n.sort((e,t)=>t.length-e.length);let r=e?`__default__`:n.join(``),i=rh.get(r);if(i)return i;let a=e?[wm,qm].filter(Boolean).join(`|`):[n.map(e=>e.replace(/[.*+?^${}()|[\\]\\\]/g,`\\$&`)).join(`|`),wm].filter(Boolean).join(`|`),o=RegExp(`(^|[^\\\\\\w])(${a})\\s*\\{`,`g`);return rh.set(r,o),o}var oh={" ":`t`,"\r":`r`,"\b":`b`,"\f":`f`,"\v":`v`};function sh(e){let t=/(^|[^\\])(__|\*\*)/g,n=0;for(;t.exec(e)!==null;)n++;return n}function ch(e){return e.replace(/(^|[^\\])!+/gu,(e,t)=>{if(t&&eh.test(t))return e;let n=t?e.slice(t.length):e;return`${t}${`\\!`.repeat(n.length)}`})}function lh(e){let t=/(^|[^\\])(__|\*\*)/g,n,r=null;for(;(n=t.exec(e))!==null;)r={marker:n[2],index:n.index+(n[1]?.length??0)};return r}function uh(e,t){let n=t?.commands??Gm,r=t?.escapeExclamation??!0,i=t?.commands==null,a=ih(i?void 0:n),o=e.replace(a,(e,t,r,i,a)=>{if(t!==void 0&&oh[t]!==void 0)return`\\${oh[t]}`;if(r&&n.includes(r)){let t=a&&typeof i==`number`?a[i-1]:void 0;return t===`\\`||t&&/\w/.test(t)?e:`\\${r}`}return e});r&&(o=ch(o));let s=o,c=ah(i,i?void 0:n);return s=s.replace(c,(e,t,n)=>`${t}\\${n}{`),s=s.replace(Xm,`span\\{$1\\}`).replace(Zm,`\\operatorname{span}\\{$1\\}`),s=s.replace(Qm,`$1\\\\
|
|
103
|
+
`),s=s.replace($m,`$1\\\\`),s=s.replace(Ym,`$1\\$2`),s}function dh(e){let t=e.trim();return!(!Rm(t)||/"[^"\n]{1,80}"\s*:\s*/.test(t)||!(/\\[a-z]+/i.test(t)||/[=+*/^<>]|\\times|\\pm|\\cdot|\\le|\\ge|\\neq/.test(t)||/[_^]/.test(t))&&/\s-\s/.test(t))}var fh=new WeakMap;function ph(e){let t=fh.get(e);if(t)return t;let n=e.src,r=e.env?.__markstreamFinal!==!0,i=[];for(let e=0;e<n.length;e++){let t=n[e];(t===`$`||t===`\\`)&&i.push(e)}return t={codeSpanRanges:hh(n),imageRanges:_h(n,r),mathOpenerPositions:i},fh.set(e,t),t}function mh(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1;e[i]<t?n=i+1:r=i}return n<e.length}function hh(e){let t=[],n=0;for(;n<e.length;){if(e[n]!=="`"){n++;continue}let r=n,i=1;for(;r+i<e.length&&e[r+i]==="`";)i++;let a=r+i,o=-1;for(;a<e.length;){if(e[a]!=="`"){a++;continue}let t=1;for(;a+t<e.length&&e[a+t]==="`";)t++;if(t===i){o=a;break}a+=t}o===-1?n=r+i:(t.push([r,o+i]),n=o+i)}return t}function gh(e,t){for(let n of e)if(t>=n[0]&&t<n[1])return n;return null}function _h(e,t=!1){let n=[],r=0;for(;r<e.length-1;){if(e[r]===`!`&&e[r+1]===`[`){let i=r,a=r+2,o=1;for(;a<e.length&&o>0;)e[a]===`\\`&&a+1<e.length?a+=2:(e[a]===`[`?o++:e[a]===`]`&&o--,a++);if(o===0&&a<e.length&&e[a]===`(`){let o=a+1,s=1;for(;o<e.length&&s>0;)e[o]===`\\`&&o+1<e.length?o+=2:(e[o]===`(`?s++:e[o]===`)`&&s--,o++);if(s===0){n.push([i,o]),r=o;continue}if(t){n.push([i,e.length]),r=e.length;continue}}}r++}return n}function vh(e,t){let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function yh(e,t){let n=t;for(;n<e.length;){let t=e.indexOf(`$`,n);if(t===-1)return-1;if(vh(e,t))n=t+1;else return t}return-1}function bh(e,t){let n=t;for(;n<e.length;){let t=yh(e,n);if(t===-1)return-1;if(t>0&&e[t-1]===`$`||t+1<e.length&&e[t+1]===`$`)n=t+1;else return t}return-1}function xh(e,t,n=0){let r=Math.max(0,n);for(;r<e.length;){let n=e.indexOf(t,r);if(n===-1)return-1;if(!vh(e,n))return n;r=n+Math.max(1,t.length)}return-1}function Sh(e,t,n=0,r=e.length,i=[]){let a=0,o=Math.max(0,n),s=Math.min(e.length,Math.max(0,r));for(;o<s;){let n=e.indexOf(t,o);if(n===-1||n>=s)break;let r=gh(i,n);r?o=Math.max(n+Math.max(1,t.length),r[1]):(vh(e,n)||a++,o=n+Math.max(1,t.length))}return a}function Ch(e,t,n){let r=Th(String(e??``));if(!r.endsWith(t))return-1;let i=r.length-t.length;if(i<=0||!Th(r.slice(0,i)).trim()||vh(r,i))return-1;let a=hh(r);if(gh(a,i))return-1;let o=Sh(r,t,0,i,a);if(t===`$$`){if(o%2==1)return-1}else if(o>Sh(r,n,0,i,a))return-1;return i}function wh(e){return e===` `||e===` `}function Th(e){let t=e.length;for(;t>0&&wh(e[t-1]);)t--;return e.slice(0,t)}function Eh(e){let t=0;for(let n=0;n<e.length;n++)e[n]===`
|
|
104
|
+
`&&t++;return t}function Dh(e){if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function Oh(e){if(e.length<3)return!1;let t=e[0];if(t!==`-`&&t!==`*`&&t!==`_`&&t!==`=`)return!1;let n=0;for(let r=0;r<e.length;r++){let i=e[r];if(i===t)n++;else if(!wh(i))return!1}return n>=3}function kh(e){let t=e.trim();if(!t)return!1;let n=0;t[n]===`:`&&n++;let r=0;for(;t[n]===`-`;)r++,n++;return r<3?!1:(t[n]===`:`&&n++,n===t.length)}function Ah(e){if(!e.includes(`|`))return!1;let t=e[0]===`|`?e.slice(1):e;return(t.endsWith(`|`)?t.slice(0,-1):t).split(`|`).every(kh)}function jh(e){let t=0;if(!Dh(e[t]))return!1;for(;Dh(e[t]);)t++;return e[t]!==`.`&&e[t]!==`)`?!1:wh(e[t+1])}function Mh(e){let t=e.trimStart();if(!t||t.startsWith("```")||t.startsWith(`~~~`)||t.startsWith(`:::`)||t[0]===`>`||t[0]===`<`)return!0;if(t[0]===`#`){let e=0;for(;t[e]===`#`;)e++;if(e>=1&&e<=6&&wh(t[e]))return!0}return!!((t[0]===`-`||t[0]===`+`||t[0]===`*`)&&wh(t[1])||jh(t)||Oh(t)||Ah(t))}function Nh(e,t){return e?t?`${e}\n${t}`:e:t}function Ph(e){let t=String(e??``).trim();return t?Rm(t):!1}function Fh(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return t.toString(36)}function Ih(e,t){if(e.length<=Hm)return{source:e,lineOffset:0};if(t){let n=e.length-Hm,r=e.indexOf(`
|
|
105
|
+
`,n);r=r===-1?e.length:r+1;let i=t.lineOffset+Eh(e.slice(t.windowStart,r));return t.lineOffset=i,t.windowStart=r,{source:e.slice(r),lineOffset:i}}let n=e.length-Hm,r=e.indexOf(`
|
|
106
|
+
`,n);n=r===-1?e.length:r+1;let i=Eh(e.slice(0,n));return{source:e.slice(n),lineOffset:i}}function Lh(e,t){let n=String(e??``);if(!n||!n.includes(`$$`)&&!n.includes(`\\[`))return!1;let{source:r}=Ih(n,t);if(!r)return!1;let i=r.split(/\r?\n/),a=Math.max(0,i.length-Bm-2),o=[[`$$`,`$$`],[`\\[`,`\\]`]];for(let e=a;e<i.length;e++){let t=Th(i[e]);if(t&&!Mh(t)){for(let[e,n]of o)if(Ch(t,e,n)!==-1)return!0}}return!1}function Rh(e,t){let n=String(e??``);if(!n||!n.includes(`$$`)&&!n.includes(`\\[`))return null;let{source:r,lineOffset:i}=Ih(n,t);if(!r)return null;let a=r.split(/\r?\n/),o=Math.max(0,a.length-Bm-2),s=[[`$$`,`$$`],[`\\[`,`\\]`]];for(let e=o;e<a.length-1;e++){let t=Th(a[e]);for(let[n,r]of s){let o=Ch(t,n,r);if(o===-1)continue;let s=``,c=!1;for(let t=e+1;t<a.length;t++){if(t-e>Bm){c=!0;break}let l=a[t],u=xh(l,r);if(u!==-1){let a=Nh(s,l.slice(0,u));if(!Ph(a)){c=!0;break}let d=l.slice(u+r.length),f=d.trim()?`suffix:${Fh(d)}`:`nosuffix`;return[`closed`,n,i+e,o,i+t,u,Fh(a),f].join(`:`)}if(Mh(l)||(s=Nh(s,l),s.length>Vm)){c=!0;break}}if(!c&&Ph(s))return[`pending`,n,i+e,o].join(`:`)}}return null}function zh(e,t){let n=String(e??``).trim();return!n||!/^\d[\d,.]*\s*[~~-]\s*$/.test(n)?!1:/\d/.test(String(t??``))}function Bh(e,t=!1){let n=String(e??``).split(`\\(`,1)[0].trimStart(),r=n.match(/^\d+(?:,\d{3})*(?:\.\d+)?/);if(!r||/[\\^{}_]/.test(n))return!1;let i=n.slice(r[0].length);return i.trim()?/^\s*[+\-*/=<>]/.test(i)?/^[\s+\-*/=<>]+$/.test(i)||i.startsWith(`**`):/^[)\s,.!?;:~~–—]/.test(i):!t}function Vh(e){let t=String(e??``).trim();return t?/^(?:\.{3,}|…+)$/.test(t):!1}function Hh(e,t){Wm(e);let n=(e,t,n)=>{let r=String(t??``).replace(/^[\t ]+/,``).replace(/[\t ]+$/,``);if(!r)return;let i=e.push(`paragraph_open`,`p`,1);i.map=[n,n+1];let a=e.push(`inline`,``,0);a.content=r,a.map=[n,n+1],a.children=[],e.push(`paragraph_close`,`p`,-1)},r=(e,n)=>{let r=e,i=!!t?.strictDelimiters,a=!r?.env?.__markstreamFinal,o=(e,t)=>{let n=t;for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;if(n===t||!(e[n]===`
|
|
107
|
+
`||e[n]===`\r`&&e[n+1]===`
|
|
108
|
+
`))return t;let i=e.slice(t,n),a=r.push(`text`,``,0);return a.content=i,n};if(/^\*[^*]+/.test(r.src))return!1;let s=String(r.pending??``),c=Math.max(0,r.pos-s.length),l=ph(r);if(!mh(l.mathOpenerPositions,c))return!1;if(r.src[r.pos]===`$`){let e=r.pos+1;for(;r.src[e]===`$`;)e++;let t=e-r.pos,n=r.src[e];if(t>=3&&(!n||/\s/.test(n))){let t=r.push(`text`,``,0);return t.content=r.src.slice(r.pos,e),r.pos=e,!0}}let u=[[`$$`,`$$`],[`$`,`$`],[`\\(`,`\\)`]],d=c,f=c,p=c,m=r.src,{codeSpanRanges:h,imageRanges:g}=l;for(let[e,s]of u){let c=!1;e===`$$`&&d!==p&&(d=p);let l=-1,u=-1,_=0,v=n=>{if((n===`undefined`||n==null)&&(n=``),n===`\\`){r.pos+=n.length,d=r.pos;return}if(n===`\\)`||n===`\\(`){let e=r.push(`text_special`,``,0);e.content=n===`\\)`?`)`:`(`,e.markup=n,r.pos+=n.length,d=r.pos;return}if(!n)return;if(e===`$$`&&n.includes(`$`)){let e=0;for(;e<n.length;){let i=yh(n,e);if(i===-1){let t=n.slice(e);if(t){let e=r.push(`text`,``,0);e.content=t,r.pos+=t.length,d=r.pos}break}if(i>0&&n[i-1]===`$`||i+1<n.length&&n[i+1]===`$`){let t=n.slice(e,i+1);if(t){let e=r.push(`text`,``,0);e.content=t,r.pos+=t.length,d=r.pos}e=i+1;continue}let a=n.slice(e,i);if(a){let e=r.push(`text`,``,0);e.content=a,r.pos+=a.length,d=r.pos}let o=bh(n,i+1);if(o===-1){let e=n.slice(i),t=r.push(`text`,``,0);t.content=e,r.pos+=e.length,d=r.pos;break}let s=n.slice(i+1,o),c=s.includes("`"),l=!s||!s.trim(),u=n[o+1],f=zh(s,u),p=Bh(s,!0),m=Vh(s);if(!c&&!l&&!f&&!p&&!m){let n=r.push(`math_inline`,`math`,0);n.content=uh(s,t),n.markup=`$`,n.raw=`$${s}$`,n.loading=!1,r.pos+=o-i+1,d=r.pos,e=o+1;continue}let h=r.push(`text`,``,0);h.content=`$`,r.pos+=1,d=r.pos,e=i+1}return}let i=n.indexOf(`![`);if(i!==-1){if(i>0){let e=n.slice(0,i),t=r.push(`text`,``,0);t.content=e,r.pos+=e.length,d=r.pos}let e=n.slice(i).match(/^!\[([^\]]*)\]\(([^)]+)\)/);if(e){let[,t,a]=e,o=a.match(/^(\S+)(?:\s+"([^"]+)")?\s*$/),s=o?o[1]:a,c=o&&o[2]?o[2]:null,l=r.push(`image`,`img`,0);l.attrs=[[`src`,s],[`alt`,t]],c&&l.attrs.push([`title`,c]),l.content=t,l.children=[{type:`text`,content:t,tag:``}],r.pos+=e[0].length,d=r.pos;let u=n.slice(i+e[0].length);u&&v(u);return}let t=r.push(`text`,``,0);t.content=n,r.pos+=n.length,d=r.pos;return}let a=r.push(`text`,``,0);a.content=n,r.pos+=n.length,d=r.pos};for(;!(d>=m.length);){let p=m.indexOf(e,d);if(p===-1)break;if(vh(m,p)){d=p+Math.max(1,e.length);continue}let y=gh(h,p);if(y){d=y[1];continue}let b=gh(g,p);if(b){d=b[1];continue}if(p===l&&d===u){if(_++,_>2){d=p+Math.max(1,e.length);continue}}else _=0,l=p,u=d;if(e===`(`&&p>0){let t=p-1;for(;t>=0&&m[t]===` `;)t--;if(t>=0&&m[t]===`]`){d=p+e.length;continue}}if(e===`$`&&p>0&&m[p-1]===`$`){d=p+1;continue}if(e===`$`&&p<m.length-1&&m[p+1]===`$`){d=p+2;continue}let x=e===`$`?bh(m,p+e.length):Cm(m,p+e.length,e,s);if(x===-1){let o=m.slice(p+e.length);if(o.includes(e)){d=m.indexOf(e,p+e.length);continue}if(x===-1){let l=e===`$`&&Bh(o);if(a&&!i&&!l&&Rm(o)&&!o.includes("`")){if(d=p+e.length,c=!0,!n){r.pending=``;let n=f?m.slice(f,d):m.slice(0,d),i=sh(n)%2==1;if(f)v(m.slice(f,d));else{let t=m.slice(0,d);t.endsWith(e)&&(t=t.slice(0,t.length-e.length)),v(t)}if(i){let i=lh(n)?.marker??`**`,a=r.push(`strong_open`,``,0);a.markup=i;let c=r.push(`math_inline`,`math`,0);c.content=uh(o,t),c.markup=e===`$$`?`$$`:e===`\\(`?`\\(\\)`:e===`$`?`$`:`()`,c.raw=`${e}${o}${s}`,c.loading=!0,a.content=o,r.push(`strong_close`,``,0)}else{let n=r.push(`math_inline`,`math`,0);n.content=uh(o,t),n.markup=e===`$$`?`$$`:e===`\\(`?`\\(\\)`:e===`$`?`$`:`()`,n.raw=`${e}${o}${s}`,n.loading=!0}r.pos=m.length}d=m.length,f=d}break}}let S=m.slice(p+e.length,x),C=S.includes("`"),w=!S||!S.trim(),T=e===`$`,E=m[x+s.length],D=T&&zh(S,E),O=T&&Bh(S,!0),k=T&&Vh(S);if(O||D)d=p+e.length;else if(i?C||w||k:C||w||k||!T&&!Rm(S)){d=x+s.length;let e=m.slice(r.pos,d);r.pending||(v(e),f=d)}else{if(c=!0,!n){let n=m.slice(r.pos-(r.pending??``).length,p),i=m.slice(0,d)?m.slice(f,p):n,a=sh(i)%2==1;p!==r.pos&&a&&(i=r.pending+m.slice(r.pos,p));let c=a?lh(i):null,l=c?.marker??`**`;if(r.pending!==i){if(r.pending=``,a){if(c){let e=i.slice(c.index+l.length);v(i.slice(0,c.index));let t=r.push(`strong_open`,``,0);t.markup=l;let n=r.push(`text`,``,0);n.content=e,r.push(`strong_close`,``,0)}else v(i)}else v(i)}if(a){let n=r.push(`strong_open`,``,0);n.markup=l;let i=r.push(`math_inline`,`math`,0);i.content=uh(S,t),i.markup=e===`$$`?`$$`:e===`\\(`?`\\(\\)`:e===`$`?`$`:`()`,i.raw=`${e}${S}${s}`,i.loading=!1;let a=m.slice(x+s.length).startsWith(l);return a&&r.push(`strong_close`,``,0),r.pos=o(m,x+s.length),d=r.pos,f=d,a||r.push(`strong_close`,``,0),!0}{let n=r.push(`math_inline`,`math`,0);n.content=uh(S,t),n.markup=e===`$$`?`$$`:e===`\\(`?`\\(\\)`:e===`$`?`$`:`()`,n.raw=`${e}${S}${s}`,n.loading=!1}}return d=o(m,x+s.length),f=d,r.pos=d,!0}}if(c){if(n)r.pos=d;else{if(e===`$$`&&d<m.length&&m.slice(d).includes(`$`)){let e=d;for(;!(e>=m.length);){let n=yh(m,e);if(n===-1)break;if(n+1<m.length&&m[n+1]===`$`){e=n+2;continue}if(n>0&&m[n-1]===`$`){e=n+1;continue}let i=bh(m,n+1);if(i===-1)break;let a=m.slice(n+1,i),o=a.includes("`"),s=!a||!a.trim(),c=m[i+1],l=zh(a,c),u=Bh(a,!0),f=Vh(a);if(!o&&!s&&!l&&!u&&!f){let o=m.slice(d,n);o&&v(o);let s=r.push(`math_inline`,`math`,0);s.content=uh(a,t),s.markup=`$`,s.raw=`$${a}$`,s.loading=!1,d=i+1,e=i+1}else v(`$`),e=n+1}e<m.length&&v(m.slice(e))}else d<m.length&&v(m.slice(d));r.pos=m.length}return!0}}return!1},i=(e,r,i,a)=>{let o=e,s=!o?.env?.__markstreamFinal,c=t?.strictDelimiters,l=c?[[`\\[`,`\\]`],[`$$`,`$$`]]:[[`\\[`,`\\]`],[`[`,`]`],[`$$`,`$$`]],u=o.bMarks[r]+o.tShift[r],d=o.src.slice(u,o.eMarks[r]).trim(),f=!1,p=``,m=``,h=!1,g=``,_=!1;for(let[e,n]of l)if(!(e===`[`&&d.startsWith(`[^`))){if(d.startsWith(e)){if(e.includes(`[`)){let a=e===`\\[`?d.slice(e.length):``;if(e===`\\[`&&xh(a,n)===-1&&!/^\s*!\[/.test(a)&&!a.includes("`")&&Rm(a)){f=!0,p=e,m=n;break}if(t?.strictDelimiters){if(d.replace(`\\`,``)===`[`){if(r+1<i){f=!0,p=e,m=n;break}continue}}else if(d.replace(`\\`,``)===`[`){if(r+1<i){f=!0,p=e,m=n;break}continue}else{let t=o.tokens[o.tokens.length-1];if(t&&t.type===`list_item_open`&&t.mark===`-`&&d.slice(e.length,d.indexOf(`]`)).trim()===`x`)continue;if(d.replace(`\\`,``).startsWith(`[`)&&!d.includes(`](`)){let t=d.indexOf(`]`);if(d.slice(t).trim()!==`]`)continue;let r=d.slice(e.length,t);if(e===`[`?dh(r):Rm(r)){f=!0,p=e,m=n;break}continue}}}else{f=!0,p=e,m=n;break}}else if((e===`$$`||e===`\\[`)&&d.endsWith(e)&&r+1<i){let t=Ch(d,e,n);if(t===-1)continue;g=Th(d.slice(0,t)),_=!0;let i=o.bMarks[r+1]+o.tShift[r+1];d=o.src.slice(i,o.eMarks[r+1]).trim(),h=!0,f=!0,p=e,m=n;break}}if(!f)return!1;if(a&&!_)return!0;let v=d.indexOf(p),y=v+p.length,b=!c&&p===`[`?d.indexOf(`\\]`,y):-1,x=b>=0?`\\]`:m,S=b>=0?b:xh(d,m,y);if(!h&&S>p.length){let e=d.slice(v+p.length,S),t=o.push(`math_block`,`math`,0);t.content=uh(e),t.markup=p===`$$`?`$$`:p===`[`?`[]`:`\\[\\]`,t.map=[r,r+1],t.raw=`${p}${e}${x}`,t.block=!0,t.loading=!1,o.line=r+1;let i=d.slice(S+x.length);return i.trim()&&n(o,i,r),!0}let C=r,w=``,T=!1,E=``,D=r,O=h?d:d===p?``:d.slice(p.length),k=!c&&p===`\\[`?`]`:``,A=xh(O,m);if(A!==-1){let e=A;w=O.slice(0,e),E=O.slice(e+m.length),D=h?r+1:r,T=!0,C=D}else for(O&&!h&&(w=O),C=r+1;C<i;C++){let e=o.bMarks[C]+o.tShift[C],t=o.eMarks[C],n=o.src.slice(e,t),r=n.trim();if(!c&&p===`[`&&r===`\\]`){m=`\\]`,T=!0;break}if(k&&n.trim()===k){m=k,T=!0;break}if(r===m){T=!0;break}if(!c&&p===`[`&&n.includes(`\\]`)){T=!0;let e=n.indexOf(`\\]`);m=`\\]`;let t=n.slice(0,e);t&&(w+=(w?`
|
|
109
|
+
`:``)+t),E=n.slice(e+m.length),D=C;break}if(xh(n,m)!==-1){T=!0;let e=xh(n,m),t=n.slice(0,e);t&&(w+=(w?`
|
|
110
|
+
`:``)+t),E=n.slice(e+m.length),D=C;break}w+=(w?`
|
|
111
|
+
`:``)+n}if((!s||c)&&!T)return!1;let j=/^\s*!\[/.test(w);if(!(_?!j&&Ph(w):p===`$$`?!j:p===`[`?dh(w):Rm(w)))return!1;if(a)return!0;g&&n(o,g,r);let M=o.push(`math_block`,`math`,0);return M.content=uh(w),M.markup=p===`$$`?`$$`:p===`[`?`[]`:`\\[\\]`,M.raw=`${p}${w}${w.startsWith(`
|
|
112
|
+
`)?`
|
|
113
|
+
`:``}${m}`,M.map=[r,C+1],M.block=!0,M.loading=!T,o.line=C+1,E.trim()&&n(o,E,D),!0};e.inline.ruler.before(`escape`,`math`,r),e.block.ruler.before(`lheading`,`explicit_math_block`,(e,t,n,r)=>{let a=e,o=a.bMarks[t]+a.tShift[t],s=a.src.slice(o,a.eMarks[t]).trim();return!s.startsWith(`$$`)&&!s.startsWith(`\\[`)?!1:i(e,t,n,r)},{alt:[`paragraph`,`reference`,`blockquote`,`list`]}),e.block.ruler.before(`paragraph`,`math_block`,i,{alt:[`paragraph`,`reference`,`blockquote`,`list`]})}function Uh(e){let t=e.renderer.rules.image||function(e,t,n,r,i){let a=e,o=i;return o.renderToken?o.renderToken(a,t,n):``};e.renderer.rules.image=(e,n,r,i,a)=>{let o=e;return o[n].attrSet?.(`loading`,`lazy`),t(o,n,r,i,a)},e.renderer.rules.fence=e.renderer.rules.fence||((t,n)=>{let r=t[n],i=String(r.info??``).trim();return`<pre class="${i?`language-${e.utils.escapeHtml(i.split(/\s+/g)[0])}`:``}"><code>${e.utils.escapeHtml(String(r.content??``))}</code></pre>`})}var Wh=/^<a[>\s]/i,Gh=/^<\/a\s*>/i,Kh=/[@:]|\/\/|\.\S/;function qh(e,t){if(e?.type!==`inline`)return!1;let n=e.children;if(!Array.isArray(n)||n.length===0)return t.test(String(e.content??``));let r=0;for(let e=n.length-1;e>=0;e--){let i=n[e];if(i?.type===`link_close`)for(e--;e>=0&&n[e]?.level!==i.level&&n[e]?.type!==`link_open`;)e--;else{if(i?.type===`html_inline`){let e=String(i.content??``);Wh.test(e)&&r>0&&r--,Gh.test(e)&&r++}if(!(r>0)&&i?.type===`text`&&t.test(String(i.content??``)))return!0}}return!1}function Jh(e){let t=e.core?.ruler,n=t.getNamedRules?.().find(e=>e.name===`linkify`)?.fn;if(typeof n!=`function`)return;let r=e.options.linkify?e.linkify:void 0,i=r?.test,a=r?.match,o=r?.re&&Object.getPrototypeOf(r.re),s,c=!1;t.at(`linkify`,e=>{if(!e.md?.options?.linkify)return;let t=Array.isArray(e.tokens)?e.tokens:[],r=e.md.linkify;if(!r||!t.some(e=>e?.type===`inline`))return;let l=r.re,u=l&&Object.getPrototypeOf(l)===o&&!Object.values(l).some(e=>typeof e==`function`),d=r.test===i&&r.match===a;if(d&&u&&s!==l.cache){s=l.cache;let{schema_names:e=[],tlds:t=[]}=l.opts;c=e.every(e=>e===`//`||e.endsWith(`:`))&&t.every(e=>/^[\p{L}\p{N}-]+$/u.test(e))}let f=!!d&&!!u&&c&&(e.env?.__markstreamFinal!==!1||!!l?.cache.link_fuzzy_search),p=t.filter(e=>{if(f&&e?.type===`inline`){let t=e.children;if(Array.isArray(t)&&t.length>0){if(!t.some(e=>e?.type===`text`&&Kh.test(String(e.content??``))))return!1}else if(!Kh.test(String(e.content??``)))return!1;f=!1}return qh(e,r)});if(p.length)return n(Object.assign(Object.create(Object.getPrototypeOf(e)),e,{tokens:p}))})}function Yh(e){let t=e.inline.ruler,n=t.getNamedRules?.(),r=n?.find(e=>e.name===`link`)?.fn,i=n?.find(e=>e.name===`image`)?.fn;if(typeof r!=`function`||typeof i!=`function`)return;let a=e.validateLink,o=e;o.__markstreamOriginalValidateLink=a,t.at(`link`,(...e)=>{let t=e[0].md,n=t?.validateLink===a?t.options?.validateLink:t?.validateLink;if(!t||typeof n!=`function`)return r(...e);let i=t.validateLink;t.validateLink=n;try{return r(...e)}finally{t.validateLink=i}}),t.at(`image`,(...e)=>{let t=e[0].md;if(!t)return i(...e);let n=t.validateLink;t.validateLink=a;try{return i(...e)}finally{t.validateLink=n}})}function Xh(e={}){let t=e.markdownItOptions??{},n=typeof t.experimental==`object`&&t.experimental!==null?t.experimental:{},r=!Object.prototype.hasOwnProperty.call(t,`stream`)||!!t.stream,i=Object.prototype.hasOwnProperty.call(t,`validateLink`),a={stream:r,...n},o=new ld({html:!0,linkify:!0,typographer:!0,...t,experimental:a}),s=`streamTailLocalPostBlockRules`;if(!(Object.prototype.hasOwnProperty.call(t,s)||Object.prototype.hasOwnProperty.call(n,s))&&Object.prototype.hasOwnProperty.call(o.options,s)&&(o.options[s]=!0),!i){let e=e=>!zd(e,{tagName:`a`,attrName:`href`});Vp(e),o.set({validateLink:e})}return Yh(o),Jh(o),(e.cjkFriendly??!0)&&o.use(ir),(e.enableMath??!0)&&Hh(o,{...e.mathOptions??{}}),(e.enableContainers??!0)&&Kd(o),e.enableFixIndentedCodeBlock!==!1&&Lf(o),tm(o),am(o),rm(o),lm(o),Uh(o),Ff(o,{customHtmlTags:e.customHtmlTags}),o}var Zh=new Map;function Qh(e,t){let n=t?`${e}:::${t}`:e,r=Zh.get(n);if(!r&&(r=new RegExp(e,t),Zh.set(n,r),Zh.size>200)){let e=Array.from(Zh.keys()).slice(0,50);for(let t of e)Zh.delete(t)}return r.lastIndex=0,r}var $h=/\S/,eg=/^(?:<!doctype\s+html[^>]*>\s*)?<html(?:\s[^>]*)?>/i,tg=/<\/html>\s*$/i,ng=/^<\s*[!?]/,rg=/^([A-Z][\w:-]*)/i,ig=/\/\s*>$/;function ag(e){let t=e.search($h);if(t===-1||e.charCodeAt(t)!==60)return null;let n=e.trim();if(!n)return null;let r=eg.test(n),i=tg.test(n);return!r||!i?null:[{type:`html_block`,tag:`html`,raw:e,content:e,loading:!1}]}function og(e){let t=e.raw;if(typeof t==`string`)return t;let n=e.content;return typeof n==`string`?n:``}function sg(e,t){if(e.type!==`html_block`||!t)return!1;let n=String(e.raw??e.content??``);return Qh(String.raw`^\s*<\s*\/\s*${qd(t)}\s*>\s*$`,`i`).test(n)}var cg=new Set([`iframe`,`script`,`style`,`textarea`,`title`]);function lg(e,t,n){if(!e||!t)return null;let r=t.toLowerCase(),i=t=>{if(e.startsWith(`<!--`,t)){let n=e.indexOf(`-->`,t+4);return{closing:!1,end:n===-1?e.length:n+3,selfClosing:!1,tag:``}}if(e.startsWith(`<![CDATA[`,t)){let n=e.indexOf(`]]>`,t+9);return{closing:!1,end:n===-1?e.length:n+3,selfClosing:!1,tag:``}}let n=Jd(e,t);if(n===-1)return null;let r=n+1,i=e.slice(t,r);if(ng.test(i))return{closing:!1,end:r,selfClosing:!1,tag:``};let a=i.slice(1).trimStart(),o=a.startsWith(`/`);o&&(a=a.slice(1).trimStart());let s=a.match(rg);return s?.[1]?{closing:o,end:r,selfClosing:ig.test(i),tag:s[1].toLowerCase()}:{closing:!1,end:t+1,selfClosing:!1,tag:``}},a=(t,n)=>{let r=Qh(String.raw`<\s*\/\s*${qd(t)}(?=\s|>)`,`gi`);r.lastIndex=n;let a=r.exec(e);if(!a||a.index==null)return null;let o=i(a.index);return o?{start:a.index,end:o.end}:null},o=-1,s=-1,c=Math.max(0,n);for(;c<e.length;){let t=e.indexOf(`<`,c);if(t===-1)return null;let n=i(t);if(!n)return null;if(!n.closing&&n.tag===r){o=t,s=n.end-1;break}c=!n.closing&&cg.has(n.tag)?a(n.tag,n.end)?.end??e.length:n.end}if(o===-1||s===-1)return null;let l=e.slice(o,s+1);if(yd.has(r)||ig.test(l))return{raw:l,start:o,end:s+1,closed:!0};if(cg.has(r)){let t=a(r,s+1);return t?{raw:e.slice(o,t.end),start:o,end:t.end,closeStart:t.start,closed:!0}:{raw:e.slice(o),start:o,end:e.length,closed:!1}}let u=1,d=s+1;for(;d<e.length;){let t=e.indexOf(`<`,d);if(t===-1)return{raw:e.slice(o),start:o,end:e.length,closed:!1};let n=i(t);if(!n)return null;if(n.closing&&n.tag===r){u--;let r=n.end;if(u===0)return{raw:e.slice(o,r),start:o,end:r,closeStart:t,closed:!0};d=r}else!n.closing&&n.tag===r?(!n.selfClosing&&!yd.has(n.tag)&&u++,d=n.end):d=!n.closing&&cg.has(n.tag)?a(n.tag,n.end)?.end??e.length:n.end}return{raw:e.slice(o),start:o,end:e.length,closed:!1}}function ug(e,t){if(!t)return 0;let n=0,r=0;for(;n<e.length&&r<t.length;)if(e[n]===t[r])n++,r++;else if(e[n]===`\r`||e[n]===`
|
|
114
|
+
`)n++;else return-1;return r===t.length?n:-1}function dg(e,t,n){return n?e:`${e.replace(/<[^>]*$/,``)}\n</${t}>`}function fg(e){return e.replace(/\r\n/g,`
|
|
115
|
+
`).replace(/(^|\n)[ \t]{1,4}/g,`$1`)}function pg(e,t,n){return n?e.includes(n,t)?!0:fg(e.slice(Math.max(0,t))).includes(fg(n)):!1}function mg(e,t){let n=Math.max(0,t);for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;return e[n]===`\r`?(n++,e[n]===`
|
|
116
|
+
`&&n++,n):e[n]===`
|
|
117
|
+
`?n+1:t}function hg(e,t){let n=Qh(String.raw`<\s*\/\s*${qd(t)}(?=\s|>)`,`gi`),r=-1,i;for(;(i=n.exec(e))!==null;)r=i.index;return r}var gg=/^\s*(?:<!--|<!|<\?)/,_g=/^\s*<([A-Z][\w:-]*)/i,vg=/\/\s*>$/,yg=/<[^>]*$/;function bg(e,t,n){let r=t.toLowerCase(),i=Qh(String.raw`^<\s*${r}(?=\s|>|/)`,`i`),a=Qh(String.raw`^<\s*\/\s*${r}(?=\s|>)`,`i`),o=0,s=Math.max(0,n);for(;s<e.length;){let t=e.indexOf(`<`,s);if(t===-1)return-1;let n=e.slice(t);if(a.test(n)){let e=Jd(n);if(e===-1)return-1;if(o===0)return t+e+1;o--,s=t+e+1}else if(i.test(n)){let e=Jd(n);if(e===-1)return-1;let r=n.slice(0,e+1);vg.test(r)||o++,s=t+e+1}else s=t+1}return-1}function xg(e){let t=String(e.content??``);if(gg.test(t))return{type:`html_block`,content:t,raw:t,tag:``,loading:!1};let n=(t.match(_g)?.[1]||``).toLowerCase();if(!n)return{type:`html_block`,content:t,raw:t,tag:``,loading:!1};let r=Jd(t),i=r===-1?t:t.slice(0,r+1),a=r!==-1&&vg.test(i),o=yd.has(n),s=Yd(i),c=(r===-1?-1:bg(t,n,r+1))!==-1,l=!(o||a||c);return{type:`html_block`,content:l?`${t.replace(yg,``)}\n</${n}>`:t,raw:t,tag:n,attrs:s.length?s:void 0,loading:l}}function Sg(e,t,n){let r=zf(n)?n.sourceLineMapper:void 0;if(!r)return{startLine:e,endLine:t};let i=r(e),a=t>e?r(t-1).endLine:r(t).startLine;return{startLine:i.startLine,endLine:Math.max(i.startLine,a)}}function Cg(e,t){let n=Math.max(0,Math.min(e.length,Math.trunc(t))),r=0;for(let t=0;t<n;t++)e[t]===`
|
|
118
|
+
`&&r++;return r}function wg(e,t,n){let r=Math.max(0,Math.min(e.length,Math.trunc(t))),i=Math.max(r,Math.min(e.length,Math.trunc(n))),a=Cg(e,r),o=Cg(e,i);return i>r&&e[i-1]!==`
|
|
119
|
+
`&&o++,{startLine:a,endLine:o}}function Tg(e,t,n,r){let i=wg(e,t,n);return Sg(i.startLine,i.endLine,r)}function Eg(e,t){let n=e?.map;if(!Array.isArray(n)||n.length<2)return null;let r=Number(n[0]),i=Number(n[1]);return!Number.isFinite(r)||!Number.isFinite(i)?null:Sg(r,i,t)}function X(e,t,n){if(!n?.includeSourceMap)return e;let r=Eg(t,n);if(!r)return e;if(e.sourceMap=r,e.type===`code_block`){let t=e;t.startLine=r.startLine,t.endLine=r.endLine}return e}function Dg(e,t,n,r){if(!r?.includeSourceMap)return e;let i=t?.map;if(!Array.isArray(i)||i.length<2)return e;let a=Number(i[0]),o=Number(i[1]),s=Number(n);return Number.isFinite(a)&&Number.isFinite(o)&&Number.isFinite(s)&&(e.sourceMap=Sg(a,Math.max(o,s),r)),e}function Og(e){let t=Object.assign(Object.create(Object.getPrototypeOf(e)),e);return Array.isArray(e.attrs)&&(t.attrs=e.attrs.map(e=>[...e])),Array.isArray(e.map)&&(t.map=[...e.map]),Array.isArray(e.children)&&(t.children=e.children.map(e=>Og(e))),Bp(e,t),t}function kg(e){if(!e||typeof e!=`object`)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Ag(e,t,n){for(let r of Reflect.ownKeys(e)){let i=Object.getOwnPropertyDescriptor(e,r);if(!i||!(`value`in i))continue;let a=Object.getOwnPropertyDescriptor(t,r);(!a||`value`in a&&a.writable!==!1)&&(t[r]=jg(i.value,n))}}function jg(e,t=new WeakMap){if(!e||typeof e!=`object`)return e;let n=e,r=t.get(n);if(r)return r;if(Array.isArray(e)){let r=[];t.set(n,r);for(let n of e)r.push(jg(n,t));return r}if(e instanceof Map){let r=new Map;t.set(n,r);for(let[n,i]of e)r.set(jg(n,t),jg(i,t));return r}if(e instanceof Set){let r=new Set;t.set(n,r);for(let n of e)r.add(jg(n,t));return r}if(e instanceof Date){let r=new Date(e.getTime());return t.set(n,r),r}if(e instanceof RegExp){let r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,t.set(n,r),r}if(typeof URL<`u`&&e instanceof URL){let r=new URL(e.href);return t.set(n,r),Ag(n,r,t),r}if(typeof URLSearchParams<`u`&&e instanceof URLSearchParams){let r=new URLSearchParams(e.toString());return t.set(n,r),Ag(n,r,t),r}if(e instanceof Error){let r,i=e.constructor;try{r=new i(e.message)}catch{r=Error(e.message)}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),t.set(n,r),Ag(n,r,t),r}if(typeof Promise<`u`&&e instanceof Promise||typeof Node<`u`&&e instanceof Node)return t.set(n,e),e;if(!kg(e)){let r=Object.create(Object.getPrototypeOf(e));return t.set(n,r),Ag(n,r,t),r}let i={};t.set(n,i);let a=e;for(let e of Object.keys(a))i[e]=jg(a[e],t);return i}function Mg(e,t){for(let n=0;n<t.length;n++){let r=Object.getOwnPropertyDescriptor(e,t[n]);if(t[n]===`__proto__`||!r||!(`value`in r)||r.writable!==!0||r.configurable!==!0)return!1}return!0}function Ng(e,t=!0){let n=Pg(e,t);return Bp(e,n),n}function Pg(e,t=!0){if(!t)return Og(e);let n=Reflect.ownKeys(e),r=Object.keys(e);if(n.length===r.length&&Mg(e,r))try{return Fg(e,r,t)}catch{return Ig(e,t)}return Ig(e,t)}function Fg(e,t,n){let r=Object.getPrototypeOf(e),i={},a=new WeakMap,o=e.children,s=e.attrs,c=e.map,l=e;for(let e=0;e<t.length;e++){let r=t[e],u=l[r];if(r===`children`&&Array.isArray(o)){let e=Array(o.length);for(let t=0;t<o.length;t++)e[t]=Ng(o[t],n);i[r]=e}else if(r===`attrs`&&Array.isArray(s)){let e=Array(s.length);for(let t=0;t<s.length;t++){let n=s[t];e[t]=[n[0],n[1]]}i[r]=e}else i[r]=r===`map`&&Array.isArray(c)?[c[0],c[1]]:n&&u&&typeof u==`object`?jg(u,a):u}return Object.setPrototypeOf(i,r),i}function Ig(e,t=!0){let n=Object.create(Object.getPrototypeOf(e)),r=new WeakMap;for(let i of Reflect.ownKeys(e)){let a=Object.getOwnPropertyDescriptor(e,i);if(!a)continue;if(!(`value`in a)){Object.defineProperty(n,i,a);continue}let o=a.value,s=o;i===`attrs`&&Array.isArray(o)?s=o.map(e=>[...e]):i===`map`&&Array.isArray(o)?s=[...o]:i===`children`&&Array.isArray(o)?s=o.map(e=>Ng(e,t)):t&&o&&typeof o==`object`&&(s=jg(o,r)),Object.defineProperty(n,i,{...a,value:s})}return n}function Lg(e,t=!0){return e.map(e=>Ng(e,t))}function Rg(e,t){let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function zg(e){return e===` `||e===` `}function Bg(e,t){return t===` `?e+1:e+4-e%4}function Vg(e){let t=0,n=0;for(;t<e.length&&zg(e[t]);)n=Bg(n,e[t]),t++;return{index:t,column:n}}function Hg(e){let t=Vg(e);return t.column>3?null:t}function Ug(e){let t=Hg(e);if(!t)return null;let n=t.index,r=e[n];if(r!=="`"&&r!==`~`)return null;let i=n;for(;i<e.length&&e[i]===r;)i++;let a=i-n;if(a<3)return null;let o=e.slice(i);return r==="`"&&o.includes("`")?null:{markerChar:r,markerLen:a,rest:o}}function Wg(e){let t=Hg(e);if(!t)return null;let n=e.slice(t.index),r=/^(?:[-+*]|\d{1,9}[.)])(?=[\t ]|$)/.exec(n)?.[0];if(!r)return null;let i=t.index+r.length,a=t.column+r.length;if(!zg(e[i]))return null;for(;i<e.length&&zg(e[i]);)a=Bg(a,e[i]),i++;return{content:e.slice(i),contentIndent:a}}function Gg(e){let t=e,n=!1;for(;;){let e=Hg(t);if(!e)return n?t:null;let r=e.index;if(t[r]!==`>`)return n?t:null;n=!0,r++,(t[r]===` `||t[r]===` `)&&r++,t=t.slice(r)}}function Kg(e){let t=Ug(e);if(t)return{...t,inBlockquote:!1,inList:!1,listIndent:0};let n=Gg(e),r=n==null?null:Ug(n);if(r)return{...r,inBlockquote:!0,inList:!1,listIndent:0};let i=Wg(e);if(!i)return null;let a=Ug(i.content);return a==null?null:{...a,inBlockquote:!1,inList:!0,listIndent:i.contentIndent}}function qg(e,t,n){let r=t;for(;r<e.length&&e[r]===n;)r++;return r-t}function Jg(e,t,n){let r=t;for(;r<e.length;){let t=e.indexOf("`",r);if(t===-1)return-1;let i=qg(e,t,"`");if(i===n)return t;r=t+i}return-1}var Yg=[`$`,`\\[`],Xg=/(^|\r?\n)[\t ]*:::[\t ]*(?:warning|info|note|tip|danger|caution|error)(?=[\t ]|\r?\n|$)[^\r\n]*(?:\r?\n[\t ]*)*$/;function Zg(){return{fenceChar:``,fenceInBlockquote:!1,fenceInList:!1,fenceLen:0,fenceListIndent:0,inDollarMath:!1,inFence:!1,inMath:!1,listContentIndent:null,dollarMathOpenOffset:null,mathOpenOffset:null}}function Qg(e){return{...e}}function $g(e,t,n,r=d_(t).state,i={lineOffset:0,windowStart:0}){e.tolerantMathBoundary={explicitBracketMath:r,source:t,key:n,pendingCandidate:n===null&&Lh(t,i),scanWindow:i}}function e_(e){return e.endsWith(`$`)||e.endsWith(`\\`)}function t_(e){let t=Math.max(e.lastIndexOf(`
|
|
120
|
+
`)+1,0),n=e.slice(t).replace(/[\t ]+$/,``);return Yg.some(e=>n.endsWith(e))}function n_(e,t){return t?!!(t.includes(`$$`)||t.includes(`\\[`)||e.endsWith(`$`)&&t[0]===`$`||e.endsWith(`\\`)&&t[0]===`[`||t_(e)&&/[\r\n]/.test(t)):!1}function r_(e,t){let n=!1,r=``,i=0,a=!1,o=!1,s=0,c=null,l=0;for(;l<t;){let u=e.indexOf(`
|
|
121
|
+
`,l),d=u===-1||u>=t?t:u,f=e.slice(l,d),p=f.endsWith(`\r`)?f.slice(0,-1):f,m=Vg(p),h=Wg(p);n&&a&&p.trim()&&Gg(p)==null&&(n=!1,r=``,i=0,a=!1,o=!1,s=0),n&&o&&p.trim()&&m.column<s&&!h&&(n=!1,r=``,i=0,a=!1,o=!1,s=0),h?c=h.contentIndent:p.trim()&&c!=null&&m.column<c&&!n&&(c=null);let g=Kg(p);if(g&&(n?g.markerChar===r&&g.markerLen>=i&&/^\s*$/.test(g.rest)&&(n=!1,r=``,i=0,a=!1,o=!1,s=0):(n=!0,r=g.markerChar,i=g.markerLen,a=g.inBlockquote,o=g.inList||c!=null&&!g.inBlockquote&&m.column>=c,s=g.listIndent||c||0)),u===-1||u>=t)break;l=u+1}return n}function i_(e,t){let n=e=>e===` `||e===` `,r=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`||e===`:`},i=e=>{if(e[0]!==`<`)return null;let t=1;for(;t<e.length&&n(e[t]);)t++;let i=e[t]===`/`;if(i)for(t++;t<e.length&&n(e[t]);)t++;let a=t;for(;t<e.length&&r(e[t]);)t++;if(t===a)return null;let o=e.slice(a,t).toLowerCase();if(!bd.has(o))return null;let s=e[t];if(s&&s!==` `&&s!==` `&&s!==`>`&&s!==`/`)return null;let c=Jd(e);if(c===-1)return null;let l=c-1;for(;l>=0&&n(e[l]);)l--;return{closing:i,tag:o,selfClosing:!i&&e[l]===`/`,after:e.slice(c+1)}},a=(e,t)=>{let r=e.toLowerCase(),i=0;for(;i<r.length;){let e=r.indexOf(`</`,i);if(e===-1)return!1;for(i=e+2;i<r.length&&n(r[i]);)i++;if(r.startsWith(t,i)){let e=r[i+t.length];if(!e||e===` `||e===` `||e===`>`)return!0}}return!1},o=[],s=!1,c=!1,l=!1,u=0;for(;u<t;){let n=e.indexOf(`
|
|
122
|
+
`,u),r=n===-1||n>=t?t:n,d=e.slice(u,r),f=d.endsWith(`\r`)?d.slice(0,-1):d,p=Hg(f);if(p){let e=f.slice(p.index);if(s)s=!e.includes(`-->`);else if(c)c=!e.includes(`>`);else if(l)l=!e.includes(`?>`);else if(e.startsWith(`<!--`))s=!e.includes(`-->`);else if(e.startsWith(`<?`))l=!e.includes(`?>`);else if(e.startsWith(`<!`))c=!e.includes(`>`);else{let t=i(e);if(t){if(t.closing){for(let e=o.length-1;e>=0;e--)if(o[e]===t.tag){o.length=e;break}}else t.selfClosing||a(t.after,t.tag)||o.push(t.tag)}}}if(n===-1||n>=t)break;u=n+1}return s||c||l||o.length>0}function a_(e,t,n){if(!n?.length)return!1;let r=new Set($d(n));if(!r.size)return!1;let i=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`||e===`:`},a=e=>e===` `||e===` `,o=e=>{if(e[0]!==`<`)return null;let t=1;for(;t<e.length&&a(e[t]);)t++;let n=e[t]===`/`;if(n)for(t++;t<e.length&&a(e[t]);)t++;let o=t;for(;t<e.length&&i(e[t]);)t++;if(t===o)return null;let s=e.slice(o,t).toLowerCase();if(!r.has(s))return null;let c=e[t];if(c&&c!==` `&&c!==` `&&c!==`>`&&c!==`/`)return null;let l=e.indexOf(`>`,t);if(l===-1)return null;let u=l-1;for(;u>=0&&a(e[u]);)u--;return{closing:n,tag:s,selfClosing:!n&&e[u]===`/`,after:e.slice(l+1)}},s=(e,t)=>{let n=e.toLowerCase(),r=0;for(;r<n.length;){let e=n.indexOf(`</`,r);if(e===-1)return!1;for(r=e+2;r<n.length&&a(n[r]);)r++;if(n.startsWith(t,r)){let e=n[r+t.length];if(!e||e===` `||e===` `||e===`>`)return!0}}return!1},c=[],l=0;for(;l<t;){let n=e.indexOf(`
|
|
123
|
+
`,l),r=n===-1||n>=t?t:n,i=e.slice(l,r),a=i.endsWith(`\r`)?i.slice(0,-1):i,u=Hg(a);if(u){let e=o(a.slice(u.index));if(e){if(e.closing){for(let t=c.length-1;t>=0;t--)if(c[t]===e.tag){c.length=t;break}}else e.selfClosing||s(e.after,e.tag)||c.push(e.tag)}}if(n===-1||n>=t)break;l=n+1}return c.length>0}function o_(e,t){let n=Xg.exec(e);if(!n)return null;let r=n[1]??``,i=n.index+r.length,a=e.indexOf(`
|
|
124
|
+
`,i),o=e.slice(i,a===-1?e.length:a);return!Hg(o.endsWith(`\r`)?o.slice(0,-1):o)||r_(e,i)||i_(e,i)||a_(e,i,t)?null:`${e.slice(0,n.index)}${r}`}function s_(e){e.inFence=!1,e.fenceChar=``,e.fenceLen=0,e.fenceInBlockquote=!1,e.fenceInList=!1,e.fenceListIndent=0}function c_(e,t,n,r,i){let a=0,o=!1;for(;a<e.length;){let s=a;if(t.inMath){if(e.startsWith(`\\]`,a)&&!Rg(e,s)){r!=null&&i&&n+a+2>r&&(o=!0),t.inMath=!1,t.mathOpenOffset=null,a+=2;continue}a++}else if(t.inDollarMath){if(e.startsWith(`$$`,a)&&!Rg(e,s)){r!=null&&i&&n+a+2>r&&(o=!0),t.inDollarMath=!1,t.dollarMathOpenOffset=null,a+=2;continue}a++}else if(e[a]==="`"&&!Rg(e,s)){let t=qg(e,a,"`"),n=Jg(e,a+t,t);if(n===-1)break;a=n+t}else e.startsWith(`\\[`,a)&&!Rg(e,s)?(t.inMath=!0,t.mathOpenOffset=n+a,a+=2):e.startsWith(`$$`,a)&&!Rg(e,s)?(t.inDollarMath=!0,t.dollarMathOpenOffset=n+a,a+=2):a++}return o}function l_(e,t,n=!0){let r=t.markdownIt;if(!Um(r))return e;let i=n?t.pendingExplicitMathTail:void 0,a=i?.source===e?i.state:i&&t.sourceExtends(i.source,e)?f_(i.state,e.slice(i.source.length),i.source.length-i.state.lineBuffer.length).state:d_(e).state;n&&(t.pendingExplicitMathTail={source:e,state:a});let{context:o}=a,s=o.inMath?o.mathOpenOffset:o.inDollarMath?o.dollarMathOpenOffset:null;if(s==null)return e;let c=e.slice(s+2),l=e.lastIndexOf(`
|
|
125
|
+
`,s-1)+1;if(e.slice(l,s).trim()!==``&&!/^\r?\n/.test(c)||/^\s*!\[/.test(c))return e;let u=c.trim(),d=/^(?:[a-z]|pi)$/i.test(u);return Rm(c)&&!d?e:e.slice(0,s)}function u_(e,t,n,r,i){let a=Vg(e),o=Wg(e);if(t.inFence&&t.fenceInBlockquote&&e.trim()&&Gg(e)==null&&s_(t),t.inFence&&t.fenceInList&&e.trim()&&a.column<t.fenceListIndent&&!o&&s_(t),o?t.listContentIndent=o.contentIndent:e.trim()&&t.listContentIndent!=null&&a.column<t.listContentIndent&&!t.inFence&&(t.listContentIndent=null),!t.inMath&&!t.inDollarMath){let o=Kg(e);if(o)t.inFence?o.markerChar===t.fenceChar&&o.markerLen>=t.fenceLen&&/^\s*$/.test(o.rest)&&s_(t):(t.inFence=!0,t.fenceChar=o.markerChar,t.fenceLen=o.markerLen,t.fenceInBlockquote=o.inBlockquote,t.fenceInList=o.inList||t.listContentIndent!=null&&!o.inBlockquote&&a.column>=t.listContentIndent,t.fenceListIndent=o.listIndent||t.listContentIndent||0);else if(!t.inFence)return c_(e,t,n,r,i)}else return c_(e,t,n,r,i);return!1}function d_(e,t=Zg(),n=null,r=!1,i=0){let a=Qg(t),o=Qg(t),s=``,c=!1,l=0;for(;l<e.length;){let t=e.indexOf(`
|
|
126
|
+
`,l),u=t!==-1,d=u&&t>l&&e[t-1]===`\r`?t-1:u?t:e.length,f=e.slice(l,d);u_(f,a,i+l,n,r)&&(c=!0),u?(o=Qg(a),s=``):s=f,l=u?t+1:e.length}return{closedOpenMath:c,state:{committedContext:o,context:a,lineBuffer:s}}}function f_(e,t,n=0){return t&&!e.context.inMath&&!e.context.inDollarMath&&!e.context.inFence&&!e.committedContext.inFence&&!/[\\$`~\r\n]/.test(t)&&(!e.lineBuffer.endsWith(`\\`)||t[0]!==`[`&&t[0]!==`]`)?{closedOpenMath:!1,state:{committedContext:Qg(e.committedContext),context:Qg(e.context),lineBuffer:e.lineBuffer+t}}:d_(e.lineBuffer+t,e.committedContext,n+e.lineBuffer.length,e.context.inMath||e.context.inDollarMath,n)}function p_(e,t){let n=e.markdownIt;if(!Um(n)||typeof n.stream?.reset!=`function`)return;let r=e.tolerantMathBoundary;if(r?.source===t)return;let i=r?e.sourceExtends(r.source,t):!1,a=i&&r?t.slice(r.source.length):``,o=i&&r?f_(r.explicitBracketMath,a,r.source.length-r.explicitBracketMath.lineBuffer.length):d_(t),s=o.state,c=i&&r?o.closedOpenMath:!1;if(r&&i&&r.key===null&&r.pendingCandidate===!1&&!c&&!n_(r.source,a)&&!e_(t)){r.source=t,r.explicitBracketMath=s;return}let l=i&&r?r.scanWindow:{lineOffset:0,windowStart:0},u=Rh(t,l);(r&&(r&&!i||r.key!==u||c)||!r&&u)&&e.resetStreamOnly(),$g(e,t,u,s,l)}function m_(e){let t=e.tolerantMathBoundary;return typeof t?.key==`string`&&t.key.startsWith(`pending:`)}function h_(e){let t=!1,n=``,r=0,i=!1,a=!1,o=!1,s=0,c=(e,s)=>{let c=Kg(e);if(c){t?c.markerChar===n&&c.markerLen>=r&&/^\s*$/.test(c.rest)&&(t=!1,n=``,r=0):(t=!0,n=c.markerChar,r=c.markerLen);return}if(t)return;let l=0;for(;l<e.length;){if(i){e.startsWith(`$$`,l)&&!Rg(e,l)?(i=!1,l+=2):l++;continue}if(a){e.startsWith(`\\]`,l)&&!Rg(e,l)?(a=!1,l+=2):l++;continue}let t=e[l];if(t==="`"){let t=qg(e,l,"`"),n=Jg(e,l+t,t);if(n===-1)break;l=n+t}else if(t===`\\`){let t=e[l+1];t===`[`&&!Rg(e,l)?(a=!0,l+=2):(t===`]`&&Rg(e,l),l+=2)}else if(t===`$`){if(e[l+1]===`$`&&!Rg(e,l)){i=!0,o=!1,l+=2;continue}if(o){o=!1,l++;continue}let t=e[l+1];(t===void 0||t!==` `&&t!==` `&&!/\d/.test(t))&&(o=!0),l++}else l++}};return{scanTo:t=>{for(;s<t;){let n=e.indexOf(`
|
|
127
|
+
`,s),r=n===-1||n>=t?t:n,i=r>s&&e[r-1]===`\r`?r-1:r;if(c(e.slice(s,i),s),n===-1||n>=t){s=t;break}o=!1,s=n+1}},inMath:()=>i||a||o}}function g_(){return typeof performance<`u`?performance.now():Date.now()}function __(e,t){let n=t.__markstreamFinal===!0?`final`:`streaming`,r=e.streamParseEnvs.get(n);r||(r={},e.streamParseEnvs.set(n,r));for(let e of Object.keys(r))Object.prototype.hasOwnProperty.call(t,e)||delete r[e];return Object.assign(r,t),r}function v_(e,t){let n=e.markdownIt,r=n.stream,i=t.streamParse??`auto`;return t.disableStreamParse!==!0&&n.__markstreamHasCustomParserExtensions===!1&&(i===!0||i===`auto`&&t.final!==!0)&&r?.enabled===!0&&typeof r.parse==`function`}function y_(e,t){let n=e.markdownIt,r=t.streamParse??`auto`,i=n.stream;return t.final===!0&&r===`auto`&&t.disableStreamParse!==!0&&n.__markstreamHasCustomParserExtensions===!1&&i?.enabled===!0&&typeof i.reset==`function`}function b_(e,t){return y_(e,t)?(e.resetForFinalAutoParse(),!0):!1}function x_(e){return typeof e.preTransformTokens==`function`||typeof e.postTransformTokens==`function`}function S_(e,t){let n=e?.map,r=t?.map;return n===r?!0:!Array.isArray(n)||!Array.isArray(r)?!1:n.length===r.length&&n.every((e,t)=>e===r[t])}function C_(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.markup===t.markup&&e.content===t.content&&S_(e,t)}function w_(e,t){return e[t]?.type===`paragraph_open`&&e[t+1]?.type===`inline`&&e[t+2]?.type===`paragraph_close`}function T_(e){for(let t=0;t+5<e.length;t++)if(w_(e,t)&&w_(e,t+3)&&C_(e[t],e[t+3])&&C_(e[t+1],e[t+4])&&C_(e[t+2],e[t+5]))return!0;return!1}function E_(e,t,n){return Um(e)&&Lh(t)&&T_(n)}function D_(e){return e.topLevelStreamParseMode}function O_(e,t,n,r,i){let a=e.markdownIt;if(r.customHtmlTags?.length&&(n.__markstreamCustomHtmlTags=r.customHtmlTags),!v_(e,r))return r.isFragment||(e.topLevelStreamParseMode=`sync`),a.parse(t,n);if(p_(e,t),m_(e))return e.topLevelStreamParseMode=`sync`,a.parse(t,n);let o=a.stream.peek?.(),s=(o?.length??0)-1,c=o?.[s]?.type===`hr`,l=c&&o?.[s-1]?.type===`bullet_list_close`?o[s-1].markup:void 0;e.markStreamParseStarted();let u=a.stream.parse(t,__(e,n)),d=u[s];if(c&&(d?.type===`paragraph_open`||l!==void 0&&d?.type===`bullet_list_open`&&d.markup===l)||E_(a,t,u))return e.resetStreamOnly(),e.topLevelStreamParseMode=`sync`,a.parse(t,n);if(e.topLevelStreamParseMode=a.stream?.stats?.()?.lastMode??`stream`,!x_(r))return u;if(!i?.recordTokenCloneMs)return Lg(u,!0);let f=g_(),p=Lg(u,!0);return i.recordTokenCloneMs(g_()-f),p}var k_=new Set([`code_inline`,`em_close`,`em_open`,`emoji`,`hardbreak`,`html_block`,`html_inline`,`image`,`ins_close`,`ins_open`,`link`,`link_close`,`link_open`,`mark_close`,`mark_open`,`math_inline`,`s_close`,`s_open`,`softbreak`,`strong_close`,`strong_open`,`sub`,`sup`,`text`]),A_=new Map([[`paragraph_open`,`paragraph_close`],[`heading_open`,`heading_close`],[`bullet_list_open`,`bullet_list_close`],[`ordered_list_open`,`ordered_list_close`],[`blockquote_open`,`blockquote_close`],[`table_open`,`table_close`]]),j_=new Set([`code_block`,`fence`,`hr`,`html_block`,`inline`,`math_block`]),M_=new Set([`paragraph_open`,`paragraph_close`,`heading_open`,`heading_close`,`bullet_list_open`,`bullet_list_close`,`ordered_list_open`,`ordered_list_close`,`list_item_open`,`list_item_close`,`blockquote_open`,`blockquote_close`]);function N_(e,t,n){let r=e.structuredStream;if(!(!r||n.final!==!0||n.isFragment||n.reuseStableTopLevelNodes!==!0||n.preTransformTokens||n.postTransformTokens||n.postTransformNodes||n.customHtmlTags?.length||n.includeSourceMap||e.markdownIt.__markstreamHasCustomParserExtensions||e.safeMarkdown?.source!==t||e.safeMarkdown.safeMarkdown!==t||r.source!==t)){for(let e of r.tokens){if(M_.has(e.type))continue;if(e.type!==`inline`||!Array.isArray(e.children))return;let t=``;for(let n of e.children)if(n.type===`text`){if(typeof n.content!=`string`||/[\\`*_[\]$<>|]/.test(n.content)||/\(\s*$/.test(n.content))return;t+=n.content}else if(n.type===`softbreak`)t+=`
|
|
128
|
+
`;else if(n.type===`code_inline`){if(!n.markup)return;t+=n.markup+n.content+n.markup}else if(n.type===`strong_open`||n.type===`strong_close`||n.type===`em_open`||n.type===`em_close`)t+=n.markup;else return;if(t!==e.content)return}return r.nodes}}function P_(e,t){return e.every(e=>{if(!k_.has(e.type)||(e.type===`link`||e.type===`link_open`||e.type===`link_close`)&&!Hp(t))return!1;if(e.type===`link`){let t=Rp(e);if(t!==`explicit`&&t!==`linkify`&&t!==`autolink`)return!1}if(e.type===`link_open`||e.type===`link_close`){let t=e.markup??``;if(t!==``&&t!==`linkify`&&t!==`autolink`)return!1}let n=e.children;return!Array.isArray(n)||P_(n,t)})}function F_(e){let t=A_.get(e);if(t)return t;let n=/^container_(.+)_open$/.exec(e);return n?`container_${n[1]}_close`:void 0}function I_(e,t,n=0){let r=[],i=!1,a=n;for(;a<e.length;){let n=e[a];if(!n||n.level!==0)return null;let o=F_(n.type),s=a+1;if(o){if(n.nesting!==1)return null;for(;s<e.length;){let t=e[s];if(t.level===0){if(t.type!==o||t.nesting!==-1)return null;s++;break}s++}if(e[s-1]?.type!==o)return null;if(n.type===`paragraph_open`||n.type===`heading_open`){if(s!==a+3||e[a+1]?.type!==`inline`)return null}else i=!0}else if(j_.has(n.type)){if(n.nesting!==0)return null;i=!0}else return null;for(let n=a;n<s;n++){let r=e[n];if(r.type!==`inline`)continue;let i=r.children;if(!Array.isArray(i)||!P_(i,t))return null}r.push(a),a=s}return{mixed:i,starts:r}}function L_(e){return/\r?\n[\t ]*\r?\n[\t ]*$/.test(e)}function R_(e){return e.reuseStableTopLevelNodes===!0&&e.final!==!0&&!e.preTransformTokens&&!e.postTransformTokens&&!e.postTransformNodes&&!e.customHtmlTags?.length&&e.includeSourceMap!==!0}function z_(e,t){let n=e?.map,r=t?.map;return n===r?!0:!Array.isArray(n)||!Array.isArray(r)?!1:n.length===r.length&&n.every((e,t)=>e===r[t])}function B_(e,t){let n=e?.attrs,r=t?.attrs;if(n===r)return!0;if(!Array.isArray(n)||!Array.isArray(r)||n.length!==r.length)return!1;for(let e=0;e<n.length;e++){let t=n[e],i=r[e];if(t[0]!==i[0]||t[1]!==i[1])return!1}return!0}function V_(e,t){return!!e&&!!t&&e.type===t.type&&e.tag===t.tag&&e.nesting===t.nesting&&e.level===t.level&&e.markup===t.markup&&e.content===t.content&&e.info===t.info&&z_(e,t)&&B_(e,t)}function H_(e,t,n,r,i,a,o,s=0,c){let l=r.starts;if(l.length===0||i.length!==l.length){e.structuredStream=void 0;return}let u=l.map((e,t)=>{let r=l[t+1]??n.length;return{firstToken:n[e],lastToken:n[r-1],tokenCount:r-e}}),d=r.mixed?Math.max(0,l.length-1):L_(t)?l.length:Math.max(0,l.length-1),f=d-s-1,p=f>=0?o?.[f]:c;e.structuredStream={groupBoundaries:u,groupStarts:l,tokenCount:n.length,tokens:n,mixed:r.mixed,source:t,nodes:i,linkifyDemotionContext:p,stableGroupCount:d,requireClosingStrong:a.requireClosingStrong,validateLink:a.validateLink}}function U_(e,t,n,r){if(e.tokens===t)return!0;let i=n.length-1;for(let a=0;a<r;a++){let r=n[a],o=n[a+1]??t.length,s=e.groupBoundaries[a];if(!s||s.tokenCount!==o-r||(s.firstToken!==t[r]||s.lastToken!==t[o-1])&&(a>=i||!V_(s.firstToken,t[r])||!V_(s.lastToken,t[o-1])))return!1}return!0}function W_(e,t,n,r,i){let a=r.disableStructuredReuse,o=v_(e,r)&&R_(r);if(r.isFragment||(e.structuredReuseTailStart=void 0),!o)return a||(e.structuredStream=void 0),i.processTokens(n,r);if(a)return i.processTokens(n,r);let s=e.structuredStream,c=D_(e),l=!!s&&(c===`append`||c===`tail`)&&s.tokenCount!==void 0&&s.tokenCount<=n.length&&n===s.tokens,u;if(l){let e=I_(n,r.validateLink,s.tokenCount);u=e?{starts:s.groupStarts.concat(e.starts),mixed:s.mixed||e.mixed}:I_(n,r.validateLink)}else u=I_(n,r.validateLink);if(!u)return e.structuredStream=void 0,i.processTokens(n,r);let d=u.starts,f=s&&u.mixed?Math.min(s.stableGroupCount,Math.max(0,s.groupBoundaries.length-1)):s?.stableGroupCount??0;if(s&&f>0&&s.requireClosingStrong===r.requireClosingStrong&&s.validateLink===r.validateLink&&e.sourceExtends(s.source,t)&&d.length>=f&&(c===`append`||c===`tail`)&&U_(s,n,d,f)){let a=d[f]??n.length,o={...r,linkifyDemotionSeedContext:s.linkifyDemotionContext},c=i.processTokens(n.slice(a),o),l=d.length-f;if(c.length===l){let a=s.nodes.slice(0,f).concat(c);return e.structuredReuseTailStart=f,i.recordReusedTopLevelNodes?.(f),H_(e,t,n,u,a,r,o.linkifyDemotionResultContexts,f,s.linkifyDemotionContext),a}}let p=i.processTokens(n,r);return H_(e,t,n,u,p,r,r.linkifyDemotionResultContexts),p}function G_(e){if(e.type!==`html_block`||String(e.tag??``).toLowerCase()!==`details`)return!1;let t=String(e.raw??e.content??``);return/^\s*<details\b/i.test(t)}function K_(e){if(e.type!==`html_block`)return!1;let t=String(e.raw??e.content??``);return/^\s*<\/details\b/i.test(t)}function q_(e,t){return Hf(e,{final:t,requireClosingStrong:e.requireClosingStrong,customHtmlTags:e.customHtmlTags,validateLink:e.validateLink},{disableStreamParse:!0,disableStructuredReuse:!0,isFragment:!0})}var J_=new Set([`admonition`,`blockquote`,`code_block`,`definition_list`,`footnote`,`heading`,`list`,`math_block`,`table`,`thematic_break`]),Y_=/(?:^|\n)\s{0,3}(?:#{1,6}\s+\S|[-+*]\s+\S|\d+[.)]\s+\S|>\s*\S|`{3,}|~{3,}|(?:\*{3,}|-{3,}|_{3,})(?:\s|$)|\|.*\|)/m,X_=/(?:^|\n)(?: {4}|\t)(?![ \t]*<)\S/m;function Z_(e){return/\n\s*\n/.test(e)||Y_.test(e)||X_.test(e)}function Q_(e){if(e.length===0)return!1;if(e.some(e=>J_.has(String(e?.type??``).toLowerCase()))||e.some(e=>{if(e?.type!==`html_block`)return!1;let t=e;return Array.isArray(t.children)&&t.children.length>0})||e.length>1)return!0;let[t]=e;return!!(t&&t.type===`paragraph`)}function $_(e){let t=[],n=0;for(;n<e.length;){for(;/\s/.test(e[n]??``);)n++;if(n>=e.length)break;let r=e.slice(n).match(/^<([A-Z][\w:-]*)/i);if(!r?.[1])return null;let i=lg(e,r[1],n);if(!i||i.start!==n)return null;t.push(i.raw),n=i.end}return t.length>1?t:null}function ev(e,t,n){return e.trim()?t.parseFragment(e,n):[]}function tv(e,t,n,r,i){let a=n.customHtmlTags?.join(`\0`)??``,o=n.runtime,s=i?o?.siblingHtmlChildren:void 0,c=s&&s.final===r&&s.customHtmlTags===a&&s.requireClosingStrong===n.requireClosingStrong&&s.validateLink===n.validateLink,l=e.map((e,r)=>c&&s.blocks[r]===e?s.children[r]:ev(e,t,n));return i&&o&&(o.siblingHtmlChildren={blocks:e,children:l,customHtmlTags:a,final:r,requireClosingStrong:n.requireClosingStrong,validateLink:n.validateLink}),l.flat()}function nv(e,t,n,r){return e.map(e=>{if(e?.type!==`html_block`)return e;let i=e,a=String(i.tag??``).toLowerCase();if(!a||a===`details`||Ed.has(a)||Array.isArray(i.children))return e;let o=String(e.raw??i.content??``);if(!o)return e;let s=Jd(o);if(s===-1)return e;let c=lg(o,a,0),l=c?.closeStart??-1,u=c?.closed===!0&&l>=s+1,d=u?o.slice(s+1,l):o.slice(s+1);if(!d.trim()||!Z_(d))return e;let f=q_(n,r),p=u?null:$_(d),m=!n.isFragment&&typeof n.preTransformTokens!=`function`&&typeof n.postTransformTokens!=`function`&&typeof n.postTransformNodes!=`function`&&t.markdownIt.__markstreamHasCustomParserExtensions===!1&&Hp(n.validateLink),h=p?tv(p,t,f,r,m):ev(d,t,f);return Q_(h)&&(i.children=h),e})}function rv(e,t=0){for(let n=t;n<e.length;n++)if(e[n]?.type===`html_block`)return!0;return!1}function iv(e,t,n){let r=ev(e,t,n),i=r[0];return r.length===1&&i?.type===`paragraph`&&Array.isArray(i.children)?i.children:r}function av(e,t,n){let r=xg({content:e}),i=Jd(e),a=hg(e,`summary`);if(i!==-1&&a!==-1&&a>=i+1){let o=iv(e.slice(i+1,a),t,n);o.length>0&&(r.children=o)}return r.raw=e,r}function ov(e,t,n){let r=Jd(e);if(r===-1)return[];let i=e.slice(r+1);if(!i.trim())return[];let a=lg(i,`summary`,0);if(!a)return ev(i,t,n);let o=i.slice(0,a.start),s=i.slice(a.end);return[...ev(o,t,n),av(a.raw,t,n),...ev(s,t,n)]}function sv(e,t,n,r,i,a=0){let o=[],s=a;for(let a=0;a<e.length;a++){let c=e[a],l=og(c),u=-1;if(l&&(u=t.indexOf(l,s),u!==-1&&(s=u+l.length)),!G_(c)){o.push(c);continue}let d=String(c.raw??og(c)??``),f=u===-1?t.indexOf(d,Math.max(0,s-d.length)):u;if(f===-1){o.push(c);continue}let p=1,m=-1;for(let t=a+1;t<e.length;t++){let n=e[t];if(G_(n))p++;else if(K_(n)&&(p--,p===0)){m=t;break}}let h=lg(t,`details`,f),g=m===-1&&h?.closed===!0,_=g?(()=>{let e=hg(d,`details`);return e===-1?d:d.slice(0,e)})():d,v=m===-1?`</details>`:String(e[m].raw??og(e[m])??`</details>`),y=g||m!==-1&&h?.closed===!0,b=v.replace(/[\t\r\n ]+$/,``),x=y?(()=>{let e=(h?.raw??``).lastIndexOf(b);return e===-1?t.length:f+e})():t.length,S=Jd(d),C=S===-1?f+d.length:f+S+1,w=t.slice(C,x===-1?t.length:x),T=x+b.length,E=y?Math.max(x+v.length,mg(t,T)):t.length,D=y?t.slice(x,E):v,O=y?t.slice(f,E):t.slice(f),k=R_(r)&&(r.runtime?.structuredReuseTailStart??0)>0?r.runtime?.detailsStitchCache:void 0,A=k?.get(c);if(A&&A.openRaw===d&&A.explicitClose===y&&A.closeSliceEnd===E&&A.middleSource===w){if(o.push(A.node),s=y?E:t.length,m===-1&&!g)break;m!==-1&&(a=m);continue}let[j]=sv(g?[]:m===-1?e.slice(a+1):e.slice(a+1,m),t,n,r,i,f+d.length),M=ov(_,n,q_(r,i)),N=j,ee=j[0];if(!M.some(e=>{let t=e;return t?.type===`html_block`&&String(t.tag??``).toLowerCase()===`summary`})){if(ee?.type===`html_block`&&String(ee.tag??``).toLowerCase()===`summary`&&!Array.isArray(ee.children))N=[av(String(ee.raw??ee.content??``),n,q_(r,i)),...j.slice(1)];else if(S!==-1){let e=lg(t,`summary`,f+S+1);if(e&&e.closed){let a=t.slice(f+S+1,e.start);/^[\t \r\n]*$/.test(a)&&(M=[av(e.raw,n,q_(r,i)),...M])}}}let te=n.markdownIt.parse(w,{__markstreamFinal:i}),P=n.markdownIt.renderer.render(te,n.markdownIt.options,{__markstreamFinal:i}),ne=S===-1?d:t.slice(f,f+S+1),F={...c,tag:`details`,attrs:Yd(d.slice(0,S+1)),raw:O,content:`${ne}${P}${D}`,children:[...M,...N],loading:!i&&!y};if(r.includeSourceMap&&(F.sourceMap=Tg(t,f,y?E:t.length,r)),k&&y&&k.set(c,{openRaw:d,explicitClose:y,closeSliceEnd:E,middleSource:w,node:F}),o.push(F),s=y?E:t.length,m===-1&&!g)break;m!==-1&&(a=m)}return[o,s]}function cv(e,t,n,r,i){if(!t)return-1;let a=i.getInternalNodeSourceRange(e)?.start??-1,o=a>=r&&n.startsWith(t,a);return e?.type===`html_block`?o&&a===r?a:n.indexOf(t,r):a<0?n.indexOf(t,r):o?a:-1}function lv(e,t,n,r,i,a=0){if(!n)return e;let o=e.slice(),s=a;for(let e=0;e<o.length;e++){let a=o[e],c=og(a),l=cv(a,c,n,s,r);if(a?.type!==`html_block`){l!==-1&&(s=l+c.length);continue}let u=String(a.tag??``).toLowerCase();if(!u)continue;if(u===`details`){l!==-1&&(s=l+c.length);continue}let d=lg(n,u,l===-1?s:l);if(!d)continue;s=d.end;let f=String(a.content??c),p=String(a.raw??f),m=l+p.length;if(l!==-1&&d.end<m&&n.slice(l,m)===p){s=m,i?.includeSourceMap&&(a.sourceMap=Tg(n,l,m,i));continue}let h=dg(d.raw,u,d.closed),g=!t&&!d.closed,_=f!==h||p!==d.raw||!!a.loading!==g,v=Jd(d.raw),y=v===-1?``:d.raw.slice(0,v+1),b=y?Yd(y):[];if(a.content=h,a.raw=d.raw,a.loading=g,a.attrs=b.length?b:void 0,i?.includeSourceMap&&(a.sourceMap=Tg(n,d.start,d.end,i)),!_)continue;let x=ug(d.raw,p);x===-1&&(x=0);let S=e+1;for(;S<o.length;){if(d.closed&&sg(o[S],u)){o.splice(S,1);continue}let e=og(o[S]);if(!e)break;let t=d.raw.indexOf(e,x);if(t===-1){if(pg(n,d.end,e))break;let t=r.getInternalNodeSourceRange(o[S]);if(!t)break;if(t.start>=d.start&&t.end<=d.end){o.splice(S,1);continue}break}x=t+e.length,o.splice(S,1)}}return o}function uv(e){let t=e.meta??{};return{type:`checkbox`,checked:t.checked===!0,raw:t.checked?`[x]`:`[ ]`}}function dv(e){let t=e,n=t.attrGet?t.attrGet(`checked`):void 0,r=n===``||n===`true`;return{type:`checkbox_input`,checked:r,raw:r?`[x]`:`[ ]`}}function fv(e){let t=String(e.content??``);return{type:`emoji`,name:t,markup:String(e.markup??``),raw:`:${t}:`}}function pv(e,t,n,r,i=!1){let a=``,o=t+1,s=1,c=[];for(;o<e.length;){if(e[o].type===n){if(s===1)break;s--}r&&e[o].type===r&&s++;let t=e[o];a+=String(i?e[o].content??t.text??``:e[o].content??``),c.push(e[o]),o++}return{content:a,innerTokens:c,nextIndex:o<e.length?o+1:e.length}}function mv(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=pv(e,t,`em_close`,void 0,!0);return i.push(...n(o,void 0,void 0,r)),{node:{type:`emphasis`,children:i,raw:`*${a}*`},nextIndex:s}}function hv(e){return Qh(`(?:^|\\r\\n|\\n|\\r) {0,3}${e}+[ \\t]*$`)}var gv=[`diff `,`index `,`--- `,`+++ `,`@@ `],_v=/\r?\n/;function vv(e){let t=String(e??``);return t?gv.some(e=>e.startsWith(t)||t.startsWith(e)):!1}function yv(e,t,n,r){n.length>0&&e.push(...n),r.length>0&&t.push(...r),n.length=0,r.length=0}function bv(e,t){return!t&&e.startsWith(` `)&&!e.startsWith(` `)?` ${e}`:e}function xv(e,t){let n=[],r=[],i=[],a=[],o=e.split(_v),s=/\r?\n$/.test(e),c=o.some(e=>e.startsWith(`diff `)||e.startsWith(`--- `)||e.startsWith(`+++ `)||e.startsWith(`@@ `)),l=e=>{let t=e;if(!gv.some(e=>t.startsWith(e))){if(t.startsWith(`-`)){let e=t.slice(1);i.push(bv(e,c))}else if(t.startsWith(`+`)){let e=t.slice(1);a.push(bv(e,c))}else{yv(n,r,i,a);let e=c&&t.startsWith(` `)?t.slice(1):t;n.push(e),r.push(e)}}},u=s?Math.max(0,o.length-1):o.length;for(let e=0;e<u;e++){let n=o[e]??``;(t||s||e!==u-1||!vv(n))&&l(n)}(t||i.length>0||a.length>0)&&yv(n,r,i,a);let d=n.join(`
|
|
129
|
+
`),f=r.join(`
|
|
130
|
+
`);return{original:t&&s&&d?`${d}\n`:d,updated:t&&s&&f?`${f}\n`:f}}function Sv(e){let t=Array.isArray(e.map)&&e.map.length===2,n=e.meta??{},r=typeof n.closed==`boolean`?n.closed:void 0,i=r===!0||r!==!1&&t,a=String(e.info??``),o=a.startsWith(`diff`),s=o?(()=>{let e=a,t=e.indexOf(` `);return t===-1?``:String(e.slice(t+1)??``)})():a,c=String(e.content??``);if(!i&&e.markup){let t=e.markup[0],n=hv(t);n.test(c)&&(c=c.replace(n,``))}if(o){let{original:e,updated:n}=xv(c,i===!0);return{type:`code_block`,language:s,code:String(n??``),raw:String(c??``),diff:o,loading:r===!0?!1:r===!1||!t,originalCode:e,updatedCode:n}}return{type:`code_block`,language:s,code:String(c??``),raw:String(c??``),diff:o,loading:r===!0?!1:r===!1||!t}}function Cv(e){let t=e.meta??{};return{type:`footnote_reference`,id:String(t.label??``),raw:`[^${String(t.label??``)}]`}}function wv(){return{type:`hardbreak`,raw:`\\
|
|
131
|
+
`}}function Tv(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=pv(e,t,`mark_close`);return i.push(...n(o,void 0,void 0,r)),{node:{type:`highlight`,children:i,raw:`==${a}==`},nextIndex:s}}function Ev(e){let t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return xd;let n=new Set(xd);for(let e of $d(t))e&&n.add(e);return n}var Dv=null,Ov=new WeakMap;function kv(){return Dv||={customTagSet:null,allowedTagSet:Ev()},Dv}function Av(e){let t=e.match(/^<\s*(?:\/\s*)?([\w-]+)/);return t?t[1].toLowerCase():``}function jv(e){return/^<\s*\//.test(e)}function Mv(e,t){return/\/\s*>\s*$/.test(t)||yd.has(e)}function Nv(e){if(!e||e.length===0)return kv();let t=Ov.get(e);if(t)return t;let n=e.map(Qd).filter(Boolean);if(!n.length){let t=kv();return Ov.set(e,t),t}let r={customTagSet:new Set(n),allowedTagSet:Ev({customHtmlTags:e})};return Ov.set(e,r),r}function Pv(e){let t=e,n=t.raw??t.content??t.markup??``;return String(n??``)}function Fv(e){let t=e.meta,n=t?.markstreamCustomHtmlRaw,r=t?.markstreamCustomHtmlInner;return typeof n==`string`&&typeof r==`string`?{raw:n,inner:r}:null}function Iv(e,t){let n=t.toLowerCase();for(let t=e.length-1;t>=0;t--){let[r,i]=e[t];if(String(r).toLowerCase()===n)return i}}function Lv(e,t,n){let r=e.slice();return Iv(r,`href`)||r.push([`href`,t]),n!=null&&!Iv(r,`title`)&&r.push([`title`,n]),r}function Rv(e){return e.map(Pv).join(``)}function zv(e){let t=[],n=e=>{let n=String(e??``);if(!n)return;let r=t[t.length-1];r?.type===`text`?(r.content=`${r.content}${n}`,r.raw=`${r.raw}${n}`):t.push({type:`text`,content:n,raw:n})};for(let r of e)r&&(r.type===`reference`||r.type===`footnote_reference`?n(String(r.raw??``)):`children`in r&&Array.isArray(r.children)?t.push({...r,children:zv(r.children)}):t.push(r));return t}function Bv(e,t,n){let r=0;for(let i=t;i<e.length;i++){let t=e[i];if(t.type!==`html_inline`)continue;let a=String(t.content??``),o=Av(a),s=jv(a),c=Mv(o,a);if(!s&&!c&&o===n)r++;else if(s&&o===n){if(r===0)return i;r--}}return-1}function Vv(e,t,n){let r=[e[t]],i=[],a=t+1,o=!1,s=n?Bv(e,t+1,n):-1;return s===-1?(i=e.slice(t+1),i.length&&r.push(...i),a=e.length):(i=e.slice(t+1,s),r.push(...i,e[s]),a=s+1,o=!0),{closed:o,html:Rv(r),innerTokens:i,nextIndex:a}}function Hv(e,t,n,r,i,a,o){let s=String(e.content??``),c=Av(s),{customTagSet:l,allowedTagSet:u}=Nv(o?.customHtmlTags);if(!c)return[{type:`inline_code`,code:s,raw:s},n+1];if(!u.has(c)&&!Vv(t,n,c).closed){let t=Pv(e);return[{type:`text`,content:t,raw:t},n+1]}if(c===`br`)return[{type:`hardbreak`,raw:s},n+1];let d=jv(s),f=Mv(c,s);if(d)return[{type:`html_inline`,tag:c,content:s,children:[],raw:s,loading:!1},n+1];if(c===`a`){let e=Vv(t,n,c),l=Yd(s),u=e.innerTokens,d=String(Iv(l,`href`)??``),f=Iv(l,`title`),p=f==null?null:String(f),m=Lv(l,d,p),h=zv(u.length?r(u,i,a,o):[]),g=u.length?Rv(u):d||``;return!h.length&&g&&h.push({type:`text`,content:g,raw:g}),[{type:`link`,href:d,title:p,text:g,attrs:m,children:h,loading:!e.closed,raw:e.html||s,markup:`html`},e.nextIndex]}if(f)return[{type:l?.has(c)?c:`html_inline`,tag:c,content:s,children:[],raw:s,loading:!1},n+1];let p=Vv(t,n,c);if(c===`p`||c===`div`)return[{type:`paragraph`,children:zv(p.innerTokens.length?r(p.innerTokens,i,a,o):[]),raw:p.html},p.nextIndex];let m=zv(p.innerTokens.length?r(p.innerTokens,i,a,o):[]),h=p.html||s,g=!p.closed,_=!1;if(!p.closed){let e=`</${c}>`;h.toLowerCase().includes(e.toLowerCase())||(h+=e),_=!0,g=!0}let v=[],y=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,b;for(;(b=y.exec(s))!==null;){let e=b[1],t=b[2]||b[3]||b[4]||``;v.push([e,t])}if(l?.has(c)){let t=Fv(e);return[{type:c,tag:c,attrs:v,content:t?t.inner:p.innerTokens.length?Rv(p.innerTokens):``,children:p.innerTokens.length?r(p.innerTokens,i,a,o):[],raw:t?.raw??h,loading:e.loading||g,autoClosed:_},p.nextIndex]}return[{type:`html_inline`,tag:c,attrs:v,content:h,children:m,raw:h,loading:g,autoClosed:_},p.nextIndex]}function Uv(e){let t=String(e.content??``);return{type:`inline_code`,code:t,raw:t}}function Wv(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=pv(e,t,`ins_close`);return i.push(...n(o,void 0,void 0,r)),{node:{type:`insert`,children:i,raw:`++${String(a)}++`},nextIndex:s}}function Gv(e){if(e.type===`math_inline`){if(e.raw)return String(e.raw);let t=e.markup===`$$`?`$$`:`$`;return`${t}${String(e.content??``)}${t}`}return Array.isArray(e.children)&&e.children.length>0?e.children.map(e=>Gv(e)).join(``):String(e.content??``)}function Kv(e){return!e||!Array.isArray(e.children)||e.children.length===0?``:e.children.map(e=>Gv(e)).join(``)}function qv(e,t=!1){let n=e.attrs??[],r=null;if((!n||n.length===0)&&Array.isArray(e.children))for(let t of e.children){let e=t.attrs;if(Array.isArray(e)&&e.length>0){n=e,r=t;break}}let i=String(n.find(e=>e[0]===`src`)?.[1]??``),a=n.find(e=>e[0]===`alt`)?.[1],o=Kv(r??e),s=``;o?s=o:a!=null&&String(a).length>0?s=String(a):r?.content!=null&&String(r.content).length>0?s=String(r.content):Array.isArray(r?.children)&&r.children[0]?.content?s=String(r.children[0].content):Array.isArray(e.children)&&e.children[0]?.content?s=String(e.children[0].content):e.content!=null&&String(e.content).length>0&&(s=String(e.content));let c=n.find(e=>e[0]===`title`)?.[1]??null,l=c===null?null:String(c),u=String(e.content??``);return{type:`image`,src:i,alt:s,title:l,raw:u,loading:t}}function Jv(e){let t=[];if(!Array.isArray(e))return t;for(let n of e){let e=n?.[0];e&&t.push([String(e),String(n?.[1]??``)])}return t}function Yv(e,t){let n=t.toLowerCase();for(let t=e.length-1;t>=0;t--){let[r,i]=e[t];if(String(r).toLowerCase()===n)return i}}function Xv(e,t,n){let r=e.slice();return Yv(r,`href`)||r.push([`href`,t]),n!=null&&!Yv(r,`title`)&&r.push([`title`,n]),r}function Zv(e,t,n,r){let i=e[t],a=Jv(i.attrs),o=String(Yv(a,`href`)??``),s=Yv(a,`title`),c=s==null?null:String(s),l=Xv(a,o,c),u=t+1,d=[],f=!0;for(;u<e.length&&e[u].type!==`link_close`;)d.push(e[u]),u++;e[u]?.type===`link_close`&&(f=!1);let p=d,m=d[d.length-1];if(zf(r)&&r.insideStrong&&m?.type===`text`&&String(m.content??``).endsWith(`**`)&&!d.some(e=>e.type===`strong_open`)){let e=String(m.content??``),t=String(m.raw??e),n=Og(m);n.content=e.slice(0,-2),n.raw=t.replace(/\*\*$/,``),p=d.slice(),p[p.length-1]=n}let h=n(p,void 0,void 0,r),g=h.map(e=>{let t=e;return`content`in e?String(t.content??``):String(t.raw??``)}).join(``);return{node:{type:`link`,href:o,title:c,text:g,children:h,raw:String(`[${g}](${o}${c?` "${c}"`:``})`),loading:f,attrs:l,markup:zp(i)},nextIndex:u<e.length?u+1:e.length}}var Qv=/\\([\\()[\]`$|*_\-!])/g,$v=new Set([`\\`,`(`,`)`,`[`,`]`,"`",`$`,`|`,`*`,`_`,`-`,`!`]),ey=1,ty=2,ny=4,ry=8,iy=16,ay=32,oy=64,sy=128,cy=256,ly=512,uy=1024,dy=1982;function fy(e){let t=0;for(let n=0;n<e.length;n++)switch(e.charCodeAt(n)){case 33:t|=sy;break;case 36:t|=cy;break;case 40:t|=uy;break;case 42:t|=ty;break;case 91:t|=ay;break;case 92:t|=ey;break;case 93:t|=oy;break;case 95:t|=ny;break;case 96:t|=iy;break;case 124:t|=ly;break;case 126:t|=ry}return t}function py(e){let t=``,n=0;for(;n<e.length;){if(e[n]!==`\\`){t+=e[n],n++;continue}let r=0;for(;n+r<e.length&&e[n+r]===`\\`;)r++;let i=e[n+r];if(t+=`\\`.repeat(Math.floor(r/2)),r%2==1){if(i&&$v.has(i)){t+=i,n+=r+1;continue}t+=`\\`}n+=r}return t}function my(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[r+1];if(i===`\\`&&a&&$v.has(a)){if(n===t)return r+1;n++,r++}else{if(n===t)return r;n++}}return-1}function hy(e,t,n){let r=my(e,t);if(r===-1||n&&e[r]!==n)return!1;let i=0;for(let t=r-1;t>=0&&e[t]===`\\`;t--)i++;return i%2==1}function gy(e,t){if(!e||!t)return null;let n=e.match(/\[([^\]\n]+)\]\(([^)]*)$/);return n&&n[2]===t?n[1]:null}function _y(e,t){return String(e.markup??``).startsWith(t)}function vy(e,t,n=fy(e)){let r=e,i=String(t.content??``);return(n&ey)!==0&&r.endsWith(`\\`)&&!_y(t,`\\\\`)&&!i.endsWith(`\\\\`)&&(r=r.slice(0,-1)),(n&uy)!==0&&r.endsWith(`(`)&&!_y(t,`\\(`)&&!i.endsWith(`\\(`)&&(r=r.slice(0,-1)),(n&ty)!==0&&/\*+$/.test(r)&&!_y(t,`\\*`)&&!i.endsWith(`\\*`)&&(r=r.replace(/\*+$/,``)),r}function yy(e,t){if(!e)return;let n=String(e);if(n&&(n===t||n.replace(Qv,`$1`)===t))return n}function by(e,t,n,r,i){let a=[],{content:o,innerTokens:s,nextIndex:c}=pv(e,t,`strong_close`,`strong_open`),l={...Vf(i),insideStrong:!0};return a.push(...n(s,yy(r,o),void 0,l)),{node:{type:`strong`,children:a,raw:`**${String(o)}**`},nextIndex:c}}var xy=/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,Sy=/:\/\//;function Cy(e){return e?xy.test(e)||Sy.test(e):!1}function wy(e,t,n){if(!t)return;let r=e.parseInlineTokens([{...n,type:`text`,content:t,raw:t}],t,e.pPreToken,e.options);if(r.length===1&&r[0]?.type===`text`){let t=r[0];e.pushText(String(t.content??``),String(t.raw??t.content??``))}else for(let t of r)e.pushParsed(t)}function Ty(e,t){return t.endsWith(`](`)?e.tokens[e.index+1]?.type===`link_open`&&e.tokens[e.index+1]?.markup===`linkify`&&e.tokens[e.index+2]?.type===`text`&&e.tokens[e.index+3]?.type===`link_close`&&e.tokens[e.index+4]?.type===`text`&&String(e.tokens[e.index+4]?.content??``).startsWith(`)`):!1}function Ey(e,t){if(Dy(e,t))return;if(Ry(e)){let{node:t,nextIndex:n}=Zv(e.tokens,e.index,e.parseInlineTokens,e.options),r=String(t.text||t.href||``);e.pushText(r,r),e.index=n;return}e.resetCurrentTextNode();let n=e.index,{node:r,nextIndex:i}=Zv(e.tokens,e.index,e.parseInlineTokens,e.options);e.index=i;let a=r.text||r.href||``;if(t.markup===`linkify`&&!Dp(a,r.href,e.raw)&&Pp(a,e.options.linkifyDemotionContext)){e.pushText(a,a);return}let o=r.children.length===1&&r.children[0]?.type===`text`;if(r.loading&&e.raw&&r.text===r.href&&o){let t=gy(e.raw,r.href);t&&(r.text=t,r.children=[{type:`text`,content:t,raw:t}],r.raw=String(`[${t}](${r.href}${r.title?` "${r.title}"`:``})`))}if(e.options?.validateLink&&!e.options.validateLink(r.href)){e.pushText(r.text,r.text);return}let s=t.attrs?.find(([e])=>e===`href`)?.[1],c=String(s??``);if(e.raw&&c){let t=e.raw.indexOf(`](`);if(t!==-1){let n=e.raw.indexOf(`)`,t+2);n===-1?r.loading=!0:r.loading&&e.raw.slice(t+2,n).includes(c)&&(r.loading=!1)}}/^file:\/\/\/[a-z]:\//i.test(r.href)&&jy(e,r,n-1)||Oy(e,r)||e.pushParsed(r)}function Dy(e,t){if(t.markup!==`linkify`)return!1;let{node:n,nextIndex:r}=Zv(e.tokens,e.index,e.parseInlineTokens,e.options);return Ay(e,n,r)?(e.index=r,!0):!1}function Oy(e,t){if(t.type!==`link`)return!1;let n=e.result[e.result.length-1];if(!n||n.type!==`text`)return!1;let r=String(n.content??``).match(/^([^[]*)\[([^\]\n]+)\]\($/);if(!r)return!1;let i=t,a=String(i.href??``),o=String(i.text??``),s=String(r[2]??``),c=a.replace(/^(?:https?:\/\/|mailto:|ftp:\/\/)/i,``);if(!a||!(o===a||o===c||Cy(o)))return!1;let l=String(r[1]??``);return l?(n.content=l,n.raw=l):e.result.pop(),e.pushParsed({...t,text:s,children:[{type:`text`,content:s,raw:s}],raw:String(`[${s}](${a}${i.title?` "${i.title}"`:``})`),markup:zp(t)}),!0}function ky(e,t){if(t.type!==`link`)return!1;let n=t,r=String(n.href??``);return r?Ay(e,{href:r,title:n.title==null||n.title===``?null:String(n.title),loading:!!n.loading},e.index+1):!1}function Ay(e,t,n){let r=e.result[e.result.length-1];if(r?.type!==`image`||r.src||!r.loading||!String(r.raw??``).endsWith(`](`))return!1;let i=e.tokens[n],a=String(i?.content??``);if(i?.type!==`text`||!a.startsWith(`)`))return!1;e.result.pop(),e.currentTextNode=null;let o=String(r.alt??``);e.pushParsed({type:`image`,src:t.href,alt:o,title:t.title,raw:String(``),loading:!!t.loading});let s=a.slice(1),c=Og(i);return c.content=s,c.raw=s,e.ensureWorkingTokens()[n]=c,!0}function jy(e,t,n=e.index-1){if(t.type!==`link`)return!1;let r=e.result[e.result.length-1],i=e.tokens[n];if(!r||r.type!==`text`||i?.type!==`text`)return!1;let a=String(r.content??``),o=String(i.content??``);if(!a.endsWith(`!`)||!o.endsWith(`!`)||_y(i,`\\!`))return!1;let s=a.slice(0,-1);s?(r.content=s,r.raw=s,e.currentTextNode=r):(e.result.pop(),e.currentTextNode=null);let c=t,l=String(c.text??c.children?.map(e=>String(e?.content??e?.raw??``)).join(``)??``),u=String(c.href??``),d=c.title==null||c.title===``?null:String(c.title);return e.pushParsed({type:`image`,src:u,alt:l,title:d,raw:String(``),loading:!!c.loading}),!0}function My(e,t=``,n=null){let r=String(e.alt??e.raw??``);return{type:`link`,href:t,title:n,text:r,children:[e],raw:String(`[${r}](${t}${n?` "${n}"`:``})`),loading:!0,markup:``}}function Ny(e){let t=e.startsWith(`;return{type:`image`,src:``,alt:r===-1?n.replace(/\]$/,``):n.slice(0,r),title:null,raw:t,loading:!0}}function Py(e,t){let n=t.indexOf(`[![`);if(n===-1||typeof e.raw==`string`&&e.tokens.length===1&&hy(e.raw,n,`[`))return!1;let r=t.slice(0,n);r&&e.pushText(r,r);let i=Ny(t.slice(n+1));return e.pushParsed(My(i)),e.index++,!0}function Fy(e,t){if(e.options?.final)return!1;let n=e.tokens[e.index-1];if(n?.type!==`text`||!String(n.content??``).endsWith(`[`)||_y(n,`\\[`))return!1;let r=e.result[e.result.length-1];if(r?.type===`text`&&r.content.endsWith(`[`)){let t=r.content.slice(0,-1);t?(r.content=t,r.raw=t,e.currentTextNode=r):(e.result.pop(),e.currentTextNode=null)}let i=qv(t);return e.pushParsed(My(i)),e.index++,!0}function Iy(e,t){if(t.type!==`link`)return!1;let n=t,r=String(n.raw??``),i=String(n.text??``);if(!r.startsWith(`[![`)&&!i.startsWith(`![`))return!1;let a=n.title==null||n.title===``?null:String(n.title),o={type:`image`,src:String(n.href??``),alt:i.replace(/^!\[/,``).replace(/\]$/,``),title:a,raw:r.startsWith(`[)return!1;let n=e.tokens[e.index-2];if(n?.type===`text`&&String(n.content??``).endsWith(`[`)&&_y(n,`\\[`))return!1;let r=e.result[e.result.length-1];if(r?.type!==`image`&&r?.type!==`link`)return!1;let i=r,a=r?.type===`link`&&Array.isArray(i.children)&&i.children.length===1&&i.children[0]?.type===`image`?e.result.pop():null,o=a?a.children[0]:e.result.pop();if(!o||o.type!==`image`)return!1;let s=e.tokens[e.index+1],c=String(a?.href??``),l=a?.title==null?null:String(a.title),u=!0;if(s?.type===`link_open`){let{node:t,nextIndex:n}=Zv(e.tokens,e.index+1,e.parseInlineTokens,e.options);c=t.href,l=t.title,u=!0,e.index=n}else{if(c=t.slice(2),c.includes(`"`)){let e=c.split(`"`);c=String(e[0]??``).trim(),l=e[1]==null?null:String(e[1]).trim()}e.index++}let d=My(o,c,l);return d.loading=u,e.pushParsed(d),!0}function Ry(e){let t=e.tokens[e.index-3];return e.tokens[e.index-2]?.type===`image`&&e.tokens[e.index-1]?.type===`text`&&String(e.tokens[e.index-1].content??``)===`](`&&t?.type===`text`&&String(t.content??``).endsWith(`[`)&&_y(t,`\\[`)}function zy(e,t,n){let r=t.indexOf(`[`);if(r===-1)return!1;let i=t.slice(0,r),a=t.indexOf(`](`,r);if(a!==-1){let o=e.tokens[e.index+2],s=t.slice(r+1,a);if(s.includes(`[`)){let e=s.indexOf(`[`);i+=t.slice(0,r+e+1);let n=r+e+1;s=t.slice(n+1,a)}let c=e.tokens[e.index+1];if(t.endsWith(`](`)&&c?.type===`link_open`&&o){let t=e.tokens[e.index+4],r=4,a=!0;if(t?.type===`text`){let n=String(t.content??``);if(n.startsWith(`)`)){a=!1;let i=n.slice(1);if(i){let n=Og(t);n.content=i,n.raw=i,e.ensureWorkingTokens()[e.index+4]=n}else r++}else n===`.`&&r++}wy(e,i,n);let c=String(o.content??``);return e.options?.validateLink&&!e.options.validateLink(c)?e.pushText(s,s):e.pushParsed({type:`link`,href:c,title:null,text:s,children:[{type:`text`,content:s,raw:s}],loading:a,markup:``}),e.index+=r,!0}let l=t.indexOf(`)`,a),u=l===-1?``:t.slice(a+2,l),d=l===-1,f=i.match(/\*+$/);if(f&&(i=i.replace(/\*+$/,``)),wy(e,i,n),f||=s.match(/^\*+/),!e.requireClosingStrong&&f){let t=f[0].length;s=s.replace(/^\*+/,``).replace(/\*+$/,``);let n=[];if(t===1?n.push({type:`em_open`,tag:`em`,nesting:1}):t===2?n.push({type:`strong_open`,tag:`strong`,nesting:1}):t===3&&(n.push({type:`strong_open`,tag:`strong`,nesting:1}),n.push({type:`em_open`,tag:`em`,nesting:1})),n.push({type:`link`,href:u,title:null,text:s,children:[{type:`text`,content:s,raw:s}],loading:d,markup:``}),t===1){n.push({type:`em_close`,tag:`em`,nesting:-1});let{node:t}=mv(n,0,e.parseInlineTokens,e.options);e.pushParsed(t)}else if(t===2){n.push({type:`strong_close`,tag:`strong`,nesting:-1});let{node:t}=by(n,0,e.parseInlineTokens,void 0,e.options);e.pushParsed(t)}else if(t===3){n.push({type:`em_close`,tag:`em`,nesting:-1}),n.push({type:`strong_close`,tag:`strong`,nesting:-1});let{node:t}=by(n,0,e.parseInlineTokens,void 0,e.options);e.pushParsed(t)}else{let{node:t}=mv(n,0,e.parseInlineTokens,e.options);e.pushParsed(t)}}else e.options?.validateLink&&!e.options.validateLink(u)?e.pushText(s,s):e.pushParsed({type:`link`,href:u,title:null,text:s,children:[{type:`text`,content:s,raw:s}],loading:d,markup:``});let p=l===-1?``:t.slice(l+1);return p&&(e.dispatchToken({type:`text`,content:p,raw:p}),e.index--),e.index++,!0}return!1}function By(e,t){let n=t.indexOf(`![`);if(n===-1)return!1;let r=t.slice(0,n);return r&&!e.currentTextNode?e.currentTextNode={type:`text`,content:r,raw:r}:r&&e.currentTextNode&&(e.currentTextNode.content+=r),e.currentTextNode&&=(e.result.push(e.currentTextNode),null),e.pushParsed(Ny(t.slice(n))),e.index++,!0}function Vy(e,t){Fy(e,t)||(e.resetCurrentTextNode(),e.pushParsed(qv(t)),e.index++)}function Hy(e,t){let n=t;if(t.type===`link`&&n.href!=null&&e.options.validateLink&&!e.options.validateLink(String(n.href))){e.resetCurrentTextNode();let t=String(n.text??``);e.pushText(t,t),e.index++}else Iy(e,t)||ky(e,t)||jy(e,t)||Oy(e,t)||e.pushToken(t),e.index++}function Uy(e){let t=e.content??``,n=e.raw===`$$`?`$${t}$`:e.raw||``;return{type:`math_inline`,content:t,loading:!!e.loading,raw:n,markup:e.markup}}function Wy(e){return{type:`reference`,id:String(e.content??``),raw:String(e.markup??`[${e.content??``}]`)}}function Gy(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=pv(e,t,`s_close`);return i.push(...n(o,void 0,void 0,r)),{node:{type:`strikethrough`,children:i,raw:`~~${a}~~`},nextIndex:s}}function Ky(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=pv(e,t,`sub_close`);i.push(...n(o,void 0,void 0,r));let c=String(e[t].content??``),l=a||c;return{node:{type:`subscript`,children:i.length>0?i:[{type:`text`,content:l,raw:l}],raw:`~${l}~`},nextIndex:s}}function qy(e,t,n,r){let i=[],{content:a,innerTokens:o,nextIndex:s}=pv(e,t,`sup_close`);return i.push(...n(o,void 0,void 0,r)),{node:{type:`superscript`,children:i.length>0?i:[{type:`text`,content:a||String(e[t].content??``),raw:a||String(e[t].content??``)}],raw:`^${a||String(e[t].content??``)}^`},nextIndex:s}}var Jy=/\s/u,Yy=/[!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~]/,Xy=/\p{P}/u,Zy=/^[\x22\x27《「『【〔〖〘〚〈([{“‘﹁﹃﹙﹛﹝]$/u,Qy=/^[\x22\x27》」』】〕〗〙〛〉)]}”’﹂﹄﹚﹜﹞]$/u;function $y(e){let t=0,n=0;for(;n<e.length;)e[n]===`\\`&&n+1<e.length&&e[n+1]===`*`?n+=2:(e[n]===`*`&&t++,n++);return t}function eb(e,t=0){if(!e)return-1;let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[r+1];if(i===`\\`&&a&&$v.has(a)){if(a===`*`&&n>=t){n++,r++;continue}n++,r++}else{if(i===`*`&&n>=t)return n;n++}}return-1}function tb(e){return!!e&&Jy.test(e)}function nb(e){return!!e&&(Yy.test(e)||Xy.test(e))}function rb(e,t){return!!e&&!!t&&/^\p{Script=Han}$/u.test(t)&&Zy.test(e)}function ib(e,t){return!!e&&!!t&&/^[\p{L}\p{N}]$/u.test(t)&&Qy.test(e)}function ab(e,t){let n=t>0?e[t-1]:void 0,r=e[t+1];return!r||tb(r)?!1:!(nb(r)&&!rb(r,n)&&n&&!tb(n)&&!nb(n))}function ob(e,t){let n=t>0?e[t-1]:void 0,r=e[t+1];return!n||tb(n)?!1:!(nb(n)&&!ib(n,r)&&r&&!tb(r)&&!nb(r))}function sb(e,t,n=0){let r=n,i=!1;for(;r<t.length;){let n=e?eb(e,r):t.indexOf(`*`,r);if(n===-1)break;if(ob(t,n))return{index:n,sawInvalidClose:i};i=!0,r=n+1}return{index:-1,sawInvalidClose:i}}function cb(e,t){let n=t>0?e[t-1]:void 0,r=e[t+2];return!r||tb(r)?!1:!(nb(r)&&!rb(r,n)&&n&&!tb(n)&&!nb(n))}function lb(e,t){let n=t>0?e[t-1]:void 0,r=e[t+2];return!n||tb(n)?!1:!(nb(n)&&!ib(n,r)&&r&&!tb(r)&&!nb(r))}function ub(e,t=0){let n=t,r=!1;for(;n<e.length;){let t=e.indexOf(`**`,n);if(t===-1)break;if(lb(e,t))return{index:t,sawInvalidClose:r};r=!0,n=t+2}return{index:-1,sawInvalidClose:r}}var db=/[\p{L}\p{N}]/u,fb=/^[\p{L}\p{N}]+$/u;function pb(e){return e?db.test(e):!1}function mb(e){return e?fb.test(e):!1}function hb(e,t){let n=t;for(;n<e.length&&e[n]===`*`;)n++;let r=t>0?e[t-1]:void 0,i=n<e.length?e[n]:void 0;return{len:n-t,prev:r,next:i,intraword:pb(r)&&pb(i)}}function gb(e){let t=[];for(let n=0;n<e.length;){if(e[n]!==`*`){n++;continue}let r=hb(e,n),i=n+r.len;r.len>=2&&r.intraword&&t.push({start:n,end:i}),n=i}for(let n=0;n<t.length-1;n++){let r=t[n],i=t[n+1];if(!mb(e.slice(r.end,i.start)))return i.end}return-1}function _b(e){return!!e&&e.trim()===e&&/^[\p{L}\p{N}\s]+$/u.test(e)}function vb(e,t){let n=t;for(;n<e.length;){let t=e.indexOf(`***`,n);if(t===-1)return-1;let r=hb(e,t);if(r.len>=3)return t;n=t+r.len}return-1}function yb(e){let t=String(e.content??``);return{type:`text`,content:t,raw:t}}var bb=/[^~]*~{2,}[^~]+/,xb=/\*\*/,Sb=/[[_*^~]/;function Cb(e,t){return t===e.tokens[e.index]}function wb(e,t,n){let r=Cb(e,n)&&e.tokens.length===1?e.raw:String(n.content??``),i=[],a=gb(t);if(a!==-1){e.pushText(t.slice(0,a),t.slice(0,a));let n=t.slice(a);return n&&(e.dispatchToken({type:`text`,content:n,raw:n}),e.index--),e.index++,!0}if(bb.test(t)){let e=t.indexOf(`~~`);e!==-1&&i.push({type:`strikethrough`,index:e})}if(xb.test(t)){let e=t.indexOf(`**`);e!==-1&&i.push({type:`strong`,index:e})}if(/[^*]*\*[^*]+/.test(t)){let e=r?eb(r,0):t.indexOf(`*`);if(r&&e===-1)return!1;e!==-1&&i.push({type:`emphasis`,index:e})}i.sort((e,t)=>e.index===t.index?e.type===t.type?0:e.type===`strong`?-1:+(t.type===`strong`):e.index-t.index);let o=i[0];if(!o)return!1;if(o.type===`strikethrough`){let n=o.index,r=n>-1?t.slice(0,n):``;if(r&&e.pushText(r,r),n===-1)return e.index++,!0;let i=t.indexOf(`~~`,n+2),a=i===-1?t.slice(n+2):t.slice(n+2,i),s=i===-1?``:t.slice(i+2),{node:c}=Gy([{type:`s_open`,tag:`s`,content:``,markup:`~~`,info:``,meta:null},{type:`text`,tag:``,content:a,markup:``,info:``,meta:null},{type:`s_close`,tag:`s`,content:``,markup:`~~`,info:``,meta:null}],0,e.parseInlineTokens,e.options);return e.resetCurrentTextNode(),e.pushParsed(c),s&&(e.dispatchToken({type:`text`,content:s,raw:s}),e.index--),e.index++,!0}if(o.type===`strong`){let n=o.index,r=n>-1?t.slice(0,n):``;if(r&&e.pushText(r,r),n===-1)return e.index++,!0;if(e.raw&&n===0){let n=!1,r=0;for(;r<t.length&&t[r]===`*`;)r++;if(e.raw.startsWith(`\\*`)&&(n=!0),n){let n=0,i=0;for(;i<e.raw.length&&n<r;)if(e.raw[i]===`\\`&&i+1<e.raw.length&&e.raw[i+1]===`*`)n+=1,i+=2;else if(e.raw[i]===`*`)break;else i++;if(n>=2)return e.pushText(t,t),e.index++,!0}}if(e.raw&&(t.match(/\*/g)||[]).length>$y(e.raw))return e.pushText(t.slice(r.length),t.slice(r.length)),e.index++,!0;let i=hb(t,n);if(i.len>=3){let r=vb(t,n+i.len);if(r!==-1){let a=t.slice(n+i.len,r);if(_b(a)){let{node:n}=by([{type:`strong_open`,tag:`strong`,content:``,markup:`**`,info:``,meta:null},{type:`em_open`,tag:`em`,content:``,markup:`*`,info:``,meta:null},{type:`text`,tag:``,content:a,markup:``,info:``,meta:null},{type:`em_close`,tag:`em`,content:``,markup:`*`,info:``,meta:null},{type:`strong_close`,tag:`strong`,content:``,markup:`**`,info:``,meta:null}],0,e.parseInlineTokens,e.raw,e.options);e.resetCurrentTextNode(),e.pushParsed(n);let i=t.slice(r+3);return i&&(e.dispatchToken({type:`text`,content:i,raw:i}),e.index--),e.index++,!0}}}if(!cb(t,n)){let r=t.slice(n,n+i.len);e.pushText(r,r);let a=t.slice(n+i.len);return a&&(e.dispatchToken({type:`text`,content:a,raw:a}),e.index--),e.index++,!0}let a=ub(t,n+2),s=``,c=``;if(a.index!==-1){s=t.slice(n+2,a.index),c=t.slice(a.index+2);let o=a.index,l=hb(t,o);if(i.intraword&&l.intraword&&!mb(s)||!s&&i.len>=4&&i.intraword)return e.pushText(t.slice(r.length),t.slice(r.length)),e.index++,!0}else{if(e.requireClosingStrong||a.sawInvalidClose||e.options?.final||i.intraword)return e.pushText(t.slice(r.length),t.slice(r.length)),e.index++,!0;s=t.slice(n+2),c=``}if(!s&&/^\*+$/.test(c))return e.pushText(t,t),e.index++,!0;let{node:l}=by([{type:`strong_open`,tag:`strong`,content:``,markup:`**`,info:``,meta:null},{type:`text`,tag:``,content:s,markup:``,info:``,meta:null},{type:`strong_close`,tag:`strong`,content:``,markup:`**`,info:``,meta:null}],0,e.parseInlineTokens,e.raw,e.options);return e.resetCurrentTextNode(),e.pushParsed(l),c&&(e.dispatchToken({type:`text`,content:c,raw:c}),e.index--),e.index++,!0}if(o.type===`emphasis`){let n=o.index;n===-1&&(n=0);let i=t.slice(0,n);if(i&&e.pushText(i,i),!ab(t,n)){e.pushText(t[n],t[n]);let r=t.slice(n+1);return r&&(e.dispatchToken({type:`text`,content:r,raw:r}),e.index--),e.index++,!0}let a=hb(t,n),s=sb(r,t,n+1),c=s.index,l=e.tokens[e.index+1];if(e.options?.final&&l?.type===`em_open`&&c!==-1&&t.slice(n+1,c).trim()!==t.slice(n+1,c)||c===-1&&(s.sawInvalidClose||e.options?.final||a.intraword||!pb(t[n+1])))return e.pushText(t.slice(n),t.slice(n)),e.index++,!0;let{node:u}=mv([{type:`em_open`,tag:`em`,content:``,markup:`*`,info:``,meta:null},{type:`text`,tag:``,content:c>-1?t.slice(n+1,c):t.slice(n+1),markup:``,info:``,meta:null},{type:`em_close`,tag:`em`,content:``,markup:`*`,info:``,meta:null}],0,e.parseInlineTokens,e.options);if(e.resetCurrentTextNode(),e.pushParsed(u),c!==-1&&c<t.length-1){let n=t.slice(c+1);n&&(e.dispatchToken({type:`text`,content:n,raw:n}),e.index--)}return e.index++,!0}return!1}function Tb(e,t,n){if(!t.includes("`"))return!1;let r=(e=>{for(let t=0;t<e.length;t++){if(e[t]!=="`")continue;let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;r--)n++;if(n%2==0)return t}return-1})(t);if(r===-1)return!1;let i=1;for(let e=r+1;e<t.length&&t[e]==="`";e++)i++;let a="`".repeat(i),o=r+i,s=t.indexOf(a,o);if(s===-1){if(i===1){let i=t.slice(0,r),a=t.slice(r+1);return i&&(wb(e,i,n)?e.index--:e.pushText(i,i)),e.pushParsed({type:`inline_code`,code:a,raw:String(a)}),e.index++,!0}let a=t;for(let t=e.index+1;t<e.tokens.length;t++)a+=String((e.tokens[t].content??``)+(e.tokens[t].markup??``));return e.index=e.tokens.length-1,e.pushText(a,a),e.index++,!0}e.resetCurrentTextNode();let c=t.slice(0,r),l=t.slice(r+i,s),u=t.slice(s+i);return c&&(wb(e,c,n)?e.index--:e.pushText(c,c)),e.pushParsed({type:`inline_code`,code:l,raw:String(l??``)}),u&&(e.dispatchToken({type:`text`,content:u,raw:u}),e.index--),e.index++,!0}function Eb(e,t){let n=e.options.markdownIt;if(!n||e.tokens.length<=1||!e.tokens.some(e=>e?.type===`math_inline`)||!Sb.test(t))return null;let r=n.parseInline(t,{__markstreamFinal:!!e.options?.final});if(!Array.isArray(r)||r.length===0)return null;let i=(r.find(e=>e?.type===`inline`)?.children??[]).filter(e=>e?.type!==`text`||String(e.content??``)!==``);if(!i.length||!i.some(e=>e?.type!==`text`)||i.length===1&&i[0]?.type===`text`&&String(i[0].content??``)===t)return null;let a=e.parseInlineTokens(i,t,e.pPreToken,e.options);return a.length?a:null}function Db(e,t,n,r,i,a=fy(t)){let o=yb({...n,content:t});if(e.currentTextNode){e.currentTextNode.content+=e.options?.final?o.content:vy(o.content,n,a),e.currentTextNode.raw+=o.raw;return}let s=r?.tag===`br`&&e.tokens[e.index-2]?.content===`[`;i||(o.content=e.options?.final?o.content:vy(o.content,n,a)),e.currentTextNode=o,e.currentTextNode.center=s,e.result.push(e.currentTextNode)}function Ob(e,t){let n=String(t.content??``),r=fy(n),i=(r&ey)!==0,a=Cb(e,t)&&e.tokens.length===1&&i&&typeof e.raw==`string`?String(e.raw):``,o=a?py(a):i?n.replace(Qv,`$1`):n,s=o===n?r:fy(o);if(t.content===`<`||o===`1`&&e.tokens[e.index-1]?.tag===`br`){e.index++;return}let c=(s&cy)===0?-1:o.indexOf(`$`);c!==-1&&c===o.lastIndexOf(`$`)&&o.endsWith(`$`)&&(o=o.slice(0,-1)),o.endsWith(`undefined`)&&!e.raw?.endsWith(`undefined`)&&(o=o.slice(0,-9));let l=e.result.length,u=``;for(let t=e.result.length-1;t>=0;t--){let n=e.result[t];if(n.type!==`text`)break;l=t,u=String(n.content??``)+u}l<e.result.length&&(o.startsWith(u)?(e.currentTextNode=null,e.result.length=l):e.currentTextNode=e.result[e.result.length-1]);let d=e.tokens[e.index+1];if(e.options?.final!==!0&&((o==="`"||o===`|`||o===`$`)&&!_y(t,`\\${o}`)||/^\*+$/.test(o)&&!_y(t,`\\*`))||(!d&&e.options?.final!==!0&&(s&uy)!==0&&/[^\]]\s*\(\s*$/.test(o)&&(o=o.replace(/\(\s*$/,``)),!o)){e.index++;return}if((s&160)==160&&Py(e,o)||(s&1088)==1088&&Ly(e,o))return;if((s&dy)===0){Db(e,o,t,e.tokens[e.index-1],d,s),e.index++;return}if((s&ay)!==0&&kb(e,o))return;let f=e.tokens[e.index-1];if((s&ay)!==0&&o===`[`&&!d?.markup?.includes(`*`)&&!_y(t,`\\[`)||(s&oy)!==0&&o===`]`&&!f?.markup?.includes(`*`)&&!_y(t,`\\]`)){e.index++;return}if((s&iy)!==0&&Tb(e,n,t)||(s&160)==160&&By(e,o)||(s&ay)!==0&&(e.tokens[e.index+1]?.type!==`link_open`||Ty(e,o))&&zy(e,o,t))return;let p=Eb(e,n);if(p){e.resetCurrentTextNode();for(let t of p)e.pushParsed(t);e.index++}else wb(e,o,t)||(Db(e,o,t,f,d,s),e.index++)}function kb(e,t){if(!(t?.startsWith(`[`)&&e.pPreToken?.type===`list_item_open`))return!1;let n=t.slice(1).match(/[^\s\]]/);if(n===null)return e.index++,!0;if(n&&/x/i.test(n[0])){let t=n[0]===`x`||n[0]===`X`;return e.pushParsed({type:`checkbox_input`,checked:t,raw:t?`[x]`:`[ ]`}),e.index++,!0}return!1}function Ab(e,t){if(!e.currentTextNode||t.loading!==!0||t.markup!==`\\(\\)`)return;let n=e.tokens[e.index-1];n&&n.type===`text`&&_y(n,`\\(`)&&e.currentTextNode.content.endsWith(`(`)&&(e.currentTextNode.content=e.currentTextNode.content.slice(0,-1),e.currentTextNode.raw.endsWith(`(`)&&(e.currentTextNode.raw=e.currentTextNode.raw.slice(0,-1)),!e.currentTextNode.content&&e.result[e.result.length-1]===e.currentTextNode&&(e.result.pop(),e.currentTextNode=null))}function jb(e,t){switch(t.type){case`text`:Ob(e,t);break;case`softbreak`:e.currentTextNode?(e.currentTextNode.content+=`
|
|
132
|
+
`,e.currentTextNode.raw+=`
|
|
133
|
+
`):(e.currentTextNode={type:`text`,content:`
|
|
134
|
+
`,raw:`
|
|
135
|
+
`},e.result.push(e.currentTextNode)),e.index++;break;case`code_inline`:e.pushParsed(Uv(t)),e.index++;break;case`html_inline`:{let[n,r]=Hv(t,e.tokens,e.index,e.parseInlineTokens,e.raw,e.pPreToken,e.options);e.pushParsed(n),e.index=r;break}case`link_open`:Ey(e,t);break;case`image`:Vy(e,t);break;case`strong_open`:{e.resetCurrentTextNode();let{node:n,nextIndex:r}=by(e.tokens,e.index,e.parseInlineTokens,t.content,e.options);e.pushParsed(n),e.index=r;break}case`em_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=mv(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`s_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=Gy(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`mark_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=Tv(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`ins_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=Wv(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`sub_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=Ky(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`sup_open`:{e.resetCurrentTextNode();let{node:t,nextIndex:n}=qy(e.tokens,e.index,e.parseInlineTokens,e.options);e.pushParsed(t),e.index=n;break}case`sub`:e.resetCurrentTextNode(),e.pushParsed({type:`subscript`,children:[{type:`text`,content:String(t.content??``),raw:String(t.content??``)}],raw:`~${String(t.content??``)}~`}),e.index++;break;case`sup`:e.resetCurrentTextNode(),e.pushParsed({type:`superscript`,children:[{type:`text`,content:String(t.content??``),raw:String(t.content??``)}],raw:`^${String(t.content??``)}^`}),e.index++;break;case`emoji`:{e.resetCurrentTextNode();let n=e.tokens[e.index-1];n?.type===`text`&&/\|:-+/.test(String(n.content??``))?e.pushText(``,``):e.pushParsed(fv(t)),e.index++;break}case`checkbox`:e.resetCurrentTextNode(),e.pushParsed(uv(t)),e.index++;break;case`checkbox_input`:e.resetCurrentTextNode(),e.pushParsed(dv(t)),e.index++;break;case`footnote_ref`:e.resetCurrentTextNode(),e.pushParsed(Cv(t)),e.index++;break;case`footnote_anchor`:{e.resetCurrentTextNode();let n=t.meta??{},r=String(n.label??t.content??``);e.pushParsed({type:`footnote_anchor`,id:r,raw:String(t.content??``)}),e.index++;break}case`hardbreak`:e.resetCurrentTextNode(),e.pushParsed(wv()),e.index++;break;case`fence`:e.resetCurrentTextNode(),e.pushParsed(Sv(e.tokens[e.index])),e.index++;break;case`math_inline`:Ab(e,t),e.resetCurrentTextNode(),!t.content&&t.markup===`$`&&e.tokens[e.index+1]?.type===`text`&&e.tokens[e.index+2]?.type===`math_inline`?(e.pushParsed(Uy({...t,content:e.tokens[e.index+1].content})),e.index+=2):e.pushParsed(Uy(t)),e.index++;break;case`reference`:Mb(e,t);break;case`text_special`:e.pushText(String(t.content??``),String(t.content??``)),e.index++;break;default:Hy(e,t)}}function Mb(e,t){e.resetCurrentTextNode(),e.pushParsed(Wy(t)),e.index++}var Nb=/[!$(*[\\\]_`|~]/;function Pb(e,t,n,r){if(!e||e.length===0)return[];if(e.length===1&&e[0].type===`text`){let t=e[0].content;if(typeof t==`string`&&t&&t!==`<`&&!t.endsWith(`undefined`)&&!Nb.test(t))return[{type:`text`,content:t,raw:t,center:!1}]}let i=Vf(r),a=i.linkifyDemotionContext,o=kp(t),s={filename:a?.filename||o.filename,explicitFilename:a?.explicitFilename||o.explicitFilename,marketTicker:a?.marketTicker||o.marketTicker};(s.filename||s.explicitFilename||s.marketTicker)&&(i={...i,linkifyDemotionContext:s}),r=i;let c=r?.requireClosingStrong,l=e,u={currentTextNode:null,index:0,options:i,parseInlineTokens:Pb,pPreToken:n,raw:t,requireClosingStrong:c,result:[],tokens:e,dispatchToken:e=>jb(u,e),ensureWorkingTokens:d,pushParsed:p,pushText:h,pushToken:m,resetCurrentTextNode:f};function d(){return u.tokens===l&&(u.tokens=u.tokens.slice()),u.tokens}function f(){u.currentTextNode=null}function p(e){f(),u.result.push(e)}function m(e){f();let t=Og(e);t.type===`link`&&(t.markup=zp(e)),u.result.push(t)}function h(e,t){u.currentTextNode?(u.currentTextNode.content+=e,u.currentTextNode.raw+=t??e):(u.currentTextNode={type:`text`,content:String(e??``),raw:String(t??e??``)},u.result.push(u.currentTextNode))}for(;u.index<u.tokens.length;){let e=u.tokens[u.index];jb(u,e)}return u.result}function Fb(e){let t=new WeakSet,n=e=>{if(!e||typeof e!=`object`||t.has(e))return;if(t.add(e),Array.isArray(e)){for(let t of e)n(t);return}let r=e;r.type===`html_block`&&r.loading===!0&&(r.loading=!1);for(let e of Object.values(r))n(e)};n(e)}function Ib(e,t){let n=t.postTransformNodes;if(typeof n!=`function`)return e;let r=n(e);return Array.isArray(r)?r:e}function Lb(e){let t=String(e.content??``),n=t.replace(/[ \t\r\n]+$/g,``);if(n===t)return;e.content=n;let r=e.children;if(Array.isArray(r)&&r.length!==0)for(;r.length;){let e=r[r.length-1];if(!e)r.pop();else if(e.type===`softbreak`||e.type===`hardbreak`)r.pop();else if(e.type===`text`){let t=String(e.content??``),n=t.replace(/[ \t\r\n]+$/g,``);if(n===t)break;if(n){e.content=n;break}r.pop()}else break}}function Rb(e){let t=String(e.content??``),n=t.match(/\r?\n\s*\d+[.)]?\s*$/);if(!n||typeof n.index!=`number`)return;e.content=t.slice(0,n.index);let r=e.children;if(Array.isArray(r)&&r.length!==0)for(;r.length;){let e=r[r.length-1];if(!e)r.pop();else if(e.type===`softbreak`||e.type===`hardbreak`)r.pop();else{if(e.type===`text`){let t=String(e.content??``);if(/^[ \t\r\n\d.)]*$/.test(t)){r.pop();continue}let n=t.replace(/[ \t\r\n\d.)]+$/g,``);n!==t&&(n?e.content=n:r.pop())}break}}}function zb(e){let t=String(e.content??``);return/[ \t\r\n]+$/.test(t)||/\r?\n\s*\d+[.)]?\s*$/.test(t)}function Bb(e,t,n,r){let i=e[t],a=[],o=xp(n,!0),s=t+1;for(;s<e.length&&e[s].type!==`bullet_list_close`&&e[s].type!==`ordered_list_close`;)if(e[s].type===`list_item_open`){let t=[],i=s+1;for(;i<e.length&&e[i].type!==`list_item_close`;)if(e[i].type===`paragraph_open`){let a=e[i+1],s=zb(a)?Og(a):a,c=e[i-1];s!==a&&(Rb(s),Lb(s));let l=String(s.content??``),u={type:`paragraph`,children:r(s.children||[],l,c,o.options()),raw:l};n?.includeSourceMap&&X(u,e[i],n),t.push(u),o.remember(l),i+=3}else if(e[i].type===`blockquote_open`){let[n,a]=Jb(e,i,o.options(),r);t.push(n),o.remember(n.raw),i=a}else if(e[i].type===`bullet_list_open`||e[i].type===`ordered_list_open`){let[n,a]=Bb(e,i,o.options(),r);t.push(n),o.remember(n.raw),i=a}else{let n=xx(e,i,o.options(),qb,r);n?(t.push(n[0]),o.remember(n[0].raw),i=n[1]):i+=1}let c={type:`list_item`,children:t,raw:t.map(e=>e.raw).join(``)};n?.includeSourceMap&&X(c,e[s],n),a.push(c),s=i+1}else s+=1;let c={type:`list`,ordered:i.type===`ordered_list_open`,start:(()=>{if(i.attrs&&i.attrs.length){let e=i.attrs.find(e=>e[0]===`start`);if(e){let t=Number(e[1]);return Number.isFinite(t)&&t!==0?t:1}}})(),items:a,raw:a.map(e=>e.raw).join(`
|
|
136
|
+
`)};return n?.includeSourceMap&&X(c,i,n),[c,s+1]}function Vb(e,t,n,r,i){let a=String(n[1]??`note`),o=String(n[2]??a.charAt(0).toUpperCase()+a.slice(1)),s=[],c=xp(r,!0),l=t+1;for(;l<e.length&&e[l].type!==`container_close`;)if(e[l].type===`paragraph_open`){let t=e[l+1];if(t){let n={type:`paragraph`,children:i(t.children||[],String(t.content??``),void 0,c.options()),raw:String(t.content??``)};r?.includeSourceMap&&X(n,e[l],r),s.push(n),c.remember(n.raw)}l+=3}else if(e[l].type===`bullet_list_open`||e[l].type===`ordered_list_open`){let[t,n]=Bb(e,l,c.options(),i);r?.includeSourceMap&&X(t,e[l],r),s.push(t),c.remember(t.raw),l=n}else if(e[l].type===`blockquote_open`){let[t,n]=Jb(e,l,c.options(),i);r?.includeSourceMap&&X(t,e[l],r),s.push(t),c.remember(t.raw),l=n}else{let t=bx(e,l,c.options(),i);t?(s.push(t[0]),c.remember(t[0].raw),l=t[1]):l++}return[{type:`admonition`,kind:a,title:o,children:s,raw:`:::${a} ${o}\n${s.map(e=>e.raw).join(`
|
|
137
|
+
`)}\n:::`},l+1]}var Hb=new Set([`warning`,`info`,`note`,`tip`,`danger`,`caution`]);function Ub(e){let t=0;for(;t<e.length&&t<3&&e[t]===`:`;)t++;if(t===0||e[t]===`:`)return null;let n=e.slice(t).trimStart();if(!n)return null;let r=n.search(/\s/),i=(r===-1?n:n.slice(0,r)).toLowerCase();return Hb.has(i)?{kind:i,title:r===-1?``:n.slice(r).trim()}:null}function Wb(e,t,n,r){let i=e[t],a=`note`,o=``,s=i.type.match(/^container_(\w+)_open$/);if(s){a=s[1];let e=String(i.info??``).trim();if(e&&!e.startsWith(`:::`)&&e.toLowerCase().startsWith(a)){let t=e.slice(a.length).trim();t&&(o=t)}}else{let e=Ub(String(i.info??``).trim());e&&(a=e.kind,o=e.title)}o||=a.charAt(0).toUpperCase()+a.slice(1);let c=[],l=xp(n,!0),u=t+1,d=RegExp(`^container_${a}_close$`);for(;u<e.length&&e[u].type!==`container_close`&&!d.test(e[u].type);)if(e[u].type===`paragraph_open`){let t=e[u+1];if(t){let i=t.children||[],a=-1;for(let e=i.length-1;e>=0;e--){let t=i[e];if(t.type===`text`&&/:+/.test(t.content)){a=e;break}}let o={type:`paragraph`,children:r((a===-1?i:i.slice(0,a))||[],void 0,void 0,l.options()),raw:String(t.content??``).replace(/\n:+$/,``).replace(/\n\s*:::\s*$/,``)};n?.includeSourceMap&&X(o,e[u],n),c.push(o),l.remember(o.raw)}u+=3}else if(e[u].type===`bullet_list_open`||e[u].type===`ordered_list_open`){let[t,i]=Bb(e,u,l.options(),r);n?.includeSourceMap&&X(t,e[u],n),c.push(t),l.remember(t.raw),u=i}else if(e[u].type===`blockquote_open`){let[t,i]=Jb(e,u,l.options(),r);n?.includeSourceMap&&X(t,e[u],n),c.push(t),l.remember(t.raw),u=i}else{let t=bx(e,u,l.options(),r);t?(c.push(t[0]),l.remember(t[0].raw),u=t[1]):u++}return[{type:`admonition`,kind:a,title:o,children:c,raw:`:::${a} ${o}\n${c.map(e=>e.raw).join(`
|
|
138
|
+
`)}\n:::`},u+1]}var Gb=/^::: ?(warning|info|note|tip|danger|caution|error) ?(.*)$/;function Kb(e,t,n,r){let i=e[t];if(i.type!==`container_open`)return null;let a=Gb.exec(String(i.info??``));return a?Vb(e,t,a,n,r):null}var qb={parseContainer:(e,t,n,r)=>Wb(e,t,n,r),matchAdmonition:Kb};function Jb(e,t,n,r){let i=[],a=xp(n,!0),o=t+1;for(;o<e.length&&e[o].type!==`blockquote_close`;){let t=e[o];switch(t.type){case`paragraph_open`:{let s=e[o+1],c={type:`paragraph`,children:r(s.children||[],String(s.content??``),void 0,a.options()),raw:String(s.content??``)};n?.includeSourceMap&&X(c,t,n),i.push(c),a.remember(c.raw),o+=3;break}case`bullet_list_open`:case`ordered_list_open`:{let[t,n]=Bb(e,o,a.options(),r);i.push(t),a.remember(t.raw),o=n;break}case`blockquote_open`:{let[t,n]=Jb(e,o,a.options(),r);i.push(t),a.remember(t.raw),o=n;break}default:{let t=xx(e,o,a.options(),qb,r);t?(i.push(t[0]),a.remember(t[0].raw),o=t[1]):o++;break}}}let s={type:`blockquote`,children:i,raw:i.map(e=>e.raw).join(`
|
|
139
|
+
`)};return n?.includeSourceMap&&X(s,e[t],n),[s,o+1]}function Yb(e){if(e.info?.startsWith(`diff`))return Sv(e);let t=String(e.content??``),n=t.match(/ type="application\/vnd\.ant\.([^"]+)"/),r=t;n?.[1]&&(r=t.replace(/<antArtifact[^>]*>/g,``).replace(/<\/antArtifact>/g,``));let i=Array.isArray(e.map)&&e.map.length===2;return{type:`code_block`,language:n?n[1]:String(e.info??``),code:r,raw:r,loading:!i}}function Xb(e,t,n,r){let i=[],a=t+1,o=[],s=[],c=xp(n,!0);for(;a<e.length&&e[a].type!==`dl_close`;)if(e[a].type===`dt_open`){let t=e[a+1];o=r(t.children||[],void 0,void 0,c.options()),c.remember(o.map(e=>e.raw).join(``)),a+=3}else if(e[a].type===`dd_open`){let t=a+1;for(s=[];t<e.length&&e[t].type!==`dd_close`;)if(e[t].type===`paragraph_open`){let n=e[t+1];s.push({type:`paragraph`,children:r(n.children||[],String(n.content??``),void 0,c.options()),raw:String(n.content??``)}),c.remember(String(n.content??``)),t+=3}else t++;o.length>0&&(i.push({type:`definition_item`,term:o,definition:s,raw:`${o.map(e=>e.raw).join(``)}: ${s.map(e=>e.raw).join(`
|
|
140
|
+
`)}`}),o=[]),a=t+1}else a++;return[{type:`definition_list`,items:i,raw:i.map(e=>e.raw).join(`
|
|
141
|
+
`)},a+1]}function Zb(e,t,n,r){let i=e[t].meta??{},a=String(i?.label??`0`),o=[],s=xp(n,!0),c=t+1;for(;c<e.length&&e[c].type!==`footnote_close`;)if(e[c].type===`paragraph_open`){let t=e[c+1],n=t.children?[...t.children]:[];e[c+2].type===`footnote_anchor`&&n.push(e[c+2]);let i={type:`paragraph`,children:r(n,String(t.content??``),void 0,s.options()),raw:String(t.content??``)};o.push(i),s.remember(i.raw),c+=3}else c++;return[{type:`footnote`,id:a,children:o,raw:`[^${a}]: ${o.map(e=>e.raw).join(`
|
|
142
|
+
`)}`},c+1]}function Qb(e,t,n,r){let i=e[t],a=i.attrs,o=Array.isArray(a)&&a.length?Object.fromEntries(a.filter(e=>Array.isArray(e)&&e.length>=1&&e[0]).map(([e,t])=>[String(e),t==null||t===``||String(t)])):void 0,s=String(i.tag?.substring(1)??`1`),c=Number.parseInt(s,10),l=e[t+1],u=String(l.content??``);return{type:`heading`,level:c,text:u,...o?{attrs:o}:{},children:r(l.children||[],u,void 0,n),raw:u}}function $b(e){let t=String(e.content??``),n=e.raw===`$$`?`$$${t}$$`:String(e.raw??``);return{type:`math_block`,content:t,loading:!!e.loading,raw:n,markup:e.markup}}function ex(e){if(!e)return`left`;for(let t of e){if(!t)continue;let[e,n]=t;if(!n)continue;let r=String(n).trim().toLowerCase();if(e===`style`){let e=/text-align\s*:\s*(left|right|center)/i.exec(r);if(e)return e[1].toLowerCase()}}return`left`}function tx(e){return e?.filename===!0||e?.explicitFilename===!0||e?.marketTicker===!0}function nx(e,t){let n={filename:e?.filename||t?.filename,explicitFilename:e?.explicitFilename||t?.explicitFilename,marketTicker:e?.marketTicker||t?.marketTicker};return tx(n)?n:void 0}function rx(e,t,n){let r=nx(kp(t),n);if(!tx(r))return e;let i=Vf(e),a=i.linkifyDemotionContext;return{...i,linkifyDemotionContext:{filename:a?.filename||r?.filename,explicitFilename:a?.explicitFilename||r?.explicitFilename,marketTicker:a?.marketTicker||r?.marketTicker}}}function ix(e,t,n,r){let i=t+1,a=null,o=[],s=!1;for(;i<e.length&&e[i].type!==`table_close`;)if(e[i].type===`thead_open`)s=!0,i++;else if(e[i].type===`thead_close`)s=!1,i++;else if(e[i].type===`tbody_open`||e[i].type===`tbody_close`)i++;else if(e[i].type===`tr_open`){let t=[],c=i+1,l;for(;c<e.length&&e[c].type!==`tr_close`;)if(e[c].type===`th_open`||e[c].type===`td_open`){let i=e[c].type===`th_open`,o=e[c+1],u=String(o.content??``),d=ex(e[c].attrs),f=t.length,p=!i&&!s,m=p?a?.cells[f]?.raw:void 0;t.push({type:`table_cell`,header:i||s,children:r(o.children||[],u,void 0,rx(n,m,p?l:void 0)),raw:u,align:d}),p&&(l=nx(l,kp(u))),c+=3}else c++;let u={type:`table_row`,cells:t,raw:t.map(e=>e.raw).join(`|`)};s?a=u:o.push(u),i=c+1}else i++;a||={type:`table_row`,cells:[],raw:``};let c=e[t].loading===!0;return[{type:`table`,header:a,rows:o,loading:c&&!n?.final&&o.length===0,raw:[a,...o].map(e=>e.raw).join(`
|
|
143
|
+
`)},i+1]}function ax(){return{type:`thematic_break`,raw:`---`}}var ox=null,sx=new WeakMap;function cx(){return ox||={allowedTagSet:Ev(),customTagSet:null},ox}function lx(e){if(!e||e.length===0)return cx();let t=sx.get(e);if(t)return t;let n=e.map(Qd).filter(Boolean);if(!n.length){let t=cx();return sx.set(e,t),t}let r={allowedTagSet:Ev({customHtmlTags:e}),customTagSet:new Set(n)};return sx.set(e,r),r}function ux(e,t,n,r){let i=e[t],a=i.attrs,o=``,s={};if(a){for(let[e,t]of a)if(e===`class`){let e=t.match(/(?:\s|^)vmr-container-(\S+)/);e&&(o=e[1])}else if(e.startsWith(`data-`)){let n=e.slice(5);try{s[n]=JSON.parse(t)}catch{s[n]=t}}}let c=[],l=xp(n,!0),u=t+1;for(;u<e.length&&e[u].type!==`vmr_container_close`;)if(e[u].type===`paragraph_open`){let t=e[u+1];if(t){let i={type:`paragraph`,children:r(t.children||[],void 0,void 0,l.options()),raw:String(t.content??``)};n?.includeSourceMap&&X(i,e[u],n),c.push(i),l.remember(i.raw)}u+=3}else if(e[u].type===`bullet_list_open`||e[u].type===`ordered_list_open`){let[t,i]=Bb(e,u,l.options(),r);n?.includeSourceMap&&X(t,e[u],n),c.push(t),l.remember(t.raw),u=i}else if(e[u].type===`blockquote_open`){let[t,i]=Jb(e,u,l.options(),r);n?.includeSourceMap&&X(t,e[u],n),c.push(t),l.remember(t.raw),u=i}else{let t=bx(e,u,l.options(),r);t?(c.push(t[0]),l.remember(t[0].raw),u=t[1]):u++}let d=u<e.length&&e[u].type===`vmr_container_close`,f=d&&i.meta?.unclosed!==!0||!!n?.final,p=`::: ${o}`;return Object.keys(s).length>0&&(p+=` ${JSON.stringify(s)}`),p+=`
|
|
144
|
+
`,c.length>0&&(p+=i.raw??c.map(e=>e.raw).join(`
|
|
145
|
+
`),p+=`
|
|
146
|
+
`),p+=`:::`,[{type:`vmr_container`,name:o,loading:!f,attrs:Object.keys(s).length>0?s:void 0,children:c,raw:p},d?u+1:u]}function dx(e,t,n,r){if(n?.type.endsWith(`_close`)){let i=Array.isArray(n.map)?Number(n.map[1]):NaN;return Number.isFinite(i)||(i=Array.isArray(t.map)?Number(t.map[1])+1:NaN),Dg(e,t,i,r)}return X(e,t,r)}function fx(e){return e.replace(/^\r?\n/,``).replace(/\r?\n$/,``)}var px=new Map;function mx(e){let t=px.get(e);if(t)return t;let n=qd(e);return t={strip:RegExp(`[\\t ]*<\\s*\\/\\s*${n}[^>]*$`,`i`),search:RegExp(`<\\s*${n}(?=\\s|>|/)`,`gi`),openAny:RegExp(`<\\s*${n}(?=\\s|>|/)`,`gi`),closeAny:RegExp(`<\\s*\\/\\s*${n}(?=\\s|>)`,`gi`)},px.set(e,t),t}function hx(e,t){if(!e||!t)return e;let n=mx(t).strip;return e.replace(n,``)}function gx(e,t,n){if(!e||!t)return null;let{openAny:r,closeAny:i}=mx(t.toLowerCase()),a=0,o=Math.max(0,n);for(;o<e.length;){let t=e.indexOf(`<`,o);if(t===-1)break;if(i.lastIndex=t,i.exec(e)?.index===t){let n=Jd(e.slice(t));if(n===-1)return null;if(a===0)return{start:t,end:t+n+1};a--,o=t+n+1}else if(r.lastIndex=t,r.exec(e)?.index===t){let n=Jd(e.slice(t));if(n===-1)return null;let r=e.slice(t,t+n+1);/\/\s*>$/.test(r)||a++,o=t+n+1}else o=t+1}return null}function _x(e,t,n){if(!e||!t)return null;let{search:r,openAny:i,closeAny:a}=mx(t.toLowerCase());r.lastIndex=Math.max(0,n||0);let o=r.exec(e);if(!o||o.index==null)return null;let s=o.index,c=e.slice(s),l=Jd(c);if(l===-1)return null;let u=s+l;if(/\/\s*>\s*$/.test(c.slice(0,l+1))){let t=u+1;return{raw:e.slice(s,t),start:s,end:t}}let d=1,f=u+1,p=t=>(i.lastIndex=t,i.exec(e)?.index===t),m=t=>(a.lastIndex=t,a.exec(e)?.index===t);for(;f<e.length;){let t=e.indexOf(`<`,f);if(t===-1)return{raw:e.slice(s),start:s,end:e.length};if(m(t)){let n=e.indexOf(`>`,t);if(n===-1)return null;if(d--,d===0){let t=n+1;return{raw:e.slice(s,t),start:s,end:t}}f=n+1}else if(p(t)){let n=Jd(e.slice(t));if(n===-1)return null;d++,f=t+n+1}else f=t+1}return{raw:e.slice(s),start:s,end:e.length}}function vx(e){return Number.isFinite(e)&&e>0?e:0}function yx(e,t){let n=vx(t);if(!e||n<=0)return 0;let r=0;for(let t=0;t<e.length;t++)if(e[t]===`
|
|
147
|
+
`&&(r++,r===n))return t+1;return e.length}function bx(e,t,n,r){let i=e[t],a=n?.includeSourceMap===!0;switch(i.type){case`heading_open`:{let o=Qb(e,t,n,r);return a&&X(o,i,n),[o,t+3]}case`code_block`:{let e=Yb(i);return a&&X(e,i,n),[e,t+1]}case`fence`:{let e=Sv(i);return a&&X(e,i,n),[e,t+1]}case`math_block`:{let e=$b(i);return a&&X(e,i,n),[e,t+1]}case`html_block`:{let e=xg(i),r=e.tag?lx(n?.customHtmlTags):null;if(e.tag&&e.loading&&r&&!r.allowedTagSet.has(e.tag)){let e=String(i.content??``).replace(/\n+$/,``),r={type:`paragraph`,children:e?[{type:`text`,content:e,raw:e}]:[],raw:e};return a&&X(r,i,n),[r,t+1]}if(e.tag&&r?.customTagSet?.has(e.tag)){let r=e.tag,o=zf(n)?n:void 0,s=String(o?.sourceMarkdown??``),c=Number(o?.customHtmlBlockCursor??0),l=Number(i.map?.[0]??0),u=Array.isArray(i.map)?o?.sourceLineOffsets?.[l]??yx(s,l):0,d=_x(s,r,Math.max(vx(c),vx(u)));d&&o&&(o.customHtmlBlockCursor=d.end);let f=String(d?.raw??e.raw??``),p=Jd(f),m=p===-1?f:f.slice(0,p+1),h=p!==-1&&/\/\s*>\s*$/.test(m),g=p===-1?null:gx(f,r,p+1),_=g?.start??-1,v=``;p!==-1&&(v=_!==-1&&p<_?f.slice(p+1,_):f.slice(p+1)),_===-1&&(v=hx(v,r));let y=[],b=/\s([\w:-]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g,x;for(;(x=b.exec(m))!==null;){let e=x[1];if(!e||e.toLowerCase()===r)continue;let t=x[2]||x[3]||x[4]||``;y.push([e,t])}let S=!n?.final&&!h&&g==null,C={type:r,tag:r,content:fx(v),raw:String(d?.raw??e.raw??f),loading:S,attrs:y.length?y:void 0};return a&&(d?C.sourceMap=Tg(s,d.start,d.end,n):X(C,i,n)),[C,t+1]}return a&&X(e,i,n),[e,t+1]}case`table_open`:{let[o,s]=ix(e,t,n,r);return a&&X(o,i,n),[o,s]}case`dl_open`:{let[o,s]=Xb(e,t,n,r);return a&&X(o,i,n),[o,s]}case`footnote_open`:{let[o,s]=Zb(e,t,n,r);return a&&X(o,i,n),[o,s]}case`hr`:{let e=ax();return a&&X(e,i,n),[e,t+1]}}return null}function xx(e,t,n,r,i){let a=bx(e,t,n,i);if(a)return a;let o=e[t],s=n?.includeSourceMap===!0;switch(o.type){case`container_warning_open`:case`container_info_open`:case`container_note_open`:case`container_tip_open`:case`container_danger_open`:case`container_caution_open`:case`container_error_open`:if(r?.parseContainer){let a=r.parseContainer(e,t,n,i);return s&&dx(a[0],o,e[a[1]-1],n),a}break;case`container_open`:if(r?.matchAdmonition){let a=r.matchAdmonition(e,t,n,i);if(a)return s&&dx(a[0],o,e[a[1]-1],n),a}break;case`vmr_container_open`:{let r=ux(e,t,n,i);return s&&dx(r[0],o,e[r[1]-1],n),r}}return null}function Sx(){return{type:`hardbreak`,raw:`\\
|
|
148
|
+
`}}function Cx(e,t,n,r){let i=e[t+1],a=String(i.content??``);return{type:`paragraph`,children:r(i.children||[],a,void 0,n),raw:a}}function wx(e,t,n){let r=t?.map,i=n.sourceMarkdown,a=n.runtime;if(!Array.isArray(r)||r.length<2||typeof i!=`string`||!a)return;let o=Number(r[0]),s=Number(r[1]);if(!Number.isFinite(o)||!Number.isFinite(s))return;let c=n.sourceLineOffsets;if(!c){c=[0];for(let e=0;e<i.length;e++)i[e]===`
|
|
149
|
+
`&&c.push(e+1);n.sourceLineOffsets=c}a.nodeSourceRanges.set(e,{start:c[Math.max(0,Math.trunc(o))]??i.length,end:c[Math.max(0,Math.trunc(s))]??i.length})}function Tx(e,t){return t.nodeSourceRanges.get(e)}function Ex(e){return e}var Dx=new Map;function Ox(e){let t=e?.customHtmlTags;if(!Array.isArray(t)||t.length===0)return null;let n=t.join(`\0`),r=Dx.get(n);if(r)return r;let i=$d(t),a=i.length?new Set(i):null;return a&&Dx.set(n,a),a}function kx(e){let t=e.raw;if(typeof t==`string`)return t;let n=Ex(e).content;return typeof n==`string`?n:e.type===`hardbreak`?`<br>`:``}function Ax(e){return{type:`paragraph`,children:e,raw:e.map(kx).join(``)}}function jx(e,t){if(t.sourceMap)for(let n of e)n.sourceMap||=t.sourceMap}function Mx(e,t){if(e.type!==`paragraph`)return null;let n=Ex(e).children,r=Array.isArray(n)?n:[];if(r.length===0)return null;let i=Ox(t);if(!i?.size)return null;let a=-1;for(let e=0;e<r.length;e++){let t=r[e];if(!i.has(String(t?.type??``).toLowerCase()))continue;let n=r.slice(0,e);if(String(Ex(t).content??``).trim()&&n.some(e=>e?.type===`hardbreak`)){a=e;break}}if(a===-1)return null;let o=r.slice(0,a),s=r[a];if(!s)return null;let c=[];o.length&&c.push(Ax(o)),c.push(s);let l=r.slice(a+1);return l.length&&c.push(Ax(l)),c}function Nx(e,t,n){if(!e||!Array.isArray(e))return[];let r=[],i=[],a=xp(t),o=t?.includeSourceMap===!0,s=0;for(;s<e.length;){let c=xx(e,s,a.options(),qb,n);if(c){wx(c[0],e[s],t),r.push(c[0]),a.remember(c[0].raw),i.push(a.snapshot()),s=c[1];continue}let l=e[s];switch(l.type){case`paragraph_open`:{let i=String(e[s+1]?.content??``),c=Cx(e,s,a.options(i),n);o&&X(c,l,t);let u=Mx(c,t);if(u){o&&jx(u,c);for(let e of u)wx(e,l,t);r.push(...u)}else wx(c,l,t),r.push(c);a.remember(c.raw),s+=3;break}case`bullet_list_open`:case`ordered_list_open`:{let[i,c]=Bb(e,s,a.options(),n);o&&X(i,l,t),wx(i,l,t),r.push(i),a.remember(i.raw),s=c;break}case`blockquote_open`:{let[i,c]=Jb(e,s,a.options(),n);o&&X(i,l,t),wx(i,l,t),r.push(i),a.remember(i.raw),s=c;break}case`footnote_anchor`:{let e=l.meta??{},n={type:`footnote_anchor`,id:String(e.label??l.content??``),raw:String(l.content??``)};o&&X(n,l,t),wx(n,l,t),r.push(n),a.remember(String(l.content??``)),s++;break}case`hardbreak`:r.push(Sx()),a.reset(),s++;break;case`text`:{let e=String(l.content??``),n={type:`paragraph`,raw:e,children:e?[{type:`text`,content:e,raw:e}]:[]};o&&X(n,l,t),wx(n,l,t),r.push(n),a.remember(e),s++;break}case`inline`:{let e=String(l.content??``),i=n(l.children||[],e,void 0,a.options(e));if(i.length!==0){if(i.every(e=>e.type===`html_block`)){if(o)for(let e of i)X(e,l,t);for(let e of i)wx(e,l,t);r.push(...i)}else{let n={type:`paragraph`,raw:e,children:i};o&&X(n,l,t);let a=Mx(n,t);if(a){o&&jx(a,n);for(let e of a)wx(e,l,t);r.push(...a)}else wx(n,l,t),r.push(n)}}a.remember(e)}s+=1;break;default:s+=1}let u=a.snapshot();for(;i.length<r.length;)i.push(u)}return t.linkifyDemotionResultContexts=i,r}function Px(e,t){let n=e.sourceLineOffsets;if(n?.source===t)return n.offsets;if(n&&t.length>n.source.length&&e.sourceExtends(n.source,t)){let e=n.offsets;for(let r=n.source.length;r<t.length;r++)t.charCodeAt(r)===10&&e.push(r+1);return n.source=t,e}let r=Fx(t);return e.sourceLineOffsets={source:t,offsets:r},r}function Fx(e){let t=[0];for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&t.push(n+1);return t}var Ix=new WeakMap,Lx=new WeakSet,Rx=new WeakSet;function zx(e,t){return e.customHtmlTags===t.customHtmlTags&&e.hasCustomParserExtensions===t.hasCustomParserExtensions&&e.includeSourceMap===t.includeSourceMap&&e.postTransformNodes===t.postTransformNodes&&e.postTransformTokens===t.postTransformTokens&&e.preTransformTokens===t.preTransformTokens&&e.requireClosingStrong===t.requireClosingStrong&&e.reuseStableTopLevelNodes===t.reuseStableTopLevelNodes&&e.streamParse===t.streamParse&&e.validateLink===t.validateLink}var Bx=class{constructor(e){this.streamParseEnvs=new Map,this.htmlPassIdentityPreserving=!1,this.detailsStitchCache=new WeakMap,this.nodeSourceRanges=new WeakMap,this.finalized=!1,this.resettingStream=!1,this.streamStateActive=!1,this.streamResetInCurrentRootParse=!1,this.markdownIt=e}sourceExtends(e,t){return this.sourceRelationPrevious===e&&this.sourceRelationCurrent===t?!0:t.startsWith(e)?(this.sourceRelationPrevious=e,this.sourceRelationCurrent=t,!0):!1}beginRootParse(e,t){this.streamResetInCurrentRootParse=!1;let n=this.documentSource!==void 0&&e!==this.documentSource&&!this.sourceExtends(this.documentSource,e),r=this.semantics!==void 0&&!zx(this.semantics,t);(this.finalized||n||r)&&this.resetDocument(this.streamStateActive),this.finalized=!1,this.documentSource=e,this.semantics=t}finishRootParse(e){this.sourceRelationPrevious=void 0,this.sourceRelationCurrent=void 0,e&&(this.clearDocumentCaches(),this.documentSource=void 0,this.semantics=void 0,this.finalized=!0)}resetForFinalAutoParse(){this.streamResetInCurrentRootParse||this.resetStreamOnly(),this.clearDocumentCaches()}markStreamParseStarted(){this.streamStateActive=!0}resetDocument(e){e&&this.resetStreamOnly(),this.clearDocumentCaches(),this.documentSource=void 0,this.semantics=void 0,this.finalized=!1}resetStreamOnly(){let e=this.markdownIt.stream,t=e?.reset;if(e&&typeof t==`function`){this.resettingStream=!0;try{t.call(e),this.streamStateActive=!1,this.streamResetInCurrentRootParse=!0}finally{this.resettingStream=!1}}}isResettingStream(){return this.resettingStream}handleExternalStreamReset(){this.streamStateActive=!1,this.streamResetInCurrentRootParse=!0,this.clearDocumentCaches(),this.documentSource=void 0,this.semantics=void 0,this.finalized=!1}invalidateConfiguration(){this.resetDocument(!0)}dispose(){this.resetDocument(!0),Ix.delete(this.markdownIt)}clearDocumentCaches(){this.safeMarkdown=void 0,this.tolerantMathBoundary=void 0,this.pendingExplicitMathTail=void 0,this.streamParseEnvs.clear(),this.topLevelStreamParseMode=void 0,this.structuredStream=void 0,this.htmlPassIdentityPreserving=!1,this.siblingHtmlChildren=void 0,this.detailsStitchCache=new WeakMap,this.nodeSourceRanges=new WeakMap,this.sourceLineOffsets=void 0,this.sourceRelationPrevious=void 0,this.sourceRelationCurrent=void 0}};function Vx(e){let t=e,n=e;if(!Lx.has(t)){Lx.add(t);let r=e.use;e.use=function(...e){try{return n.__markstreamHasCustomParserExtensions=!0,Reflect.apply(r,this,e)}finally{Ix.get(t)?.invalidateConfiguration()}};let i=e.set;e.set=function(...e){try{return Reflect.apply(i,this,e)}finally{Ix.get(t)?.invalidateConfiguration()}}}let r=e.stream;if(!r||typeof r.reset!=`function`)return;let i=r;if(Rx.has(i))return;Rx.add(i);let a=r.reset;r.reset=function(...e){let n=Ix.get(t);try{return Reflect.apply(a,this,e)}finally{n?.isResettingStream()||n?.handleExternalStreamReset()}}}function Hx(e){let t=e,n=Ix.get(t);return n||(n=new Bx(e),Ix.set(t,n)),Vx(e),n}function Ux(e,t){if(e===t)return;let n=e.split(/\r?\n/),r=t.split(/\r?\n/),i=[],a=0;for(let e=0;e<r.length;e++){let t=r[e]??``;if(n[a]===t){i[e]={startLine:a,endLine:a+1},a++;continue}let o=n[a]??``;if(t!==``&&o!==t&&o.startsWith(t)){let n=t,s=-1;for(let t=e+1;t<r.length;t++){if(n+=r[t]??``,n===o){s=t;break}if(!o.startsWith(n))break}if(s!==-1){for(let t=e;t<=s;t++)i[t]={startLine:a,endLine:a+1};a++,e=s;continue}i[e]={startLine:a,endLine:a+1};continue}let s=n[a]??``,c=-1;for(let e=a+1;e<n.length;e++){if(s+=`\\n${n[e]??``}`,s===t){c=e+1;break}if(!t.startsWith(s))break}if(c!==-1){i[e]={startLine:a,endLine:c},a=c;continue}let l=-1;if(t!==``){let e=Math.min(n.length,a+80);for(let r=a;r<e;r++)if(n[r]===t){l=r;break}}if(l!==-1){i[e]={startLine:l,endLine:l+1},a=l+1;continue}let u=Math.min(Math.max(0,n.length-1),Math.max(0,a-1));i[e]={startLine:u,endLine:u+1}}return e=>{let t=Number.isFinite(e)?Math.max(0,Math.trunc(e)):0;if(t<i.length)return i[t]??{startLine:0,endLine:0};let r=i[i.length-1]??{startLine:Math.max(0,n.length-1),endLine:n.length},a=Math.min(n.length,r.endLine+t-i.length);return{startLine:a,endLine:Math.min(n.length,a+1)}}}var Wx=new Map;function Gx(e){let t=Wx.get(e);return t||(t=new RegExp(String.raw`(^[\t ]*<\s*\/\s*${e}\s*>[\t ]*)(\r?\n)(?![\t ]*\r?\n|$)`,`gim`),Wx.size>=64&&Wx.clear(),Wx.set(e,t)),t}function Kx(e){let t=e=>e===` `||e===` `||e===`
|
|
150
|
+
`||e===`\r`,n=e=>{if(!e||e[0]!==`<`||e.includes(`>`))return!1;let n=1;if(n<e.length&&t(e[n])||e.startsWith(`<!--`)||e.startsWith(`<?`)||e.startsWith(`<!`)||e[n]===`/`&&(n++,n<e.length&&t(e[n])))return!1;let r=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122},i=e=>{let t=e.charCodeAt(0);return t>=48&&t<=57},a=e=>e===`!`||r(e),o=e=>r(e)||i(e)||e===`:`||e===`-`,s=e=>r(e)||i(e)||e===`_`||e===`.`||e===`:`||e===`-`,c=s;if(n>=e.length||!a(e[n]))return!1;for(n++;n<e.length&&o(e[n]);)n++;for(;n<e.length;){for(;n<e.length&&t(e[n]);)n++;if(n>=e.length)return!0;if(e[n]===`/`){for(n++;n<e.length&&t(e[n]);)n++;return n>=e.length}if(!s(e[n]))return!1;for(n++;n<e.length&&c(e[n]);)n++;for(;n<e.length&&t(e[n]);)n++;if(n<e.length&&e[n]===`=`){for(n++;n<e.length&&t(e[n]);)n++;if(n>=e.length)return!0;let r=e[n];if(r===`"`||r===`'`){for(n++;n<e.length&&e[n]!==r;)n++;if(n>=e.length)return!0;n++}else{for(;n<e.length;){let r=e[n];if(t(r)||r===`<`||r===`>`||r===`"`||r===`'`||r==="`")break;n++}if(n>=e.length)return!0}}}return!0},r=String(e??``),i=r.lastIndexOf(`<`);if(i===-1)return r;if(i>0){let e=r[i-1],t=e===` `||e===` `||e===`
|
|
151
|
+
`||e===`\r`,n=r[i-2];if(!t&&(e!==`n`&&e!==`r`||n!==`\\`))return r}let a=r.slice(i);return a.includes(`>`)||a.length>1&&(a[1]===` `||a[1]===` `||a[1]===`
|
|
152
|
+
`||a[1]===`\r`)||!n(a)||r_(r,i)?r:r.slice(0,i)}function qx(e,t){if(!e||!t.length)return e;let n=new Set(t.map(e=>String(e??``).toLowerCase()).filter(Boolean));if(!n.size)return e;let r=e=>e===` `||e===` `,i=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`||e===`:`},a=e=>{if(!e)return!1;if(e[0]===` `)return!0;let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r===` `){if(t++,t>=4)return!0}else{if(r===` `)return!0;break}}return!1},o=e=>{let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`)r++;else if(!n&&i===`'`)t=!t;else if(!t&&i===`"`)n=!n;else if(!t&&!n&&i===`>`)return r}return-1},s=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;let n=e[t];if(n!=="`"&&n!==`~`)return null;let i=t;for(;i<e.length&&e[i]===n;)i++;let a=i-t;return a<3?null:{markerChar:n,markerLen:a,rest:e.slice(i)}},c=(t,s)=>{if(a(t))return-1;let c=t.replace(/^[ \t]+/,``);if(!c||c.startsWith(`>`)||c.startsWith(`|`)||/^(?:[*+-]|\d+[.)])[\t ]+/.test(c))return-1;let l=!1,u=0;for(;u<t.length;){let a=t[u];if(a!==`<`){r(a)||(l=!0),u++;continue}let c=o(t.slice(u));if(c===-1){l=!0,u++;continue}let d=t.slice(u,u+c+1),f=1;for(;f<d.length&&r(d[f]);)f++;if(f>=d.length){l=!0,u++;continue}let p=d[f];if(p===`!`||p===`?`||p===`/`){l=!0,u+=c+1;continue}let m=f;for(;f<d.length&&i(d[f]);)f++;if(f===m){l=!0,u++;continue}let h=d.slice(m,f).toLowerCase(),g=d[f];if(g&&g!==` `&&g!==` `&&g!==`>`&&g!==`/`){l=!0,u++;continue}let _=new RegExp(String.raw`<\s*\/\s*${h}\s*>`,`i`),v=/\/\s*>$/.test(d),y=_.test(t.slice(u+c+1)),b=_.test(e.slice(s+u+c+1)),x=/[\r\n]/.test(e.slice(s+u+c+1));if(l&&n.has(h)&&!v&&!y&&(b||x))return u;l=!0,u+=c+1}return-1},l=!1,u=``,d=0,f=``,p=0;for(;p<e.length;){let t=e.indexOf(`
|
|
153
|
+
`,p),n=t!==-1,r=n&&t>p&&e[t-1]===`\r`,i=n?r?t-1:t:e.length,a=e.slice(p,i),o=n?r?`\r
|
|
154
|
+
`:`
|
|
155
|
+
`:``,m=s(a),h=a;if(!l&&!m){let e=c(a,p);if(e!==-1){let t=o||`
|
|
156
|
+
`;h=`${a.slice(0,e).replace(/[ \t]+$/,``)}${t}${t}${a.slice(e).replace(/^[ \t]+/,``)}`}}f+=h,f+=o,m&&(l?m.markerChar===u&&m.markerLen>=d&&/^\s*$/.test(m.rest)&&(l=!1,u=``,d=0):(l=!0,u=m.markerChar,d=m.markerLen)),p=n?t+1:e.length}return f}function Jx(e,t){if(!e||!t.length)return e;let n=new Set(t.map(e=>String(e??``).toLowerCase()));if(!n.size)return e;let r=e=>e===` `||e===` `,i=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`},a=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;return e.slice(t)},o=e=>{let t=!1,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i===`\\`)r++;else if(!n&&i===`'`)t=!t;else if(!t&&i===`"`)n=!n;else if(!t&&!n&&i===`>`)return r}return-1},s=(e,t,n)=>{let a=n.toLowerCase(),o=e.indexOf(`<`,t);for(;o!==-1;){let t=o+1;for(;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]!==`/`){o=e.indexOf(`<`,o+1);continue}for(t++;t<e.length&&r(e[t]);)t++;if(t+a.length>e.length){o=e.indexOf(`<`,o+1);continue}let n=!0;for(let r=0;r<a.length;r++){let i=e[t+r];if((i>=`A`&&i<=`Z`?String.fromCharCode(i.charCodeAt(0)+32):i)!==a[r]){n=!1;break}}if(!n){o=e.indexOf(`<`,o+1);continue}let s=t+a.length;if(s<e.length&&i(e[s]))o=e.indexOf(`<`,o+1);else{for(;s<e.length&&r(e[s]);)s++;if(s<e.length&&e[s]===`>`)return!0;o=e.indexOf(`<`,o+1)}}return!1},c=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]!==`<`)return e;for(t++;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]===`/`)return e;let c=t;for(;t<e.length&&i(e[t]);)t++;if(t===c)return e;let l=e.slice(c,t).toLowerCase();if(!n.has(l))return e;let u=o(e.slice(t));if(u===-1)return e;let d=t+u;if(s(e,d+1,l))return e;let f=a(e.slice(d+1));return f?`${e.slice(0,d+1)}\n${f}`:e},l=``,u=0;for(;u<e.length;){let t=e.indexOf(`
|
|
157
|
+
`,u);if(t===-1){l+=c(e.slice(u));break}let n=t>u&&e[t-1]===`\r`,r=n?t-1:t,i=e.slice(u,r);l+=c(i),l+=n?`\r
|
|
158
|
+
`:`
|
|
159
|
+
`,u=t+1}return l}function Yx(e,t){if(!e||!t.length)return e;let n=new Set(t.map(e=>String(e??``).toLowerCase()));if(!n.size)return e;let r=e=>e===` `||e===` `,i=e=>{let t=0,n=!1,i=0;for(;t<e.length;){for(;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]!==`>`)break;for(n=!0,t++;t<e.length&&r(e[t]);)t++;i=t}return n?{prefix:e.slice(0,i),content:e.slice(i)}:null},a=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;let n=e[t];if(n!=="`"&&n!==`~`)return null;let i=t;for(;i<e.length&&e[i]===n;)i++;let a=i-t;return a<3?null:{markerChar:n,markerLen:a,rest:e.slice(i)}},o=Array.from(n).map(e=>new RegExp(String.raw`(<\s*\/\s*${e}\s*>)${"(?=[\\t ]*(?:#{1,6}[\\t ]+|>|(?:[*+-]|\\d+[.)])[\\t ]+|(?:`{3,}|~{3,})|\\||\\$\\$|:{3,}|\\[\\^[^\\]]+\\]:|(?:-{3,}|\\*{3,}|_{3,})))"}`,`gi`)),s=!1,c=``,l=0,u=``,d=0;for(;d<e.length;){let t=e.indexOf(`
|
|
160
|
+
`,d),n=t!==-1,r=n&&t>d&&e[t-1]===`\r`,f=n?r?t-1:t:e.length,p=e.slice(d,f),m=n?r?`\r
|
|
161
|
+
`:`
|
|
162
|
+
`:``,h=i(p),g=h?.prefix??``,_=h?.content??p,v=a(_);v&&(s?v.markerChar===c&&v.markerLen>=l&&/^\s*$/.test(v.rest)&&(s=!1,c=``,l=0):(s=!0,c=v.markerChar,l=v.markerLen));let y=_;if(!s&&y.includes(`</`))for(let e of o)y=y.replace(e,(e,t,n,r)=>{if(r.replace(/^[\t ]+/,``).startsWith(`|`))return e;let i=r.slice(0,n).replace(/^[\t ]+/,``);if(i.length>0){let n=t.match(/^<\s*\/\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??``,r=i.match(/^<\s*([A-Z][\w:-]*)/i)?.[1]?.toLowerCase()??``;if(!n||!r||n!==r)return e}return`${t}\n\n`});if(g){let e=g+y.split(`
|
|
163
|
+
`).join(`\n${g}`);u+=e}else u+=y;u+=m,d=n?t+1:e.length}return u}function Xx(e,t){if(!e||!t.length)return e;let n=new Set(t.map(e=>String(e??``).toLowerCase()));if(!n.size)return e;let r=e=>e===` `||e===` `,i=e=>{if(!e)return!1;if(e[0]===` `)return!0;let t=0;for(let n=0;n<e.length;n++){let r=e[n];if(r===` `){if(t++,t>=4)return!0}else{if(r===` `)return!0;break}}return!1},a=e=>{let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||e===`_`||e===`-`||e===`:`},o=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;return e.slice(t)},s=e=>{let t=0,n=!1,i=0;for(;t<e.length;){for(;t<e.length&&r(e[t]);)t++;if(t>=e.length||e[t]!==`>`)break;for(n=!0,t++;t<e.length&&r(e[t]);)t++;i=t}if(!n)return null;let a=e.slice(0,i);return{prefix:a,key:a.replace(/[ \t]+$/,``),content:e.slice(i)}},c=e=>o(e).startsWith(`<`),l=e=>{for(let t=0;t<e.length;t++){let n=e[t];if(n!==` `&&n!==` `)return!1}return!0},u=e=>{if(i(e))return``;let t=o(e);if(!t.startsWith(`<`))return``;let s=1;for(;s<t.length&&r(t[s]);)s++;if(s>=t.length||t[s]===`/`||t[s]===`!`||t[s]===`?`)return``;let c=s;for(;s<t.length&&a(t[s]);)s++;if(s===c)return``;let l=t.slice(c,s).toLowerCase();if(!n.has(l))return``;let u=t[s];return u&&u!==` `&&u!==` `&&u!==`>`&&u!==`/`?``:l},d=e=>{if(i(e))return null;let t=o(e);if(!t.startsWith(`<`))return null;let s=1;for(;s<t.length&&r(t[s]);)s++;if(s>=t.length)return null;let c=t[s]===`/`;if(c)for(s++;s<t.length&&r(t[s]);)s++;let l=t[s];if(!l||l===`!`||l===`?`)return null;let u=s;for(;s<t.length&&a(t[s]);)s++;if(s===u)return null;let d=t.slice(u,s).toLowerCase();if(!n.has(d))return null;let f=t[s];if(f&&f!==` `&&f!==` `&&f!==`>`&&f!==`/`)return null;if(c)return{type:`close`,name:d};if(/\/\s*>\s*$/.test(t))return{type:`open`,name:d,complete:!0};let p=t.indexOf(`>`,s);if(p!==-1){let e=t.slice(p+1);if(RegExp(`<\\s*\\/\\s*${d}\\s*>`,`i`).test(e))return{type:`open`,name:d,complete:!0}}return{type:`open`,name:d,complete:!1}},f=e=>{if(i(e))return null;let t=o(e).replace(/[ \t]+$/,``);if(!t.startsWith(`<`)||/^<\s*(?:!--|!doctype\b|\?)/i.test(t))return null;let n=t.match(/^<\s*([A-Z][\w:-]*)\b[^>]*\/\s*>\s*$/i);if(n?.[1])return n[1].toLowerCase();let r=t.match(/^<\s*([A-Z][\w:-]*)\b[^>]*>[\s\S]*<\s*\/\s*([A-Z][\w:-]*)\s*>\s*$/i);if(!r?.[1]||!r[2])return null;let a=r[1].toLowerCase();return a===r[2].toLowerCase()?a:null},p=!1,m=``,h=0,g=e=>{let t=0;for(;t<e.length&&r(e[t]);)t++;let n=e[t];if(n!=="`"&&n!==`~`)return null;let i=t;for(;i<e.length&&e[i]===n;)i++;let a=i-t;return a<3?null:{markerChar:n,markerLen:a,rest:e.slice(i)}},_=e=>g(e),v=e=>{let t=o(e);return t?i(e)?!0:/^(?:#{1,6}[ \t]+|>|[*+-][ \t]+|\d+[.)][ \t]+|`{3,}|~{3,}|\||\$\$|:{3,}|\[\^[^\]]+\]:|-{3,}|\*{3,}|_{3,})/.test(t):!1},y=(t,n,r)=>{let i=t,a=0;for(;i<e.length;){let t=e.indexOf(`
|
|
164
|
+
`,i),o=t!==-1,c=o&&t>i&&e[t-1]===`\r`,u=o?c?t-1:t:e.length,f=e.slice(i,u),p=s(f),m=p?.key??``;if(a>0&&n&&m!==n)break;let h=p?.content??f,g=d(h);if(g?.name===r){if(g.type===`open`)g.complete||a++;else if(a>0&&(a--,a===0))return!1}else if(a>0&&(l(h)||v(h)))return!0;if(o)i=t+1;else break}return!1},b=``,x=0,S=!0,C=!1,w=!1,T=`
|
|
165
|
+
`,E=[],D=``;for(;x<e.length;){let t=e.indexOf(`
|
|
166
|
+
`,x),n=t!==-1,r=n&&t>x&&e[t-1]===`\r`,i=n?r?t-1:t:e.length,a=e.slice(x,i),o=n?r?`\r
|
|
167
|
+
`:`
|
|
168
|
+
`:``,g=s(a),v=g?.key??``,O=g?.content??a,k=_(O);k&&(p?k.markerChar===m&&k.markerLen>=h&&/^\s*$/.test(k.rest)&&(p=!1,m=``,h=0):(p=!0,m=k.markerChar,h=k.markerLen));let A=E.length>0;if(!p&&!A){let e=u(O),t=!!e&&!S&&C&&w&&y(x,v,e);e&&!S&&(!C||t)&&(v&&D&&v===D?b+=`${v}${T}`:v||(b+=T))}if(b+=a,b+=o,o&&(T=o),!p){let e=d(O);if(e){if(e.type===`open`)e.complete||E.push(e.name);else for(let t=E.length-1;t>=0;t--)if(E[t]===e.name){E.length=t;break}}}let j=l(O);S=j,C=!j&&c(O),w=!j&&!!f(O),D=v,x=n?t+1:e.length}return b}function Zx(e,t,n){let r=e;if(t?.length&&r.includes(`<`)){let e=$d(t);if(e.length&&(r=qx(r,e),r=Jx(r,e),r=Xx(r,e),r=Yx(r,e),r.includes(`</`)))for(let t of e)r=r.replace(Gx(t),`$1$2$2`)}return n||(r=Kx(r)),r}var Qx=1024,$x=16;function eS(e,t,n){let r=e.replace(/([^\\])\r(ight|ho)/g,`$1\\r$2`),i=h_(r);return r=r.replace(/([^\\])\r?\n(abla|eq|ot|exists)/g,(e,t,n,r)=>{i.scanTo(r+1);let a=i.inMath();return i.scanTo(r+e.length),a?`${t}\\n${n}`:e}),t||(r.endsWith(`- *`)&&(r=r.replace(/- \*$/,`- \\*`)),/(?:^|\n)\s*-\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*-\s*$/,e=>e.startsWith(`
|
|
169
|
+
`)?`
|
|
170
|
+
`:``):/(?:^|\n)\s*--\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*--\s*$/,e=>e.startsWith(`
|
|
171
|
+
`)?`
|
|
172
|
+
`:``):/(?:^|\n)\s*>\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*>\s*$/,e=>e.startsWith(`
|
|
173
|
+
`)?`
|
|
174
|
+
`:``):/\n\s*[*+]\s*$/.test(r)?r=r.replace(/\n\s*[*+]\s*$/,`
|
|
175
|
+
`):/(?:^|\n)\s*\d+\s*$/.test(r)?/^\d+$/.test(r.trim())||(r=r.replace(/(?:^|\n)\s*\d+\s*$/,e=>e.startsWith(`
|
|
176
|
+
`)?`
|
|
177
|
+
`:``)):/(?:^|\n)\s*\d+[.)]\s+\*{1,3}\s*$/.test(r)?r=r.replace(/((?:^|\n)\s*\d+[.)]\s+)(\*{1,3})\s*$/,(e,t,n)=>`${t}${n.split(``).map(()=>`\\*`).join(``)}`):/(?:^|\n)\s*\d+[.)]\s*$/.test(r)?r=r.replace(/(?:^|\n)\s*\d+[.)]\s*$/,e=>e.startsWith(`
|
|
178
|
+
`)?`
|
|
179
|
+
`:``):/\n[[(]\n*$/.test(r)&&(r=r.replace(/(\n\[|\n\()+\n*$/g,`
|
|
180
|
+
`)),r=o_(r,n.customHtmlTags)??r),r=Zx(r,n.customHtmlTags,t),r}function tS(e,t,n,r){let i=`${n?`final`:`stream`}:${(r.customHtmlTags??[]).join(`,`)}`,a=r.isFragment?void 0:e.safeMarkdown,o;if(!n&&!r.customHtmlTags?.length&&a&&a.mode===i&&t.length>=a.source.length&&e.sourceExtends(a.source,t)){let e=Math.max(0,a.source.length-Qx-$x),i=eS(t.slice(e),n,r),s=a.source.length-e;o=i.length>=s&&i.slice(0,s)===a.safeMarkdown.slice(-s)?a.safeMarkdown.slice(0,a.safeMarkdown.length-s)+i:eS(t,n,r)}else o=eS(t,n,r);return n||(o=l_(o,e,!r.isFragment)),r.isFragment||(e.safeMarkdown={source:t,safeMarkdown:o,mode:i}),o}function nS(){return typeof performance<`u`?performance.now():Date.now()}function rS(e,t,n){e&&(e[t]=(e[t]??0)+n)}function iS(e){return e.parserMetrics}function aS(e,t,n){return t&&rS(t,`parseMarkdownToStructureTotalMs`,nS()-n),e}function oS(e,t,n,r){return aS(Ib(e,t),n,r)}function sS(e,t,n){if(!n)return Nx(e,t,Pb);rS(n,`processTokensInputTokens`,e.length);let r=nS(),i=Nx(e,t,Pb);return rS(n,`processTokensMs`,nS()-r),i}function cS(e,t){let n=e,r=typeof n.validateLink==`function`&&n.__markstreamOriginalValidateLink&&n.validateLink!==n.__markstreamOriginalValidateLink?n.validateLink:void 0;return t.validateLink??r??n.options?.validateLink??(typeof n.validateLink==`function`?n.validateLink:void 0)}function lS(e,t){let n=t.runtime,r=t.markdownIt,i={...t,customHtmlBlockCursor:0,sourceLineOffsets:void 0},a=iS(i),o=a?{recordTokenCloneMs:e=>rS(a,`tokenCloneMs`,e)}:void 0,s=a?nS():0,c=!!i.final,l=(e??``).toString();i.isFragment||b_(n,i);let u=tS(n,l,c,i);a&&rS(a,`safeMarkdownMs`,nS()-s);let d=ag(u);if(d){if(i.includeSourceMap){let e={...i,sourceLineMapper:Ux(l,u)};d[0].sourceMap=Tg(u,0,u.length,e)}let e=i.preTransformTokens,t=i.postTransformTokens;if(v_(n,i)||typeof e==`function`||typeof t==`function`){let r=O_(n,u,{__markstreamFinal:c},i,o),a=typeof e==`function`&&e(r)||r;typeof t==`function`&&t(a)}return oS(d,i,a,s)}let f=a?nS():0,p=O_(n,u,{__markstreamFinal:c},i,o);if(a&&rS(a,`tokenizeMs`,nS()-f),!p||!Array.isArray(p))return oS([],i,a,s);let m=i.preTransformTokens,h=i.postTransformTokens,g=p;m&&typeof m==`function`&&(g=m(g)||g);let _={...i,sourceLineMapper:i.includeSourceMap===!0?Ux(l,u):void 0,sourceMarkdown:u,sourceLineOffsets:i.isFragment?Fx(u):Px(n,u),customHtmlBlockCursor:0},v=W_(n,u,g,_,{processTokens:(e,t)=>sS(e,t,a),recordReusedTopLevelNodes:e=>rS(a,`processTokensReusedTopLevelNodes`,e)});if(h&&typeof h==`function`){let e=h(g);if(Array.isArray(e)){let t=e[0],n=t?.type;v=t&&typeof n==`string`?sS(e,{..._,customHtmlBlockCursor:0},a):e}}let y=n.structuredReuseTailStart,b=y&&y>0&&y<v.length?y:0;if(rv(v)){let e=a?nS():0,t={getInternalNodeSourceRange:e=>Tx(e,n),markdownIt:r,parseFragment:(e,t)=>lS(e,t)},i=b>0&&n.htmlPassIdentityPreserving,o=i?Tx(v[b],n)?.start:void 0,s=!1;for(let e=i?b:0;e<v.length;e++){let t=v[e];if(t.type===`html_block`&&String(t.tag??``).toLowerCase()===`details`){s=!0;break}}let l=i&&!s&&o!=null,d=l?v.slice(0,b):[],f=l?v.slice(b):v,p=l?o:0,m=lv(f,c,u,t,_,p),h=m.length===f.length&&m.every((e,t)=>e===f[t]);s&&(m=sv(m,u,t,_,c,p)[0]),m=nv(m,t,_,c),v=l?d.concat(m):m,n.htmlPassIdentityPreserving=!s&&h,a&&rS(a,`htmlBlockPassesMs`,nS()-e)}else n.htmlPassIdentityPreserving=!0;return c&&Fb(v),v=Ib(v,i),i.debug&&console.log(`Parsed Markdown Tree Structure:`,v),aS(v,a,s)}function uS(e,t,n={}){let r=(e??``).toString(),i=Hx(t),a=cS(t,n),o=Bf(n,{markdownIt:t,runtime:i,validateLink:a}),s=t;i.beginRootParse(r,{customHtmlTags:(n.customHtmlTags??[]).join(`\0`),hasCustomParserExtensions:s.__markstreamHasCustomParserExtensions===!0,includeSourceMap:n.includeSourceMap===!0,postTransformNodes:n.postTransformNodes,postTransformTokens:n.postTransformTokens,preTransformTokens:n.preTransformTokens,requireClosingStrong:n.requireClosingStrong,reuseStableTopLevelNodes:n.reuseStableTopLevelNodes===!0,streamParse:n.streamParse,validateLink:a});try{let e=n.parserMetrics?nS():0,t=N_(i,r,o);return t?(rS(n.parserMetrics,`processTokensReusedTopLevelNodes`,t.length),i.resetStreamOnly(),n.debug&&console.log(`Parsed Markdown Tree Structure:`,t),aS(t,n.parserMetrics,e)):(n.final===!0&&!o.isFragment&&i.safeMarkdown&&i.resetDocument(!0),lS(r,o))}finally{i.finishRootParse(n.final===!0)}}var dS=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g,fS=/\d/u,pS=/[,.!?;:,。;、!?:]/u,mS=/\d\p{Script=Han}{1,3}$/u;function hS(e){return e.pos>0&&e.pos+1<e.posMax&&fS.test(e.src[e.pos-1])&&fS.test(e.src[e.pos+1])}function gS(e,t,n,r,i,a={}){let o=e.charCodeAt(0);return(e,s)=>{let c=e,l=c.posMax,u=c.pos;if(c.src.charCodeAt(u)!==o||s||a.refuseDigitRange&&hS(c))return!1;c.pos=u+1;let d=!1;for(;c.pos<l;){if(c.src.charCodeAt(c.pos)===o){d=!0;break}c.md.inline.skipToken(c)}if(!d||u+1===c.pos)return c.pos=u,!1;let f=c.src.slice(u+1,c.pos);if(!f||f.match(/(^|[^\\])(\\\\)*\s/))return c.pos=u,!1;let p=c.src[c.pos+1],m=fS.test(f[0]),h=p!==void 0&&fS.test(p);if(m&&h&&(mS.test(c.src.slice(0,u))||pS.test(f)||fS.test(f[f.length-1])))return c.pos=u,!1;let g=c.push(n,i,1);g.markup=t;let _=c.push(`text`,``,0);_.content=f.replace(dS,`$1`);let v=c.push(r,i,-1);return v.markup=t,c.pos+=1,!0}}function _S(e){let t=gS(`~`,`~`,`sub_open`,`sub_close`,`sub`,{refuseDigitRange:!0});e.inline.ruler.after(`emphasis`,`sub`,t)}var vS=/^([a-z][\w-]*)(?=[\t\n\f\r />]|$)/i,yS=new Set([...Td,`base`,`button`,`datalist`,`dialog`,`embed`,`fieldset`,`form`,`iframe`,`input`,`legend`,`link`,`meta`,`object`,`optgroup`,`option`,`output`,`param`,`select`,`style`,`template`,`textarea`,`title`]),bS=new Set(`a.abbr.b.blockquote.br.caption.code.col.colgroup.dd.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.ins.kbd.li.mark.ol.p.picture.pre.s.small.source.span.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.ul`.split(`.`));function xS(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function SS(e){return typeof e==`string`?e:e==null?``:String(e)}function CS(e){return/^[^\s"'<>`=]+$/.test(e)&&!/^on/i.test(e)}function wS(e){return SS(e).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function TS(e){return wS(e).replace(/`/g,```)}function ES(e){return String(e??``).trim().toLowerCase()}function DS(e,t=`safe`){let n=ES(e);return n?t===`escape`?!0:t===`trusted`?Td.has(n):!bS.has(n):!1}function OS(e,t=`safe`){let n=ES(e);return n?t===`escape`?!0:t===`trusted`?Td.has(n):yS.has(n):!1}function kS(e){let t=Object.entries(e);return t.length===0?``:t.map(([e,t])=>t===``?` ${e}`:` ${e}="${TS(t)}"`).join(``)}function AS(e){let t=e.startsWith(`/`),n=t?e.slice(1):e,r=n.match(vS);return r?{attrsStr:t?``:n.slice(r[0].length).trimStart(),isClosing:t,isSelfClosing:!t&&e.trimEnd().endsWith(`/`),tagName:r[1]}:null}function jS(e,t){let n=e.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length!==0&&n.some(e=>{let n=e.split(/\s+/,1)[0]??``;return!n||zd(n,{tagName:t,attrName:`srcset`})})}function MS(e,t,n,r){return Cd.has(e)||n===`safe`&&e===`style`?!0:e===`srcset`?jS(t,r):!!(wd.has(e)&&t&&zd(t,{tagName:r,attrName:e}))}function NS(e,t){let n=t.toLowerCase();return Object.keys(e).find(e=>e.toLowerCase()===n)}function PS(e,t,n,r=!1){if(t!==`safe`||ES(n)!==`a`)return e;let i=NS(e,`href`);if(r&&(!i||!e[i])){let t=NS(e,`target`),n=NS(e,`rel`);return t&&delete e[t],n&&delete e[n],e}let a=NS(e,`target`);if((a?String(e[a]).trim():``).toLowerCase()!==`_blank`)return e;let o=NS(e,`rel`),s=new Set(String(o?e[o]:``).split(/\s+/).map(e=>e.trim()).filter(Boolean).filter(e=>e.toLowerCase()!==`opener`));return s.add(`noopener`),s.add(`noreferrer`),o&&o!==`rel`&&delete e[o],e.rel=Array.from(s).join(` `),e}function FS(e,t=`safe`,n){let r={};for(let[i,a]of Object.entries(e)){let e=i.trim(),o=e.toLowerCase();e&&CS(e)&&(MS(o,a,t,n)||(r[e]=a))}return PS(r,t,n,!!NS(e,`href`))}function IS(e,t){let n=e.toLowerCase();return Sd.has(n)?!1:xS(t,n)||xS(t,e)}function LS(e,t=`safe`,n){let r={};for(let[i,a]of Object.entries(e)){let e=i.trim(),o=e.toLowerCase();e&&CS(e)&&(MS(o,a,t,n)||(r[e]=a))}return PS(r,t,n,!!NS(e,`href`))}function RS(e){let t={};if(!Array.isArray(e)||e.length===0)return t;for(let[n,r]of e)n&&(t[String(n)]=r==null?``:String(r));return t}function zS(e,t=`safe`,n){let r=LS(RS(e),t,n),i=Object.entries(r).map(([e,t])=>[e,t]);return i.length>0?i:void 0}function BS(e,t){let n=t.toLowerCase();if([`checked`,`disabled`,`readonly`,`required`,`autofocus`,`multiple`,`hidden`].includes(n))return e===`true`||e===``||e===t;if([`value`,`min`,`max`,`step`,`width`,`height`,`size`,`maxlength`].includes(n)){let t=Number(e);if(e!==``&&!Number.isNaN(t))return t}return e}function VS(e){let t={};for(let[n,r]of Object.entries(e))t[n]=BS(r,n);return t}function HS(e){return e.trim().length>0}function US(e){let t=[],n=0;for(;n<e.length;){if(e.startsWith(`<!--`,n)){let t=e.indexOf(`-->`,n);if(t!==-1){n=t+3;continue}break}let r=e.indexOf(`<`,n);if(r===-1){if(n<e.length){let r=e.slice(n);HS(r)&&t.push({type:`text`,content:r})}break}if(r>n){let i=e.slice(n,r);HS(i)&&t.push({type:`text`,content:i})}if(e.startsWith(`![CDATA[`,r+1)){let i=e.indexOf(`]]>`,r);if(i!==-1){t.push({type:`text`,content:e.slice(r,i+3)}),n=i+3;continue}break}if(e.startsWith(`!`,r+1)){let t=e.indexOf(`>`,r);if(t!==-1){n=t+1;continue}break}let i=e.indexOf(`>`,r);if(i===-1)break;let a=AS(e.slice(r+1,i));if(a){if(a.isClosing)t.push({type:`tag_close`,tagName:a.tagName});else{let e={};if(a.attrsStr){let t=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g,n;for(;(n=t.exec(a.attrsStr))!==null;){let t=n[1],r=n[2]??n[3]??n[4]??``;t&&!t.endsWith(`/`)&&(e[t]=r)}}t.push({type:a.isSelfClosing||yd.has(a.tagName.toLowerCase())?`self_closing`:`tag_open`,tagName:a.tagName,attrs:e})}n=i+1}else{let a=e.slice(r,i+1);HS(a)&&t.push({type:`text`,content:a}),n=i+1}}return t}function WS(e){let t=[],n=0;for(;n<e.length;){if(e.startsWith(`<!--`,n)){let t=e.indexOf(`-->`,n);if(t!==-1){n=t+3;continue}break}let r=e.indexOf(`<`,n);if(r===-1){n<e.length&&t.push({type:`text`,content:e.slice(n)});break}if(r>n&&t.push({type:`text`,content:e.slice(n,r)}),e.startsWith(`![CDATA[`,r+1)){let i=e.indexOf(`]]>`,r);if(i!==-1){t.push({type:`text`,content:e.slice(r,i+3)}),n=i+3;continue}break}if(e.startsWith(`!`,r+1)){let t=e.indexOf(`>`,r);if(t!==-1){n=t+1;continue}break}let i=e.indexOf(`>`,r);if(i===-1)break;let a=AS(e.slice(r+1,i));if(!a){t.push({type:`text`,content:e.slice(r,i+1)}),n=i+1;continue}if(a.isClosing){t.push({type:`tag_close`,tagName:a.tagName}),n=i+1;continue}let o={};if(a.attrsStr){let e=/([^\s=]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S*)))?/g,t;for(;(t=e.exec(a.attrsStr))!==null;){let e=t[1],n=t[2]??t[3]??t[4]??``;e&&!e.endsWith(`/`)&&(o[e]=n)}}t.push({type:a.isSelfClosing||yd.has(a.tagName.toLowerCase())?`self_closing`:`tag_open`,tagName:a.tagName,attrs:o}),n=i+1}return t}function GS(e){let t=String(e.tagName??``).trim();if(!t)return``;if(e.type===`tag_close`)return`</${wS(t)}>`;let n=Object.entries(e.attrs??{}).map(([e,t])=>t===``?` ${wS(e)}`:` ${wS(e)}="${TS(t)}"`).join(``);return e.type===`self_closing`?`<${wS(t)}${n} />`:`<${wS(t)}${n}>`}function KS(e,t=`safe`){if(!e)return``;if(t===`escape`)return wS(e);let n=WS(e),r=[],i=[],a=[];for(let e of n){if(e.type===`text`){a.length===0&&i.push(wS(e.content??``));continue}let n=ES(e.tagName);if(!n)continue;if(OS(n,t)){e.type===`tag_open`?a.push(n):e.type===`tag_close`&&a[a.length-1]===n&&a.pop();continue}if(a.length>0)continue;if(t===`safe`&&DS(n,t)){i.push(GS(e));continue}if(e.type===`self_closing`){i.push(`<${n}${kS(FS(e.attrs??{},t,n))}>`);continue}if(e.type===`tag_open`){i.push(`<${n}${kS(FS(e.attrs??{},t,n))}>`),yd.has(n)||r.push(n);continue}let o=r.lastIndexOf(n);if(o===-1)continue;for(;r.length>o+1;){let e=r.pop();e&&i.push(`</${e}>`)}let s=r.pop();s&&i.push(`</${s}>`)}for(;r.length>0;){let e=r.pop();e&&i.push(`</${e}>`)}return i.join(``)}var qS=[/javascript:/i,/vbscript:/i,/data:text\/html/i,/expression\s*\(/i,/@import/i],JS=`http://www.w3.org/2000/svg`,YS=new Set([`script`,`style`,`iframe`,`object`,`embed`,`link`,`meta`]),XS=new Set([`svg`,`style`,`g`,`a`,`defs`,`marker`,`path`,`rect`,`circle`,`ellipse`,`line`,`polyline`,`polygon`,`text`,`tspan`,`title`,`desc`,`use`,`image`,`lineargradient`,`radialgradient`,`stop`,`clippath`,`mask`,`pattern`]),ZS=new Set([`href`,`xlink:href`,`src`,`srcdoc`,`action`,`data`,`formaction`,`poster`]),QS=new Set([`clip-path`,`fill`,`filter`,`marker-end`,`marker-mid`,`marker-start`,`mask`,`stroke`]),$S=new Set([`circle`,`ellipse`,`image`,`line`,`path`,`polygon`,`polyline`,`rect`,`text`,`tspan`,`use`]);function eC(e){return(e.getAttribute(`href`)||e.getAttribute(`xlink:href`))?.startsWith(`#`)===!0}function tC(e){return!!(e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||e.getAttribute(`src`))}function nC(e){let t=e.nodeName.toLowerCase();return t===`use`?eC(e):t===`image`?tC(e):t===`text`||t===`tspan`?!!e.textContent?.trim():$S.has(t)}function rC(e){return e.replace(/(["'])\s*javascript:/gi,`$1#`).replace(/\bjavascript:/gi,`#`).replace(/(["'])\s*vbscript:/gi,`$1#`).replace(/\bvbscript:/gi,`#`).replace(/\bdata:text\/html/gi,`#`)}function iC(e,t,n){let r=e.toLowerCase(),i=t.toLowerCase(),a=String(n??``).trim();return a?(r===`use`||r===`marker`||r===`clippath`||r===`mask`)&&(i===`href`||i===`xlink:href`)?a.startsWith(`#`)?a:``:r===`a`&&(i===`href`||i===`xlink:href`)?zd(a,{tagName:`a`,attrName:`href`})?``:a:r===`image`&&(i===`href`||i===`xlink:href`||i===`src`)?zd(a,{tagName:`img`,attrName:`src`})?``:a:i===`href`||i===`xlink:href`?a.startsWith(`#`)?a:``:zd(a,{tagName:r,attrName:i})?``:a:``}function aC(e,t){let n=t+4;for(;n<e.length&&/\s/.test(e[n]??``);)n++;let r=e[n];if(r===`"`||r===`'`){let t=n+1,i=e.indexOf(r,t);if(i===-1)return{next:e.length,url:``};for(n=i+1;n<e.length&&/\s/.test(e[n]??``);)n++;return{next:n<e.length&&e[n]===`)`?n+1:n,url:e.slice(t,i)}}let i=n;for(;n<e.length&&e[n]!==`)`;)n++;return{next:n<e.length?n+1:n,url:e.slice(i,n)}}function oC(e){return e.replace(/\\([0-9a-f]{1,6}\s?|.)/gi,(e,t)=>{let n=t.trim();if(/^[0-9a-f]+$/i.test(n)){let e=Number.parseInt(n,16);try{return Number.isFinite(e)?String.fromCodePoint(e):``}catch{return``}}return String(t).trim()})}function sC(e){let t=oC(e),n=t.toLowerCase(),r=0;for(;r<n.length;){let e=n.indexOf(`url(`,r);if(e===-1)return!1;let i=aC(t,e);if(r=Math.max(i.next,e+4),!i.url.trim().startsWith(`#`))return!0}return!1}function cC(e){let t=oC(e);return qS.some(e=>e.test(t))||sC(t)}function lC(e){if(e.tagName.toLowerCase()!==`a`||e.getAttribute(`target`)?.trim().toLowerCase()!==`_blank`)return;let t=new Set(String(e.getAttribute(`rel`)??``).split(/\s+/).map(e=>e.trim()).filter(Boolean).filter(e=>e.toLowerCase()!==`opener`));t.add(`noopener`),t.add(`noreferrer`),e.setAttribute(`rel`,Array.from(t).join(` `))}function uC(e){let t=Number.parseFloat(String(e??``));return Number.isFinite(t)?t:0}function dC(e,t){if(e.nodeType===Node.TEXT_NODE){let n=e.textContent??``;n&&t.push(n);return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e,r=n.tagName.toLowerCase();if(!YS.has(r)){if(r===`br`)t.push(`
|
|
181
|
+
`);else for(let e of Array.from(n.childNodes))dC(e,t)}}function fC(e){for(let t of Array.from(e.querySelectorAll(`foreignObject`))){let n=[];dC(t,n);let r=n.join(``).split(/\r?\n/).map(e=>e.trim()).filter(Boolean);if(!r.length){t.remove();continue}let i=uC(t.getAttribute(`width`)),a=uC(t.getAttribute(`height`)),o=uC(t.getAttribute(`x`)),s=uC(t.getAttribute(`y`)),c=e.ownerDocument.createElementNS(JS,`text`);c.setAttribute(`x`,String(o+i/2)),c.setAttribute(`y`,String(s+a/2)),c.setAttribute(`text-anchor`,`middle`),c.setAttribute(`dominant-baseline`,`central`);let l=t.querySelector(`.nodeLabel`);if(l?.getAttribute(`class`)&&c.setAttribute(`class`,l.getAttribute(`class`)),r.length===1)c.textContent=r[0];else{let t=-.6*(r.length-1);for(let[n,a]of r.entries()){let r=e.ownerDocument.createElementNS(JS,`tspan`);r.setAttribute(`x`,String(o+i/2)),r.setAttribute(`dy`,n===0?`${t}em`:`1.2em`),r.textContent=a,c.appendChild(r)}}t.parentNode?.replaceChild(c,t)}}function pC(e){fC(e);let t=[e,...Array.from(e.querySelectorAll(`*`))];for(let e of t){let t=e.tagName.toLowerCase();if(!XS.has(t)||t===`style`&&cC(e.textContent??``)){e.remove();continue}let n=Array.from(e.attributes);for(let r of n){let n=r.name.toLowerCase();if(/^on/i.test(n))e.removeAttribute(r.name);else if(n===`style`&&r.value&&cC(r.value))e.removeAttribute(r.name);else if(n===`srcdoc`)e.removeAttribute(r.name);else if(ZS.has(n)&&r.value){let i=iC(t,n,r.value);if(!i){e.removeAttribute(r.name);continue}i!==r.value&&e.setAttribute(r.name,i)}else if(QS.has(n)&&r.value&&sC(r.value))e.removeAttribute(r.name);else if(r.value){let t=rC(r.value);t!==r.value&&e.setAttribute(r.name,t)}}lC(e)}}function mC(e){if(typeof DOMParser>`u`||!e)return null;try{let t=new DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(!t||t.nodeName.toLowerCase()!==`svg`)return null;let n=t;return pC(n),hC(n)?null:n}catch{return null}}function hC(e){let t=e.getAttribute(`viewBox`);if(t){let e=t.trim().split(/[\s,]+/);if(e.length===4){let t=Number.parseFloat(e[2]||``),n=Number.parseFloat(e[3]||``);if(!Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0)return!0}}let n=[e,...Array.from(e.querySelectorAll(`*`))],r=!1;for(let e of n){nC(e)&&(r=!0);for(let t of Array.from(e.attributes))if(/\bNaN\b/i.test(t.value)||t.name===`style`&&/max-width:\s*0(?:px)?/i.test(t.value))return!0}return!r}var gC=[];function _C(e){return String(e??``).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}function vC(e){return(String(e||`text`).trim().split(/\s+/)[0]||`text`).replace(/[^\w+.#:-]/g,`-`).replace(/-+/g,`-`)||`text`}function yC(e){return e.replace(/[^\w:.+-]/g,`-`).replace(/-+/g,`-`)}function bC(e=`editor-${Date.now()}`,t={}){let n=Xh(t),r=n;r.__markstreamRegisteredPluginCount=gC.length,r.__markstreamHasCustomParserExtensions=!!(t.plugin?.length||t.apply?.length||gC.length);let i={"common.copy":`Copy`},a;if(typeof t.i18n==`function`)a=t.i18n;else if(t.i18n&&typeof t.i18n==`object`){let e=t.i18n;a=t=>e[t]??i[t]??t}else a=e=>i[e]??e;if(Array.isArray(t.plugin))for(let e of t.plugin){let t=e;if(Array.isArray(t)){let[e,...r]=t;typeof e==`function`&&n.use(e,...r)}else typeof t==`function`&&n.use(t)}if(Array.isArray(t.apply))for(let e of t.apply)try{e(n)}catch(e){console.error(`[getMarkdown] apply function threw an error`,e)}if(gC.length)for(let e of gC)if(Array.isArray(e)){let[t,...r]=e;typeof t==`function`&&n.use(t,...r)}else typeof e==`function`&&n.use(e);n.use(_S),n.use(Sn),n.use(yn);let o=Cn,s=o.default??o;n.use(s),n.use(vn),n.use(_n),n.block.ruler.before(`footnote_def`,`pending_footnote_def`,(e,t,n,r)=>{if(e.env.__markstreamFinal!==!1||e.eMarks[t]!==e.src.length)return!1;let i=e.src.slice(e.bMarks[t]+e.tShift[t],e.eMarks[t]),a=/^\[\^([^\]\s]*)(?:\](?::[\t ]*)?)?$/.exec(i);return!a||i.endsWith(`]`)&&e.env.footnotes?.refs?.[`:${a[1]}`]!=null?!1:(r||(e.line=t+1),!0)},{alt:[`paragraph`,`reference`]}),n.core.ruler.after(`block`,`mark_fence_closed`,e=>{let t=e,n=t.src,r=!!t.env?.__markstreamFinal,i;for(let e of t.tokens){if(e.type!==`fence`||!e.map||!e.markup)continue;let t=e.map[0],a=e.map[1],o=e.markup,s=o[0],c=o.length,l=Math.max(0,a-1);i??=n.split(/\r?\n/);let u=i[l]??``,d=0;for(;d<u.length&&(u[d]===` `||u[d]===` `);)d++;let f=0;for(;d+f<u.length&&u[d+f]===s;)f++;let p=d+f;for(;p<u.length&&(u[p]===` `||u[p]===` `);)p++;let m=r?!0:a>t+1&&f>=c&&p===u.length,h=e;h.meta=h.meta??{},h.meta.unclosed=!m,h.meta.closed=!!m}}),n.renderer.rules.fence=(t,n)=>{let r=t[n],i=String(r.info??``).trim(),o=String(r.content??``),s=btoa(unescape(encodeURIComponent(o))),c=vC(i),l=_C(c),u=yC(`editor-${e}-${n}-${c}`),d=_C(a(`common.copy`));return`<div class="code-block" data-code="${s}" data-lang="${l}" id="${u}">
|
|
182
|
+
<div class="code-header">
|
|
183
|
+
<span class="code-lang">${_C(c.toUpperCase())}</span>
|
|
184
|
+
<button class="copy-button" data-code="${s}">${d}</button>
|
|
185
|
+
</div>
|
|
186
|
+
<div class="code-editor"></div>
|
|
187
|
+
</div>`};let c=/^\[(\d+)\]/,l=/^\[([^\]\n]+)\]/,u=e=>{if(!e.startsWith(`[`))return!1;let t=l.exec(e);if(!t)return e!==`[`&&!/^\[\d+$/.test(e);let n=String(t[1]??``);return!e.slice(t[0].length).startsWith(`(`)&&!/^\d+$/.test(n)};n.inline.ruler.before(`escape`,`reference`,(e,t)=>{let n=e;if(n.src[n.pos]!==`[`)return!1;let r=c.exec(n.src.slice(n.pos));if(!r)return!1;let i=n.src.slice(Math.max(0,n.pos-120),n.pos);if(/"[^"\n]{1,80}"\s*:\s*$/.test(i))return!1;let a=n.src.slice(n.pos+r[0].length);if(a.startsWith(`](`)||a.startsWith(`(`)||u(a))return!1;if(!t){let e=r[1],t=n.push(`reference`,`span`,0);t.content=e,t.markup=r[0],t.raw=r[0]}return n.pos+=r[0].length,!0}),n.renderer.rules.reference=(e,t)=>{let n=String(e[t].content??``);return`<span class="reference-link" data-reference-id="${n}" role="button" tabindex="0" title="Click to view reference">${n}</span>`};let d=n.use.bind(n);return n.use=((...e)=>(r.__markstreamHasCustomParserExtensions=!0,d(...e))),n}var xC=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),SC=Symbol.for(`markstream-vue:node-lifecycle`),CC=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M30 14v-2h-2V8h-2v4h-2V8h-2v4h-2v2h2v2h-2v2h2v4h2v-4h2v4h2v-4h2v-2h-2v-2Zm-4 2h-2v-2h2Zm-12.437 6A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>`,wC=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>`,TC={id:`material`,core:{"":wC,plain:`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="M0 0h24v24H0z"/><path fill="#42a5f5" d="M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5z"/></svg>`,text:wC,javascript:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ffca28" d="M2 2v12h12V2zm6 6h1v4a1.003 1.003 0 0 1-1 1H7a1.003 1.003 0 0 1-1-1v-1h1v1h1zm3 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>`,typescript:`<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 16 16"><path fill="#0288d1" d="M2 2v12h12V2zm4 6h3v1H8v4H7V9H6zm5 0h2v1h-2v1h1a1.003 1.003 0 0 1 1 1v1a1.003 1.003 0 0 1-1 1h-2v-1h2v-1h-1a1.003 1.003 0 0 1-1-1V9a1.003 1.003 0 0 1 1-1"/></svg>`,jsx:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00bcd4" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#00bcd4" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#00bcd4" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#00bcd4" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>`,tsx:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M16 12c7.444 0 12 2.59 12 4s-4.556 4-12 4-12-2.59-12-4 4.556-4 12-4m0-2c-7.732 0-14 2.686-14 6s6.268 6 14 6 14-2.686 14-6-6.268-6-14-6"/><path fill="#0288d1" d="M16 14a2 2 0 1 0 2 2 2 2 0 0 0-2-2"/><path fill="#0288d1" d="M10.458 5.507c2.017 0 5.937 3.177 9.006 8.493 3.722 6.447 3.757 11.687 2.536 12.392a.9.9 0 0 1-.457.1c-2.017 0-5.938-3.176-9.007-8.492C8.814 11.553 8.779 6.313 10 5.608a.9.9 0 0 1 .458-.1m-.001-2A2.87 2.87 0 0 0 9 3.875C6.13 5.532 6.938 12.304 10.804 19c3.284 5.69 7.72 9.493 10.74 9.493A2.87 2.87 0 0 0 23 28.124c2.87-1.656 2.062-8.428-1.804-15.124-3.284-5.69-7.72-9.493-10.74-9.493Z"/><path fill="#0288d1" d="M21.543 5.507a.9.9 0 0 1 .457.1c1.221.706 1.186 5.946-2.536 12.393-3.07 5.316-6.99 8.493-9.007 8.493a.9.9 0 0 1-.457-.1C8.779 25.686 8.814 20.446 12.536 14c3.07-5.316 6.99-8.493 9.007-8.493m0-2c-3.02 0-7.455 3.804-10.74 9.493C6.939 19.696 6.13 26.468 9 28.124a2.87 2.87 0 0 0 1.457.369c3.02 0 7.455-3.804 10.74-9.493C25.061 12.304 25.87 5.532 23 3.876a2.87 2.87 0 0 0-1.457-.369"/></svg>`,html:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#e65100" d="m4 4 2 22 10 2 10-2 2-22Zm19.72 7H11.28l.29 3h11.86l-.802 9.335L15.99 25l-6.635-1.646L8.93 19h3.02l.19 2 3.86.77 3.84-.77.29-4H8.84L8 8h16Z"/></svg>`,css:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#7e57c2" d="M20 18h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 20 22h2v2h2v-2c0-.388-.562-.851-1.254-1.034C20.356 20.34 20 18.84 20 18m-3.254 2.966C14.356 20.34 14 18.84 14 18h-2v-2h-2v8h2v-2h4v2h2v-2c0-.388-.562-.851-1.254-1.034"/><path fill="#7e57c2" d="M24 4H4v20a4 4 0 0 0 4 4h16.16A3.84 3.84 0 0 0 28 24.16V8a4 4 0 0 0-4-4m2 14h-2v-2h-2v2c0 .193 0 .703 1.254 1.033A3.345 3.345 0 0 1 26 22v2a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2 2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2 2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z"/></svg>`,scss:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ec407a" d="M27.837 5.673a4.33 4.33 0 0 0-2.293-2.701c-2.362-1.261-6.11-1.298-9.548-.092a26.3 26.3 0 0 0-8.76 4.966c-2.752 2.542-3.438 4.925-3.189 6.194.523 2.668 3.274 4.539 5.485 6.042.418.284.822.559 1.175.816-1.429.76-4.261 2.444-5.088 4.248a3.88 3.88 0 0 0-.118 3.332A2.37 2.37 0 0 0 6.869 29.8a5.6 5.6 0 0 0 1.49.2 6.35 6.35 0 0 0 5.19-2.856 6.74 6.74 0 0 0 .864-5.382 7.3 7.3 0 0 1 2.044-.03 3.92 3.92 0 0 1 2.816 1.311 1.82 1.82 0 0 1 .423 1.262 1.55 1.55 0 0 1-.772 1.05c-.234.14-.586.355-.504.803.036.194.198.633.894.512a2.93 2.93 0 0 0 2.145-2.651 4 4 0 0 0-1.197-2.904 5.94 5.94 0 0 0-4.396-1.626 10.6 10.6 0 0 0-2.672.304 20 20 0 0 0-2.203-1.846c-1.712-1.3-3.33-2.529-3.235-4.26.125-2.263 2.468-4.532 6.964-6.744 4.016-1.976 7.254-2.037 8.944-1.438a2 2 0 0 1 1.204.883 2.77 2.77 0 0 1-.36 2.47 9.71 9.71 0 0 1-7.425 4.304 3.86 3.86 0 0 1-3.238-.757c-.278-.302-.593-.645-1.074-.383q-.565.31-.225 1.189a3.9 3.9 0 0 0 2.407 1.92 11.7 11.7 0 0 0 7.128-.671c3.527-1.35 6.681-5.202 5.756-8.787M11.895 24.475a4 4 0 0 1-.192.468 4.5 4.5 0 0 1-.753 1.081 2.83 2.83 0 0 1-2.533 1.107c-.056-.032-.078-.146-.085-.193a3.28 3.28 0 0 1 1.076-2.284 11.3 11.3 0 0 1 2.644-1.933 3.85 3.85 0 0 1-.157 1.754"/></svg>`,json:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path fill="#f9a825" d="M560-160v-80h120q17 0 28.5-11.5T720-280v-80q0-38 22-69t58-44v-14q-36-13-58-44t-22-69v-80q0-17-11.5-28.5T680-720H560v-80h120q50 0 85 35t35 85v80q0 17 11.5 28.5T840-560h40v160h-40q-17 0-28.5 11.5T800-360v80q0 50-35 85t-85 35zm-280 0q-50 0-85-35t-35-85v-80q0-17-11.5-28.5T120-400H80v-160h40q17 0 28.5-11.5T160-600v-80q0-50 35-85t85-35h120v80H280q-17 0-28.5 11.5T240-680v80q0 38-22 69t-58 44v14q36 13 58 44t22 69v80q0 17 11.5 28.5T280-240h120v80z"/></svg>`,python:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#0288d1" d="M9.86 2A2.86 2.86 0 0 0 7 4.86v1.68h4.29c.39 0 .71.57.71.96H4.86A2.86 2.86 0 0 0 2 10.36v3.781a2.86 2.86 0 0 0 2.86 2.86h1.18v-2.68a2.85 2.85 0 0 1 2.85-2.86h5.25c1.58 0 2.86-1.271 2.86-2.851V4.86A2.86 2.86 0 0 0 14.14 2zm-.72 1.61c.4 0 .72.12.72.71s-.32.891-.72.891c-.39 0-.71-.3-.71-.89s.32-.711.71-.711"/><path fill="#fdd835" d="M17.959 7v2.68a2.85 2.85 0 0 1-2.85 2.859H9.86A2.85 2.85 0 0 0 7 15.389v3.75a2.86 2.86 0 0 0 2.86 2.86h4.28A2.86 2.86 0 0 0 17 19.14v-1.68h-4.291c-.39 0-.709-.57-.709-.96h7.14A2.86 2.86 0 0 0 22 13.64V9.86A2.86 2.86 0 0 0 19.14 7zM8.32 11.513l-.004.004.038-.004zm6.54 7.276c.39 0 .71.3.71.89a.71.71 0 0 1-.71.71c-.4 0-.72-.12-.72-.71s.32-.89.72-.89"/></svg>`,ruby:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#f44336" d="M18.041 3.177c2.24.382 2.879 1.919 2.843 3.527V6.67l-1.013 13.266-13.132.897h.008c-1.093-.044-3.518-.151-3.634-3.545l1.217-2.222 2.462 5.74 2.097-6.77-.045.009.018-.018 6.85 2.186L13.945 9.3l6.53-.409-5.144-4.212 2.71-1.51v.009M3.113 17.252v.017zM6.916 6.874c2.63-2.622 6.033-4.168 7.34-2.844 1.297 1.306-.072 4.523-2.702 7.135-2.666 2.613-6.015 4.248-7.322 2.933-1.306-1.324.036-4.612 2.675-7.224z"/></svg>`,go:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#00acc1" d="M2 12h4v2H2zm-2 4h6v2H0zm4 4h2v2H4zm16.954-5H14v3h3.239a4.42 4.42 0 0 1-3.531 2 2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 15.292 13a2.73 2.73 0 0 1 1.749.584l2.962-1.185A5.6 5.6 0 0 0 15.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 6.4 6.4 0 0 0 .003-1.5"/><path fill="#00acc1" d="M26.292 10a7.526 7.526 0 0 0-7.243 6.5 5.614 5.614 0 0 0 5.659 6.5 7.526 7.526 0 0 0 7.243-6.5 5.614 5.614 0 0 0-5.659-6.5m2.681 6.137A4.515 4.515 0 0 1 24.708 20a2.65 2.65 0 0 1-2.053-.858 2.86 2.86 0 0 1-.628-2.28A4.515 4.515 0 0 1 26.292 13a2.65 2.65 0 0 1 2.053.858 2.86 2.86 0 0 1 .628 2.28Z"/></svg>`,java:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#f44336" d="M4 26h24v2H4zM28 4H7a1 1 0 0 0-1 1v13a4 4 0 0 0 4 4h10a4 4 0 0 0 4-4v-4h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2m0 8h-4V6h4Z"/></svg>`,kotlin:`<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24"><defs><linearGradient id="a" x1="1.725" x2="22.185" y1="22.67" y2="1.982" gradientTransform="translate(1.306 1.129)scale(.89324)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#7c4dff"/><stop offset=".5" stop-color="#d500f9"/><stop offset="1" stop-color="#ef5350"/></linearGradient></defs><path fill="url(#a)" d="M2.975 2.976v18.048h18.05v-.03l-4.478-4.511-4.48-4.515 4.48-4.515 4.443-4.477z"/></svg>`,c:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M19.563 22A5.57 5.57 0 0 1 14 16.437v-2.873A5.57 5.57 0 0 1 19.563 8H24V2h-4.437A11.563 11.563 0 0 0 8 13.563v2.873A11.564 11.564 0 0 0 19.563 28H24v-6Z"/></svg>`,cpp:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#0288d1" d="M28 14v-4h-2v4h-6v-4h-2v4h-4v2h4v4h2v-4h6v4h2v-4h4v-2z"/><path fill="#0288d1" d="M13.563 22A5.57 5.57 0 0 1 8 16.437v-2.873A5.57 5.57 0 0 1 13.563 8H18V2h-4.437A11.563 11.563 0 0 0 2 13.563v2.873A11.564 11.564 0 0 0 13.563 28H18v-6Z"/></svg>`,cs:CC,csharp:CC,php:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#1e88e5" d="M12 18.08c-6.63 0-12-2.72-12-6.08s5.37-6.08 12-6.08S24 8.64 24 12s-5.37 6.08-12 6.08m-5.19-7.95c.54 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.58 1.09q-.42.33-1.29.33h-.87l.53-2.76zm-3.5 5.55h1.44l.34-1.75h1.23c.54 0 .98-.06 1.33-.17.35-.12.67-.31.96-.58.24-.22.43-.46.58-.73.15-.26.26-.56.31-.88.16-.78.05-1.39-.33-1.82-.39-.44-.99-.65-1.82-.65H4.59zm7.25-8.33-1.28 6.58h1.42l.74-3.77h1.14c.36 0 .6.06.71.18s.13.34.07.66l-.57 2.93h1.45l.59-3.07c.13-.62.03-1.07-.27-1.36-.3-.27-.85-.4-1.65-.4h-1.27L12 7.35zM18 10.13c.55 0 .91.1 1.09.31.18.2.22.56.13 1.03-.1.53-.29.87-.57 1.09-.29.22-.72.33-1.3.33h-.85l.5-2.76zm-3.5 5.55h1.44l.34-1.75h1.22c.55 0 1-.06 1.35-.17.35-.12.65-.31.95-.58.24-.22.44-.46.58-.73.15-.26.26-.56.32-.88.15-.78.04-1.39-.34-1.82-.36-.44-.99-.65-1.82-.65h-2.75z"/></svg>`,shell:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>`,powershell:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#03a9f4" d="M29.07 6H7.677A1.535 1.535 0 0 0 6.24 7.113l-4.2 17.774A.852.852 0 0 0 2.93 26h21.393a1.535 1.535 0 0 0 1.436-1.113L29.96 7.112A.852.852 0 0 0 29.07 6M8.626 23.797a1.4 1.4 0 0 1-1.814-.31l-.007-.009a1.075 1.075 0 0 1 .315-1.599l9.6-6.061-6.102-5.852-.01-.01a1.068 1.068 0 0 1 .084-1.625l.037-.03a1.38 1.38 0 0 1 1.8.07l7.233 6.957a1.1 1.1 0 0 1 .236.739 1.08 1.08 0 0 1-.412.79c-.074.04-.146.119-10.951 6.935ZM24 22.94A1.135 1.135 0 0 1 22.803 24h-5.634a1.061 1.061 0 1 1 .001-2.112h5.633A1.134 1.134 0 0 1 24 22.938Z"/></svg>`,sql:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ffca28" d="M16 24c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-8c-5.525 0-10-.9-10-2v4c0 1.1 4.475 2 10 2s10-.9 10-2v-4c0 1.1-4.475 2-10 2m0-12C10.477 4 6 4.895 6 6v4c0 1.1 4.475 2 10 2s10-.9 10-2V6c0-1.105-4.477-2-10-2"/></svg>`,yaml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#ff5252" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12c0 1.1-.9 2-2 2H6c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2m12 16v-2H9v2zm-4-4v-2H6v2z"/></svg>`,markdown:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>`,xml:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#8bc34a" d="M13 9h5.5L13 3.5zM6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4c0-1.11.89-2 2-2m.12 13.5 3.74 3.74 1.42-1.41-2.33-2.33 2.33-2.33-1.42-1.41zm11.16 0-3.74-3.74-1.42 1.41 2.33 2.33-2.33 2.33 1.42 1.41z"/></svg>`,rust:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#ff7043" d="m30 12-4-2V6h-4l-2-4-4 2-4-2-2 4H6v4l-4 2 2 4-2 4 4 2v4h4l2 4 4-2 4 2 2-4h4v-4l4-2-2-4ZM6 16a9.9 9.9 0 0 1 .842-4H10v8H6.842A9.9 9.9 0 0 1 6 16m10 10a9.98 9.98 0 0 1-7.978-4H16v-2h-2v-2h4c.819.819.297 2.308 1.179 3.37a1.89 1.89 0 0 0 1.46.63h3.34A9.98 9.98 0 0 1 16 26m-2-12v-2h4a1 1 0 0 1 0 2Zm11.158 6H24a2.006 2.006 0 0 1-2-2 2 2 0 0 0-2-2 3 3 0 0 0 3-3q0-.08-.004-.161A3.115 3.115 0 0 0 19.83 10H8.022a9.986 9.986 0 0 1 17.136 10"/></svg>`,vue:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="#41b883" d="M1.791 3.851 12 21.471 22.209 3.936V3.85H18.24l-6.18 10.616L5.906 3.851z"/><path fill="#35495e" d="m5.907 3.851 6.152 10.617L18.24 3.851h-3.723L12.084 8.03 9.66 3.85z"/></svg>`,mermaid:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#42a5f5" d="m14 10-4 3.5L6 10H4v12h4v-6l2 2 2-2v6h4V10zm12 6v-6h-4v6h-4l6 8 6-8z"/></svg>`},fallback:`<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#ff7043" d="M2 2a1 1 0 0 0-1 1v10c0 .554.446 1 1 1h12c.554 0 1-.446 1-1V3a1 1 0 0 0-1-1zm0 3h12v8H2zm1 2 2 2-2 2 1 1 3-3-3-3zm5 3.5V12h5v-1.5z"/></svg>`,loadExtended:()=>B(()=>import(`./extended-BP0HZdSW.js`).then(e=>e.materialExtendedMap),[])},EC=new Map,DC=`material`,OC=new Map,kC=new Map,AC=null;function jC(e){EC.set(e.id,e)}function MC(e){let t=EC.get(DC);if(!t)return;let n=t.core[e];if(n)return n;let r=OC.get(t.id);if(r){let t=r[e];if(t)return t}t.loadExtended&&!OC.has(t.id)&&PC(t)}function NC(){return EC.get(DC)?.fallback??``}function PC(e){return xC(this,null,function*(){if(OC.has(e.id))return OC.get(e.id)??null;let t=kC.get(e.id);return t||(t=(e.loadExtended?.call(e)??Promise.resolve(null)).then(t=>(OC.set(e.id,t),AC?.(),t)).catch(()=>(OC.set(e.id,null),null)),kC.set(e.id,t)),t})}var FC=ee(0);AC=()=>{FC.value++},jC(TC);var IC={"":``,javascript:`javascript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,typescript:`typescript`,ts:`typescript`,jsx:`jsx`,tsx:`tsx`,golang:`go`,py:`python`,rb:`ruby`,sh:`shell`,bash:`shell`,zsh:`shell`,shellscript:`shell`,bat:`shell`,batch:`shell`,ps1:`powershell`,plaintext:`plain`,text:`plain`,txt:`plain`,"c++":`cpp`,"c#":`csharp`,cs:`csharp`,"objective-c":`objectivec`,"objective-c++":`objectivecpp`,yml:`yaml`,md:`markdown`,rs:`rust`,kt:`kotlin`};function LC(e){let t=function(e){if(!e)return``;let t=e.trim();if(!t)return``;let[n]=t.split(/\s+/),[r]=n.split(`:`);return r.toLowerCase()}(e);return IC[t]??t}function RC(e){let t=LC(e);if(!t)return`plaintext`;switch(t){case`plain`:return`plaintext`;case`shell`:return`zsh`;case`objectivec`:return`objective-c`;case`objectivecpp`:return`objective-cpp`;default:return t}}function zC(e){return MC(LC(e))||NC()}var BC={js:`JavaScript`,javascript:`JavaScript`,ts:`TypeScript`,typescript:`TypeScript`,jsx:`JSX`,tsx:`TSX`,html:`HTML`,css:`CSS`,scss:`SCSS`,json:`JSON`,py:`Python`,python:`Python`,rb:`Ruby`,go:`Go`,java:`Java`,c:`C`,cpp:`C++`,cs:`C#`,csharp:`C#`,php:`PHP`,sh:`Shell`,bash:`Bash`,sql:`SQL`,yaml:`YAML`,md:`Markdown`,d2:`D2`,d2lang:`D2`,"":`Plain Text`,plain:`Plain Text`};function VC(){}var HC=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),UC=null,WC=!1,GC=null,KC=YC;function qC(e){let t=e?.default??e;return t&&typeof t.renderToString==`function`?t:null}function JC(){try{return qC(globalThis?.katex)}catch{return null}}function YC(){return HC(null,null,function*(){let e=JC();if(e)return e;let t=yield B(()=>import(`./__vite-optional-peer-dep_katex_markstream-vue-Bg9-FXxr.js`),[]);try{yield B(()=>import(`./mhchem_markstream-vue-tp86PqxG.js`),[])}catch{}return qC(t)})}function XC(e){let t=Promise.resolve(e).then(e=>GC===t&&e?(UC=qC(e)??e,UC):null).catch(()=>null).finally(()=>{GC===t&&(GC=null)});return GC=t,WC=!0,t}function ZC(e){KC=e,UC=null,WC=!1,GC=null}function QC(){ZC(null)}function $C(){return typeof KC==`function`}function ew(){let e=KC;if(!e||e===YC)return null;if(UC)return UC;let t=JC();if(t)return UC=t,UC;if(WC)return null;try{let t=e();return t?typeof t?.then==`function`?(XC(t),null):(UC=qC(t)??t,UC):null}catch{return null}}function tw(){return HC(this,null,function*(){let e=JC();if(e)return UC=e,UC;if(UC)return UC;if(GC)return GC;if(WC)return null;let t=KC;if(!t)return WC=!0,null;try{let e=t();if(typeof e?.then==`function`)return XC(e);if(e)return UC=qC(e)??e,WC=!0,UC}catch{}return WC=!0,null})}function nw(e){return e?e.replace(/·/g,`⋅`).replace(/℃/g,`°C`):``}var rw=null,iw=null,aw=new Map,ow=new Map,sw=5,cw=new Set;function lw(){if(aw.size<sw&&cw.size){let e=sw-aw.size;for(let t of Array.from(cw)){if(e<=0)break;cw.delete(t),e--;try{t()}catch{}}}}function uw(e,t=!0,n=2e3,r){return HC(this,null,function*(){performance.now();let i=nw(e);if(!$C()){let e=Error(`KaTeX rendering disabled`);return e.name=`KaTeXDisabled`,e.code=`KATEX_DISABLED`,Promise.reject(e)}if(iw)return Promise.reject(iw);let a=`${t?`d`:`i`}:${i}`,o=ow.get(a);if(o)return lw(),Promise.resolve(o);let s=rw||(iw=Error(`[katexWorkerClient] No worker instance set. Please inject a Worker via setKaTeXWorker().`),iw.name=`WorkerInitError`,iw.code=`WORKER_INIT_ERROR`,null);if(!s)return Promise.reject(iw);if(aw.size>=sw){let e=Error(`Worker busy`);return e.name=`WorkerBusy`,e.code=`WORKER_BUSY`,e.busy=!0,e.inFlight=aw.size,e.max=sw,Promise.reject(e)}return new Promise((e,a)=>{if(r?.aborted){let e=Error(`Aborted`);e.name=`AbortError`,a(e);return}let o=Math.random().toString(36).slice(2),c=null,l=globalThis.setTimeout(()=>{let e=aw.get(o);if(!e)return;aw.delete(o),e.cleanup();let t=Error(`Worker render timed out`);t.name=`WorkerTimeout`,t.code=`WORKER_TIMEOUT`,e.aborted||e.reject(t),lw()},n);c=()=>{let e=aw.get(o);if(!e||e.aborted)return;e.aborted=!0,e.cleanup();let t=Error(`Aborted`);t.name=`AbortError`,a(t)},r&&r.addEventListener(`abort`,c,{once:!0});let u=e,d=a;aw.set(o,{resolve:e=>{u(e)},reject:e=>{d(e)},timeoutId:l,aborted:!1,cleanup:()=>{r&&c&&r.removeEventListener(`abort`,c),c=null}});try{s.postMessage({id:o,content:i,displayMode:t})}catch(e){let t=aw.get(o);aw.delete(o),clearTimeout(l),t?.cleanup(),t?.reject(e),lw()}})})}function dw(e,t=!0,n){let r=`${t?`d`:`i`}:${nw(e)}`;if(ow.set(r,n),ow.size>200){let e=ow.keys().next().value;ow.delete(e)}}var fw=`WORKER_BUSY`;function pw(e=2e3,t){return aw.size<sw?Promise.resolve():new Promise((n,r)=>{let i,a=!1,o=null,s=()=>{},c=()=>{i&&globalThis.clearTimeout(i),cw.delete(s),t&&o&&t.removeEventListener(`abort`,o),o=null};s=()=>{a||(a=!0,c(),n())},cw.add(s),i=globalThis.setTimeout(()=>{if(a)return;a=!0,c();let e=Error(`Wait for worker slot timed out`);e.name=`WorkerBusyTimeout`,e.code=`WORKER_BUSY_TIMEOUT`,r(e)},e),queueMicrotask(()=>lw()),t&&(o=()=>{if(a)return;a=!0,c();let e=Error(`Aborted`);e.name=`AbortError`,r(e)},t.aborted?o():t.addEventListener(`abort`,o,{once:!0}))})}var mw={timeout:2e3,waitTimeout:1500,backoffMs:30,maxRetries:1};function hw(e){return HC(this,arguments,function*(e,t=!0,n={}){if(!$C()){let e=Error(`KaTeX rendering disabled`);throw e.name=`KaTeXDisabled`,e.code=`KATEX_DISABLED`,e}let r=n.timeout??mw.timeout,i=n.waitTimeout??mw.waitTimeout,a=n.backoffMs??mw.backoffMs,o=n.maxRetries??mw.maxRetries,s=Number.isFinite(o)?Math.max(0,Math.min(Math.floor(o),8)):mw.maxRetries,c=n.signal,l=0;for(;;){if(c?.aborted){let e=Error(`Aborted`);throw e.name=`AbortError`,e}try{return yield uw(e,t,r,c)}catch(e){if(e?.code!==`WORKER_BUSY`||l>=s)throw e;if(l++,yield pw(i,c).catch(()=>{}),c?.aborted){let e=Error(`Aborted`);throw e.name=`AbortError`,e}a>0&&(yield new Promise(e=>globalThis.setTimeout(e,a*l)))}}})}function gw(e){let t=typeof e==`number`?e:Number.parseFloat(String(e??``));return Number.isFinite(t)&&t>0?t:null}function _w(e){for(let t of e.split(/\r?\n/)){let e=t.trim();if(e&&!e.startsWith(`%%`))return(e.match(/^([A-Z][\w-]*)\b/i)?.[1])?.toLowerCase()||``}return``}function vw(e){let t=e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith(`%%`)),n=Math.max(1,t.length),r=_w(e);return r===`gantt`?220+28*n:r===`sequencediagram`?180+26*n:r===`classdiagram`||r===`statediagram`||r===`erdiagram`?180+24*n:r===`flowchart`||r===`graph`?170+28*n:200+22*n}function yw(e){let t=e.split(/\r?\n/).filter(e=>/^\s*-\s+/.test(e)).length;return t>=3?500:t>0?280+60*t:360}function bw(e,t=360,n=500){return n==null?Math.max(t,e):Math.min(Math.max(t,e),n)}function xw(e,t=360,n=500){return bw(e,t,n)}function Sw(e,t=120,n=500){return bw(e,t,n)}function Cw(e,t=360,n=500){return bw(e,t,n)}function ww(e,t=240,n=500){return bw(e,t,n)}var Tw=new Set([`direction`,`label`,`shape`,`icon`,`near`,`link`,`tooltip`,`width`,`height`,`grid-rows`,`grid-columns`,`grid-gap`,`vertical-gap`,`horizontal-gap`,`class`,`constraint`,`source-arrowhead`,`target-arrowhead`]),Ew=new Set([`vars`,`classes`,`style`,`layers`,`scenarios`,`steps`]);function Dw(e){let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e[r];i!==`"`&&i!==`'`?n||(i===`{`?t+=1:i===`}`&&--t):n=!n}return t}function Ow(e){let t=0,n=0,r=0;for(let i of e.split(/\r?\n/)){let e=i.trim();if(r>0){r=Math.max(0,r+Dw(e));continue}if(!e||e.startsWith(`#`)||e.startsWith(`...`)||/^[}\]]+$/.test(e))continue;let a=e.match(/^([A-Z_][\w-]*)\s*:(.*)$/i);if(a){let e=a[1].toLowerCase();if(Ew.has(e)){t+=1,r=Math.max(0,Dw(a[2]));continue}if(Tw.has(e)){t+=1;continue}}n+=1,t+=1}return bw(120+46*Math.max(1,n)+8*Math.max(0,t-n),240,500)}var kw=Object.defineProperty,Aw=Object.defineProperties,jw=Object.getOwnPropertyDescriptors,Mw=Object.getOwnPropertySymbols,Nw=Object.prototype.hasOwnProperty,Pw=Object.prototype.propertyIsEnumerable,Fw=(e,t,n)=>t in e?kw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Iw=(e,t)=>{for(var n in t||={})Nw.call(t,n)&&Fw(e,n,t[n]);if(Mw)for(var n of Mw(t))Pw.call(t,n)&&Fw(e,n,t[n]);return e},Lw=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),Rw=()=>B(()=>import(`./__vite-optional-peer-dep_mermaid_markstream-vue-cPZl55sA.js`),[]),zw=null,Bw=Rw,Vw=null,Hw=!1,Uw=!1,Ww=0;function Gw(e){Bw=e,Ww++,zw=null,Vw=null,Hw=!1,Uw=!1}function Kw(){Gw(null)}function qw(){return typeof Bw==`function`}function Jw(e){if(!e)return e;let t=e&&e.default?e.default:e;if(t&&(typeof t.render==`function`||typeof t.parse==`function`||typeof t.initialize==`function`))return t;if(t&&t.mermaidAPI&&(typeof t.mermaidAPI.render==`function`||typeof t.mermaidAPI.parse==`function`)){let e=t.mermaidAPI;return n=Iw({},t),r={render:e.render.bind(e),parse:e.parse?e.parse.bind(e):void 0,initialize:n=>typeof t.initialize==`function`?t.initialize(n):e.initialize?e.initialize(n):void 0},Aw(n,jw(r))}var n,r;return e.mermaid&&typeof e.mermaid.render==`function`?e.mermaid:t}function Yw(e){if(e)try{let t=e?.initialize;e.initialize=n=>{let r=Iw({suppressErrorRendering:!0},n||{});return typeof t==`function`?t.call(e,r):e?.mermaidAPI&&typeof e.mermaidAPI.initialize==`function`?e.mermaidAPI.initialize(r):void 0}}catch{}}function Xw(){return Lw(this,null,function*(){if(zw)return zw;let e=function(){try{return Jw(globalThis?.mermaid)}catch{return null}}();if(e)return zw=e,Yw(zw),zw;let t=Bw,n=Ww;return t?t===Rw&&Hw?null:Vw||(Vw=Lw(null,null,function*(){let e;try{e=yield t()}catch(e){if(t===Rw)return n===Ww&&t===Bw&&(Hw=!0,function(e){Uw||(Uw=!0,console.warn(`[markstream-vue] Optional dependency "mermaid" is not installed. Mermaid blocks will render as source.`,e))}(e)),null;throw e}finally{n===Ww&&t===Bw&&(Vw=null)}return n!==Ww||t!==Bw?null:e?(zw=Jw(e),Yw(zw),zw):null}),Vw):null})}var Zw=null,Qw=null,$w=new Map,eT=new Map,tT=5,nT=`MERMAID_DISABLED`;function rT(e,t,n,r){if(!qw()){let e=Error(`Mermaid rendering disabled`);return e.name=`MermaidDisabled`,e.code=nT,Promise.reject(e)}let i=`${e}\0${t.theme}\0${n}\0${t.code}`,a=eT.get(i);return a||(a=function(e,t,n=1400){if(!qw()){let e=Error(`Mermaid rendering disabled`);return e.name=`MermaidDisabled`,e.code=`MERMAID_DISABLED`,Promise.reject(e)}if(Qw)return Promise.reject(Qw);let r=Zw||(Qw=Error(`[mermaidWorkerClient] No worker instance set. Please inject a Worker via setMermaidWorker().`),Qw.name=`WorkerInitError`,Qw.code=`WORKER_INIT_ERROR`,null);if(!r)return Promise.reject(Qw);if($w.size>=tT){let e=Error(`Worker busy`);return e.name=`WorkerBusy`,e.code=`WORKER_BUSY`,e.inFlight=$w.size,e.max=tT,Promise.reject(e)}return new Promise((i,a)=>{let o=Math.random().toString(36).slice(2),s,c=!1,l=()=>{c||(c=!0,s!=null&&globalThis.clearTimeout(s),$w.delete(o))};$w.set(o,{resolve:e=>{l(),i(e)},reject:e=>{l(),a(e)}});try{r.postMessage({id:o,action:e,payload:t})}catch(e){$w.delete(o),a(e);return}s=globalThis.setTimeout(()=>{let e=Error(`Worker call timed out`);e.name=`WorkerTimeout`,e.code=`WORKER_TIMEOUT`;let t=$w.get(o);t&&t.reject(e)},n)})}(e,t,n),eT.set(i,a),a.then(()=>{eT.get(i)===a&&eT.delete(i)},()=>{eT.get(i)===a&&eT.delete(i)})),function(e,t){if(!t)return e;if(t.aborted){let e=Error(`Aborted`);return e.name=`AbortError`,Promise.reject(e)}return new Promise((n,r)=>{let i=()=>{},a=()=>t.removeEventListener(`abort`,i);i=()=>{a();let e=Error(`Aborted`);e.name=`AbortError`,r(e)},t.addEventListener(`abort`,i,{once:!0}),e.then(e=>{a(),n(e)},e=>{a(),r(e)})})}(a,r)}function iT(e,t,n=1400,r){return rT(`canParse`,{code:e,theme:t},n,r)}function aT(e,t,n=1400,r){return rT(`findPrefix`,{code:e,theme:t},n,r)}var oT=Object.defineProperty,sT=Object.defineProperties,cT=Object.getOwnPropertyDescriptors,lT=Object.getOwnPropertySymbols,uT=Object.prototype.hasOwnProperty,dT=Object.prototype.propertyIsEnumerable,fT=(e,t,n)=>t in e?oT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Z=(e,t)=>{for(var n in t||={})uT.call(t,n)&&fT(e,n,t[n]);if(lT)for(var n of lT(t))dT.call(t,n)&&fT(e,n,t[n]);return e},Q=(e,t)=>sT(e,cT(t)),pT=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())}),mT=`__global__`,hT=`__MARKSTREAM_VUE_CUSTOM_COMPONENTS_STORE__`,gT=(()=>{let e=globalThis;if(e[hT])return e[hT];let t={scopedCustomComponents:{},revision:ee(0)};return e[hT]=t,t})(),_T=gT.revision,vT=Symbol(`markstreamCustomComponents`),yT=new Set(`text.paragraph.heading.code_block.list.list_item.blockquote.table.table_row.table_cell.definition_list.definition_item.footnote.footnote_reference.footnote_anchor.admonition.hardbreak.link.image.thematic_break.math_inline.math_block.strong.emphasis.strikethrough.highlight.insert.subscript.superscript.emoji.checkbox.checkbox_input.inline_code.html_inline.html_block.reference.mermaid.infographic.d2.vmr_container`.split(`.`));function bT(e){return yT.has(String(e).trim().toLowerCase())}function xT(e){return e.trim().replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/[_\s]+/g,`-`).toLowerCase()}function ST(e={}){let t={};for(let[n,r]of Object.entries(e))if(r!=null){t[n]=r;for(let e of new Set([Qd(n),Qd(xT(n))]))!e||bT(e)||Object.prototype.hasOwnProperty.call(t,e)||(t[e]=r)}return t}function CT(e,t){typeof e==`string`?gT.scopedCustomComponents[e]=ST(t||{}):gT.scopedCustomComponents[mT]=ST(e||{}),_T.value++}function wT(e){let t=j(vT,null);return O(()=>(_T.value,function(e,t={}){return _T.value,Z(Z(Z({},ST(gT.scopedCustomComponents[mT]||{})),ST(t)),ST(function(e){return e&&gT.scopedCustomComponents[e]||{}}(e)))}(e?.(),t?.value??{})))}var TT=[`aria-label`],ET={key:0,xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,class:`checkbox-icon checkbox-unchecked`},DT={key:1,xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,class:`checkbox-icon checkbox-checked`},$=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},OT=$(h({__name:`CheckboxNode`,props:{node:{}},setup:e=>(t,n)=>(p(),R(`span`,{class:`checkbox-node`,role:`img`,"aria-label":e.node.checked?`checked`:`unchecked`},[e.node.checked?(p(),R(`svg`,DT,[...n[1]||=[D(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`4`,fill:`currentColor`},null,-1),D(`path`,{d:`M9 12l2 2 4-4`,stroke:`hsl(var(--ms-background))`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,-1)]])):(p(),R(`svg`,ET,[...n[0]||=[D(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`4`,stroke:`currentColor`,"stroke-width":`2`},null,-1)]]))],8,TT))}),[[`__scopeId`,`data-v-be21ab83`]]);OT.install=e=>{e.component(OT.__name,OT)};var kT={class:`emoji-node`},AT=$(h({__name:`EmojiNode`,props:{node:{}},setup:e=>(t,n)=>(p(),R(`span`,kT,w(e.node.name),1))}),[[`__scopeId`,`data-v-de55dc97`]]);AT.install=e=>{e.component(AT.__name,AT)};var jT=`.markdown-renderer`;function MT(e,t){if(typeof document>`u`||typeof Element>`u`)return null;let n=function(e){return`[id="${e.replace(/["\\]/g,`\\$&`)}"]`}(t),r=e instanceof Element?e.closest(jT):null;for(;r;){let e=r.querySelector(n);if(e)return e;r=r.parentElement?.closest(jT)??null}return document.querySelector(n)}var NT=[`id`],PT=[`title`],FT=$(h({__name:`FootnoteReferenceNode`,props:{node:{}},setup(e){let t=e,n=`#fnref--${t.node.id}`;function r(e){if(typeof document>`u`)return;let r=MT(e.currentTarget,`fnref--${t.node.id}`);r?r.scrollIntoView({behavior:`smooth`}):console.warn(`Element with href: ${n} not found`)}return(t,i)=>(p(),R(`sup`,{id:`fnref-${e.node.id}`,class:`footnote-reference`,onClick:r},[D(`span`,{href:n,title:`查看脚注 ${e.node.id}`,class:`footnote-link cursor-pointer`},`[`+w(e.node.id)+`]`,9,PT)],8,NT))}}),[[`__scopeId`,`data-v-d1baf613`]]);FT.install=e=>{e.component(FT.__name,FT)};var IT=(()=>{try{return!1}catch{}return!1})();function LT(e){IT&&console.warn(e)}function RT(e,t){return IS(e,t)}function zT(e,t=`safe`,n){return LS(e,t,n)}function BT(e){return VS(e)}function VT(e){return!0===e?``:!1===e?`false`:e==null?null:String(e)}function HT(e,t=`safe`){let n=String(e.tag||e.type||``).trim(),r=zS((i=e.attrs)?Array.isArray(i)?i.every(Array.isArray)?i.map(([e,t])=>[String(e),VT(t)]):i.filter(e=>e&&typeof e==`object`&&!Array.isArray(e)&&`name`in e).map(e=>[String(e.name),VT(e.value)]):Object.entries(i).map(([e,t])=>[e,VT(t)]):null,t,n);var i;if(!r)return;let a=BT(RS(r));return Object.keys(a).length>0?a:void 0}function UT(e,t,n=!1){let r=Object.entries(t??{}),i=r.length>0?r.map(([e,t])=>t===``?` ${e}`:` ${e}="${t}"`).join(``):``;return n?`<${e}${i} />`:`<${e}${i}>`}function WT(e,t){Array.isArray(t)?e.push(...t):t!=null&&e.push(t)}function GT(e,t,n,r,i,a,o=!1){let s=RT(e,r);if(Td.has(e.toLowerCase())||!s&&OS(e,a))return null;if(!s&&DS(e,a))return o?[UT(e,t,!0)]:[UT(e,t),...n,`</${e}>`];let c=LS(t,a,e),l=c.key,u=l!=null&&l!==``?l:i;if(s){let t=r[e]||r[e.toLowerCase()],i=BT(c);return d(t,Q(Z({},i),{key:u}),n.length>0?n:void 0)}return d(e,Q(Z({},c),{innerHTML:void 0,key:u}),n.length>0?n:void 0)}function KT(e,t,n=`safe`,r=!1){var i;try{if(!r&&Object.keys(t).length===0)return{ok:!0,hasCustomComponents:!1,nodes:null};let i=US(e),a=!1;for(let e of i)if((e.type===`tag_open`||e.type===`self_closing`)&&RT(e.tagName??``,t)){a=!0;break}let o=r||a?function(e,t,n=`safe`){let r=0,i=[],a=[];for(let o of e)if(o.type===`text`)(i.length>0?i[i.length-1].children:a).push(o.content);else if(o.type===`self_closing`){let e=GT(o.tagName,o.attrs||{},[],t,`ms-html-`+r++,n,!0);WT(i.length>0?i[i.length-1].children:a,e)}else if(o.type===`tag_open`)i.push({tagName:o.tagName,children:[],attrs:o.attrs,autoKey:`ms-html-`+r++});else if(o.type===`tag_close`){let e=o.tagName.toLowerCase(),r=-1;for(let t=i.length-1;t>=0;t--)if(i[t].tagName.toLowerCase()===e){r=t;break}if(r!==-1)for(;i.length>r;){let o=i.pop(),s=GT(o.tagName,o.attrs||{},o.children,t,o.autoKey,n);i.length>0?WT(i[i.length-1].children,s):WT(a,s),o.tagName.toLowerCase()!==e&&i.length>r&<(`Auto-closing unclosed tag: <${o.tagName}>`)}else LT(`Ignoring closing tag with no matching opening tag: </${o.tagName}>`)}for(;i.length>0;){let e=i.pop(),r=GT(e.tagName,e.attrs||{},e.children,t,e.autoKey,n);i.length>0?WT(i[i.length-1].children,r):WT(a,r),LT(`Auto-closing unclosed tag: <${e.tagName}>`)}return a}(i,t,n):null;return{ok:!0,hasCustomComponents:a,nodes:o}}catch(e){return i=e,IT&&console.error(`Failed to parse HTML to VNodes:`,i),{ok:!1,hasCustomComponents:!1,nodes:null}}}var qT=[`innerHTML`],JT=$(h({__name:`HtmlInlineNode`,props:{node:{},customId:{},htmlPolicy:{}},setup(e){let t=e,n=j(`markstreamHtmlPolicy`,void 0),i=O(()=>t.htmlPolicy??n?.value??`safe`),a=wT(()=>t.customId),o=h({name:`DynamicRenderer`,props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),s=O(()=>{let e=t.node.content;if(!e)return{mode:`html`,content:``};if(i.value===`escape`)return{mode:`html`,content:KS(e,i.value)};if(t.node.loading&&!t.node.autoClosed)return{mode:`text`,content:e};let n=!0===t.node.loading&&!0===t.node.autoClosed,r=KT(e,a.value,i.value,n);return r.ok&&(n||r.hasCustomComponents)?{mode:`dynamic`,nodes:r.nodes}:{mode:`html`,content:KS(e,i.value)}});return(e,n)=>s.value.mode===`dynamic`?(p(),R(`span`,{key:0,class:C([`html-inline-node`,{"html-inline-node--loading":t.node.loading}])},[r(k(o),{nodes:s.value.nodes},null,8,[`nodes`])],2)):s.value.mode===`text`?(p(),R(`span`,{key:1,class:C([`html-inline-node`,{"html-inline-node--loading":t.node.loading}])},w(s.value.content),3)):(p(),R(`span`,{key:2,class:C([`html-inline-node`,{"html-inline-node--loading":t.node.loading}]),innerHTML:s.value.content},null,10,qT))}}),[[`__scopeId`,`data-v-fbbbc497`]]);function YT(t){let n=Kt(t),r=I(t),i=ee(n.getSnapshot().segments),a=new Set,o=0;function s(){o&&cancelAnimationFrame(o),o=0,a.clear()}function c(){let e=n.getSnapshot();r.value=e.settledContent,i.value=e.segments}return e(s),{settledContent:r,segments:i,update:function(e,t,r){r||s();let i=typeof document>`u`||document.visibilityState!==`hidden`;n.update(e,t,r&&i),c()},finish:function(e,t=!1){n.finish(e,t),c()},queueFinish:function(e,t){a.add(e),o||=requestAnimationFrame(()=>{o=0;for(let e of a)n.finish(e,!0);a.clear(),t!=null&&t()||n.settleFinished(),c()})},finishAll:function(e=!1){s(),n.finishAll(e),c()},settleFinished:function(){n.settleFinished(),c()}}}JT.install=e=>{e.component(JT.__name,JT)};var XT={class:`inline-code`},ZT={key:0},QT=[`onAnimationend`],$T=$(h({__name:`InlineCodeNode`,props:{node:{}},setup(t){let n=t,r=l(),i=j(`markstreamFade`,void 0),a=j(`markstreamTextFinal`,void 0),o=j(`markstreamFinalCleanup`,void 0),s=!0;e(()=>{s=!1});let c=j(`markstreamTextStreamState`,void 0),u=O(()=>{let e=r.fade;return e===``||!0===e||e===`true`||!1!==e&&e!==`false`&&void 0}),d=O(()=>typeof u.value==`boolean`?u.value:typeof i?.value!=`boolean`||i.value),f=O(()=>String(n.node.code??``)),h=O(()=>!d.value),g=O(()=>{let e=r[`index-key`]??r.indexKey;return e==null||e===``?``:String(e)}),{settledContent:v,segments:y,update:b,finish:x,queueFinish:S,finishAll:T}=YT(n.node.code);return P([()=>n.node.code,g,d,()=>y.value.length>0&&!0===a?.value],([e])=>{let t=String(e??``);if(!0===a?.value&&o&&y.value.length&&t===v.value+y.value.map(e=>e.content).join(``)){let e=y.value.find(e=>!e.finished);e&&(T(!0),o(()=>{s&&x(e.id)}));return}let n=g.value;b(t,n?c?.get(n):void 0,d.value&&!0!==a?.value),n&&c?.set(n,t)},{immediate:!0}),(e,t)=>(p(),R(`code`,XT,[h.value?(p(),R(E,{key:0},[m(w(f.value),1)],64)):(p(),R(E,{key:1},[k(v)?(p(),R(`span`,ZT,w(k(v)),1)):L(``,!0),(p(!0),R(E,null,_(k(y),e=>(p(),R(`span`,{key:e.id,class:C(e.finished||!0===k(a)?.value?`inline-code-stream-final`:`inline-code-stream-delta`),onAnimationend:t=>k(S)(e.id)},w(e.content),43,QT))),128))],64))]))}}),[[`__scopeId`,`data-v-8afc29be`]]);$T.install=e=>{e.component($T.__name,$T)};var eE=I(!1),tE=I(``),nE=I(`top`),rE=I(null),iE=I(null),aE=I(null),oE=I(null),sE=I(null),cE=null,lE=null,uE=0;function dE(){cE&&=(clearTimeout(cE),null),lE&&=(clearTimeout(lE),null)}var fE=!1,pE=null,mE=!1;function hE(e,t,n=`top`,r=!1,i,a){if(!e)return;let o=++uE;dE();let s=()=>pT(null,null,function*(){if(yield function(){return pT(this,null,function*(){if(!fE&&!mE&&typeof document<`u`){pE??=pT(null,null,function*(){let[{createApp:e,h:t},{default:n}]=yield Promise.all([B(()=>import(`./vue.runtime.esm-bundler-4XjPOHMM.js`).then(e=>e.t),__vite__mapDeps([0,1])),B(()=>import(`./Tooltip-CrG6tFax.js`),__vite__mapDeps([2,0,1,3,4]))]),r=document.createElement(`div`);r.setAttribute(`data-singleton-tooltip`,`1`),document.body.appendChild(r),e({setup:()=>()=>t(n,{visible:eE.value,"anchor-el":rE.value,content:tE.value,placement:nE.value,id:iE.value,originX:aE.value,originY:oE.value,isDark:sE.value??void 0})}).mount(r),fE=!0});try{yield pE}catch(e){fE=!1,pE=null,mE=!0,console.warn(`[markstream-vue] Failed to mount Tooltip component. Tooltips will be disabled.`,e)}}})}(),fE&&o===uE){iE.value=`tooltip-${Date.now()}-${Math.floor(1e3*Math.random())}`,rE.value=e,tE.value=t,nE.value=n,aE.value=i?.x??null,oE.value=i?.y??null,sE.value=typeof a==`boolean`?a:null,eE.value=!0;try{e.setAttribute(`aria-describedby`,iE.value)}catch{}}});r?s():cE=setTimeout(s,80)}function gE(e=!1){uE+=1,dE();let t=()=>{if(rE.value&&iE.value)try{rE.value.removeAttribute(`aria-describedby`)}catch{}eE.value=!1,rE.value=null,iE.value=null,aE.value=null,oE.value=null};e?t():lE=setTimeout(t,120)}var _E={"common.copy":`Copy`,"common.selectCopy":`全选(复制)`,"common.copied":`Copied`,"common.decrease":`Decrease`,"common.reset":`Reset`,"common.increase":`Increase`,"common.expand":`Expand`,"common.collapse":`Collapse`,"common.preview":`Preview`,"common.source":`Source`,"common.export":`Export`,"common.open":`Open`,"common.minimize":`Minimize`,"common.zoomIn":`Zoom in`,"common.zoomOut":`Zoom out`,"common.resetZoom":`Reset zoom`,"image.loadError":`Image failed to load`,"image.loading":`Loading image...`},vE=Symbol(`markstreamI18nFallback`);function yE(e,t){return t?.[e]??_E[e]}var bE=(e,t)=>yE(e,t)??function(e){return(e.split(`.`).pop()||e).replace(/[_-]/g,` `).replace(/([A-Z])/g,` $1`).replace(/\s+/g,` `).replace(/\b\w/g,e=>e.toUpperCase()).trim()}(e);function xE(e,t){return{t(n){let r=yE(n,t);if(e.te&&r!=null&&!e.te(n))return bE(n,t);let i=e.t(n);return i===n&&r!=null?bE(n,t):i}}}function SE(){let e=function(){try{let e=a(),t=vE,n=e?.provides,r=e?.appContext?.provides;return n?.[t]??r?.[t]??null}catch{}return null}(),t=function(){try{let e=a(),t=e?.proxy,n=t?.$t;if(typeof n==`function`){let e=t?.$te;return{t:n.bind(t),te:typeof e==`function`?e.bind(t):void 0}}let r=e?.appContext?.config?.globalProperties,i=r?.$t;if(typeof i==`function`){let e=r?.$te;return{t:i.bind(r),te:typeof e==`function`?e.bind(r):void 0}}}catch{}return null}();if(t)return xE(t,e);try{let t=globalThis.$vueI18nUse||null;if(t&&typeof t==`function`)try{let n=t();if(n&&typeof n.t==`function`)return xE({t:n.t.bind(n),te:typeof n.te==`function`?n.te.bind(n):void 0},e)}catch{}}catch{}return{t:t=>bE(t,e)}}var CE=Symbol(`ViewportPriority`),wE=Symbol(`ViewportPriorityOptions`),TE=Symbol(`OffscreenHeavyNodeDeferral`),EE=O(()=>!1),DE=`400px`;function OE(){return j(wE,void 0)}function kE(){return j(TE,EE)}function AE(e,t){let r=typeof window<`u`&&typeof document<`u`,i=typeof t==`boolean`?I(t):t,a=r?window.requestIdleCallback??(e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16)):null,o=r?window.cancelIdleCallback??(e=>window.clearTimeout(e)):null,s=new WeakMap,c=1,l=new Map,u=new Map,d=new Set,f=null,p=null;function m(e){if(!e)return`viewport`;let t=s.get(e);return t||(t=c++,s.set(e,t)),String(t)}function h(){if(f!=null){try{o?.(f)}catch{}f=null}}function g(e){if(e){let t=l.get(e);if(t&&!t.targets.size){try{t.io.disconnect()}catch{}l.delete(e)}}u.size||d.size||h()}function _(e){let t=u.get(e);if(!t)return;let n=l.get(t.bucketKey);if(!t.visible.value){t.visible.value=!0;try{t.resolve()}catch{}}try{n?.io.unobserve(e)}catch{}n?.targets.delete(e),u.delete(e),d.delete(e),g(t.bucketKey)}function v(){!0!==window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__&&a&&f==null&&d.size&&(f=a(()=>{f=null;let e=d.values().next().value;e&&(d.delete(e),_(e),d.size&&v())},{timeout:1200}))}function y(t,n){if(!r||typeof IntersectionObserver>`u`)return null;let i=function(t,n){return{root:e?.(t??null)??null,rootMargin:n?.rootMargin??DE,threshold:n?.threshold??0}}(t,n),a=[m((o=i).root),o.rootMargin,o.threshold].join(`\0`);var o;let s=l.get(a);if(s)return{key:a,bucket:s};let c;try{c=new IntersectionObserver(e=>{for(let t of e)(t.isIntersecting||t.intersectionRatio>0)&&_(t.target)},{root:i.root,rootMargin:i.rootMargin,threshold:i.threshold})}catch{return null}let u={io:c,targets:new Map};return l.set(a,u),{key:a,bucket:u}}function b(){if(r&&i.value)for(let[e,t]of Array.from(u.entries())){let n=y(e,t.opts);if(!n){_(e);continue}if(n.key===t.bucketKey)continue;let r=t.bucketKey,i=l.get(r);try{i?.io.unobserve(e)}catch{}i?.targets.delete(e),t.bucketKey=n.key,n.bucket.targets.set(e,t),n.bucket.io.observe(e),g(r)}}P(i,e=>{if(!e){for(let e of Array.from(u.keys()))_(e);h()}},{flush:`sync`});let x=(e,t)=>{let a=I(!1),o,s=!1,c=!1,f=new Promise(e=>{o=()=>{s||(s=!0,e())}}),m=()=>{c=!0;let t=u.get(e);if(!t)return d.delete(e),void g();let n=l.get(t.bucketKey);try{n?.io.unobserve(e)}catch{}n?.targets.delete(e),u.delete(e),d.delete(e),g(t.bucketKey)};return r&&i.value&&typeof IntersectionObserver<`u`?(n(()=>{if(c)return;let n=i.value?y(e,t):null;if(!n)return a.value=!0,void o();let s={resolve:o,visible:a,bucketKey:n.key,opts:t};u.set(e,s),n.bucket.targets.set(e,s),n.bucket.io.observe(e),r&&p==null&&(p=window.requestAnimationFrame(()=>{p=null,b()})),!1!==t?.allowIdle&&(d.add(e),v())}),{isVisible:a,whenVisible:f,destroy:m}):(a.value=!0,o(),{isVisible:a,whenVisible:f,destroy:m})};return x.refresh=b,z(CE,x),x}function jE(){let e=j(CE,void 0);if(e)return e;let t=new WeakMap,n=new Map,r=new Set,i=null,a=typeof window<`u`?window.requestIdleCallback??(e=>window.setTimeout(()=>e({didTimeout:!0,timeRemaining:()=>0}),16)):null,o=typeof window<`u`?window.cancelIdleCallback??(e=>window.clearTimeout(e)):null,s=()=>{if(i!=null){try{o?.(i)}catch{}i=null}},c=e=>{if(!e)return;let t=n.get(e);if(t&&!t.targets.size){try{t.io.disconnect()}catch{}n.delete(e)}},l=e=>{let i=t.get(e);if(!i)return;let a=n.get(i.bucketKey);if(!i.visible.value){i.visible.value=!0;try{i.resolve()}catch{}}try{a?.io.unobserve(e)}catch{}t.delete(e),a?.targets.delete(e),r.delete(e),c(i.bucketKey),r.size||s()},u=()=>{!0!==window.__MARKSTREAM_DISABLE_VIEWPORT_PRIORITY_IDLE_DRAIN__&&a&&i==null&&r.size&&(i=a(()=>{i=null;let e=r.values().next().value;e&&(r.delete(e),l(e),r.size&&u())},{timeout:1200}))};return(e,i)=>{let a=I(!1),o,d=!1,f=new Promise(e=>{o=()=>{d||(d=!0,e())}}),p=()=>{let i=t.get(e);if(!i)return r.delete(e),void(r.size||s());let a=n.get(i.bucketKey);try{a?.io.unobserve(e)}catch{}t.delete(e),a?.targets.delete(e),r.delete(e),c(i.bucketKey),r.size||s()},m=(e=>{if(typeof window>`u`||typeof IntersectionObserver>`u`)return null;let t=(e=>[e?.rootMargin??DE,e?.threshold??0].join(`\0`))(e),r=n.get(t);if(r)return{key:t,bucket:r};let i=e?.rootMargin??DE,a;try{a=new IntersectionObserver(e=>{for(let t of e)(t.isIntersecting||t.intersectionRatio>0)&&l(t.target)},{root:null,rootMargin:i,threshold:e?.threshold??0})}catch{return null}let o={io:a,targets:new Set};return n.set(t,o),{key:t,bucket:o}})(i);return m?(t.set(e,{resolve:o,visible:a,bucketKey:m.key}),m.bucket.targets.add(e),m.bucket.io.observe(e),!1!==i?.allowIdle&&(r.add(e),u()),{isVisible:a,whenVisible:f,destroy:p}):(a.value=!0,o(),{isVisible:a,whenVisible:f,destroy:p})}}function ME(e,t){let n=e.indexKey??t[`index-key`]??t.indexKey;return n==null||n===``?``:String(n)}var NE=[`data-markstream-viewport-pending`],PE=[`src`,`alt`,`title`,`loading`,`fetchpriority`,`decoding`,`tabindex`,`aria-label`],FE={key:1,class:`image-placeholder`},IE={key:1,class:`image-node__raw-text`},LE={key:2,class:`image-error`},RE=$(h({__name:`ImageNode`,props:{node:{},fallbackSrc:{default:``},lazy:{type:Boolean,default:!1},usePlaceholder:{type:Boolean,default:!0}},emits:[`load`,`error`,`click`],setup(e,{emit:t}){var n;let r=e,i=t,o=I(!1),c=I(!1),d=I(!1),f=I(``),m=I(`primary`),h=I(null),g=l(),_=j(SC,null),v=jE(),y=OE(),b=kE(),x=O(()=>Hd(r.node.src)),S=O(()=>Hd(r.fallbackSrc)),T=((n=a()?.vnode.el)?.querySelector)?.call(n,`img`),E=typeof window<`u`&&T?.getAttribute(`src`)===(x.value||S.value),M=I(typeof window>`u`||E||!b.value),N=ee(null),te=``,ne=null,F=O(()=>f.value),re=O(()=>!r.lazy),z=O(()=>typeof window<`u`&&b.value&&!E),B=O(()=>!z.value||M.value),ie=O(()=>B.value?F.value:``),ae=O(()=>y?.value.heavyBlockMargin??y?.value.rootMargin??DE),oe=O(()=>!r.node.loading&&m.value!==`failed`&&f.value.length>0),se=O(()=>m.value===`failed`),ce=O(()=>(c.value||!re.value||z.value)&&!o.value&&!d.value&&m.value!==`failed`&&f.value.length>0),le=O(()=>ME(r,g));function ue(e=le.value){e&&h.value&&_?.reportHeight(e,h.value.offsetHeight)}function de(e=le.value){e&&A(()=>{ue(e)})}function fe(){ne&&=(clearTimeout(ne),null)}function pe(){let e=le.value;e&&te!==e&&(te&&_?.markSettled(te),fe(),te=e,_?.markPending(e),typeof window<`u`&&(ne=window.setTimeout(()=>{te===e&&(de(e),me())},8e3)))}function me(){return pT(this,null,function*(){let e=te;e&&(fe(),te=``,yield A(),ue(e),_?.markSettled(e))})}function he(){if(m.value===`primary`&&S.value&&S.value!==f.value)return m.value=`fallback`,f.value=S.value,o.value=!1,d.value=!1,void de();m.value=`failed`,d.value=!0,i(`error`,f.value),de()}function ge(){o.value=!0,c.value=!1,d.value=!1,i(`load`,F.value),de()}function _e(e){e.preventDefault(),o.value&&!d.value&&i(`click`,[e,F.value])}let{t:ve}=SE();return P([x,S,()=>r.node.loading],()=>(o.value=!1,d.value=!1,r.node.loading?(c.value=!0,f.value=x.value,void(m.value=`primary`)):x.value?(f.value=x.value,void(m.value=`primary`)):S.value?(f.value=S.value,void(m.value=`fallback`)):(f.value=``,m.value=`failed`,void(d.value=!0))),{immediate:!0}),typeof window<`u`&&P([h,z],([e,t],n,r)=>{var i;if((i=N.value)==null||i.destroy(),N.value=null,!t||M.value)return void(M.value=!0);if(!e)return void(M.value=!1);let a=!0,o=v(e,{rootMargin:ae.value,allowIdle:!1});N.value=o,M.value=o.isVisible.value,o.whenVisible.then(()=>{a&&N.value===o&&(M.value=!0)}),r(()=>{a=!1,o.destroy(),N.value===o&&(N.value=null)})},{immediate:!0}),P([oe,o,d,F,()=>r.lazy,B],([e,t,n,r,i,a])=>e&&r&&!n&&a?t?(me(),void de()):i?(pe(),void de()):void(t||n||pe()):(me(),void de()),{flush:`post`,immediate:!0}),u(()=>{var e;(e=N.value)==null||e.destroy(),N.value=null,function(){let e=te;e&&(fe(),te=``,_?.markSettled(e))}()}),(t,n)=>(p(),R(`span`,{ref_key:`rootRef`,ref:h,class:`image-node-container`,"data-markstream-viewport-pending":z.value&&!M.value?`true`:void 0},[oe.value?(p(),R(`img`,{key:0,src:ie.value||void 0,alt:String(r.node.alt??r.node.title??``),title:String(r.node.title??r.node.alt??``),class:C([`image-node__img`,{"has-placeholder":e.node.loading||ce.value,"is-loading":!re.value&&!o.value,"is-loaded":re.value||o.value,"has-natural-size":o.value,"cursor-pointer":o.value}]),loading:r.lazy?`lazy`:void 0,fetchpriority:re.value?`high`:void 0,decoding:re.value?`sync`:`async`,tabindex:o.value?0:-1,"aria-label":r.node.alt??k(ve)(`image.preview`),onError:he,onLoad:ge,onClick:_e},null,42,PE)):L(``,!0),!e.node.loading&&!ce.value||d.value?L(``,!0):(p(),R(`span`,FE,[r.usePlaceholder?s(t.$slots,`placeholder`,{key:0,node:r.node,displaySrc:F.value,imageLoaded:o.value,hasError:d.value,fallbackSrc:r.fallbackSrc,lazy:r.lazy},()=>[n[0]||=D(`span`,{class:`image-shimmer`},null,-1)],!0):(p(),R(`span`,IE,w(e.node.raw),1))])),se.value?(p(),R(`span`,LE,[s(t.$slots,`error`,{node:r.node,displaySrc:F.value,imageLoaded:o.value,hasError:d.value,fallbackSrc:r.fallbackSrc,lazy:r.lazy},()=>[n[1]||=D(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`16`,height:`16`,viewBox:`0 0 24 24`},[D(`path`,{fill:`currentColor`,d:`M2 2h20v10h-2V4H4v9.586l5-5L14.414 14L13 15.414l-4-4l-5 5V20h8v2H2zm13.547 5a1 1 0 1 0 0 2a1 1 0 0 0 0-2m-3 1a3 3 0 1 1 6 0a3 3 0 0 1-6 0m3.625 6.757L19 17.586l2.828-2.829l1.415 1.415L20.414 19l2.829 2.828l-1.415 1.415L19 20.414l-2.828 2.829l-1.415-1.415L17.586 19l-2.829-2.828z`})],-1),D(`span`,null,w(k(ve)(`image.loadError`)),1)],!0)])):L(``,!0)],8,NE))}}),[[`__scopeId`,`data-v-e4e45fcb`]]);RE.install=e=>{e.component(RE.__name,RE)};var zE=re({loader:()=>Promise.resolve().then(()=>lA),suspensible:!1}),BE={key:2},VE=h({__name:`NodeChildRenderer`,props:{node:{},components:{},customId:{},indexKey:{},fallbackToText:{type:Boolean,default:!1}},setup(e){let n=e,r=wT(()=>n.customId),i=j(`markstreamHtmlPolicy`,void 0),a=j(`markstreamNestedRendererProps`,void 0),o=O(()=>i?.value??`safe`),s=O(()=>{let e=a?.value??{};return Q(Z({},e),{customId:n.customId??e.customId,htmlPolicy:o.value})}),c=O(()=>n.components[String(n.node.type)]),l=O(()=>!!(c.value&&r.value[n.node.type]&&!bT(String(n.node.type)))),u=O(()=>l.value?HT(n.node,o.value):void 0),d=O(()=>Array.isArray(n.node.children)&&n.node.children.length>0),f=O(()=>String(n.node.content??``)),m=O(()=>String(n.node.content??n.node.raw??``));return(n,r)=>c.value&&l.value?(p(),S(v(c.value),t({key:0},u.value,{node:e.node,loading:e.node.loading,"index-key":e.indexKey,"custom-id":e.customId,"is-dark":s.value.isDark,"data-markstream-reference-id":e.node.type===`reference`?String(e.node.id):void 0}),{default:b(()=>[d.value?(p(),S(k(zE),t({key:0},s.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):f.value?(p(),S(k(zE),t({key:1},s.value,{content:f.value,final:!e.node.loading,"index-key":`${e.indexKey||`child`}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:1},16,[`node`,`loading`,`index-key`,`custom-id`,`is-dark`,`data-markstream-reference-id`])):c.value?(p(),S(v(c.value),{key:1,node:e.node,"custom-id":e.customId,"index-key":e.indexKey,"data-markstream-reference-id":e.node.type===`reference`?String(e.node.id):void 0},null,8,[`node`,`custom-id`,`index-key`,`data-markstream-reference-id`])):e.fallbackToText?(p(),R(`span`,BE,w(m.value),1)):L(``,!0)}}),HE=[`aria-busy`,`aria-label`,`data-language`,`data-markstream-line-numbers`],UE={key:0,translate:`no`,class:`markstream-pre__diff-code`},WE={class:`markstream-pre__diff-pane-content`},GE={key:0,class:`markstream-pre__diff-collapsed-icon`,"aria-hidden":`true`},KE={class:`markstream-pre__diff-number`,"aria-hidden":`true`},qE={class:`markstream-pre__diff-content`},JE={class:`markstream-pre__diff-content-inner`},YE={key:0,translate:`no`,class:`markstream-pre__code markstream-pre__code--wrapped`},XE=[`data-line-number`,`textContent`],ZE={key:0,class:`markstream-pre__line-numbers`,"aria-hidden":`true`},QE=[`textContent`],$E=[`textContent`],eD=h({__name:`PreCodeNode`,props:{node:{},loading:{type:Boolean},showLineNumbers:{type:Boolean},diffInline:{type:Boolean},diffHideUnchangedRegions:{type:[Boolean,Object]},reservedHeightPx:{}},setup(e){let t=e,n=l(),r=Ee();function i(e,t){let n=String(e??``);return t?n:n.replace(/\r\n$|\n$|\r$/,``)}let a=O(()=>{let e=String(t.node?.language??``);return String(String(e).split(/\s+/g)[0]??``).toLowerCase().replace(/[^\w-]/g,``)||`plaintext`}),o=O(()=>`language-${a.value}`),s=O(()=>!0===t.loading||!0===t.node?.loading),c=O(()=>i(t.node?.code,s.value)),d=``,f=1,m=O(()=>function(e){let t=0,n=1;e.startsWith(d)&&(t=d.length,n=f,t>0&&e[t-1]===`\r`&&e[t]===`
|
|
188
|
+
`&&t++);for(let r=t;r<e.length;r++)e[r]===`
|
|
189
|
+
`?n++:e[r]===`\r`&&(n++,e[r+1]===`
|
|
190
|
+
`&&r++);return d=e,f=n,n}(c.value)),h=``,g=[],v=0,y=0,b=RegExp(`(?<=\\n)|(?<=\\r)(?!\\n)`),x=O(()=>function(e){let t=e.length>h.length&&e.startsWith(h),n=t?g:[],r=t?y:0;t&&(n.length=v);for(let t of e.slice(r).split(b))n.push(t);let i=e[e.length-1];return i===`
|
|
191
|
+
`?(v=n.length,y=e.length,n.push(``)):(v=n.length-1,y=e.length-n[n.length-1].length,i===`\r`&&n.push(``)),h=e,g=n,n}(c.value)),S=O(()=>!0===t.showLineNumbers&&!0===t.node?.diff),T=O(()=>{if(C(n.class).split(/\s+/).includes(`is-wrap`))return!0;let e=F(n.style);return typeof e==`string`?/(?:^|;)\s*white-space\s*:\s*(?:pre-wrap|break-spaces)(?:\s*!important)?\s*(?:;|$)/i.test(e):[`pre-wrap`,`break-spaces`].includes(String(e?.whiteSpace??e?.[`white-space`]))}),k=O(()=>S.value&&T.value),A=0,j=``,M=O(()=>{let e=m.value;e<A&&(A=0,j=``);for(let t=A+1;t<=e;t++)j+=`${j?`
|
|
192
|
+
`:``}${t}`;return A=e,j}),N=O(()=>S.value&&!0===t.diffInline),ee=O(()=>{let e=Number(t.reservedHeightPx);if(!Number.isFinite(e)||e<=0)return;let n=`${Math.ceil(e)}px`;return s.value?{maxHeight:n,overflow:`auto`}:{height:n,minHeight:n,maxHeight:n,overflow:`auto`}});function te(e,t){let n=i(e,t);if(!n)return 0;let r=1;for(let e=0;e<n.length;e++)n[e]===`
|
|
193
|
+
`?r++:n[e]===`\r`&&(r++,n[e+1]===`
|
|
194
|
+
`&&e++);return r}let ne=O(()=>S.value?rt({code:t.node?.code,hideUnchangedRegions:t.diffHideUnchangedRegions,inline:N.value,language:t.node?.language,loading:s.value,matchCache:r,originalCode:t.node?.originalCode,raw:t.node?.raw,updatedCode:t.node?.updatedCode}):[]),re=O(()=>{let e=ne.value,t=1,n=!1;for(let r of e)for(let e of r.lines)e.kind===`collapsed`&&(n=!0),typeof e.number==`number`&&e.number>t&&(t=e.number);return{maxNumberedLine:t,hasCollapsed:n}}),z=O(()=>{if(!0!==t.showLineNumbers)return;let e=S.value?1:m.value;S.value&&(e=Math.max(e,te(t.node?.originalCode,s.value),te(t.node?.updatedCode,s.value),re.value.maxNumberedLine));let n=`${Math.max(2,String(e).length)}ch`;return{"--markstream-pre-line-number-width":n,"--markstream-pre-diff-line-number-width":n,"--markstream-code-padding-left":`calc(var(--markstream-pre-line-number-padding-left, 2ch) + var(--markstream-pre-line-number-width, 2ch) + var(--markstream-pre-line-number-padding-right, 1ch) + var(--markstream-pre-line-number-separator-width, 2px) + var(--markstream-pre-line-number-gap-to-code, 1ch))`}}),B=O(()=>S.value&&re.value.hasCollapsed),ie=O(()=>{let e=a.value;return e?`Code block: ${e}`:`Code block`}),ae=I(null),oe=I([]),se=null,ce=!1,le=null;function ue(){!ce&&typeof window<`u`&&S.value&&!N.value&&k.value&&se==null&&(se=window.requestAnimationFrame(()=>{!ce&&ae.value&&(oe.value=ut(ae.value,oe.value)),se=null}))}function de(e){le?.disconnect(),le=null,e&&S.value&&!N.value&&k.value&&typeof ResizeObserver<`u`&&(le=new ResizeObserver(()=>{ue()}),le.observe(e))}function fe(e,t){if(!k.value)return;let n=oe.value[e];if(!n)return;let r=t===`original`?n.originalHeight:n.modifiedHeight;return{"--markstream-pre-diff-synced-row-height":`${Math.ceil(n.rowHeight)}px`,"--markstream-pre-diff-content-height":`${Math.ceil(r)}px`}}return P(ae,e=>{de(e),ue()},{flush:`post`}),P([S,N,ne,k],()=>{de(ae.value),S.value&&!N.value&&k.value?ue():oe.value.length&&(oe.value=[])},{flush:`post`,immediate:!0}),u(()=>{ce=!0,se!=null&&(window.cancelAnimationFrame(se),se=null),le?.disconnect(),le=null}),(e,n)=>{return p(),R(`pre`,{ref_key:`preRef`,ref:ae,style:F([ee.value,z.value]),class:C([o.value,{"markstream-pre--line-numbers":t.showLineNumbers,"markstream-pre--diff-preview":S.value,"markstream-pre--diff-inline":N.value,"markstream-pre--diff-collapsed":B.value}]),"aria-busy":s.value,"aria-label":ie.value,"data-language":a.value,"data-markstream-line-numbers":t.showLineNumbers?`1`:void 0,"data-markstream-pre":`1`,tabindex:`0`},[S.value?(p(),R(`code`,UE,[(p(!0),R(E,null,_(ne.value,e=>(p(),R(`span`,{key:e.key,class:C([`markstream-pre__diff-pane`,e.className])},[D(`span`,WE,[(p(!0),R(E,null,_(e.lines,(t,r)=>(p(),R(`span`,{key:t.key,class:C([`markstream-pre__diff-line`,[`markstream-pre__diff-line--${t.kind}`,t.metadataKind?`markstream-pre__diff-line--metadata-${t.metadataKind}`:``,{"markstream-pre__diff-line--empty":t.empty,"markstream-pre__diff-line--collapsed-first":!0===t.collapsedFirst,"markstream-pre__diff-line--collapsed-last":!0===t.collapsedLast}]]),style:F(fe(r,e.key))},[n[1]||=D(`span`,{class:`markstream-pre__diff-rail`,"aria-hidden":`true`},null,-1),t.kind===`collapsed`?(p(),R(`span`,GE,[...n[0]||=[D(`svg`,{viewBox:`0 0 16 16`,width:`16`,height:`16`,"aria-hidden":`true`},[D(`path`,{d:`M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06`})],-1)]])):L(``,!0),D(`span`,KE,w(t.number),1),D(`span`,qE,[D(`span`,JE,w(t.code),1)])],6))),128))])],2))),128))])):(p(),R(E,{key:1},[!0===t.showLineNumbers&&!0!==(r=t.node)?.diff&&T.value?(p(),R(`code`,YE,[(p(!0),R(E,null,_(x.value,(e,t)=>(p(),R(`span`,{key:t,class:`markstream-pre__logical-line`,"data-line-number":t+1,textContent:w(e)},null,8,XE))),128))])):(p(),R(E,{key:1},[t.showLineNumbers?(p(),R(`span`,ZE,[D(`span`,{class:`markstream-pre__line-numbers-text`,textContent:w(M.value)},null,8,QE)])):L(``,!0),D(`code`,{translate:`no`,class:`markstream-pre__code`,textContent:w(c.value)},null,8,$E)],64))],64))],14,HE);var r}}});eD.install=e=>{e.component(eD.__name,eD)};var tD=[`onAnimationend`],nD=$(h({__name:`TextNode`,props:{node:{}},emits:[`copy`],setup(t){let n=t,r=l(),i=j(`markstreamFade`,void 0),a=j(`markstreamTextFinal`,void 0),o=O(()=>!0===a?.value),s=j(`markstreamFinalCleanup`,void 0),c=!0,u=j(`markstreamTextStreamState`,void 0),d=O(()=>{let e=r.fade;return e===``||!0===e||e===`true`||!1!==e&&e!==`false`&&void 0}),f=O(()=>typeof d.value==`boolean`?d.value:typeof i?.value!=`boolean`||i.value),h=O(()=>{let e=r[`index-key`]??r.indexKey;return e==null||e===``?``:String(e)}),{settledContent:g,segments:v,update:b,finish:x,queueFinish:S,finishAll:T,settleFinished:A}=YT(n.node.content),N=I(null),ee=I(null),te=I([]),ne=I(``),F,L=``,re=null,z=null,B=!1;function ie(e){let t=document.getSelection?.call(document);if(!t||t.rangeCount===0)return!1;let{anchorNode:n,focusNode:r}=t;return n!=null&&e.contains(n)||r!=null&&e.contains(r)}function ae(){if(!te.value.length)return!1;let e=document.getSelection?.call(document);if(!e||e.isCollapsed)return!1;for(let t=0;t<e.rangeCount;t++){let n=e.getRangeAt(t);if(te.value.some(e=>n.intersectsNode(e)))return!0}return!1}function oe(){let e=ae();return e&&(B=!0,ue()),e}function se(e){let t=h.value;b(e,t?u?.get(t):void 0,f.value&&!o.value),t&&u?.set(t,e)}P([g,N,ee],function(){let e=N.value;if(!e)return;let t=String(g.value??``),n=ee.value;if(re||(re=e.firstChild,L=re?.data??``),!t.startsWith(L))return e.textContent=t,re=e.firstChild,n&&(n.textContent=``),void(L=t);if(!re&&t)return e.textContent=t,re=e.firstChild,void(L=t);if(t.length>L.length&&n){let e=t.slice(L.length),r=n.lastChild;o.value&&r?.nodeType===3&&!ie(n)?r.appendData(e):n.appendChild(document.createTextNode(e)),L=t,function(e){if(o.value||e.childNodes.length<=4||ie(e))return;let t=``;for(let n=0;n<e.childNodes.length;n++)t+=e.childNodes[n]?.textContent??``;e.textContent=t}(n)}},{immediate:!0}),P([()=>n.node.content,h,f,()=>v.value.length>0&&o.value],([e])=>{let t=String(e??``);if(o.value&&s&&v.value.length&&t===g.value+v.value.map(e=>e.content).join(``)){let e=v.value.find(e=>!e.finished);e&&(T(!0),s(()=>{var t;c&&(t=e.id,x(t,oe()))}))}else{if(ae()){let e=o.value?g.value+v.value.map(e=>e.content).join(``):``;if(!o.value||t.startsWith(e))return z=t,ne.value=o.value?t.slice(e.length):``,void ue()}ne.value=``,z=null,B=!1,se(t)}},{immediate:!0});let ce=I(g.value);function le(){if(!ae()){if(de(),z!=null){let e=z;z=null,ne.value=``,B=!1,se(e),A()}else B&&(B=!1,A())}}function ue(){F||(F=document,F.addEventListener(`selectionchange`,le))}function de(){F?.removeEventListener(`selectionchange`,le),F=void 0}return e(()=>{c=!1,de()}),(e,n)=>(p(),R(`span`,{class:C([[t.node.center?`text-node-center`:``],`text-node`])},[y(D(`span`,{ref_key:`settledTextEl`,ref:N},w(ce.value),513),[[M,k(g)!==``]]),y(D(`span`,{ref_key:`settledAppendsEl`,ref:ee},null,512),[[M,k(g)!==``]]),(p(!0),R(E,null,_(k(v),e=>(p(),R(`span`,{key:e.id,ref_for:!0,ref_key:`streamedDeltaEls`,ref:te,class:C(o.value||e.finished?`text-node-stream-final`:`text-node-stream-delta`),onAnimationend:t=>k(S)(e.id,oe)},w(e.content),43,tD))),128)),m(w(ne.value),1)],2))}}),[[`__scopeId`,`data-v-e05f584c`]]);function rD(e,t,n){return h({name:e,inheritAttrs:!1,setup(e,{attrs:r,slots:i}){let o=jE(),s=OE(),c=kE(),l=typeof window<`u`&&a()?.vnode.el?.nodeType===1,f=I(typeof window>`u`||l||!c.value),p=ee(null),m=null;function h(e){let t=e&&`$el`in e?e.$el:e;p.value=t instanceof HTMLElement?t:null}return typeof window<`u`&&P([p,c],([e,t],n,r)=>{if(m?.destroy(),m=null,!t||f.value)return void(f.value=!0);if(!e)return;let i=!0,a=o(e,{rootMargin:s?.value.heavyBlockMargin,allowIdle:!1});m=a,f.value=a.isVisible.value,a.whenVisible.then(()=>{i&&m===a&&(f.value=!0)}),r(()=>{i=!1,a.destroy(),m===a&&(m=null)})},{immediate:!0}),u(()=>{m?.destroy(),m=null}),()=>d(f.value?t:n,Q(Z({},r),{ref:h}),i)}})}nD.install=e=>{e.component(nD.__name,nD)};var iD=h({name:`CodeBlockNodeLoadingShell`,inheritAttrs:!1,props:`node.isDark.loading.stream.codeBlockOptions.showLineNumbers.theme.darkTheme.lightTheme.isShowPreview.showHeader.showCopyButton.showExpandButton.showPreviewButton.showCollapseButton.showFontSizeButtons.enableFontSizeControl.minWidth.maxWidth.themes.showTooltips.htmlPreviewAllowScripts.htmlPreviewSandbox.customId.indexKey.estimatedHeightPx.estimatedContentHeightPx.estimatedDiffInline.diffInline.diffHideUnchangedRegions.reservedHeightPx`.split(`.`),emits:[`click`,`mouseover`,`mouseout`,`copy`,`previewCode`,`handleArtifactClick`],setup(e,{attrs:t}){let n=e,r=Ee();return()=>{let e=n.codeBlockOptions??{},i=vt(e),a=pt({darkTheme:n.darkTheme,isDark:n.isDark,lightTheme:n.lightTheme,theme:n.theme,themes:n.themes}),o=LC(String(n.node?.language??``)),s=de(n.node),c=pe(String(n.node?.raw??``),BC[o]||(o===`typescript`?`TypeScript`:o?o.charAt(0).toUpperCase()+o.slice(1):BC[``]),s),l=s?rt({originalCode:n.node?.originalCode,updatedCode:n.node?.updatedCode,loading:!0,matchCache:r}).flatMap(e=>e.lines):[],u=s?{removed:l.filter(e=>e.kind===`removed`).length,added:l.filter(e=>e.kind===`added`).length}:null,f=Number(n.estimatedContentHeightPx??n.reservedHeightPx),p=!s&&Number.isFinite(f)&&f>0?Math.min(i.maxHeight,Math.ceil(f)):void 0,m=e=>d(`button`,{class:`code-action-btn code-loading-action code-loading-action--${e} inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded leading-none shrink-0`,"aria-hidden":`true`,disabled:!0,tabindex:-1,type:`button`}),h=!1!==n.showExpandButton||!1!==n.showPreviewButton&&!1!==n.isShowPreview&&(o===`html`||o===`svg`)||!1!==n.showFontSizeButtons&&!1!==n.enableFontSizeControl,g=e=>e==null?void 0:typeof e==`number`?`${e}px`:String(e),_={"--code-bg":a.background,"--code-fg":a.foreground,"--code-line-number":a.lineNumber,"--markstream-code-fallback-bg":a.background,"--markstream-code-fallback-fg":a.foreground,"--markstream-diff-added-line-fill":a.diffAddedLine,"--markstream-diff-added-number-fill":a.diffAddedNumber,"--markstream-diff-editor-bg":a.background,"--markstream-diff-metadata-bg":a.background,"--markstream-diff-metadata-fg":a.lineNumber,"--markstream-diff-removed-line-fill":a.diffRemovedLine,"--markstream-diff-removed-number-fill":a.diffRemovedNumber,"--markstream-diff-shell-bg":a.background,"--markstream-pre-resolved-theme-bg":a.background,"--markstream-pre-resolved-theme-fg":a.foreground,"--markstream-pre-resolved-theme-line-number":a.lineNumber};return d(`div`,Q(Z({},t),{class:[`code-block-container rounded-lg border`,{dark:!0===n.isDark,"is-dark":a.dark,"is-rendering":!1!==n.loading,"is-diff":s},t.class],style:[Z(Q(Z({},_),{backgroundColor:a.background,color:a.foreground,minWidth:g(n.minWidth),maxWidth:g(n.maxWidth)}),s?{}:{borderColor:`var(--markstream-code-border-color, var(--code-border))`}),t.style],"data-markstream-code-block":`1`,"data-markstream-enhanced":`false`,"data-markstream-code-block-state":n.loading?`streaming`:`settled`,"data-markstream-code-loading":`1`}),[!1===n.showHeader?null:d(`div`,{class:`code-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)] border-[var(--code-border)] bg-[var(--code-header-bg)] text-[var(--code-fg)]`},[d(`div`,{class:`code-header-main`},[d(`span`,{class:`icon-slot h-4 w-4 flex-shrink-0`,"aria-hidden":`true`,innerHTML:zC(o)}),d(`div`,{class:`code-header-copy`},[d(`div`,{class:`code-header-title`},c.title),c.caption?d(`div`,{class:`code-header-caption`},c.caption):null])]),d(`div`,{class:`flex items-center gap-0.5`},[u?d(`div`,{class:`code-diff-stats`,"aria-label":`-${u.removed} +${u.added}`},[d(`span`,{class:`code-diff-stat removed`},`-${u.removed}`),d(`span`,{class:`code-diff-stat added`},`+${u.added}`)]):null,!1===n.showCopyButton?null:m(`copy`),!1===n.showCollapseButton?null:m(`collapse`),h?d(`div`,{class:`relative`},[m(`more`)]):null])]),d(`div`,{class:`code-block-shell-content`,style:!1!==n.stream||!1===n.loading?void 0:{display:`none`}},[d(eD,{node:n.node,loading:n.loading,showLineNumbers:n.showLineNumbers??!0!==e.disableLineNumbers,diffInline:s&&!!(n.diffInline??n.estimatedDiffInline??e.diffStyle===`unified`),diffHideUnchangedRegions:s?n.diffHideUnchangedRegions??se(e):void 0,reservedHeightPx:p,class:[`code-pre-fallback`,{"is-wrap":i.overflow===`wrap`}],style:Q(Z({},_),{"--markstream-code-padding-x":`${i.padding}px`,"--markstream-code-padding-y":`${i.padding}px`,"--markstream-code-tab-size":i.tabSize,"--markstream-pre-diff-line-height":`${i.lineHeight}px`,backgroundColor:a.background,color:a.foreground,fontFamily:i.fontFamily,fontSize:`${i.fontSize}px`,lineHeight:`${i.lineHeight}px`,maxHeight:`${p??i.maxHeight}px`,overflow:`auto`,paddingTop:`${i.padding}px`,paddingBottom:`${i.paddingBottom}px`,tabSize:i.tabSize,whiteSpace:i.overflow===`wrap`?`pre-wrap`:`pre`,overflowWrap:i.overflow===`wrap`?`anywhere`:`normal`}),"data-markstream-code-loading":`1`})]),d(`div`,{class:`code-loading-placeholder`,style:!1===n.stream&&!1!==n.loading?void 0:{display:`none`}},[d(`div`,{class:`loading-skeleton`},[d(`div`,{class:`skeleton-line`}),d(`div`,{class:`skeleton-line`}),d(`div`,{class:`skeleton-line short`})])])])}}}),aD=re({loader:()=>B(()=>import(`./PreCodeBlock-BBTzkaAH.js`),__vite__mapDeps([5,6,0,1])),loadingComponent:iD,delay:0,suspensible:!0}),oD=rD(`ViewportDeferredCodeBlockNode`,re({loader:()=>pT(null,null,function*(){try{return(yield B(()=>import(`./CodeBlockNode-BOeBLCjf.js`),__vite__mapDeps([7,0,1,6,8,3,4]))).default}catch(e){return console.warn(`[markstream-vue] Failed to load the enhanced CodeBlockNode chunk; falling back to preformatted code rendering. Enhanced code blocks require the optional "stream-diffs" peer.`,e),eD}}),loadingComponent:iD,delay:0,suspensible:!1}),iD),sD=re(()=>pT(null,null,function*(){if(function(){return Reflect.get(globalThis,`process`)?.env}()?.NODE_ENV===`test`&&typeof window<`u`)return e=>d(nD,Q(Z({},e),{node:{type:`text`,content:e.node.raw??`$${e.node.content??``}$`,raw:e.node.raw??`$${e.node.content??``}$`}}));try{return yield tw(),(yield B(()=>import(`./index6-DsTT-iog.js`),__vite__mapDeps([9,0,1]))).default}catch(e){console.warn(`[markstream-vue] Optional peer dependencies for MathInlineNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".`,e)}return e=>d(nD,Q(Z({},e),{node:{type:`text`,content:e.node.raw??`$${e.node.content??``}$`,raw:e.node.raw??`$${e.node.content??``}$`}}))})),cD=re(()=>pT(null,null,function*(){try{return yield tw(),(yield B(()=>import(`./index5-Cxc_iCM3.js`),__vite__mapDeps([10,0,1]))).default}catch(e){console.warn(`[markstream-vue] Optional peer dependencies for MathBlockNode are missing. Falling back to text rendering. To enable full math rendering features, please install "katex".`,e)}return e=>d(nD,Q(Z({},e),{node:{type:`text`,content:e.node.raw??`$$${e.node.content??``}$$`,raw:e.node.raw??`$$${e.node.content??``}$$`}}))})),lD=[`data-reference-id`,`data-markstream-reference-id`],uD=$(h({__name:`ReferenceNode`,props:{node:{},messageId:{},threadId:{}},emits:[`click`,`mouseEnter`,`mouseLeave`],setup:e=>(t,n)=>(p(),R(`span`,{class:`reference-node cursor-pointer text-xs rounded-md px-1.5 mx-0.5`,role:`button`,tabindex:`0`,"data-reference-id":e.node.id,"data-markstream-reference-id":e.node.id,onClick:n[0]||=n=>t.$emit(`click`,n,e.node.id,e.messageId,e.threadId),onMouseenter:n[1]||=n=>t.$emit(`mouseEnter`,n,e.node.id,e.messageId,e.threadId),onMouseleave:n[2]||=n=>t.$emit(`mouseLeave`,n,e.node.id,e.messageId,e.threadId)},w(e.node.id),41,lD))}),[[`__scopeId`,`data-v-b96c91c3`]]);uD.install=e=>{e.component(uD.__name,uD)};var dD={class:`superscript-node`},fD=$(h({__name:`SuperscriptNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=wT(()=>t.customId),r=O(()=>Z({text:nD,inline_code:$T,link:CD,html_inline:JT,strong:gD,emphasis:kD,footnote_reference:FT,strikethrough:vD,highlight:DD,insert:TD,subscript:mD,emoji:AT,math_inline:sD,reference:uD},n.value));return(n,i)=>(p(),R(`sup`,dD,[(p(!0),R(E,null,_(e.node.children,(n,i)=>(p(),S(k(VE),{key:`${e.indexKey||`superscript`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`superscript`}-${i}`,"fallback-to-text":``},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-24160b22`]]);fD.install=e=>{e.component(fD.__name,fD)};var pD={class:`subscript-node`},mD=$(h({__name:`SubscriptNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=wT(()=>t.customId),r=O(()=>Z({text:nD,inline_code:$T,link:CD,html_inline:JT,strong:gD,emphasis:kD,footnote_reference:FT,strikethrough:vD,highlight:DD,insert:TD,superscript:fD,emoji:AT,math_inline:sD,reference:uD},n.value));return(n,i)=>(p(),R(`sub`,pD,[(p(!0),R(E,null,_(e.node.children,(n,i)=>(p(),S(k(VE),{key:`${e.indexKey||`subscript`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`subscript`}-${i}`,"fallback-to-text":``},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-197fa13b`]]);mD.install=e=>{e.component(mD.__name,mD)};var hD={class:`strong-node`},gD=$(h({__name:`StrongNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=wT(()=>t.customId),r=O(()=>Z({text:nD,inline_code:$T,link:CD,html_inline:JT,emphasis:kD,strikethrough:vD,highlight:DD,insert:TD,subscript:mD,superscript:fD,emoji:AT,footnote_reference:FT,math_inline:sD,reference:uD},n.value));return(n,i)=>(p(),R(`strong`,hD,[(p(!0),R(E,null,_(e.node.children,(n,i)=>(p(),S(k(VE),{key:`${e.indexKey||`strong`}-${i}`,components:r.value,node:n,"index-key":`${e.indexKey||`strong`}-${i}`,"custom-id":t.customId},null,8,[`components`,`node`,`index-key`,`custom-id`]))),128))]))}}),[[`__scopeId`,`data-v-a8647104`]]);gD.install=e=>{e.component(gD.__name,gD)};var _D={class:`strikethrough-node`},vD=$(h({__name:`StrikethroughNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=wT(()=>t.customId),r=O(()=>Z({text:nD,inline_code:$T,link:CD,html_inline:JT,strong:gD,emphasis:kD,highlight:DD,insert:TD,subscript:mD,superscript:fD,emoji:AT,footnote_reference:FT,math_inline:sD,reference:uD},n.value));return(n,i)=>(p(),R(`del`,_D,[(p(!0),R(E,null,_(e.node.children,(n,i)=>(p(),S(k(VE),{key:`${e.indexKey||`strikethrough`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`strikethrough`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-b7a531fa`]]);vD.install=e=>{e.component(vD.__name,vD)};var yD=[`href`,`title`,`aria-label`,`aria-hidden`,`target`,`rel`],bD=[`aria-hidden`],xD={class:`link-text-wrapper relative inline-flex`},SD={class:`leading-[normal] link-text`},CD=$(h({__name:`LinkNode`,props:{node:{},indexKey:{},customId:{},showTooltip:{type:Boolean,default:!0},color:{},underlineHeight:{},underlineBottom:{},animationDuration:{},animationOpacity:{},animationTiming:{},animationIteration:{}},setup(e){let n=e,i=j(`markstreamShowTooltips`,void 0),a=O(()=>{let e=i?.value;return typeof e==`boolean`?e:n.showTooltip}),o=O(()=>{let e=n.underlineBottom===void 0?`-3px`:typeof n.underlineBottom==`number`?`${n.underlineBottom}px`:String(n.underlineBottom),t=n.animationOpacity??.35,r=Math.max(.12,Math.min(.5*t,t)),i={"--underline-height":`${n.underlineHeight??2}px`,"--underline-bottom":e,"--underline-opacity":String(t),"--underline-rest-opacity":String(r),"--underline-duration":`${n.animationDuration??1.6}s`,"--underline-timing":n.animationTiming??`ease-in-out`,"--underline-iteration":typeof n.animationIteration==`number`?String(n.animationIteration):n.animationIteration??`infinite`};return n.color&&(i[`--link-color`]=n.color),i}),s=wT(()=>n.customId),c=O(()=>Z({text:nD,strong:gD,strikethrough:vD,emphasis:kD,image:RE,html_inline:JT,inline_code:$T},s.value)),u=l(),d=O(()=>{let e=n.node?.attrs;if(!e||typeof e!=`object`)return{};let t={};if(Array.isArray(e))for(let n of e)Array.isArray(n)&&n[0]&&(t[String(n[0])]=String(n[1]??``));else for(let[n,r]of Object.entries(e))n&&r!=null&&!1!==r&&(t[n]=!0===r?``:String(r));return zT(t,`safe`,`a`)}),f=O(()=>Z(Z({},u),d.value)),m=O(()=>zT({href:String(n.node?.href??``)},`safe`,`a`).href),h=O(()=>{if(!m.value)return;let e=f.value.target;return(typeof e==`string`?e.trim():String(e??``).trim())||(Bd(m.value)?`_blank`:void 0)}),g=O(()=>String(h.value??``).trim().toLowerCase()===`_blank`),v=O(()=>{if(!m.value)return;let e=f.value.rel,t=new Set((typeof e==`string`?e:String(e??``)).split(/\s+/).filter(Boolean)),n=new Set(Array.from(t).filter(e=>e.toLowerCase()!==`opener`));return g.value&&(n.add(`noopener`),n.add(`noreferrer`)),n.size>0?Array.from(n).join(` `):void 0}),y=O(()=>{let e=Z({},f.value);return delete e.title,delete e.href,delete e.target,delete e.rel,e});function b(){a.value&&gE()}let x=O(()=>{let e=n.node?.title;return typeof e==`string`&&e.trim().length>0?e:String(m.value??``)});return(i,s)=>e.node.loading?(p(),R(`span`,t({key:1,class:`link-loading inline-flex items-baseline gap-1.5`,"aria-hidden":e.node.loading?`false`:`true`},k(u),{style:o.value}),[D(`span`,xD,[D(`span`,SD,[r(k(nD),{class:`leading-[normal] link-text`,node:{type:`text`,content:String(e.node.text??``),raw:String(e.node.text??``)},"index-key":`${e.indexKey||`link-text`}-loading`},null,8,[`node`,`index-key`])]),s[1]||=D(`span`,{class:`link-loading-indicator`,"aria-hidden":`true`},null,-1)])],16,bD)):(p(),R(`a`,t({key:0,class:`link-node`,href:m.value,title:a.value?``:x.value,"aria-label":`Link: ${x.value}`,"aria-hidden":e.node.loading?`true`:`false`,target:h.value,rel:v.value},y.value,{style:o.value,onMouseenter:s[0]||=e=>function(e){if(!a.value)return;let t=e,r=t?.clientX!=null&&t?.clientY!=null?{x:t.clientX,y:t.clientY}:void 0,i=n.node?.title||(m.value?.includes(`xn--`)&&(n.node?.text)?.includes(`://`)?n.node.text:m.value)||``;hE(e.currentTarget,i,`top`,!1,r)}(e),onMouseleave:b}),[(p(!0),R(E,null,_(e.node.children,(t,r)=>(p(),S(k(VE),{key:`${e.indexKey||`emphasis`}-${r}`,components:c.value,node:t,"custom-id":n.customId,"index-key":`${e.indexKey||`link-text`}-${r}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))],16,yD))}}),[[`__scopeId`,`data-v-a414d325`]]);CD.install=e=>{e.component(CD.__name,CD)};var wD={class:`insert-node`},TD=$(h({__name:`InsertNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=wT(()=>t.customId),r=O(()=>Z({text:nD,inline_code:$T,link:CD,html_inline:JT,strong:gD,emphasis:kD,strikethrough:vD,highlight:DD,subscript:mD,superscript:fD,emoji:AT,footnote_reference:FT,math_inline:sD,reference:uD},n.value));return(n,i)=>(p(),R(`ins`,wD,[(p(!0),R(E,null,_(e.node.children,(n,i)=>(p(),S(k(VE),{key:`${e.indexKey||`insert`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`insert`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-1e2c29d4`]]);TD.install=e=>{e.component(TD.__name,TD)};var ED={class:`highlight-node`},DD=$(h({__name:`HighlightNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=wT(()=>t.customId),r=O(()=>Z({text:nD,inline_code:$T,link:CD,html_inline:JT,strong:gD,emphasis:kD,strikethrough:vD,insert:TD,subscript:mD,superscript:fD,emoji:AT,footnote_reference:FT,math_inline:sD,reference:uD},n.value));return(n,i)=>(p(),R(`mark`,ED,[(p(!0),R(E,null,_(e.node.children,(n,i)=>(p(),S(k(VE),{key:`${e.indexKey||`highlight`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`highlight`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-7a62982a`]]);DD.install=e=>{e.component(DD.__name,DD)};var OD={class:`emphasis-node`},kD=$(h({__name:`EmphasisNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let t=e,n=wT(()=>t.customId),r=O(()=>Z({text:nD,inline_code:$T,link:CD,html_inline:JT,strong:gD,strikethrough:vD,highlight:DD,insert:TD,subscript:mD,superscript:fD,emoji:AT,footnote_reference:FT,math_inline:sD,reference:uD},n.value));return(n,i)=>(p(),R(`em`,OD,[(p(!0),R(E,null,_(e.node.children,(n,i)=>(p(),S(k(VE),{key:`${e.indexKey||`emphasis`}-${i}`,components:r.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`emphasis`}-${i}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))]))}}),[[`__scopeId`,`data-v-2a5aafbf`]]);kD.install=e=>{e.component(kD.__name,kD)};var AD={class:`hard-break`},jD=$(h({__name:`HardBreakNode`,props:{node:{}},setup:e=>(e,t)=>(p(),R(`br`,AD))}),[[`__scopeId`,`data-v-50c58f70`]]);jD.install=e=>{e.component(jD.__name,jD)};var MD=h({__name:`SimpleInlineRenderer`,props:{nodes:{},customId:{},indexKey:{}},setup(e){let t=e,n=f({checkbox:OT,checkbox_input:OT,emoji:AT,emphasis:kD,hardbreak:jD,highlight:DD,inline_code:$T,insert:TD,link:CD,reference:uD,strikethrough:vD,strong:gD,subscript:mD,superscript:fD,text:nD}),r=wT(()=>t.customId),i=O(()=>{let e=r.value;return Object.keys(e).length>0?Z(Z({},n),e):n});return(n,r)=>(p(!0),R(E,null,_(e.nodes,(n,r)=>(p(),S(k(VE),{key:r,components:i.value,node:n,"custom-id":t.customId,"index-key":`${e.indexKey||`inline`}-${r}`},null,8,[`components`,`node`,`custom-id`,`index-key`]))),128))}}),ND=[`cite`],PD={key:0,dir:`auto`,class:`paragraph-node`},FD=[`custom-id`],ID=$(h({__name:`BlockquoteNode`,props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:[`copy`],setup(e){let t=e,n=wT(()=>t.customId),r=O(()=>!!n.value.paragraph),i=O(()=>!!n.value.text),a=O(()=>kt(t.node.children,!r.value)),o=O(()=>!1!==t.fade||i.value?null:At(a.value));return z(`markstreamShowTooltips`,O(()=>t.showTooltips)),z(`markstreamFade`,O(()=>t.fade)),(n,r)=>(p(),R(`blockquote`,{class:`blockquote blockquote-node`,dir:`auto`,cite:e.node.cite},[a.value?(p(),R(`p`,PD,[o.value===null?(p(),S(k(MD),{key:1,nodes:a.value,"custom-id":t.customId,"index-key":`blockquote-${t.indexKey}-paragraph`},null,8,[`nodes`,`custom-id`,`index-key`])):(p(),R(`span`,{key:0,class:`text-node`,"custom-id":t.customId},w(o.value),9,FD))])):(p(),S(k(cA),{key:1,"show-tooltips":t.showTooltips,"index-key":`blockquote-${t.indexKey}`,nodes:t.node.children||[],"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:r[0]||=e=>n.$emit(`copy`,e)},null,8,[`show-tooltips`,`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`]))],8,ND))}}),[[`__scopeId`,`data-v-c7658eda`]]);ID.install=e=>{e.component(ID.__name,ID)};var LD={class:`definition-list`},RD={class:`definition-term`},zD={class:`definition-desc`},BD=$(h({__name:`DefinitionListNode`,props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:[`copy`],setup(e){let t=e;return(e,n)=>(p(),R(`dl`,LD,[(p(!0),R(E,null,_(t.node.items,(i,a)=>(p(),R(E,{key:a},[D(`dt`,RD,[r(k(cA),{"index-key":`definition-term-${t.indexKey}-${a}`,nodes:i.term,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:n[0]||=t=>e.$emit(`copy`,t)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])]),D(`dd`,zD,[r(k(cA),{"index-key":`definition-desc-${t.indexKey}-${a}`,nodes:i.definition,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:n[1]||=t=>e.$emit(`copy`,t)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])])],64))),128))]))}}),[[`__scopeId`,`data-v-4e103b30`]]);BD.install=e=>{e.component(BD.__name,BD)};var VD=[`href`,`title`],HD=$(h({__name:`FootnoteAnchorNode`,props:{node:{}},setup(e){let t=e;function n(e){if(e.preventDefault(),typeof document>`u`)return;let n=MT(e.currentTarget,`fnref-${String(t.node.id??``)}`);n&&n.scrollIntoView({behavior:`smooth`,block:`center`})}return(t,r)=>(p(),R(`a`,{class:`footnote-anchor text-sm hover:underline cursor-pointer`,href:`#fnref-${e.node.id}`,title:`返回引用 ${e.node.id}`,onClick:n},` ↩︎ `,8,VD))}}),[[`__scopeId`,`data-v-0dbaa45e`]]);HD.install=e=>{e.component(HD.__name,HD)};var UD=[`id`],WD={class:`flex-1`},GD=h({__name:`FootnoteNode`,props:{node:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:[`copy`],setup(e){let t=e;return(n,i)=>(p(),R(`div`,{id:`fnref--${e.node.id}`,class:`footnote-node flex text-sm leading-relaxed border-t border-[var(--footnote-border)] pt-2`},[D(`div`,WD,[r(k(cA),{"index-key":`footnote-${t.indexKey}`,nodes:t.node.children,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,onCopy:i[0]||=e=>n.$emit(`copy`,e)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])])],8,UD))}});GD.install=e=>{e.component(GD.__name,GD)};var KD=[`custom-id`],qD=$(h({__name:`HeadingNode`,props:{node:{},customId:{},indexKey:{}},setup(e){let n=e,r=wT(()=>n.customId),i=j(`markstreamFade`,void 0),a=O(()=>!1!==i?.value||r.value.text?null:At(n.node.children)),o=O(()=>Z({text:nD,inline_code:$T,link:CD,image:RE,strong:gD,emphasis:kD,strikethrough:vD,highlight:DD,insert:TD,subscript:mD,superscript:fD,emoji:AT,checkbox:OT,checkbox_input:OT,footnote_reference:FT,hardbreak:jD,math_inline:sD,reference:uD},r.value));return(r,i)=>(p(),S(v(`h${e.node.level}`),t({class:[`heading-node`,[`heading-${e.node.level}`]],dir:`auto`},e.node.attrs),{default:b(()=>[a.value===null?(p(!0),R(E,{key:1},_(e.node.children,(t,r)=>(p(),S(k(VE),{key:r,components:o.value,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||`heading`}-${r}`},null,8,[`components`,`custom-id`,`node`,`index-key`]))),128)):(p(),R(`span`,{key:0,class:`text-node`,"custom-id":n.customId},w(a.value),9,KD))]),_:1},16,[`class`]))}}),[[`__scopeId`,`data-v-2d6f45ba`]]),JD=qD;JD.install=e=>{e.component(qD.__name,qD)};var YD={key:0,dir:`auto`,class:`paragraph-node`},XD=[`custom-id`],ZD={dir:`auto`,class:`paragraph-node`},QD=[`custom-id`],$D=$(h({__name:`ListItemNode`,props:{node:{},item:{},indexKey:{},customId:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},value:{},isDark:{type:Boolean}},emits:[`copy`],setup(e){let n=e,r=O(()=>n.node??n.item),i=wT(()=>n.customId),a=O(()=>!!i.value.paragraph),o=O(()=>!!i.value.text),s=O(()=>kt(r.value?.children,!a.value)),c=O(()=>{if(a.value)return null;let e=r.value?.children;if(!Array.isArray(e)||e.length<2)return null;let t=e[0];if(t?.type!==`paragraph`||!Array.isArray(t.children))return null;let n=e.slice(1);if(!n.every(e=>e?.type===`list`))return null;let i=kt([t]);return i?{paragraphChildren:i,nestedLists:n}:null});function l(){return!1===n.fade&&!o.value}let u=O(()=>l()?At(s.value):null),d=O(()=>l()?At(c.value?.paragraphChildren):null),f=Object.freeze({}),m=O(()=>{let{value:e}=n;return typeof e==`number`&&Number.isFinite(e)?{value:e}:f});return z(`markstreamShowTooltips`,O(()=>n.showTooltips)),z(`markstreamFade`,O(()=>n.fade)),(e,i)=>(p(),R(`li`,t({class:`list-item`,dir:`auto`},m.value),[s.value?(p(),R(`p`,YD,[u.value===null?(p(),S(k(MD),{key:1,nodes:s.value,"custom-id":n.customId,"index-key":`list-item-${n.indexKey}-paragraph`},null,8,[`nodes`,`custom-id`,`index-key`])):(p(),R(`span`,{key:0,class:`text-node`,"custom-id":n.customId},w(u.value),9,XD))])):c.value?(p(),R(E,{key:1},[D(`p`,ZD,[d.value===null?(p(),S(k(MD),{key:1,nodes:c.value.paragraphChildren,"custom-id":n.customId,"index-key":`list-item-${n.indexKey}-paragraph`},null,8,[`nodes`,`custom-id`,`index-key`])):(p(),R(`span`,{key:0,class:`text-node`,"custom-id":n.customId},w(d.value),9,QD))]),(p(!0),R(E,null,_(c.value.nestedLists,(t,r)=>(p(),S(k(cA),{key:r,nodes:[t],"custom-id":n.customId,"index-key":`list-item-${n.indexKey}-nested-${r}`,"show-tooltips":n.showTooltips,typewriter:n.typewriter,fade:n.fade,"is-dark":n.isDark,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0,onCopy:i[0]||=t=>e.$emit(`copy`,t)},null,8,[`nodes`,`custom-id`,`index-key`,`show-tooltips`,`typewriter`,`fade`,`is-dark`]))),128))],64)):(p(),S(k(cA),{key:2,"show-tooltips":n.showTooltips,"index-key":`list-item-${n.indexKey}`,nodes:r.value?.children??[],"custom-id":n.customId,typewriter:n.typewriter,fade:n.fade,"is-dark":n.isDark,"batch-rendering":!1,onCopy:i[1]||=t=>e.$emit(`copy`,t)},null,8,[`show-tooltips`,`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`,`is-dark`]))],16))}}),[[`__scopeId`,`data-v-a2b8a81c`]]);$D.install=e=>{e.component($D.__name,$D)};var eO=$(h({__name:`ListNode`,props:{node:{},customId:{},indexKey:{},typewriter:{type:Boolean},fade:{type:Boolean},showTooltips:{type:Boolean},isDark:{type:Boolean}},emits:[`copy`],setup(e){let n=wT(()=>e.customId),r=O(()=>n.value.list_item||$D);return(n,i)=>(p(),S(v(e.node.ordered?`ol`:`ul`),{class:C([`list-node`,{"list-decimal":e.node.ordered,"list-disc":!e.node.ordered}])},{default:b(()=>[(p(!0),R(E,null,_(e.node.items,(a,o)=>(p(),S(v(r.value),t({key:`${e.indexKey||`list`}-${o}`},{ref_for:!0},{showTooltips:e.showTooltips},{node:a,"custom-id":e.customId,"index-key":`${e.indexKey||`list`}-${o}`,typewriter:e.typewriter,fade:e.fade,"is-dark":e.isDark,value:e.node.ordered?(e.node.start??1)+o:void 0,onCopy:i[0]||=e=>n.$emit(`copy`,e)}),null,16,[`node`,`custom-id`,`index-key`,`typewriter`,`fade`,`is-dark`,`value`]))),128))]),_:1},8,[`class`]))}}),[[`__scopeId`,`data-v-99cb95e0`]]);eO.install=e=>{e.component(eO.__name,eO)};var tO={key:2,class:`html-block-node__raw`},nO=[`innerHTML`],rO={key:1,class:`html-block-node__placeholder`},iO=$(h({__name:`HtmlBlockNode`,props:{node:{},customId:{},htmlPolicy:{}},setup(e){let n=e,r=j(`markstreamHtmlPolicy`,void 0),a=j(`markstreamNestedRendererProps`,void 0),o=O(()=>n.htmlPolicy??r?.value??`safe`),c=O(()=>{let e=a?.value??{};return Q(Z({},e),{customId:n.customId??e.customId,htmlPolicy:o.value})}),l=re({loader:()=>Promise.resolve().then(()=>lA),suspensible:!1}),d=O(()=>{let e=zS(n.node.attrs,o.value);if(!e)return;let t=RS(e);return Object.keys(t).length>0?t:void 0}),f=O(()=>{let e=String(n.node.tag||``).trim(),t=zS(n.node.attrs,o.value,e);if(!t)return;let r=RS(t);return Object.keys(r).length>0?r:void 0}),m=wT(()=>n.customId),g=h({name:`DynamicRenderer`,props:{nodes:{type:Array,required:!0}},render(){return this.nodes}}),_=I(null);function y(e,t,n,r){if(!0!==e)return!1;let i=String(t??``);if(!i)return!1;if(i!==String(n??``))return!0;let a=String(r??``).trim();return!!a&&!1===i.toLowerCase().includes(`</${a.toLowerCase()}`)}let x=I(y(n.node.loading,n.node.raw,n.node.content,n.node.tag)),C=I(typeof window>`u`||x.value),T=I(n.node.content),M=I(0),N=I(String(n.node.raw??``)),ne=O(()=>Array.isArray(n.node.children)?n.node.children:[]);P(()=>[n.node.loading,n.node.raw,n.node.content,n.node.tag],([e,t,n,r])=>{let i=String(t??``),a=!N.value||i.startsWith(N.value),o=y(e,t,n,r);a?o&&(x.value=!0):(x.value=o,M.value=0),o&&(C.value=!0),N.value=i},{flush:`sync`});let F=O(()=>String(n.node.tag||`div`)),z=O(()=>{if(F.value.trim().toLowerCase()!==`details`||n.node.attrs?.some(([e])=>String(e).toLowerCase()===`open`))return null;let e=ne.value[0];return e?.type===`html_block`&&String(e.tag||``).toLowerCase()===`summary`?e:null}),B=O(()=>At(z.value?.children)),ie=O(()=>{let e=z.value;if(!e)return;let t=zS(e.attrs,o.value,`summary`);if(!t)return;let n=RS(t);return Object.keys(n).length>0?n:void 0}),ae=O(()=>B.value==null?ne.value:ne.value.slice(1)),oe=O(()=>{let e=F.value.trim().toLowerCase();return Ed.has(e)||DS(e,o.value)}),se=O(()=>ne.value.length>0&&!!n.node.tag&&!oe.value),ce=O(()=>{if(se.value)return{mode:`structured`};if(!C.value)return{mode:`html`,content:T.value??``};let e=T.value??n.node.content;if(!e)return{mode:`html`,content:``};if(o.value===`escape`)return{mode:`html`,content:KS(e,o.value)};let t=x.value||!0===n.node.loading,r=KT(e,m.value,o.value,t);return r.ok&&(t||r.hasCustomComponents)?{mode:`dynamic`,nodes:r.nodes}:t?{mode:`text`,content:n.node.raw??e}:{mode:`html`,content:KS(e,o.value)}}),le=jE(),ue=OE(),de=kE(),fe=ee(null),pe=!!n.node.loading,me=null;return typeof window<`u`?(P([()=>_.value,()=>n.node.loading,x],([e,t,r],i,a)=>{if(me?.disconnect(),me=null,!e||!r||!1===t||typeof ResizeObserver>`u`)return;let o=new ResizeObserver(e=>{if(!x.value||!1===n.node.loading)return;let t=e[0],r=(Array.isArray(t?.borderBoxSize)?t.borderBoxSize[0]:t?.borderBoxSize)?.blockSize??t?.contentRect.height??0;r>M.value&&(M.value=r)});me=o,o.observe(e),a(()=>o.disconnect())},{immediate:!0}),P(()=>n.node.loading,e=>pT(null,null,function*(){!1!==e||!x.value||M.value<=0||(yield A(),requestAnimationFrame(()=>{!1===n.node.loading&&(M.value=0)}))})),P([()=>_.value,()=>ue?.value.heavyBlockMargin,()=>ue?.value.rootMargin],([e],t,r)=>{var i,a;if((a=(i=fe.value)?.destroy)==null||a.call(i),fe.value=null,!pe)return C.value=!0,void(T.value=n.node.content);if(!e)return void(x.value||(C.value=!1));let o=!0,s=ue?.value.heavyBlockMargin??ue?.value.rootMargin??DE,c=le(e,{rootMargin:s,allowIdle:!de.value});fe.value=c,C.value=C.value||c.isVisible.value,c.whenVisible.then(()=>{o&&fe.value===c&&(C.value=!0)}),r(()=>{o=!1,c.destroy(),fe.value===c&&(fe.value=null)})},{immediate:!0}),P(()=>n.node.content,e=>{pe&&!C.value||(T.value=e)})):C.value=!0,u(()=>{var e,t;me?.disconnect(),me=null,(t=(e=fe.value)?.destroy)==null||t.call(e),fe.value=null}),(n,r)=>(p(),S(v(se.value?F.value:`div`),t({ref_key:`htmlRef`,ref:_,class:`html-block-node`,style:M.value>0?{boxSizing:`border-box`,minHeight:`${M.value}px`}:void 0,"data-markstream-viewport-pending":k(de)&&!C.value?`true`:void 0},se.value?f.value:void 0),{default:b(()=>[C.value?(p(),R(E,{key:0},[ce.value.mode===`structured`?(p(),R(E,{key:0},[B.value===null?(p(),S(k(l),t({key:1},c.value,{nodes:ne.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`])):(p(),R(E,{key:0},[D(`summary`,te(i(ie.value)),w(B.value),17),ae.value.length?(p(),S(k(l),t({key:0},c.value,{nodes:ae.value,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`])):L(``,!0)],64))],64)):ce.value.mode===`dynamic`?(p(),S(k(g),{key:1,nodes:ce.value.nodes},null,8,[`nodes`])):ce.value.mode===`text`?(p(),R(`pre`,tO,w(ce.value.content),1)):(p(),R(`div`,t({key:3},d.value,{innerHTML:ce.value.content}),null,16,nO))],64)):(p(),R(`div`,rO,[s(n.$slots,`placeholder`,{node:e.node},()=>[r[0]||=D(`span`,{class:`html-block-node__placeholder-bar`},null,-1),r[1]||=D(`span`,{class:`html-block-node__placeholder-bar w-4/5`},null,-1),r[2]||=D(`span`,{class:`html-block-node__placeholder-bar w-2/3`},null,-1)],!0)]))]),_:3},16,[`style`,`data-markstream-viewport-pending`]))}}),[[`__scopeId`,`data-v-b7034867`]]);iO.install=e=>{e.component(iO.__name,iO)};var aO={dir:`auto`,class:`paragraph-node`},oO=[`custom-id`],sO=$(h({__name:`ParagraphNode`,props:{node:{},customId:{},indexKey:{},customHtmlTags:{},parseOptions:{},customMarkdownIt:{type:Function}},setup(e){let n=e,r=wT(()=>n.customId),i=j(`markstreamHtmlPolicy`,void 0),a=j(`markstreamFade`,void 0),o=j(`markstreamParseOptions`,void 0),s=j(`markstreamCustomMarkdownIt`,void 0),c=j(`markstreamNestedRendererProps`,void 0),l=O(()=>i?.value??`safe`),u=O(()=>n.parseOptions??o?.value),d=O(()=>n.customMarkdownIt??s?.value),f=O(()=>n.customHtmlTags??c?.value?.customHtmlTags),h=O(()=>{let e=c?.value??{};return Q(Z({},e),{customId:n.customId??e.customId,customHtmlTags:f.value,parseOptions:u.value,customMarkdownIt:d.value,htmlPolicy:l.value})});function g(e){return e.type===`text`&&String(e.content??``).trim()===``}let y=O(()=>n.node.children.filter(e=>!g(e))),x=O(()=>y.value.length>0&&y.value.every(e=>e.type===`image`||function(e){let t=function(e){return e.type===`link`&&Array.isArray(e.children)?e.children.filter(e=>!g(e)):[]}(e);return t.length===1&&t[0]?.type===`image`}(e))),C=O(()=>new Set($d(f.value))),T=O(()=>{if(!x.value||y.value.length<=1)return n.node.children;let e=[];for(let t=0;t<n.node.children.length;t++){let r=n.node.children[t];if(!g(r)){e.push(r);continue}let i=e.length>0,a=n.node.children.slice(t+1).some(e=>!g(e));i&&a&&e.push(Q(Z({},r),{content:` `,raw:` `}))}return e}),D=O(()=>!1===a?.value&&!r.value.text),A=O(()=>D.value?At(T.value):null);function M(e,t){return Z({node:e,"index-key":`${n.indexKey}-${t}`,"custom-id":n.customId,"custom-html-tags":f.value},e.type===`reference`?{"data-markstream-reference-id":String(e.id)}:{})}function N(e){let t=e,n=String(t.type);if(r.value[n])return null;let i=function(e){if(!Array.isArray(e))return``;let t=[];for(let n of e){if(!n||typeof n!=`object`)return null;let e=N(n);if(e==null)return null;t.push(e)}return t.join(``)}(t.children);if(i==null)return null;let a=[n,t.loading,i];switch(n){case`text`:return[...a,t.content,t.center].join(``);case`inline_code`:return[...a,t.code].join(``);case`image`:return[...a,t.src,t.alt,t.title].join(``);case`link`:return[...a,t.href,t.title,t.text,JSON.stringify(t.attrs??null)].join(``);case`html_inline`:case`html_block`:return[...a,t.tag,t.content,t.autoClosed,JSON.stringify(t.attrs??null)].join(``);case`emoji`:return[...a,t.name,t.markup].join(``);case`checkbox`:case`checkbox_input`:return[...a,t.checked].join(``);case`math_inline`:return[...a,t.content,t.markup].join(``);case`reference`:case`footnote_anchor`:case`footnote_reference`:return[...a,t.id].join(``);case`hardbreak`:case`emphasis`:case`strong`:case`strikethrough`:case`highlight`:case`insert`:case`subscript`:case`superscript`:return a.join(``);default:return null}}let ee=new Map,te=O(()=>Z({inline_code:$T,image:RE,link:CD,hardbreak:jD,emphasis:kD,strong:gD,strikethrough:vD,highlight:DD,insert:TD,subscript:mD,superscript:fD,html_inline:JT,html_block:iO,emoji:AT,checkbox:OT,math_inline:sD,checkbox_input:OT,reference:uD,footnote_anchor:HD,footnote_reference:FT,text:nD},r.value)),P=O(()=>{let e=T.value;if(ee.size>e.length)for(let t of ee.keys())t>=e.length&&ee.delete(t);return e.map((e,t)=>{let i=N(e),a=ee.get(t),o=i!=null&&a?.sig===i?a.child:e;i==null?ee.delete(t):ee.set(t,{child:o,sig:i});let s=function(e){if(e.type===`html_block`||e.type===`html_inline`){let t=String(e.tag??``).trim().toLowerCase()||nf(e.content);if(t&&!C.value.has(t)&&af(e.content??e.raw,t)){let t=String(e.content??e.raw??``);return{child:{type:`text`,content:t,raw:t},component:nD,isCustomComponent:!1}}}return{child:e,component:te.value[e.type],isCustomComponent:!(!r.value[e.type]||bT(String(e.type)))}}(o);return Q(Z({},s),{index:t,key:`${n.indexKey||`paragraph`}-${t}`,customAttrs:s.isCustomComponent?HT(s.child,l.value):void 0,hasSlotChildren:Array.isArray(s.child.children)&&s.child.children.length>0,slotContent:String(s.child.content??``),originalChild:o})})});return(e,r)=>(p(),R(`p`,aO,[A.value===null?(p(!0),R(E,{key:1},_(P.value,e=>{return p(),R(E,{key:e.key},[x.value&&g(e.originalChild)?(p(),R(E,{key:0},[m(w((r=e.originalChild,String((i=r.content)??``))),1)],64)):e.isCustomComponent?(p(),S(v(e.component),t({key:1,ref_for:!0},e.customAttrs,{node:e.child,loading:e.child.loading,"index-key":e.key,"custom-id":n.customId,"custom-html-tags":f.value,"is-dark":h.value.isDark}),{default:b(()=>[e.hasSlotChildren?(p(),S(k(zE),t({key:0,ref_for:!0},h.value,{nodes:e.child.children,"index-key":e.key,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):e.slotContent?(p(),S(k(zE),t({key:1,ref_for:!0},h.value,{content:e.slotContent,final:!e.child.loading,"index-key":`${e.key}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:2},1040,[`node`,`loading`,`index-key`,`custom-id`,`custom-html-tags`,`is-dark`])):(p(),S(v(e.component),t({key:2,ref_for:!0},M(e.child,e.index)),null,16))],64);var r,i}),128)):(p(),R(`span`,{key:0,class:`text-node`,"custom-id":n.customId},w(A.value),9,oO))]))}}),[[`__scopeId`,`data-v-c4381289`]]);sO.install=e=>{e.component(sO.__name,sO)};var cO={class:`table-node-wrapper`},lO=[`aria-busy`],uO={key:0},dO=[`custom-id`],fO=[`aria-label`,`onPointerdown`],pO=[`custom-id`],mO={key:0,class:`table-node__loading`,role:`status`,"aria-live":`polite`},hO=$(h({__name:`TableNode`,props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{},showTooltips:{type:Boolean}},emits:[`copy`],setup(e){let t=e,n=O(()=>{var e;return(e=t.node.loading)!=null&&e}),i=O(()=>t.node.rows??[]),a=I(null),o=I([]),c=null,l=O(()=>t.node.header.cells.length),d=O(()=>o.value.some(e=>Number.isFinite(e)&&e>0)),f=O(()=>d.value?o.value.map(e=>e>0?{width:`${e}px`}:void 0):[]);z(`markstreamShowTooltips`,O(()=>t.showTooltips)),z(`markstreamFade`,O(()=>t.fade));let m=wT(()=>t.customId),h=O(()=>!!m.value.text),g=O(()=>!!m.value.paragraph),v=new WeakMap;function y(e){let n=!1===t.fade&&!h.value,r=!g.value,i=v.get(e);if(i?.children===e.children&&i.textFastPath===n&&i.paragraphFastPath===r)return i.info;let a=kt(e.children,r,!0),o={simpleChildren:a,plainText:a&&n?At(a):null};return v.set(e,{children:e.children,textFastPath:n,paragraphFastPath:r,info:o}),o}function x(e){if(!c)return;e.preventDefault();let t=c.startWidth+c.nextStartWidth,n=Math.min(48,Math.floor(t/2)),r=Math.max(n,Math.min(t-n,Math.round(c.startWidth+e.clientX-c.startX))),i=[...c.widths];i[c.index]=r,i[c.index+1]=t-r,o.value=i}function T(){c&&=(window.removeEventListener(`pointermove`,x),window.removeEventListener(`pointerup`,T),window.removeEventListener(`pointercancel`,T),null)}return P(l,()=>{T(),o.value=[]}),u(T),(l,u)=>(p(),R(`div`,cO,[D(`table`,{ref_key:`tableRef`,ref:a,class:C([`table-node`,{"table-node--loading":n.value}]),"aria-busy":n.value},[d.value?(p(),R(`colgroup`,uO,[(p(!0),R(E,null,_(e.node.header.cells,(e,t)=>(p(),R(`col`,{key:t,style:F(f.value[t])},null,4))),128))])):L(``,!0),D(`thead`,null,[D(`tr`,null,[(p(!0),R(E,null,_(e.node.header.cells,(n,r)=>(p(),R(`th`,{key:r,dir:`auto`,class:C([n.align===`right`?`text-right`:n.align===`center`?`text-center`:`text-left`])},[y(n).plainText===null?y(n).simpleChildren?(p(),S(k(MD),{key:1,nodes:y(n).simpleChildren,"custom-id":t.customId,"index-key":`table-th-${t.indexKey}-${r}`},null,8,[`nodes`,`custom-id`,`index-key`])):(p(),S(k(cA),{key:2,nodes:n.children,"index-key":`table-th-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:u[0]||=e=>l.$emit(`copy`,e)},null,8,[`nodes`,`index-key`,`custom-id`,`typewriter`,`fade`,`show-tooltips`])):(p(),R(`span`,{key:0,class:`text-node`,"custom-id":t.customId},w(y(n).plainText),9,dO)),r<e.node.header.cells.length-1?(p(),R(`button`,{key:3,type:`button`,class:`table-node__resize-handle`,"aria-label":`Resize columns ${r+1} and ${r+2}`,onPointerdown:e=>function(e,t){if(t.button!==0)return;let n=function(){let e=a.value?.querySelectorAll(`thead th`);return Array.from(e??[],e=>Math.round(e.getBoundingClientRect().width))}(),r=n[e],i=n[e+1];r&&i&&(t.preventDefault(),c={index:e,startX:t.clientX,startWidth:r,nextStartWidth:i,widths:n},o.value=n,window.addEventListener(`pointermove`,x),window.addEventListener(`pointerup`,T),window.addEventListener(`pointercancel`,T))}(r,e)},null,40,fO)):L(``,!0)],2))),128))])]),D(`tbody`,null,[(p(!0),R(E,null,_(i.value,(e,n)=>(p(),R(`tr`,{key:n},[(p(!0),R(E,null,_(e.cells,(e,r)=>(p(),R(`td`,{key:r,class:C([e.align===`right`?`text-right`:e.align===`center`?`text-center`:`text-left`]),dir:`auto`},[y(e).plainText===null?y(e).simpleChildren?(p(),S(k(MD),{key:1,nodes:y(e).simpleChildren,"custom-id":t.customId,"index-key":`table-td-${t.indexKey}-${n}-${r}`},null,8,[`nodes`,`custom-id`,`index-key`])):(p(),S(k(cA),{key:2,nodes:e.children,"index-key":`table-td-${t.indexKey}`,"custom-id":t.customId,typewriter:t.typewriter,fade:t.fade,"show-tooltips":t.showTooltips,onCopy:u[1]||=e=>l.$emit(`copy`,e)},null,8,[`nodes`,`index-key`,`custom-id`,`typewriter`,`fade`,`show-tooltips`])):(p(),R(`span`,{key:0,class:`text-node`,"custom-id":t.customId},w(y(e).plainText),9,pO))],2))),128))]))),128))])],10,lO),r(N,{name:`table-node-fade`},{default:b(()=>[n.value?(p(),R(`div`,mO,[s(l.$slots,`loading`,{isLoading:n.value},()=>[u[2]||=D(`span`,{class:`table-node__spinner animate-spin`,"aria-hidden":`true`},null,-1),u[3]||=D(`span`,{class:`sr-only`},`Loading`,-1)],!0)])):L(``,!0)]),_:3})]))}}),[[`__scopeId`,`data-v-6704fa51`]]);hO.install=e=>{e.component(hO.__name,hO)};var gO={class:`hr-node`},_O=$({},[[`render`,function(e,t){return p(),R(`hr`,gO)}],[`__scopeId`,`data-v-b0d616f1`]]);_O.install=e=>{e.component(_O.__name,_O)};var vO={class:`unknown-node`},yO=h({__name:`FallbackComponent`,props:{node:{}},setup:e=>(t,n)=>(p(),R(`div`,vO,w(e.node.raw),1))}),bO=$(h({__name:`VmrContainerNode`,props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},setup(e){let n=e,r=O(()=>`vmr-container vmr-container-${n.node.name}`),i=wT(()=>n.customId),a=O(()=>Z({text:nD,paragraph:sO,heading:JD,inline_code:$T,link:CD,image:RE,strong:gD,emphasis:kD,strikethrough:vD,insert:TD,subscript:mD,superscript:fD,checkbox:OT,checkbox_input:OT,hardbreak:jD,math_inline:sD,reference:uD,list:eO,math_block:cD,table:hO},i.value));return(i,o)=>(p(),R(`div`,t({class:r.value},e.node.attrs),[(p(!0),R(E,null,_(e.node.children,(t,r)=>{return p(),S(v((i=t.type,a.value[i]||yO)),{key:`${e.indexKey||`vmr-container`}-${r}`,"custom-id":n.customId,node:t,"index-key":`${e.indexKey||`vmr-container`}-${r}`,typewriter:n.typewriter,fade:n.fade,"data-markstream-reference-id":t.type===`reference`?String(t.id):void 0},null,8,[`custom-id`,`node`,`index-key`,`typewriter`,`fade`,`data-markstream-reference-id`]);var i}),128))],16))}}),[[`__scopeId`,`data-v-e38ca2a3`]]);bO.install=e=>{e.component(bO.__name,bO)};var xO=`__MARKSTREAM_VUE_HEIGHT_ESTIMATION_EXPERIMENT__`,SO=[`diff `,`index `,`--- `,`+++ `,`@@ `],CO=(()=>{let e=globalThis;if(e[xO])return e[xO];let t={configs:{},controllers:{},revision:ee(0),preparedCache:new Map,blockEstimateCache:new Map};return e[xO]=t,t})(),wO=null,TO=null,EO=null;function DO(){return TO||typeof window>`u`?null:(EO||=B(()=>import(`./layout-BA_bUv_G.js`).then(e=>(TO=e,CO.revision.value++,e)),[]).catch(()=>null),EO.then(()=>{}))}var OO=CO.revision;function kO(e){var t;return e&&(t=CO.configs[e])!=null?t:null}function AO(e,t){let n=Number.parseFloat(String(e??``));return Number.isFinite(n)&&n>0?n:t}function jO(e){return e?.type===`text`||e?.type===`emoji`||e?.type===`hardbreak`}function MO(e){if(!Array.isArray(e)||e.length===0)return null;let t=``;for(let n of e){if(!jO(n))return null;n.type===`text`?t+=String(n.content??``):n.type===`emoji`?t+=String(n.name??n.raw??``):n.type===`hardbreak`&&(t+=`
|
|
195
|
+
`)}return t.length>0?t:null}function NO(e,t,n){if(!e||!Number.isFinite(t)||t<=0||!function(){if(wO!=null)return wO;if(typeof document>`u`)return!1;try{let e=document.createElement(`canvas`);return wO=!!e.getContext?.call(e,`2d`),wO}catch{return wO=!1,!1}}())return null;let r=TO;if(!r)return DO(),null;try{let i=Math.round(100*t)/100,a=[n.whiteSpace??`pre-wrap`,n.font,n.lineHeight,n.wrapperOverhead,n.widthAdjustment,i,e].join(`\0`),o=CO.blockEstimateCache.get(a);if(o)return CO.blockEstimateCache.delete(a),CO.blockEstimateCache.set(a,o),{kind:`simple-text`,height:o.height,contentHeight:o.contentHeight};let s=n.whiteSpace??`pre-wrap`,c=function(e,t,n,r){let i=`${r}\0${n}\0${t}`,a=CO.preparedCache.get(i);if(a)return CO.preparedCache.delete(i),CO.preparedCache.set(i,a),a.prepared;let o=e.prepare(t,n,{whiteSpace:r});for(CO.preparedCache.set(i,{prepared:o});CO.preparedCache.size>240;){let e=CO.preparedCache.keys().next().value;if(!e)break;CO.preparedCache.delete(e)}return o}(r,e,n.font,s),l=Math.max(24,i-n.widthAdjustment),u=r.layout(c,l,n.lineHeight),d=Math.max(n.lineHeight,u.height),f=Math.max(n.lineHeight,Math.round(d+n.wrapperOverhead));for(CO.blockEstimateCache.set(a,{height:f,contentHeight:Math.round(d)});CO.blockEstimateCache.size>4e3;){let e=CO.blockEstimateCache.keys().next().value;if(!e)break;CO.blockEstimateCache.delete(e)}return{kind:`simple-text`,height:f,contentHeight:Math.round(d)}}catch{return null}}function PO(e,t,n){if(!n||!e||!Number.isFinite(t)||t<=0)return null;if(e.type===`paragraph`){let r=MO(e.children);return r&&n.paragraph?NO(r,t,n.paragraph):null}if(e.type===`heading`){let r=Number(e.level||0),i=MO(e.children),a=n.headings[r];return i&&a?NO(i,t,a):null}if(e.type===`list_item`){let r=Array.isArray(e.children)?e.children:[];if(r.length!==1||r[0]?.type!==`paragraph`||!n.listItem)return null;let i=MO(r[0]?.children);return i?NO(i,t,n.listItem):null}if(e.type===`list`){let r=Array.isArray(e.items)?e.items:[];if(!r.length)return null;let i=Math.max(0,n.listWrapperOverhead);for(let e of r){let r=PO(e,t,n);if(!r)return null;i+=r.height}return{kind:`simple-text`,height:Math.max(1,Math.round(i)),contentHeight:Math.max(1,Math.round(i))}}return null}function FO(e){if(!e)return 1;let t=String(e).split(/\r\n|\n|\r/);return Math.max(1,t.length)}function IO(e,t){let n=String(e??``);return t?n:n.replace(/\r\n$|\n$|\r$/,``)}function LO(e,t){return e.diff?ce({diffStyle:t})?function(e){let t=IO(e.raw);if(t){let n=t.split(/\r?\n/);return e.originalCode!=null||e.updatedCode!=null?Math.max(1,n.filter(e=>!SO.some(t=>e.startsWith(t))).length):Math.max(1,n.length)}return FO(IO(e.originalCode))+FO(IO(e.updatedCode))}(e):function(e){let t=e.originalCode,n=e.updatedCode;if(t!=null||n!=null)return Math.max(FO(IO(t)),FO(IO(n)));let r=IO(e.code).split(/\r?\n/),i=0,a=0;for(let e of r)e.startsWith(`+`)&&!e.startsWith(`+++`)?a++:e.startsWith(`-`)&&!e.startsWith(`---`)?i++:(i++,a++);return Math.max(1,i,a)}(e):FO(IO(e.code,!0===e.loading))}function RO(e,t,n){return Math.max(1,Math.ceil(function(e,t){let n=0;for(let r of e)n+=r===` `?t-n%t:r>=`ᄀ`?2:1;return n}(e,n)/t))}function zO(e,t,n,r,i,a){let o=e/(a?2:1),s=i.codeBlockOptions?.padding==null?t:r.padding,c=i.showLineNumbers??!0!==i.codeBlockOptions?.disableLineNumbers,l=Math.max(2,String(Math.max(1,n)).length)*t,u=c?3*t+l+2:0;return Math.max(1,Math.floor((o-u-2*s)/t))}function BO(e){return e?`${e.fontStyle||`normal`} ${e.fontWeight||`400`} ${e.fontSize||`16px`} ${e.fontFamily||`sans-serif`}`:``}function VO(e,t,n=`pre-wrap`){if(!e||!t||typeof window>`u`)return null;let r=window.getComputedStyle(t),i=e.offsetHeight,a=AO(r.lineHeight,1.5*AO(r.fontSize,16)),o=e.getBoundingClientRect().width,s=t.getBoundingClientRect().width;return{font:BO(r),lineHeight:a,wrapperOverhead:Math.max(0,i-a),widthAdjustment:Math.max(0,o-s),whiteSpace:n}}var HO=new Set([`node`,`key`,`ref`,`ctx`,`renderNode`,`indexKey`,`__proto__`,`prototype`,`constructor`]);function UO(e,t={}){let n={},r=new Set(t.omit??[]);if(!e||typeof e!=`object`)return n;let i=Object.getOwnPropertyDescriptors(e);for(let[e,t]of Object.entries(i))HO.has(e)||r.has(e)||t.enumerable&&`value`in t&&(n[e]=t.value);return n}function WO(e,t){let n=t.trim().toLowerCase();if(n)for(let t of[n,LC(n),Et(n),n===`d2lang`?`d2`:``]){let n=t&&e[t];if(n)return n}}function GO(e,t,n,r){let i=function(e){return Math.max(0,Math.ceil(e.scrollHeight||0)-Math.ceil(e.clientHeight||0))}(e),a=function(e,t){return Number.isFinite(e)?Math.min(Math.max(0,e),t):0}(n,i);if(!r.isReverseFlexScrollRoot(e))return void(e.scrollTop=a);let o=Math.max(0,i-a),s=[-o,o],c=s[0],l=1/0;for(let n of s){e.scrollTop=n;let i=r.getNormalizedScrollTop(e,t,!1),o=Math.abs(i-a);o<l&&(l=o,c=n)}e.scrollTop=c;let u=r.epsilonPx??2;Math.abs(r.getNormalizedScrollTop(e,t,!1)-a)>u&&(e.scrollTop=c)}function KO(e,t){let n=0,r=null,i=null,a=()=>{let t=i;i=null,r=null,t&&(n=Date.now(),e(...t))};return function(...o){let s=Date.now(),c=t-(s-n);i=o,c<=0?(r&&=(clearTimeout(r),null),n=s,i=null,e(...o)):r||=setTimeout(a,c)}}function qO(e){return e===`simple`?`simple`:!0===e||e===`true`||e===`precise`?`precise`:`off`}function JO(e){return qO(e)!==`off`}var YO=Symbol(`MarkstreamMathBlockMinHeightCache`);function XO(){return j(YO,null)}var ZO=new Set([`text`,`inline_code`,`emoji`,`footnote_reference`]),QO=new Set([`strong`,`emphasis`,`strikethrough`,`highlight`,`insert`,`subscript`,`superscript`,`link`]);function $O(e){let t=Number(e);return!Number.isFinite(t)||t<=0?-1:Math.round(t/32)}function ek(e,t,n,r=22){let i=String(e??``);if(!i)return n;let a=Math.max(18,Math.floor(Math.max(320,t)/8)),o=i.split(/\r?\n/).length,s=Math.ceil(i.length/a);return Math.max(n,Math.ceil(Math.max(1,o,s)*r+12))}function tk(e){if(!e||typeof e!=`object`)return!1;let t=e,n=String(t.type??``);if(ZO.has(n))return!0;if(!QO.has(n))return!1;let r=t.children;return!Array.isArray(r)||!r.length||r.every(tk)}function nk(e){if(!e||typeof e!=`object`)return``;let t=e,n=String(t.type??``);if(n===`text`)return String(t.content??t.raw??``);if(n===`inline_code`)return String(t.code??t.content??t.raw??``);if(n===`emoji`)return String(t.name??t.raw??``);if(typeof t.text==`string`)return t.text;let r=[];for(let e of[`children`,`items`,`cells`,`rows`]){let n=t[e];if(Array.isArray(n)){let e=n.map(nk).filter(Boolean).join(` `);e&&r.push(e)}}return r.join(` `).replace(/\s+/g,` `).trim()}function rk(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`inline_code`||[`children`,`items`,`cells`,`rows`].some(e=>{let n=t[e];return Array.isArray(n)&&n.some(rk)})}function ik(e,t){if(!e)return 30;let n=Math.max(18,Math.floor(Math.max(320,t)/8)),r=e.split(/\r?\n/).length,i=Math.ceil(e.length/n);return 30+26*Math.max(0,Math.max(1,r,i)-1)}function ak(e,t){if(!e||typeof e!=`object`)return 32;let n=e,r=String(n.type??``),i=Number.isFinite(t)&&t>0?t:640;switch(r){case`heading`:return function(e){let t=Number(e.level??e.depth);return t>=4?20:t===3?30:t===2?32:44}(n);case`paragraph`:return function(e,t){let n=String(e??``);if(!n)return 28;let r=Math.max(18,Math.floor(Math.max(320,t)/8)),i=n.split(/\r?\n/).length,a=Math.ceil(n.length/r);return Math.max(1,i,a)<=1?28:ek(n,t,34)}(String(n.raw??n.content??``),i);case`list`:return function(e,t){let n=Array.isArray(e.items)?e.items:[];if(!n.length)return 48;let r=Math.max(48,30*n.length+12),i=12;for(let e of n)i+=ik(nk(e)||String(e.raw??``),t);let a=Math.max(0,i-r);if(n.length>20){let e=Math.round(2.4*n.length);return Math.round(r+Math.max(e,Math.min(a,3*n.length)))}if(a<=0)return r;let o=n.length>8?8*n.length:a;return Math.round(r+Math.min(a,o))}(n,i);case`list_item`:return ek(String(n.raw??n.content??``),i,34);case`blockquote`:return ek(String(n.raw??n.content??``),i,56);case`table`:return function(e,t){let n=[...e.header?[e.header]:[],...Array.isArray(e.rows)?e.rows:[]];if(!n.length){let t=Array.isArray(e.children)?e.children.length:3;return Math.max(120,38*t+48)}return Math.max(120,Math.round(4+n.reduce((e,n)=>e+function(e,t){let n=Math.max(1,e.length),r=Math.max(80,(t-32)/n),i=Math.max(10,Math.floor(r/8)),a=Math.max(1,...e.map(e=>{let t=nk(e)||String(e?.raw??``);return Math.ceil(t.length/i)||1}));return 54+34*Math.max(0,a-1)+(n<=3&&e.some(rk)?14:0)}(function(e){var t;return Array.isArray(e?.cells)&&(t=e.cells)!=null?t:[]}(n),t),0)))}(n,i);case`code_block`:{let e=String(n.language??``).trim().toLowerCase(),t=String(n.code??n.raw??``);return e===`mermaid`?xw(vw(t)):e===`infographic`?Cw(yw(t)):ek(t,i,96,20)}case`math_block`:return 72;case`image`:return 220;case`admonition`:case`vmr_container`:case`html_block`:return function(e,t){let n=e.match(/^\s*<details\b([^>]*)>/i);return n&&!/(?:^|\s)open(?:\s|=|$)/i.test(n[1]??``)?ek((e.match(/<summary\b[^>]*>([\s\S]*?)<\/summary>/i)?.[1])?.replace(/<[^>]*>/g,``).trim()||`Details`,t,28,28):ek(e,t,96)}(String(n.raw??n.content??``),i);case`thematic_break`:return 24;default:return ek(String(n.raw??n.content??``),i,40)}}function ok(e,t,n){return Math.min(Math.max(e,t),n)}var sk=new WeakMap;function ck(e,t,n){let r=e;if(n.has(r))return n.get(r);let i=String(e.type).trim().toLowerCase();if(t[i])return n.set(r,!0),!0;if(i===`code_block`){let i=String(e.language??``).trim().toLowerCase();if(i&&WO(t,i))return n.set(r,!0),!0}let a=e;n.set(r,!1);let o=Object.values(a).some(e=>Array.isArray(e)?e.some(e=>wk(e)&&ck(e,t,n)):wk(e)&&ck(e,t,n));return n.set(r,o),o}var lk=[`total`,`cacheHits`,`appendHits`,`tailHits`,`fullParses`,`chunkedParses`],uk=[`tokenCloneMs`,`processTokensInputTokens`,`processTokensReusedTopLevelNodes`,`processTokensMs`,`safeMarkdownMs`,`tokenizeMs`,`htmlBlockPassesMs`,`parseMarkdownToStructureTotalMs`],dk=new Set([`attrs`,`data`,`items`,`header`,`payload`,`props`,`rows`,`cells`,`term`,`definition`,`sourceMap`]),fk=[`raw`,`content`,`code`,`originalCode`,`updatedCode`],pk=new WeakMap,mk=new WeakMap,hk=1;function gk(){return typeof performance<`u`?performance.now():Date.now()}function _k(e){let t=e.stream;return t&&typeof t.stats==`function`?t.stats():null}function vk(e){if(typeof e!=`object`&&typeof e!=`function`||e===null)return``;let t=e,n=pk.get(t);return n||(n=hk++,pk.set(t,n)),String(n)}function yk(e,t,n,r={}){let i=!1!==r.includeFinal,a={md:vk(t),customMarkdownIt:vk(n),requireClosingStrong:!0===e.requireClosingStrong,customHtmlTags:e.customHtmlTags??[],includeSourceMap:!0===e.includeSourceMap,streamParse:e.streamParse??`auto`,validateLink:vk(e.validateLink),preTransformTokens:vk(e.preTransformTokens),postTransformTokens:vk(e.postTransformTokens),postTransformNodes:vk(e.postTransformNodes)};return i&&(a.final=!0===e.final),JSON.stringify(a)}function bk(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===10;)--t;let n=e.lastIndexOf(`
|
|
196
|
+
`,t-1)+1;return e.slice(n,t).trim()}function xk(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Sk(e){let t=String(e??``);return`${t.length}:${xk(t)}`}function Ck(e,t=new WeakMap,n=0){if(e==null||typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`string`)return`s:${function(e){return e.length<=8192?Sk(e):`${e.length}:${xk(e.slice(0,8192))}:truncated`}(e)}`;if(typeof e==`function`)return`fn:${vk(e)}`;if(typeof e!=`object`)return typeof e;let r=e,i=t.get(r);if(i)return`cycle:${i}`;if(n>=6)return`object:${vk(r)}`;let a=vk(r);if(t.set(r,a),Array.isArray(e)){let r=e.slice(0,200);return`a:${e.length}:${r.map(e=>Ck(e,t,n+1)).join(`,`)}`}if(typeof e==`object`){let r=e,i=Object.keys(r).sort(),a=i.slice(0,80);return`o:${i.length}:${a.map(e=>`${e}:${Ck(r[e],t,n+1)}`).join(`;`)}`}return typeof e}function wk(e){return typeof e==`object`&&!!e&&typeof e.type==`string`&&typeof e.raw==`string`}function Tk(e,t=new WeakMap,n=0){return Array.isArray(e)?`a:${e.length}:${e.slice(0,200).map(e=>wk(e)?Ok(e,t,n+1):Tk(e,t,n+1)).join(`,`)}`:wk(e)?Ok(e,t,n):Ck(e,t,n)}function Ek(e,t,n){return Object.keys(e).sort().filter(e=>e!==`children`&&!fk.includes(e)).map(r=>{let i=e[r];return typeof i==`string`?`${r}=s:${Sk(i)}`:typeof i==`number`||typeof i==`boolean`||i==null?`${r}=${String(i)}`:typeof i==`function`?`${r}=fn:${vk(i)}`:dk.has(r)&&(Array.isArray(i)||typeof i==`object`)?`${r}=${Tk(i,t,n+1)}`:i&&typeof i==`object`?`${r}=object:${vk(i)}`:``}).filter(Boolean).join(`;`)}function Dk(e){return fk.map(t=>{let n=e[t];return typeof n==`string`?`${t}=s:${Sk(n)}`:``}).filter(Boolean).join(`;`)}function Ok(e,t=new WeakMap,n=0){let r=mk.get(e);if(r)return r;let i=e,a=t.get(i);if(a)return`node-cycle:${a}`;if(n>=6)return`node:${e.type}:${vk(i)}`;let o=vk(i);t.set(i,o);let s=function(e,t,n){let r=e,i=Array.isArray(r.children)?r.children:[],a=i.length?i.slice(0,200).map(e=>Ok(e,t,n+1)).join(`|`):``;return[e.type,Dk(r),Ek(r,t,n),i.length,a].join(`:`)}(e,t,n);return mk.set(i,s),s}function kk(e,t){return Ok(e)===Ok(t)}function Ak(e,t,n){let r=gk(),i=t===`stabilizeSignatureMs`?`stabilizeSignatureCallCount`:`primeSignatureCallCount`;try{return n()}finally{e[t]+=gk()-r,e[i]+=1,e.signatureMs=e.stabilizeSignatureMs+e.primeSignatureMs,e.signatureCallCount=e.stabilizeSignatureCallCount+e.primeSignatureCallCount}}function jk(e,t,n){return Ak(t,n,()=>Ok(e))}function Mk(e,t,n){return jk(e,n,`stabilizeSignatureMs`)===jk(t,n,`stabilizeSignatureMs`)}function Nk(e){return{reusedNodeCount:0,dirtyStartIndex:e>0?0:-1,stablePrefixNodeCount:0,dirtyTailNodeCount:e}}function Pk(e,t,n){return e<0?0:Math.max(t.length,n.length)-e}function Fk(e){return!0===e.__markstreamHasCustomParserExtensions||function(e){return Number(e.__markstreamRegisteredPluginCount??0)>0}(e)}function Ik(e,t){return e.length===t.length&&e===t}function Lk(e,t,n=0){if(n>=4)return null;if(e.type!==t.type)return!1;let r=e,i=t,a=Object.keys(r).filter(e=>e!==`type`&&e!==`children`).sort(),o=Object.keys(i).filter(e=>e!==`type`&&e!==`children`).sort();if(a.length!==o.length)return!1;for(let e=0;e<a.length;e++){let t=a[e];if(t!==o[e])return!1;let n=r[t],s=i[t];if(typeof n!=typeof s)return!1;if(typeof n!=`string`){if(typeof n!=`number`&&typeof n!=`boolean`&&n!=null)return null;if(!Object.is(n,s))return!1}else if(typeof s!=`string`||!Ik(n,s))return!1}let s=Object.prototype.hasOwnProperty.call(r,`children`);if(s!==Object.prototype.hasOwnProperty.call(i,`children`))return!1;if(!s)return!0;let c=r.children,l=i.children;if(!Array.isArray(c)||!Array.isArray(l))return null;if(c.length!==l.length)return!1;for(let e=0;e<c.length;e++){let t=c[e],r=l[e];if(!wk(t)||!wk(r))return null;let i=Lk(t,r,n+1);if(i==null)return null;if(!i)return!1}return!0}function Rk(e,t,n=0){if(e===t||e.type!==t.type||n>=6)return;let r=e,i=t;for(let e of[`children`,`items`,`rows`,`cells`]){let t=r[e],a=i[e];if(!Array.isArray(t)||!Array.isArray(a))continue;let o=Math.min(t.length,a.length);for(let e=0;e<o;e++){let r=t[e],i=a[e];r!==i&&wk(r)&&wk(i)&&(!0===Lk(r,i)?a[e]=r:Rk(r,i,n+1))}}}function zk(e,t){return!e||!t?!1:e===t?!0:e.type===t.type?Lk(e,t)??kk(e,t):!1}function Bk(e,t,n){if(!e||!t)return!1;if(e===t)return!0;if(e.type!==t.type)return!1;let r=null;return Ak(n,`stabilizeSignatureMs`,()=>{r=Lk(e,t)}),r??Mk(e,t,n)}function Vk(e,t){let n={};for(let r of lk){let i=e[r],a=t?.[r];typeof i==`number`&&(n[r]=i-(typeof a==`number`?a:0))}return n}function Hk(t,n){let r=bC(n.instanceMsgId),i=new Map,a=n.smoothStreamingEnabled??O(()=>!1),o=I(n.renderContent.value),s=[],c=``,l=``,u=``,d=!1,p=``,m=new WeakMap,h=function(){let e=``,t=0,n=!1,r=!1,i=!1,a=!1;function o(){e=``,t=0,n=!1,r=!1,i=!1,a=!1}function s(e){let o=!1;for(let s=0;s<e.length;s++){let c=e.charCodeAt(s);if(c===10||c===13){let e=c===10&&a;a=c===13,n=!1,e||(i||(r=!1,t=0),i=!1);continue}a=!1;let l=c===9||c===32;if(l||(i=!0,r&&(o=!0)),t){if(t!==1)l||(c===58?(o=!0,r=!0):t=+(c===91));else{if(n){n=!1;continue}if(c===92){n=!0;continue}c===93&&(t=2)}}else c===91&&(t=1)}return o}return(t,n)=>{if(!t||!n.startsWith(t)||n.length<=t.length)return o(),[!0,0];let r=0;e!==t&&(o(),s(t),r=t.length);let i=n.slice(t.length),a=s(i);return e=n,[a,r+i.length]}}(),g,_=0,v=0,y=gk(),b=-1,x=0;function S(e){b=Number.isInteger(e)?e:0,x+=1}function C(){g&&=(clearTimeout(g),void 0)}function w(){C();let e=n.renderContent.value;o.value!==e&&(o.value=e),y=gk()}P([n.renderContent,n.effectiveFinal,a],([e,n,r])=>{o.value!==e&&(!r||n||function(e,t){if(!e&&t||t.length<=80||t.length<e.length||!t.startsWith(e))return!0;let n=t.slice(e.length);return!(!n||!function(e){let t=function(e){return e.includes(`|`)?e.replace(/^\|/,``).replace(/\|$/,``).split(`|`):[]}(e);return t.length>=2&&t.every(e=>{let t=e.trim();return t.length>=1&&t.replace(/^:/,``).replace(/:$/,``).split(``).every(e=>e===`-`)})}(bk(t))&&(r=t,i=bk(r),!(/^={3,}$/.test(i)||/^-{3,}$/.test(i)||n.includes(`
|
|
197
|
+
|
|
198
|
+
`)||/(?:^|\n)(?:#{1,6}\s|[-+*]\s+|\d+[.)]\s+|>\s*|`{3,}|~{3,})/.test(n))));var r,i}(o.value,e)?w():function(){if(v+=1,g)return;let e=Math.max(0,function(e){let t=e.parseCoalesceMs;return typeof t==`number`&&Number.isFinite(t)&&t>=0?t:!0===e.fade?0:80}(t)-(gk()-y));e<=0?w():g=setTimeout(w,e)}())},{flush:`sync`,immediate:!0}),e(C);let T=O(()=>{var e;return ef(t.customHtmlTags,t.parseOptions?.customHtmlTags,(e=n.customComponentsMap?.value??{},Object.entries(e).map(([e,t])=>{let n=Qd(e);return t==null||!n||bT(n)||Sd.has(n)||Td.has(n)?``:n}).filter(Boolean)))}),E=O(()=>{let{key:e,tags:t}=tf(T.value);if(!e)return r;let a=i.get(e);if(a)return a;let o=bC(n.instanceMsgId,{customHtmlTags:t});return i.set(e,o),o}),D=O(()=>{let e=E.value;if(!t.customMarkdownIt)return e;let n=t.customMarkdownIt(e);return e.__markstreamHasCustomParserExtensions=!0,n.__markstreamHasCustomParserExtensions=!0,n}),k=O(()=>{var e;let r=t.parseOptions??{},i=n.effectiveFinal.value,a=T.value,o=i!=null,s=a.length>0;return o||s||r.streamParse==null?Z(Z(Q(Z({},r),{streamParse:(e=r.streamParse)==null||e}),o?{final:i}:{}),s?{customHtmlTags:a}:{}):r}),A=O(()=>new Set(T.value.map(e=>String(e).trim().toLowerCase()).filter(Boolean))),j=O(()=>yk(k.value,D.value,t.customMarkdownIt,{includeFinal:!0})),M=O(()=>yk(k.value,D.value,t.customMarkdownIt,{includeFinal:!1}));return P([j,M],([e,t],[n,r])=>{n&&(e===n&&t===r||(w(),t!==r&&(s=[],u=``)))},{flush:`sync`}),{effectiveCustomHtmlTags:T,effectiveCustomHtmlTagsSet:A,mdBase:E,mdInstance:D,mergedParseOptions:k,getParsedNodesDirtyStartIndex:()=>b,getParsedNodesRevision:()=>x,parsedNodes:O(()=>{if(t.nodes?.length)return s=[],u=``,S(0),f(t.nodes.slice());let e=o.value;if(!e)return s=[],u=``,S(-1),[];let r=n.debugPerformanceEnabled.value,i=r?gk():0,a=D.value,g=j.value,y=M.value;c&&g!==c&&y!==l&&function(e){var t,n;(n=(t=e.stream)?.reset)==null||n.call(t)}(a),l&&y!==l&&(s=[],u=``);let x=n.customComponentsMap?.value??{},C=function(e){let t=e,n=sk.get(t);if(n!==void 0)return n;let r=function(e){return JSON.stringify(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,vk(t)]))}(e);return sk.set(t,r),r}(x);p&&C!==p&&(s=[],u=``,m=new WeakMap);let w=Object.keys(x).length>0,T=typeof k.value.postTransformNodes==`function`;T!==d&&(s=[],u=``);let E=!T&&s.length>0&&e.startsWith(u)&&y===l,O=r?_k(a):null,A=r?{}:void 0,N=Fk(a),ee=w&&s.some(e=>ck(e,x,m)),te=!N&&!T&&(!w||s.length>0&&!ee),P=uS(e,a,Z(Q(Z({},k.value),{reuseStableTopLevelNodes:te}),A?{parserMetrics:A}:{})),ne=r?gk():0;if(E&&!N&&!w&&!k.value.preTransformTokens&&!k.value.postTransformTokens){let e=Math.min(s.length,P.length);for(let t=0;t<e;t++)Rk(s[t],P[t])}let F=r?{signatureMs:0,stabilizeSignatureMs:0,primeSignatureMs:0,signatureCallCount:0,stabilizeSignatureCallCount:0,primeSignatureCallCount:0}:void 0,I,L=r?Nk(P.length):void 0,re=0,R=0,z=0;if(E){let n=r?gk():0,[i,o]=w?[0,0]:function(e){let[t,n]=e.scanGlobalReferenceAppend(e.previousContent,e.content),r=e.parseOptions;return[e.previousDirtyStartIndex>0&&!0!==r.final&&!e.customMarkdownIt&&!Fk(e.md)&&!t&&typeof r.preTransformTokens!=`function`&&typeof r.postTransformTokens!=`function`&&typeof r.postTransformNodes!=`function`&&(r.customHtmlTags?.length??0)===0?e.previousDirtyStartIndex:0,n]}({content:e,previousContent:u,previousDirtyStartIndex:b,parseOptions:k.value,customMarkdownIt:t.customMarkdownIt,md:a,scanGlobalReferenceAppend:h});z=o;let c=i<=0,l=w?e=>!ck(e,x,m):void 0;if(F){let e=function(e,t,n,r={}){if(!t.length)return{nodes:e,metrics:Nk(e.length)};let i=!1!==r.reuseDirtyTail,a=function(e,t,n,r){let i=Math.min(e.length,t.length);for(let a=Math.min(i,Math.max(0,r.scanStartIndex??0));a<i;a++){let i=t[a],o=e[a];if(r.canReuseNode&&(!r.canReuseNode(i)||!r.canReuseNode(o))||!Bk(i,o,n))return a}return e.length===t.length?-1:i}(e,t,n,r);if(a<0)return{nodes:t,metrics:{reusedNodeCount:e.length,dirtyStartIndex:a,stablePrefixNodeCount:e.length,dirtyTailNodeCount:0}};let o=e.slice(),s=a;for(let e=0;e<a;e++)o[e]=t[e];if(i)for(let i=a;i<e.length;i++){let a=t[i],c=e[i];a&&(!r.canReuseNode||r.canReuseNode(a)&&r.canReuseNode(c))&&Mk(a,c,n)&&(o[i]=a,s+=1)}return{nodes:o,metrics:{reusedNodeCount:s,dirtyStartIndex:a,stablePrefixNodeCount:a,dirtyTailNodeCount:Pk(a,e,t)}}}(P,s,F,{canReuseNode:l,reuseDirtyTail:c,scanStartIndex:i});I=e.nodes,L=e.metrics}else{let e=function(e,t,n={}){if(!t.length)return{nodes:e,metrics:Nk(e.length)};let r=!1!==n.reuseDirtyTail,i=function(e,t,n){let r=Math.min(e.length,t.length);for(let i=Math.min(r,Math.max(0,n.scanStartIndex??0));i<r;i++){let r=t[i],a=e[i];if(n.canReuseNode&&(!n.canReuseNode(r)||!n.canReuseNode(a))||!zk(r,a))return i}return e.length===t.length?-1:r}(e,t,n);if(i<0)return{nodes:t,metrics:{reusedNodeCount:e.length,dirtyStartIndex:i,stablePrefixNodeCount:e.length,dirtyTailNodeCount:0}};let a=e.slice(),o=i;for(let e=0;e<i;e++)a[e]=t[e];if(r)for(let r=i;r<e.length;r++){let i=t[r],s=e[r];i&&(!n.canReuseNode||n.canReuseNode(i)&&n.canReuseNode(s))&&kk(i,s)&&(a[r]=i,o+=1)}return{nodes:a,metrics:{reusedNodeCount:o,dirtyStartIndex:i,stablePrefixNodeCount:i,dirtyTailNodeCount:Pk(i,e,t)}}}(P,s,{canReuseNode:l,reuseDirtyTail:c,scanStartIndex:i});I=e.nodes,L=e.metrics}re=r?gk()-n:0,R=c?L?.dirtyStartIndex==null||L.dirtyStartIndex<0?I.length:L.dirtyStartIndex:I.length}else I=P,L=Nk(I.length);if(!0!==n.effectiveFinal.value&&(F?function(e,t,n=0){for(let r=Math.max(0,n);r<e.length;r++)Ak(t,`primeSignatureMs`,()=>Ok(e[r]))}(I,F,R):function(e,t=0){for(let n=Math.max(0,t);n<e.length;n++)Ok(e[n])}(I,R)),w)for(let e=L?.dirtyStartIndex!=null&&L.dirtyStartIndex>=0?L.dirtyStartIndex:I.length;e<I.length;e++)ck(I[e],x,m);let B=r?gk()-ne:0;_+=1,u=e,c=g,l=y,d=T,p=C,s=I;let ie=L?.dirtyStartIndex??0;if(ie>0&&I[I.length-1]?.type===`footnote`&&(ie=Math.min(ie,I.findIndex(e=>e.type===`footnote`))),S(ie),r){let t=_k(a),r=typeof t?.total==`number`&&t.total>(O?.total??0);n.logPerf(r?`parse(stream)`:`parse(sync)`,Z(Z(Z({rendererId:n.instanceMsgId,ms:Math.round(gk()-i),nodes:I.length,contentLength:e.length,parseCommitCount:_,parseCoalescedCount:v,nodeReuseMs:B,referenceDefinitionScanChars:z,signatureMs:F?.signatureMs??0,stabilizeSignatureMs:F?.stabilizeSignatureMs??0,primeSignatureMs:F?.primeSignatureMs??0,signatureCallCount:F?.signatureCallCount??0,stabilizeSignatureCallCount:F?.stabilizeSignatureCallCount??0,primeSignatureCallCount:F?.primeSignatureCallCount??0,stabilizeMs:re},L??{}),A?Object.fromEntries(uk.map(e=>[e,A[e]??0])):{}),t?{streamMode:t.lastMode,streamDelta:Vk(t,O),streamStats:t}:{}))}return f(I)})}}function Uk(e){let{isClient:t}=e,n=I(new Set),r=new Map,i=new Map,a=new Map;function o(e){if(!t)return;let n=a.get(e);n!=null&&(window.clearTimeout(n),a.delete(e))}function s(){if(t)for(let e of a.values())window.clearTimeout(e);a.clear()}function c(){n.value=new Set}return{visibleNodeIndices:n,nodeVisibilityHandles:r,nodeVisibilityWatchStops:i,nodeVisibilityFallbackTimers:a,clearVisibilityFallback:o,clearAllVisibilityFallbacks:s,markNodeVisible:function(t,r=!0){var i;r&&o(t),function(t,r){if((a=(i=e.shouldTrackVisibleNodeIndices)?.call(e))!=null&&!a)return;var i,a;let o=n.value,s=o.has(t);if(r){if(s)return;let e=new Set(o);e.add(t),n.value=e;return}if(!s)return;let c=new Set(o);c.delete(t),n.value=c}(t,r),r&&((i=e.onNodeMarkedVisible)==null||i.call(e,t))},resetNodeVisibleState:c,cleanupNodeVisibility:function(t){var s;if(e.shouldCleanupNodeVisibility&&!e.shouldCleanupNodeVisibility())return;for(let[e,n]of i.entries())e<t||(n(),i.delete(e));for(let[n,i]of r.entries())n<t||(i.destroy(),r.delete(n),o(n),(s=e.onNodeVisibilityCleaned)==null||s.call(e,n));for(let e of Array.from(a.keys()))e<t||o(e);if(!n.value.size)return;let c=new Set;for(let e of n.value)e<t&&c.add(e);n.value=c},destroyNodeVisibilityState:function(){c();for(let e of i.values())e();i.clear();for(let e of r.values())e.destroy();r.clear(),s()}}}function Wk(e){let{isClient:t,virtualizationEnabled:n,listenerEnabled:r,scrollRootElement:i,resolveScrollContainer:a,scheduleFocusSync:o,onScroll:s}=e,c=null,l=null,u=!1,d=null,f=e.requestFrame===void 0?typeof requestAnimationFrame==`function`?requestAnimationFrame:null:e.requestFrame,p=e.cancelFrame===void 0?typeof cancelAnimationFrame==`function`?cancelAnimationFrame:null:e.cancelFrame;function m(){d!=null&&(p?.(d),d=null),u=!1,c&&=(c(),null),l=null,i.value=null}function h(t){let n=e.getScrollTop?e.getScrollTop(t):t.scrollTop;return Math.max(0,Number.isFinite(n)?Math.abs(n):0)}return{cleanupScrollListener:m,setupScrollListener:function(){if(!t)return;if(!((e=r?.value)??n.value))return void m();var e;let p=a();if(!p)return void m();if(i.value===p&&c)return;m(),l=h(p);let g=()=>{s?.(),n.value&&(()=>{if(u)return;u=!0;let e=()=>{if(u=!1,d=null,n.value){let e=function(e){let t=h(e),n=l;l=t;let r=Math.max(480,.75*(e.clientHeight||0));return n==null?t>r?{immediate:!0}:void 0:Math.abs(t-n)>r?{immediate:!0}:void 0}(p);e?o(e):o()}};f?d=f(e):e()})()};p.addEventListener(`scroll`,g,{passive:!0}),i.value=p,c=()=>{p.removeEventListener(`scroll`,g)}}}}function Gk(t={}){let n=I(``),r=I(``),i=I(!1),a=It(t),o=()=>{let e=a.getSnapshot();n.value=e.source,r.value=e.visible,i.value=e.done},s=a.subscribe(o);o();let c=O(()=>Math.max(0,n.value.length-r.value.length)),l=O(()=>c.value===0),u=O(()=>i.value&&l.value);return x()&&e(()=>{s(),a.destroy()}),{source:n,visible:r,done:i,final:u,caughtUp:l,pendingChars:c,enqueue:e=>a.enqueue(e),finish:e=>a.finish(e),flush:e=>a.flush(e),reset:(e,t)=>a.reset(e,t),pause:()=>a.pause(),resume:()=>a.resume()}}var Kk=/auto|scroll|overlay/i;function qk(e){if(!e)return!1;let t=(e.overflowY||``).toLowerCase(),n=(e.overflow||``).toLowerCase();return Kk.test(t)||Kk.test(n)}function Jk(e){let t=Math.ceil(e.scrollHeight)>Math.ceil(e.clientHeight)+1,n=Math.ceil(e.scrollWidth)>Math.ceil(e.clientWidth)+1;return t||n}var Yk=h({name:`D2BlockNodeLoading`,props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){let t=O(()=>ww(gw(e.estimatedPreviewHeightPx)??Ow(String(e.node.code??``))));return()=>d(`div`,{class:`d2-block-container rounded-lg border overflow-hidden`,style:{margin:`var(--ms-flow-diagram-y) 0`,background:`var(--diagram-bg)`,borderColor:`var(--diagram-border)`,color:`hsl(var(--ms-foreground))`,boxShadow:`var(--ms-shadow-subtle)`},"data-markstream-d2":`1`,"data-markstream-mode":`pending`},[e.showHeader?d(`div`,{class:`d2-block-header flex justify-between items-center border-b`,style:{padding:`var(--ms-inset-panel-y) var(--ms-inset-panel-x)`,background:`var(--diagram-header-bg)`,borderColor:`var(--diagram-border)`}},[d(`div`,{class:`flex items-center gap-x-2`},[d(`span`,{class:`d2-label font-medium font-mono`,style:{fontSize:`var(--ms-text-label)`,color:`var(--code-action-fg)`}},`D2`)]),d(`div`,{class:`d2-header-actions flex items-center`,"aria-hidden":`true`})]):null,d(`div`,{class:`d2-block-body`,style:{minHeight:`${t.value}px`}})])}}),Xk={class:`m-0 p-0`},Zk=[`data-probe`],Qk=$(h(Q(Z({},{name:`HeightEstimationProbes`}),{__name:`HeightEstimationProbes`,props:{width:{},flowRoot:{type:Boolean},paragraphNode:{},listItemNode:{},listNode:{},headingNodes:{},setParagraphWrapper:{type:Function},setListItemWrapper:{type:Function},setListWrapper:{type:Function},setHeadingWrapper:{type:Function}},setup(e){let t=e;function n(e){return t.headingNodes?.[e]??null}return(t,i)=>(p(),R(`div`,{class:`height-estimation-probes`,style:F({width:`${e.width}px`}),"aria-hidden":`true`},[D(`div`,{ref:t=>e.setParagraphWrapper(t),class:C([`node-content`,{"node-content-flow-root":e.flowRoot}]),"data-probe":`paragraph`},[r(k(sO),{node:e.paragraphNode,"index-key":`probe-paragraph`},null,8,[`node`])],2),D(`div`,{ref:t=>e.setListItemWrapper(t),class:C([`node-content`,{"node-content-flow-root":e.flowRoot}]),"data-probe":`list-item`},[D(`ul`,Xk,[r(k($D),{node:e.listItemNode,"index-key":`probe-list-item`},null,8,[`node`])])],2),D(`div`,{ref:t=>e.setListWrapper(t),class:C([`node-content`,{"node-content-flow-root":e.flowRoot}]),"data-probe":`list`},[r(k(eO),{node:e.listNode,"index-key":`probe-list`},null,8,[`node`])],2),(p(),R(E,null,_(6,t=>D(`div`,{key:`probe-heading-${t}`,ref_for:!0,ref:n=>e.setHeadingWrapper(t,n),class:C([`node-content`,{"node-content-flow-root":e.flowRoot}]),"data-probe":`heading-${t}`},[r(k(JD),{node:n(t),"index-key":`probe-heading-${t}`},null,8,[`node`,`index-key`])],10,Zk)),64))],4))}})),[[`__scopeId`,`data-v-3e0766e2`]]),$k=h({name:`InfographicBlockNodeLoading`,props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){let t=O(()=>Cw(gw(e.estimatedPreviewHeightPx)??yw(String(e.node.code??``))));return()=>d(`div`,{class:`infographic-block-container rounded-lg border overflow-hidden`,style:{margin:`var(--ms-flow-diagram-y) 0`,background:`var(--diagram-bg)`,borderColor:`var(--diagram-border)`,color:`hsl(var(--ms-foreground))`},"data-markstream-infographic":`1`,"data-markstream-mode":`pending`},[e.showHeader?d(`div`,{class:`infographic-block-header flex justify-between items-center border-b`,style:{padding:`var(--ms-inset-panel-y) var(--ms-inset-panel-x)`,background:`var(--diagram-header-bg)`,borderColor:`var(--diagram-border)`,minHeight:`calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding) + var(--ms-inset-panel-y) + var(--ms-inset-panel-y) + 1px)`}},[d(`div`,{class:`flex items-center gap-x-2 overflow-hidden`},[d(`span`,{class:`icon-slot action-icon shrink-0`,style:{display:`inline-flex`,width:`var(--ms-action-btn-icon)`,height:`var(--ms-action-btn-icon)`}}),d(`span`,{class:`infographic-label font-medium font-mono truncate`,style:{fontSize:`var(--ms-text-label)`,color:`hsl(var(--ms-muted-foreground))`}},`Infographic`)]),d(`div`,{class:`infographic-header-actions flex items-center opacity-0 pointer-events-none`,style:{gap:`var(--ms-gap-header-actions)`},"aria-hidden":`true`},Array.from({length:4},()=>d(`span`,{class:`infographic-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded`,style:{width:`calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))`,height:`calc(var(--ms-action-btn-icon) + var(--ms-action-btn-padding) + var(--ms-action-btn-padding))`}})))]):null,d(`div`,{class:`infographic-preview relative overflow-hidden block`,style:{height:`${t.value}px`,minHeight:`var(--ms-size-diagram-min-height)`,background:`var(--diagram-bg)`}},[d(`pre`,{class:`infographic-pending-source text-sm font-mono whitespace-pre-wrap`,style:{position:`absolute`,inset:`0`,zIndex:`1`,margin:`0`,padding:`var(--ms-inset-panel-body)`,overflow:`auto`,textAlign:`left`}},String(e.node.code??``)),d(`div`,{class:`absolute inset-0`},[d(`div`,{class:`w-full text-center flex items-center justify-center min-h-full`})])])])}}),eA=h({name:`MermaidBlockNodeLoading`,props:{node:{type:Object,required:!0},showHeader:{type:Boolean,default:!0},estimatedPreviewHeightPx:{type:Number,default:void 0}},setup(e){let t=O(()=>xw(gw(e.estimatedPreviewHeightPx)??vw(String(e.node.code??``))));return()=>d(`div`,{class:`mermaid-block-container rounded-lg border overflow-hidden`,style:{margin:`var(--ms-flow-diagram-y) 0`,borderColor:`var(--diagram-border)`},"data-markstream-mermaid":`1`,"data-markstream-mode":`pending`},[e.showHeader?d(`div`,{class:`mermaid-block-header flex justify-between items-center border-b px-[var(--ms-inset-panel-x)] py-[var(--ms-inset-panel-y)]`,style:{background:`var(--diagram-header-bg)`,borderColor:`var(--diagram-border)`}},[d(`div`,{class:`flex items-center gap-x-2 overflow-hidden`},[d(`span`,{class:`mermaid-label-text text-[length:var(--ms-text-label)] font-medium font-mono truncate`,style:{color:`var(--code-action-fg)`}},`Mermaid`)]),d(`div`,{class:`mermaid-header-actions flex items-center gap-[var(--ms-gap-header-actions)] opacity-0 pointer-events-none`,"aria-hidden":`true`},Array.from({length:4},()=>d(`span`,{class:`mermaid-action-btn inline-flex items-center justify-center p-[var(--ms-action-btn-padding)] rounded`},[d(`span`,{class:`action-icon block`})])))]):null,d(`div`,{class:`mermaid-preview-area relative overflow-hidden block`,style:{height:`${t.value}px`,minHeight:`var(--ms-size-diagram-min-height)`,background:`var(--diagram-bg)`}},[d(`pre`,{class:`mermaid-source-code text-sm font-mono whitespace-pre-wrap`,style:{position:`absolute`,inset:`0`,margin:`0`,padding:`var(--ms-inset-panel-body)`,overflow:`auto`,textAlign:`left`}},String(e.node.code??``)),d(`div`,{class:`_mermaid w-full text-center flex items-center justify-center min-h-full`,style:{fontFamily:`inherit`,contentVisibility:`auto`,contain:`content`,containIntrinsicSize:`var(--ms-size-diagram-min-height) 240px`}})])])}}),tA=h({name:`NodeRendererContent`,props:[`item`,`sourceNodes`,`fade`,`nestedRendererProps`],setup(e){let t=j(`markstreamTextFinal`,void 0),n=!0===t?.value;return P(()=>t?.value,e=>{n=!0===e},{flush:`sync`}),()=>d(N,{name:`fade`,css:!1!==e.fade&&!n,appear:!1!==e.fade&&!n},{default:()=>{let t=e.item;return t.rendersCustomNode?d(t.component,Z({key:0},t.customNodeProps),{default:()=>t.hasSlotChildren?d(sA,Q(Z({key:0},e.nestedRendererProps),{nodes:t.node.children,indexKey:t.indexKey,batchRendering:!1,deferNodesUntilVisible:!1,renderAsFragment:!0})):t.slotContent?d(sA,Q(Z({key:1},e.nestedRendererProps),{content:t.slotContent,final:!t.node.loading,indexKey:`${t.indexKey}-content`,smoothStreaming:!1,batchRendering:!1,deferNodesUntilVisible:!1,renderAsFragment:!0})):L(`v-if`,!0)}):d(t.component,Z({key:1},t.nodeProps))}})}}),nA={docs:{showTooltips:!0,fade:!0,batchRendering:!0,initialRenderBatchSize:40,renderBatchSize:80,renderBatchDelay:16,renderBatchBudgetMs:6,renderBatchIdleTimeoutMs:120,deferNodesUntilVisible:!0,maxLiveNodes:220,liveNodeBuffer:60,nodeVirtual:`auto`},chat:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:`auto`},minimal:{showTooltips:!1,fade:!1,batchRendering:!0,initialRenderBatchSize:32,renderBatchSize:48,renderBatchDelay:6,renderBatchBudgetMs:8,renderBatchIdleTimeoutMs:60,deferNodesUntilVisible:!0,maxLiveNodes:0,liveNodeBuffer:0,nodeVirtual:`auto`}};function rA(e){if(e==null)return``;if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)}catch{return String(e)}}var iA=[`data-custom-id`],aA=[`data-node-index`,`data-node-type`],oA=`typewriter-simple-cursor-target`,sA=$(h(Q(Z({},{name:`NodeRenderer`}),{__name:`NodeRenderer`,props:{content:{},nodes:{},final:{type:Boolean},parseOptions:{},customMarkdownIt:{},debugPerformance:{type:Boolean,default:!1},customHtmlTags:{},mode:{},domMode:{},htmlPolicy:{},viewportPriority:{type:Boolean,default:void 0},viewportPriorityOptions:{},codeBlockStream:{type:Boolean,default:!0},codeBlockDarkTheme:{},codeBlockLightTheme:{},renderCodeBlocksAsPre:{type:Boolean,default:void 0},codeBlockMinWidth:{},codeBlockMaxWidth:{},codeBlockOptions:{},codeBlockProps:{},mermaidProps:{},d2Props:{},infographicProps:{},showTooltips:{type:Boolean,default:void 0},themes:{},isDark:{type:Boolean},customId:{},indexKey:{},typewriter:{type:[Boolean,String],default:!1},smoothStreaming:{type:[Boolean,String],default:`auto`},smoothStreamingOptions:{},parseCoalesceMs:{},fade:{type:Boolean,default:void 0},batchRendering:{type:Boolean,default:void 0},initialRenderBatchSize:{},renderBatchSize:{},renderBatchDelay:{},renderBatchBudgetMs:{},renderBatchIdleTimeoutMs:{},deferNodesUntilVisible:{type:Boolean,default:void 0},maxLiveNodes:{},liveNodeBuffer:{},nodeVirtual:{type:[Boolean,String],default:void 0},virtualScroll:{},renderAsFragment:{type:Boolean}},emits:[`copy`,`copy-code`,`handleArtifactClick`,`click`,`mouseover`,`mouseout`,`virtual-state-change`,`height-change`,`render-settled`,`render-final`,`anchor-change`],setup(n,{expose:r,emit:i}){let s=n,d=i;function m(e){if(!(typeof Event<`u`&&e instanceof Event))return typeof e==`string`&&d(`copy-code`,e),void d(`copy`,e)}function h(e){d(`handleArtifactClick`,e)}function y(e){d(`mouseover`,e)}function x(e){d(`mouseout`,e)}let w=a(),D=j(`markstreamNestedRendererProps`,void 0);function M(e){let t=w?.vnode.props;return!!t&&(Object.prototype.hasOwnProperty.call(t,e)||Object.prototype.hasOwnProperty.call(t,String(e).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)))}function N(e){let t=s[e];return M(e)?t:D?.value?.[e]??t}let te=O(()=>{return(e=N(`mode`))===`chat`||e===`minimal`||e===`docs`?e:`docs`;var e}),ie=O(()=>qO(N(`typewriter`))),ae=O(()=>ie.value!==`off`),oe=O(()=>N(`domMode`)===`minimal`?`minimal`:`full`),se=O(()=>!0===N(`renderCodeBlocksAsPre`)),le=O(()=>nA[te.value]),ue=O(()=>N(`showTooltips`)??le.value.showTooltips),de=O(()=>N(`fade`)??le.value.fade),fe=O(()=>N(`batchRendering`)??le.value.batchRendering),pe=O(()=>N(`initialRenderBatchSize`)??le.value.initialRenderBatchSize),me=O(()=>N(`renderBatchSize`)??le.value.renderBatchSize),he=O(()=>N(`renderBatchDelay`)??le.value.renderBatchDelay),ge=O(()=>N(`renderBatchBudgetMs`)??le.value.renderBatchBudgetMs),_e=O(()=>N(`renderBatchIdleTimeoutMs`)??le.value.renderBatchIdleTimeoutMs),ve=O(()=>N(`deferNodesUntilVisible`)??le.value.deferNodesUntilVisible),ye=O(()=>N(`maxLiveNodes`)??le.value.maxLiveNodes),be=O(()=>N(`liveNodeBuffer`)??le.value.liveNodeBuffer),xe=O(()=>N(`nodeVirtual`)??le.value.nodeVirtual),V={get content(){return s.content},get nodes(){return s.nodes},get final(){return s.final},get parseOptions(){return N(`parseOptions`)},get customMarkdownIt(){return N(`customMarkdownIt`)},get debugPerformance(){return s.debugPerformance},get customHtmlTags(){return N(`customHtmlTags`)},get mode(){return N(`mode`)},get domMode(){return oe.value},get htmlPolicy(){return N(`htmlPolicy`)},get viewportPriority(){return N(`viewportPriority`)},get viewportPriorityOptions(){return N(`viewportPriorityOptions`)},get codeBlockStream(){return N(`codeBlockStream`)},get codeBlockDarkTheme(){return N(`codeBlockDarkTheme`)},get codeBlockLightTheme(){return N(`codeBlockLightTheme`)},get codeBlockMinWidth(){return N(`codeBlockMinWidth`)},get codeBlockMaxWidth(){return N(`codeBlockMaxWidth`)},get codeBlockOptions(){return N(`codeBlockOptions`)},get codeBlockProps(){return N(`codeBlockProps`)},get mermaidProps(){return N(`mermaidProps`)},get d2Props(){return N(`d2Props`)},get infographicProps(){return N(`infographicProps`)},get showTooltips(){return ue.value},get themes(){return N(`themes`)},get isDark(){return N(`isDark`)},get customId(){return N(`customId`)},get indexKey(){return s.indexKey},get typewriter(){return N(`typewriter`)},get smoothStreaming(){return s.smoothStreaming},get smoothStreamingOptions(){return N(`smoothStreamingOptions`)},get parseCoalesceMs(){return N(`parseCoalesceMs`)},get fade(){return de.value},get batchRendering(){return fe.value},get initialRenderBatchSize(){return pe.value},get renderBatchSize(){return me.value},get renderBatchDelay(){return he.value},get renderBatchBudgetMs(){return ge.value},get renderBatchIdleTimeoutMs(){return _e.value},get deferNodesUntilVisible(){return ve.value},get maxLiveNodes(){return ye.value},get liveNodeBuffer(){return be.value},get nodeVirtual(){return xe.value},get virtualScroll(){return s.virtualScroll},get renderAsFragment(){return s.renderAsFragment}};function Se(e){d(`height-change`,e)}function Ce(e){d(`virtual-state-change`,e)}function we(e){d(`anchor-change`,e)}let H=I(),Te=I(null),Ee=I(null),De=I(null),Oe=T({1:null,2:null,3:null,4:null,5:null,6:null}),ke=I(!1),Ae=new Map,je=I(0),Me=!1,Ne=I(0),Pe=I({paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}});function Fe(e,t){return typeof e==`string`&&e.trim()||t}function Ie(e){let t=Number(e);return Number.isFinite(t)&&t>0?Math.max(1,Math.trunc(t)):640}let Le=O(()=>{let e=V.viewportPriorityOptions??{},t=Fe(e.rootMargin,DE);return{rootMargin:t,heavyBlockMargin:Fe(e.heavyBlockMargin,t),maxTargets:Ie(e.maxTargets)}}),Re=O(()=>Le.value.rootMargin??DE),U=O(()=>Le.value.maxTargets??640);function ze(){if(!0!==s.virtualScroll?.enabled)return null;let e=s.virtualScroll?.scrollRoot;return Be(typeof e==`function`?e():e)}function Be(e){return e?typeof HTMLElement<`u`&&e instanceof HTMLElement?e:typeof e==`object`&&`value`in e?Be(e.value):typeof e==`object`&&`$el`in e?Be(e.$el):null:null}z(wE,Le);let{isClient:W,renderAsFragment:Ve,debugPerformanceEnabled:He,resolvedShowTooltips:Ue,resolvedHtmlPolicy:We,inheritedSmoothStreaming:Ge,ownsTypewriterCursor:Ke}=function(e){let t=typeof window<`u`,n=l(),r=j(`markstreamHtmlPolicy`,void 0),i=j(`markstreamTypewriterCursor`,void 0),a=j(`markstreamSmoothStreaming`,void 0);return{isClient:t,renderAsFragment:O(()=>!0===e.renderAsFragment),debugPerformanceEnabled:O(()=>!!(e.debugPerformance&&t&&typeof console<`u`)),resolvedShowTooltips:O(()=>{if(typeof e.showTooltips==`boolean`)return e.showTooltips;let t=n.showTooltips??n[`show-tooltips`];return t===``||!0===t||t===`true`||!1!==t&&t!==`false`&&void 0}),resolvedHtmlPolicy:O(()=>e.htmlPolicy??r?.value??`safe`),inheritedSmoothStreaming:a,inheritedTypewriterCursor:i,ownsTypewriterCursor:O(()=>!0!==i?.value)}}(V),{resolveViewportRoot:qe,resolveScrollContainer:Je,isReverseFlexScrollRoot:Ye,getNormalizedScrollTop:Xe,getOffsetTopWithinRoot:Ze}=function(e,t){function n(){return t.scrollRoot?.call(t)??null}function r(t){if(typeof window>`u`)return null;let r=n();if(r)return r;let i=t??e.value;if(!i)return null;let a=i.ownerDocument||document,o=a.scrollingElement||a.documentElement,s=i;for(;s&&s!==a.body&&s!==o;){if(qk(window.getComputedStyle(s))&&Jk(s))return s;s=s.parentElement}return null}function i(e){if(!t.isClient)return!1;try{let t=window.getComputedStyle(e);return!!(t.display||``).toLowerCase().includes(`flex`)&&(t.flexDirection||``).toLowerCase().endsWith(`reverse`)}catch{return!1}}function a(e,t,n){if(n)return o(t);let r=e.scrollTop;if(!i(e))return r;let a=r<0?-r:r;return Math.max(0,(e.scrollHeight??0)-(e.clientHeight??0))-a}function o(e){let t=Number(e.scrollingElement?.scrollTop),n=Number(e.documentElement?.scrollTop??0),r=Number(e.body?.scrollTop??0);return Math.max(0,Number.isFinite(t)?t:0,Number.isFinite(n)?n:0,Number.isFinite(r)?r:0)}return{resolveViewportRoot:r,resolveScrollContainer:function(t){let i=n();if(i)return i;let a=r(t??e.value??null);if(a)return a;let o=t?.ownerDocument??e.value?.ownerDocument??(typeof document<`u`?document:null);return o?.scrollingElement||o?.documentElement||null},isReverseFlexScrollRoot:i,getNormalizedScrollTop:a,getOffsetTopWithinRoot:function(e,t){let n=t.ownerDocument||e.ownerDocument||document;if(function(e,t){return e===t.documentElement||e===t.body||e===t.scrollingElement}(t,n))return e.getBoundingClientRect().top+o(n);let r=t.getBoundingClientRect(),i=e.getBoundingClientRect(),s=a(t,n,!1);return i.top-r.top+s}}}(H,{isClient:W,scrollRoot:ze});z(`markstreamShowTooltips`,Ue),z(`markstreamHtmlPolicy`,We),z(`markstreamTypewriter`,ae),z(`markstreamFade`,O(()=>!1!==V.fade)),z(`markstreamTypewriterCursor`,O(()=>!0)),z(`markstreamTextStreamState`,Ae),z(`markstreamStreamVersion`,je),z(`markstreamParseOptions`,O(()=>V.parseOptions)),z(`markstreamCustomMarkdownIt`,O(()=>V.customMarkdownIt));let{smoothStreamingEnabled:Qe,renderContent:$e,requestedFinal:et,effectiveFinal:tt,scheduleFinalCleanup:nt}=function(t,n){let r=Gk(Q(Z(Z({},St),t.smoothStreamingOptions),{burstInitialContent:!1===t.fade&&!JO(t.typewriter)})),i=!1!==t.smoothStreamingOptions?.flushOnFinish,a=I(!1),s=Ct(Q(Z({},r),{getSnapshot:()=>({source:r.source.value,pendingChars:r.pendingChars.value,caughtUp:r.caughtUp.value})}),{flushOnFinish:i,commit:e=>pT(null,null,function*(){e(),yield A()}),measure:n.measureFinalCommit,onReady:e=>{a.value=e}});e(s.dispose);let c=O(()=>!1!==t.smoothStreaming&&!t.nodes?.length&&(!0===t.smoothStreaming||!n.inheritedSmoothStreaming?.value)&&(!0===t.smoothStreaming||JO(t.typewriter)||(t.maxLiveNodes??0)<=0)),l=I(!n.isClient||!0===t.smoothStreaming);o(()=>{l.value=!0});let u=O(()=>l.value&&c.value),d=O(()=>u.value?r.visible.value:t.content??``),f=O(()=>{let e=t.parseOptions??{};return t.final??e.final}),p=O(()=>{let e=f.value;return u.value&&e!=null?!!e&&a.value&&r.caughtUp.value:e});return P([()=>t.content,()=>t.nodes,u,f],([e,n,r,i])=>{s.update(e??``,!!n?.length,r,i,!1!==t.fade)},{immediate:!0}),{smoothStream:r,smoothStreamingEligible:c,smoothStreamingEnabled:u,renderContent:d,requestedFinal:f,effectiveFinal:p,scheduleFinalCleanup:s.scheduleCleanup}}(V,{isClient:W,inheritedSmoothStreaming:Ge,measureFinalCommit:()=>{var e;(e=H.value)==null||e.offsetHeight}}),rt=!0===et.value,it=j(`markstreamTextFinal`,void 0),at=O(()=>!0===et.value||!0===it?.value);z(`markstreamTextFinal`,at);let ot=j(`markstreamFinalCleanup`,void 0);z(`markstreamFinalCleanup`,ot??nt),P(at,e=>{var t;e&&((t=H.value)==null||t.querySelectorAll(`.fade-enter-from, .fade-enter-active, .fade-enter-to`).forEach(e=>{e.classList.remove(`fade-enter-from`,`fade-enter-active`,`fade-enter-to`)}))},{flush:`post`}),z(`markstreamSmoothStreaming`,Qe);let st=I(!1),ct=I(!1),lt=I(!1),ut=``,dt=!1,ft=null;function pt(){W&&ft!=null&&(window.clearTimeout(ft),ft=null)}function mt(){st.value=!1,pt()}function ht(e,t){if(!He.value)return;let n=function(){if(!He.value)return null;let e=xt(gt),t=xt(_t),n=Math.max(bt,t);if(e<=0&&n<=0)return null;let r={total:e,maxPerFrame:n,byLabel:(i=gt,Object.fromEntries(Array.from(i.entries()).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))))};var i;return gt.clear(),_t.clear(),bt=0,r}();console.info(`[markstream-vue][perf] ${e}`,n?Q(Z({},t),{layoutReads:n}):t)}P([()=>V.indexKey,()=>V.customId],()=>{mt(),ct.value=!1,lt.value=!s.nodes?.length&&!0!==et.value&&!!s.content,ut=$e.value??``,dt=ut.length>0},{flush:`sync`}),P([()=>s.content,()=>s.nodes,et],([e,t,n])=>{!(t!=null&&t.length)&&!0!==n&&e&&(lt.value=!0)},{flush:`sync`,immediate:!0}),P([$e,()=>s.nodes,tt],([e,t,n])=>{let r=e??``;t?.length||!0===n?(mt(),ct.value=!1,ut=r,dt=!0):(r.length>0&&(lt.value=!0),dt?(ut&&r.length>ut.length&&r.startsWith(ut)?(st.value=!0,ct.value=!0,W&&(pt(),ft=window.setTimeout(()=>{var e;ft=null,!0===tt.value||(e=s.nodes)!=null&&e.length||(Ro(),st.value=!1,Vo())},1200))):(r.length<ut.length||!r.startsWith(ut))&&(mt(),ct.value=!1),ut=r):(ut=r,dt=!0))},{flush:`sync`,immediate:!0});let gt=new Map,_t=new Map,yt=!1,bt=0;function xt(e){let t=0;for(let n of e.values())t+=n;return t}function wt(){bt=Math.max(bt,xt(_t)),_t.clear(),yt=!1}function Tt(e){e.maxPerFrame=Math.max(Number(e.maxPerFrame||0),Number(e.currentFrameTotal||0)),e.currentFrameTotal=0,e.frameScheduled=!1}function Et(e){He.value&&(gt.set(e,(gt.get(e)??0)+1),_t.set(e,(_t.get(e)??0)+1),function(e){let t=function(){if(!W||typeof window>`u`)return null;let e=window;if(e.__markstreamLayoutReadPerformance)return e.__markstreamLayoutReadPerformance;let t={total:0,maxPerFrame:0,byLabel:{}};return e.__markstreamLayoutReadPerformance=t,t}();t&&(t.total=Number(t.total||0)+1,t.byLabel[e]=Number(t.byLabel[e]||0)+1,t.currentFrameTotal=Number(t.currentFrameTotal||0)+1,t.frameScheduled||(t.frameScheduled=!0,typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>Tt(t)):typeof queueMicrotask==`function`?queueMicrotask(()=>Tt(t)):setTimeout(()=>Tt(t),0)))}(e),yt||(yt=!0,W&&typeof window<`u`&&typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(wt):typeof queueMicrotask==`function`?queueMicrotask(wt):setTimeout(wt,0)))}function G(e,t){return Et(e),t()}let Dt=V.customId?`renderer-${V.customId}`:`renderer-${Date.now()}-${Math.random().toString(36).slice(2)}`,Ot=function(e){let t=new Map;return{scope:e,cache:t,clear:()=>t.clear()}}(Dt),kt=Dt;z(YO,Ot);let At=wT(()=>V.customId),{effectiveCustomHtmlTagsSet:jt,mdInstance:Mt,mergedParseOptions:Nt,parsedNodes:K,getParsedNodesDirtyStartIndex:Pt,getParsedNodesRevision:Ft}=Hk(V,{instanceMsgId:Dt,renderContent:$e,effectiveFinal:tt,smoothStreamingEnabled:Qe,debugPerformanceEnabled:He,customComponentsMap:At,logPerf:ht});P(K,()=>{st.value||Ot.clear(),je.value+=1,Me&&er(Mi(K.value.length))},{immediate:!0});let It=O(()=>({customId:V.customId,customHtmlTags:Nt.value.customHtmlTags,parseOptions:V.parseOptions,customMarkdownIt:V.customMarkdownIt,htmlPolicy:We.value,viewportPriority:V.viewportPriority,viewportPriorityOptions:Le.value,mode:te.value,domMode:V.domMode,codeBlockStream:V.codeBlockStream,codeBlockDarkTheme:V.codeBlockDarkTheme,codeBlockLightTheme:V.codeBlockLightTheme,renderCodeBlocksAsPre:se.value,codeBlockMinWidth:V.codeBlockMinWidth,codeBlockMaxWidth:V.codeBlockMaxWidth,codeBlockOptions:V.codeBlockOptions,codeBlockProps:V.codeBlockProps,mermaidProps:V.mermaidProps,d2Props:V.d2Props,infographicProps:V.infographicProps,showTooltips:Ue.value,themes:V.themes,isDark:V.isDark,typewriter:ae.value,smoothStreamingOptions:V.smoothStreamingOptions,parseCoalesceMs:V.parseCoalesceMs,fade:V.fade}));z(`markstreamNestedRendererProps`,It);let Lt=O(()=>K.value),Rt=O(()=>K.value.length),zt=I(null),Bt=I(null),Vt=I(null),Ht=I(null),Ut=s.indexKey!=null&&String(s.indexKey).startsWith(`list-item-`),Wt=!Ut&&V.customId?kO(V.customId):null,Gt=O(()=>Wt?(OO.value,kO(V.customId)):null),Kt=O(()=>!(Ve.value||!V.customId||Ut||!Gt.value?.enabled)),qt=O(()=>!!(W&&Kt.value)),Jt=O(()=>!(Ve.value||!s.virtualScroll?.enabled)),Yt=O(()=>Jt.value),Xt=I(!1);o(()=>{Xt.value=!0});let Zt=O(()=>!!(W&&Jt.value));z(`markstreamHostScrollManaged`,Zt);let Qt=O(()=>!!(Xt.value&&Zt.value)),$t=O(()=>qt.value||Zt.value);P($t,e=>{e&&DO()},{immediate:!0});let en=O(()=>qt.value||Qt.value),tn=O(()=>$t.value&&!1!==Gt.value?.textEstimation);function nn(){if(Ne.value>0)return Ne.value;let e=G(`getMeasuredContainerWidth.clientWidth`,()=>H.value?.clientWidth||0);return Number.isFinite(e)&&e>0?e:0}let rn=O(()=>{let e=nn();return e>0?Math.max(1,Math.round(e)):640}),an=O(()=>!(!0!==tt.value||Jt.value||te.value!==`chat`&&te.value!==`minimal`||M(`maxLiveNodes`)||M(`liveNodeBuffer`)||s.nodes?.length||lt.value||!((V.maxLiveNodes??0)<=0))),on=O(()=>an.value?50:Math.max(1,V.maxLiveNodes??320)),sn=O(()=>an.value?16:Math.max(0,V.liveNodeBuffer??60)),q=O(()=>!Ve.value&&!1!==V.nodeVirtual&&!((V.maxLiveNodes??0)<=0&&!an.value)&&(!0===V.nodeVirtual?K.value.length>0:K.value.length>on.value)),cn=O(()=>q.value||qt.value||Zt.value),ln=O(()=>!1!==V.viewportPriority),un=O(()=>!!ln.value&&!ke.value);var dn=O(()=>ln.value);z(TE,dn);let fn=O(()=>!(Ve.value||!1===V.deferNodesUntilVisible||(V.maxLiveNodes??0)<=0||q.value||K.value.length>900||!1===V.viewportPriority)),pn=AE(e=>qe(e?.parentElement??H.value??null),ln),{requestFrame:mn,cancelFrame:hn,hasIdleCallback:gn,isTestEnv:_n}=function(e){return{requestFrame:e.isClient&&typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame.bind(window):null,cancelFrame:e.isClient&&typeof window.cancelAnimationFrame==`function`?window.cancelAnimationFrame.bind(window):null,hasIdleCallback:e.isClient&&typeof window.requestIdleCallback==`function`,isTestEnv:function(){return typeof globalThis>`u`||!(`process`in globalThis)?void 0:Object.getOwnPropertyDescriptor(globalThis,`process`)?.value?.env}()?.NODE_ENV===`test`}}({isClient:W}),vn=O(()=>!0===tt.value&&!Jt.value),{resolvedBatchSize:yn,resolvedInitialBatch:bn,batchingEnabled:xn,incrementalRenderingActive:Sn,renderedCount:Cn,previousRenderContext:wn,adaptiveBatchSize:Tn,previousBatchConfig:En}=function(e,t){let n=O(()=>{let t=Math.trunc(e.renderBatchSize??80);return Number.isFinite(t)?Math.max(0,t):0}),r=O(()=>{let t=Math.trunc(e.initialRenderBatchSize??n.value);return Number.isFinite(t)?Math.max(0,t):n.value}),i=O(()=>!t.renderAsFragment.value&&!1!==e.batchRendering&&n.value>0&&t.isClient&&!t.isTestEnv),a=I(0),o=I({key:e.indexKey,total:0}),s=I(Math.max(1,n.value||1)),c=O(()=>i.value&&!t.continuousStreaming?.value&&!t.forceFullRenderFinalContent?.value&&(e.maxLiveNodes??0)<=0);return{resolvedBatchSize:n,resolvedInitialBatch:r,batchingEnabled:i,incrementalRenderingActive:c,renderedCount:a,previousRenderContext:o,adaptiveBatchSize:s,previousBatchConfig:I({batchSize:n.value,initial:r.value,delay:e.renderBatchDelay??16,enabled:c.value})}}(V,{isClient:W,isTestEnv:_n,renderAsFragment:Ve,forceFullRenderFinalContent:vn,continuousStreaming:O(()=>ct.value&&!0!==tt.value)}),Dn=O(()=>!Ve.value&&!1!==V.batchRendering&&yn.value>0&&!_n&&(V.maxLiveNodes??0)<=0&&!vn.value),On=O(()=>Dn.value),kn=O(()=>$t.value||On.value),An=O(()=>kn.value&&!1!==Gt.value?.codeBlockEstimation),jn=new Map,Mn=new Map,Nn=new Map,Pn=new WeakMap,Fn=null,In=[];P(()=>K.value.length,e=>{In.length>e&&(In.length=e)});let Ln=[],Rn=[],zn=[],Bn=[],Vn=-1,Hn=ee(Rn),Un=new Set,Wn=I(0),Gn=0,Kn=I(0),qn=O(()=>(Kn.value,Array.from(jn.entries()).sort((e,t)=>e[0]-t[0]))),Jn=I(null),Yn=I(null),Xn,Zn=null,Qn=0,$n=null;function er(e){Xn.markFallbackHeightPrefixDirty(e)}function tr(e){return Xn.getFallbackNodeHeight(e)}function nr(e,t){return Xn.estimateHeightRange(e,t)}function rr(e){return Xn.estimateIndexForOffset(e)}let{activeRestoreAnchor:ir,getRelativeScrollTopWithinContainer:ar,setRelativeScrollTopWithinContainer:or,resolveAnchorOffset:sr,clearRestoreReconcile:cr,scheduleRestoreReconcile:lr,captureRestoreAnchor:ur,restoreAnchor:dr,getAnchorDrift:fr}=function(e){let{isClient:t,containerRef:n,parsedNodeCount:r,requestFrame:i,cancelFrame:a,resolveScrollContainer:o,getNormalizedScrollTop:s,getOffsetTopWithinRoot:c,isReverseFlexScrollRoot:l,estimateIndexForOffset:u,estimateHeightRange:d,getFallbackNodeHeight:f,clamp:p}=e,m=I(null),h=null,g=[];function _(){let e=o(),t=n.value;if(!e||!t)return null;let r=e.ownerDocument||t.ownerDocument||document;if(e===r.documentElement||e===r.body||e===r.scrollingElement){let e=t.getBoundingClientRect();return Math.max(0,-e.top)}return Math.max(0,s(e,r,!1)-c(t,e))}function v(e){var t;let r=o(),i=n.value;if(!r||!i)return;let a=Math.max(0,e),u=r.ownerDocument||i.ownerDocument||document,d=u.defaultView||(typeof window<`u`?window:null);if(r===u.documentElement||r===u.body||r===u.scrollingElement){let e=s(r,u,!0)+i.getBoundingClientRect().top;(t=d?.scrollTo)==null||t.call(d,0,Math.max(0,e+a))}else GO(r,u,c(i,r)+a,{isReverseFlexScrollRoot:e=>{var t;return(t=l?.(e))!=null&&t},getNormalizedScrollTop:s})}function y(e){let t=r.value,n=p(e.nodeIndex,0,Math.max(0,t-1));return d(0,n)+Math.max(0,e.offsetWithinNodePx)}function b(){if(h!=null&&(a?.(h),h=null),t)for(let e of g)window.clearTimeout(e);g=[]}function x(e){let t=y(e),n=_();n!=null&&Math.abs(n-t)<=.5||v(t)}return{activeRestoreAnchor:m,getRelativeScrollTopWithinContainer:_,setRelativeScrollTopWithinContainer:v,resolveAnchorOffset:y,clearRestoreReconcile:b,applyRestoreAnchor:x,scheduleRestoreReconcile:function(){m.value&&t&&h==null&&(h=i?i(()=>{h=null,m.value&&x(m.value)}):null,h==null&&m.value&&x(m.value))},captureRestoreAnchor:function(){let e=_(),t=r.value;if(e==null||t<=0)return null;let n=p(u(e+1),0,t-1),i=d(0,n),a=f(n);return{nodeIndex:n,offsetWithinNodePx:p(e-i,0,Math.max(0,a-1))}},restoreAnchor:function(e){let n=r.value;if(m.value={nodeIndex:p(e.nodeIndex,0,Math.max(0,n-1)),offsetWithinNodePx:Math.max(0,e.offsetWithinNodePx)},b(),x(m.value),t)for(let e of[0,120,280,480])g.push(window.setTimeout(()=>{m.value&&x(m.value)},e))},getAnchorDrift:function(e){let t=_();return t==null?null:t-y(e)}}}({isClient:W,containerRef:H,parsedNodeCount:Rt,requestFrame:mn,cancelFrame:hn,resolveScrollContainer:()=>Jn.value||Je(),getNormalizedScrollTop:Xe,getOffsetTopWithinRoot:Ze,isReverseFlexScrollRoot:Ye,estimateIndexForOffset:rr,estimateHeightRange:nr,getFallbackNodeHeight:tr,clamp:ji}),{nodeHeights:pr,heightStats:mr,heightTreeSize:hr,heightSumTree:gr,heightKnownTree:_r,averageNodeHeight:vr,resetHeightMeasurements:yr,pruneHeightMeasurements:br,rebuildHeightTrees:xr,syncHeightTreeSize:Sr,recordNodeHeight:Cr,removeNodeHeights:wr,exportHeightCache:Tr,importHeightCache:Er,fenwickRangeSum:Dr}=function(e={}){let t=T({}),n=T({total:0,count:0}),r=I(0),i=I([]),a=I([]);function o(){for(let e of Object.keys(t))delete t[Number(e)];n.total=0,n.count=0,r.value=0,i.value=[],a.value=[]}function s(e,t,n){for(let r=t+1;r<e.length;r+=r&-r)e[r]+=n}function c(e,t){let n=0;for(let r=t+1;r>0;r-=r&-r)n+=e[r];return n}function l(e,t,n){if(n<=t)return 0;let r=c(e,n-1);return t<=0?r:r-c(e,t-1)}function u(e){r.value=e;let n=Array(e+1).fill(0),o=Array(e+1).fill(0);for(let[r,i]of Object.entries(t)){let t=Number(r),a=Number(i);!Number.isFinite(t)||t<0||t>=e||!Number.isFinite(a)||a<=0||(s(n,t,a),s(o,t,1))}i.value=n,a.value=o}function d(e){if(!Number.isInteger(e)||e<0)return!1;let o=t[e];if(!Number.isFinite(o)||o<=0)return!1;if(delete t[e],n.total=Math.max(0,n.total-o),n.count=Math.max(0,n.count-1),r.value>e){let t=i.value,n=a.value;t.length&&n.length&&(s(t,e,-o),s(n,e,-1))}return!0}return{nodeHeights:t,heightStats:n,heightTreeSize:r,heightSumTree:i,heightKnownTree:a,averageNodeHeight:O(()=>n.count>0?Math.max(12,n.total/n.count):32),resetHeightMeasurements:o,pruneHeightMeasurements:function(e){if(e<=0)return void o();let r=0,i=0;for(let[n,a]of Object.entries(t)){let o=Number(n),s=Number(a);!Number.isFinite(o)||o<0||o>=e||!Number.isFinite(s)||s<=0?delete t[o]:(r+=s,i++)}n.total=r,n.count=i},rebuildHeightTrees:u,syncHeightTreeSize:function(e){let n=r.value;if(e===n)return;if(e<n||n===0)return void u(e);let o=i.value,c=a.value;o.length=e+1,c.length=e+1;for(let t=n;t<e;t++)o[t+1]=0,c[t+1]=0;for(let r=n;r<e;r++){let e=Number(t[r]);!Number.isFinite(e)||e<=0||(s(o,r,e),s(c,r,1))}for(let t=n+1;t<=e;t++){let e=t-(t&-t);e>=n||(o[t]+=l(o,e,n),c[t]+=l(c,e,n))}r.value=e},recordNodeHeight:function(o,c,l={}){(function(o,c,l={}){var u;if(!Number.isFinite(c)||c<=0)return!1;let d=t[o];if(d&&(!1===l.allowShrink&&c<d||Math.abs(c-d)<=1))return!1;if(t[o]=c,d?n.total+=c-d:(n.total+=c,n.count++),r.value>o){let e=i.value,t=a.value;if(e.length&&t.length){if(d){let t=c-d;t!==0&&s(e,o,t)}else s(e,o,c),s(t,o,1)}}!1!==l.notify&&((u=e.onHeightRecorded)==null||u.call(e,o))})(o,c,Q(Z({},l),{notify:!0}))},removeNodeHeight:function(t,n={}){var r;let i=d(t);return i&&!1!==n.notify&&((r=e.onHeightRecorded)==null||r.call(e,t)),i},removeNodeHeights:function(t,n={}){var r;let i=0,a=1/0;for(let e of t){let t=Number(e);d(t)&&(i++,t<a&&(a=t))}return i>0&&!1!==n.notify&&((r=e.onHeightRecorded)==null||r.call(e,Number.isFinite(a)?a:void 0)),i},exportHeightCache:function(){return Object.entries(t).map(([e,t])=>({index:Number(e),height:Number(t)})).filter(e=>Number.isFinite(e.index)&&e.index>=0&&Number.isFinite(e.height)&&e.height>0).sort((e,t)=>e.index-t.index)},importHeightCache:function(i,a={}){var o;if(!Array.isArray(i))return;let s=r.value,c=!1;if(a.mode!==`merge`){let e=Object.keys(t);if(e.length>0){for(let n of e)delete t[Number(n)];c=!0}}for(let e of i){let n=Number(e.index),r=Number(e.height);if(!Number.isInteger(n)||n<0||s>0&&n>=s||!Number.isFinite(r)||r<=0)continue;let i=t[n];i&&Math.abs(i-r)<=1||(t[n]=r,c=!0)}c&&(function(){let e=0,i=0,a=r.value;for(let[n,r]of Object.entries(t)){let o=Number(n),s=Number(r);!Number.isFinite(o)||o<0||a>0&&o>=a||!Number.isFinite(s)||s<=0?delete t[o]:(e+=s,i++)}n.total=e,n.count=i}(),s>0&&u(s),(o=e.onHeightRecorded)==null||o.call(e))},fenwickRangeSum:l}}({onHeightRecorded:e=>{er(e??0),Zt.value&&$o(),ir.value&&lr(),Yn.value&&Wa(),Mo(`node-resize`)}});function Or(e){Number.isInteger(e)&&e>=0&&Un.add(e)}function kr(e){for(let t of e)Or(Number(t))}function Ar(e){Gn++;let t=!0;try{let n=e();return t=!1!==n,n}finally{Gn--,Gn===0&&t&&Wn.value++}}function jr(){zn=[],Bn=[],Vn=-1,Un.clear(),Hn.value=Rn}function Mr(){jr(),Ar(()=>yr()),Ln.length=0}function Nr(e){!Number.isInteger(e)||e<0||e>=K.value.length||(Ln[e]=Ia(e))}function Pr(e,t,n={}){let r=pr[e];Or(e),Cr(e,t,n);let i=pr[e];return Object.is(r,i)?(Un.delete(e),!1):(i&&i>0?Nr(e):r&&e<Ln.length&&(Ln[e]=void 0),!0)}function Fr(e,t){let n=G(`getNodeLayoutHeight.content.offsetHeight`,()=>t.offsetHeight);return n>0?n:G(`getNodeLayoutHeight.slot.offsetHeight`,()=>jn.get(e)?.offsetHeight??0)}function Ir(e,t={}){t.mode===`merge`?kr(e.map(e=>e.index)):jr(),Ar(()=>Er(e,t)),co()}let Lr=O(()=>fn.value&&un.value),Rr=O(()=>$t.value||Dn.value||Lr.value&&K.value.length>bn.value),zr=O(()=>!Ve.value&&!1!==V.batchRendering&&yn.value>0&&(V.maxLiveNodes??0)<=0),Br=O(()=>!Ve.value&&rt&&!0===tt.value&&!q.value&&!Jt.value&&!Kt.value&&!Lr.value&&!zr.value),Vr=O(()=>!!pn&&Lr.value),Hr=O(()=>[Vr.value,Lr.value,q.value,ke.value,U.value,Re.value,bn.value,!!pn].join(`|`)),Ur=O(()=>q.value||Zt.value),{focusIndex:Wr,liveRange:Gr,updateLiveRange:Kr}=function(e,t){let{parsedNodeCount:n,virtualizationEnabled:r,maxLiveNodesResolved:i,liveNodeBufferResolved:a,clamp:o}=t,s=a??O(()=>Math.max(0,e.liveNodeBuffer??60)),c=I(0),l=T({start:0,end:0});return{liveNodeBufferResolved:s,focusIndex:c,liveRange:l,updateLiveRange:function(){let e=n.value;if(!r.value||e===0)return l.start=0,void(l.end=e);let t=Math.min(i.value,e),a=s.value,u=o(c.value-a,0,Math.max(0,e-t));l.start=u,l.end=Math.min(e,u+t)}}}(V,{parsedNodeCount:Rt,virtualizationEnabled:q,maxLiveNodesResolved:on,liveNodeBufferResolved:sn,clamp:ji}),qr=new Map,Jr=new Map,Yr=new Map,Xr=new Map,Zr=[],Qr=new Map,$r=-1/0,ei=new Set,ti=I(0),ni=!1,ri=O(()=>(ti.value,ei.size)),ii=new Map,ai=new Map,oi=I(0),si=0,ci=O(()=>(oi.value,si)),li=null,ui=O(()=>{if(!q.value)return K.value.length;let e=sn.value,t=Math.max(Gr.end+e,bn.value),n=Math.min(K.value.length,t);return Math.max(Cn.value,n)});function di(){ni||(ni=!0,queueMicrotask(()=>{ni=!1,ti.value+=1}))}function fi(e,t,n=`node-resize`){if(!W||typeof window>`u`)return null;let r=window.setTimeout(()=>{ei.delete(r)&&di();try{t()}finally{Mo(n)}},Math.max(0,e));return ei.add(r),di(),r}function pi(e){W&&e!=null&&(ei.delete(e)&&di(),window.clearTimeout(e))}function mi(){if(W&&typeof window<`u`)for(let e of ei)window.clearTimeout(e);ei.size&&(ei.clear(),di()),Zr.length=0,Xr.clear()}function hi(e){Te.value=e}function gi(e){Ee.value=e}function _i(e){De.value=e}let{cancelScheduledFocusSync:vi,scheduleFocusSync:yi}=function(e){let{isClient:t,containerRef:n,virtualizationEnabled:r,requestFrame:i,cancelFrame:a,syncFocusToScroll:o}=e,s=null;function c(){return n.value?.ownerDocument?.defaultView??(typeof window<`u`?window:null)}function l(){if(!s)return;let e=c();s.viaTimeout?e?e.clearTimeout(s.id):clearTimeout(s.id):a?.(s.id),s=null}return{cancelScheduledFocusSync:l,scheduleFocusSync:function(e={}){if(!r.value)return;if(!t)return void o(!0);if(e.immediate)return l(),void o(!0);if(s)return;let n=()=>{s=null,o()};if(i)return void(s={id:i(n),viaTimeout:!1});let a=c();s={id:a?a.setTimeout(n,16):setTimeout(n,16),viaTimeout:!0}}}}({isClient:W,containerRef:H,virtualizationEnabled:q,requestFrame:mn,cancelFrame:hn,syncFocusToScroll:function(e=!1){if(!q.value)return;let t=Jn.value||Je();if(!t)return;let n=t.ownerDocument||H.value?.ownerDocument||document,r=n?.defaultView||(typeof window<`u`?window:null),i=t===n?.documentElement||t===n?.body,a=K.value.length;if(a<=0)return;if(!i&&a>0&&Ye(t)){let n=G(`syncFocusToScroll.clientHeight`,()=>t.clientHeight||0),r=G(`syncFocusToScroll.scrollTop`,()=>t.scrollTop),i=r<0?-r:r;Ai(ji((o=Math.max(0,i)+.5*Math.max(0,n),Xn.estimateIndexForOffsetFromEnd(o)),0,Math.max(0,a-1)),e);return}var o;let s=function(e,t,n,r){let i=H.value;if(!i)return null;let a=r?0:G(`syncFocusToScroll.model.root.getBoundingClientRect`,()=>e.getBoundingClientRect().top),o=G(`syncFocusToScroll.model.container.getBoundingClientRect`,()=>i.getBoundingClientRect().top),s=Math.max(0,a-o),c=r?G(`syncFocusToScroll.model.viewport.clientHeight`,()=>n?.innerHeight??t.documentElement?.clientHeight??e.clientHeight??0):G(`syncFocusToScroll.model.root.clientHeight`,()=>e.clientHeight);return ji(rr(s+.5*Math.max(0,c)),0,Math.max(0,K.value.length-1))}(t,n,r,i);if(s!=null)return void Ai(s,e);let c=i?null:G(`syncFocusToScroll.root.getBoundingClientRect`,()=>t.getBoundingClientRect()),l=i?0:c.top,u=i?G(`syncFocusToScroll.viewport.clientHeight`,()=>r?.innerHeight??t.clientHeight??0):c.bottom,d=qn.value,f=null,p=null;for(let[e,t]of d){if(!t)continue;let n=G(`syncFocusToScroll.slot.getBoundingClientRect`,()=>t.getBoundingClientRect());n.bottom<=l||n.top>=u||(f??=e,p=e)}if(f==null||p==null){let e=H.value;if(!e)return;let a=i?{top:0}:G(`syncFocusToScroll.fallback.root.getBoundingClientRect`,()=>t.getBoundingClientRect()),o=G(`syncFocusToScroll.fallback.scrollTop`,()=>Xe(t,n,i)),s=i?(()=>{let t=G(`syncFocusToScroll.fallback.container.getBoundingClientRect`,()=>e.getBoundingClientRect()),n=(i?0:a.top)-t.top;return Math.max(0,n)})():(()=>{let n=Ze(e,t);return Math.max(0,o-n)})(),c=i?G(`syncFocusToScroll.fallback.viewport.clientHeight`,()=>r?.innerHeight??n?.documentElement?.clientHeight??t.clientHeight??0):G(`syncFocusToScroll.fallback.root.clientHeight`,()=>t.clientHeight);Ai(ji(rr(s+.5*Math.max(0,c)),0,Math.max(0,K.value.length-1)),!0)}else Ai(Math.round((f+p)/2),e)}}),{visibleNodeIndices:bi,nodeVisibilityHandles:xi,nodeVisibilityWatchStops:Si,nodeVisibilityFallbackTimers:Ci,clearVisibilityFallback:wi,markNodeVisible:Ti,cleanupNodeVisibility:Ei,destroyNodeVisibilityState:Di}=Uk({isClient:W,shouldTrackVisibleNodeIndices:()=>Lr.value,shouldCleanupNodeVisibility:()=>q.value,onNodeMarkedVisible:e=>{q.value?yi():Wr.value=ji(e,0,Math.max(0,K.value.length-1))},onNodeVisibilityCleaned:e=>{jn.delete(e)&&No()}}),{cleanupScrollListener:Oi,setupScrollListener:ki}=Wk({isClient:W,virtualizationEnabled:q,listenerEnabled:Ur,scrollRootElement:Jn,resolveScrollContainer:Je,scheduleFocusSync:yi,onScroll:function(){let e=Yn.value;if(!e)return;let t=Ca();if(!t||function(e){if(So()>=Qn)return $n=null,!1;let t=$n;if(t==null)return!0;let n=Math.abs(e.scrollTop-t)<=2;return n||($n=null),n}(t))return;let n=Ta(t);(n==null||n<-32||Math.abs(Math.max(0,n)-Math.max(0,e.distanceFromBottomPx))>32)&&Ua(`restore`)},requestFrame:mn,cancelFrame:hn,getScrollTop:e=>{let t=e.ownerDocument||H.value?.ownerDocument||document,n=e===t.documentElement||e===t.body||e===t.scrollingElement;return G(`scrollListener.getScrollTop`,()=>Xe(e,t,n))}});function Ai(e,t=!1){let n=ji(e,0,Math.max(0,K.value.length-1));!t&&Math.abs(n-Wr.value)<=1||(Wr.value=n,Kr())}function ji(e,t,n){return Math.min(Math.max(e,t),n)}function Mi(e=K.value.length){let t=Pt();return!Number.isInteger(t)||t<0?e:ji(t,0,e)}function Ni(e){return e?.firstElementChild}function Pi(e,t){return e?e.matches?.call(e,t)?e:e.querySelector(t):null}function Fi(e,t){e<1||e>6||(Oe[e]=t)}function Ii(){if(!Rr.value||typeof ResizeObserver>`u`)return void(Ne.value=0);let e=G(`updateMeasuredContainerWidth.clientWidth`,()=>H.value?.clientWidth??0);Ne.value=e>0?e:0}let Li=null;function Ri(){Li?.disconnect(),Li=null}let zi=O(()=>se.value?aD:oD);function Bi(){return!1!==V.codeBlockProps?.showHeader}function Vi(){return!1!==V.codeBlockProps?.showCopyButton}function Hi(){let e=V.codeBlockProps?.showLineNumbers;return typeof e==`boolean`?e:!0!==V.codeBlockOptions?.disableLineNumbers}function Ui(e,t,n){let r=pr[t],i=typeof r==`number`&&r>0;if(tn.value&&!i&&!function(e){return!!At.value.paragraph&&(e.type===`paragraph`||e.type===`list_item`||e.type===`list`)}(e)){let t=PO(e,n,Pe.value);if(t)return t}if(An.value&&!i&&e.type===`code_block`){let t=function(e){if(e.type!==`code_block`)return null;let t=Vs(e,Is(e));return t===aD?`pre`:t===zi.value||t===oD?`stream-diffs`:null}(e);if(t===`stream-diffs`||t===`pre`)return function(e,t){if(!e||e.type!==`code_block`)return null;let n=t.rendererKind,r=n!==`pre`&&!1!==t.showHeader,i=n===`pre`&&!1!==t.showHeader,a=!!e.diff,o=0,s=500;if(n===`stream-diffs`){let n=LO(e,t.diffStyle),r=function(e){return e?0:16}(a);s=500,o=Math.round(n*18+r)}else{let n=vt(t.codeBlockOptions),r=function(e,t,n){let r=LO(e,t.diffStyle),i=Number(t.width);if(n.overflow!==`wrap`||!Number.isFinite(i)||i<=0)return r;let a=Math.max(1,.6*n.fontSize),o=!!e.diff,s=o&&ce({diffStyle:t.diffStyle});if(!o||s){let r=(o?IO(e.raw)||[IO(e.originalCode),IO(e.updatedCode)].filter(Boolean).join(`
|
|
199
|
+
`):IO(e.code,!0===e.loading)).split(/\r\n|\n|\r/),s=zO(i,a,r.length,n,t,!1);return r.reduce((e,t)=>e+RO(t,s,n.tabSize),0)}let c=IO(e.originalCode).split(/\r\n|\n|\r/),l=IO(e.updatedCode).split(/\r\n|\n|\r/);if(e.originalCode==null&&e.updatedCode==null)return r;let u=Math.max(c.length,l.length),d=zO(i,a,u,n,t,!0),f=0;for(let e=0;e<u;e++)f+=Math.max(RO(c[e]??``,d,n.tabSize),RO(l[e]??``,d,n.tabSize));return f}(e,t,n);o=Math.round(r*n.lineHeight+n.padding+n.paddingBottom),s=n.maxHeight}let c=Math.max(1,Math.min(o,s));return Z({kind:`code-block`,height:Math.round(c+(n===`pre`?i?37:0:r?40:0)),contentHeight:c,rendererKind:n},a&&n===`stream-diffs`?{diffInline:ce({diffStyle:t.diffStyle})}:{})}(e,{rendererKind:t,codeBlockOptions:V.codeBlockOptions,showHeader:Bi(),showLineNumbers:Hi(),width:n,diffStyle:V.codeBlockOptions?.diffStyle})}return null}c(()=>{if(Wn.value,Gn>0)return;let e=K.value,t=Ft();if(!e.length||!kn.value)return zn=[],Bn=[],Vn=-1,Un.clear(),void(Hn.value=Rn);let n=Ne.value||G(`estimatedNodeHeights.clientWidth`,()=>H.value?.clientWidth||0);if(!Number.isFinite(n)||n<=0)return zn=[],Bn=[],Vn=-1,Un.clear(),void(Hn.value=Rn);let r=function(e){let t=vt(V.codeBlockOptions);return[Math.round(e),tn.value,An.value,Pe.value,t.fontSize,t.lineHeight,t.fontFamily,t.padding,t.paddingBottom,t.maxHeight,t.tabSize,t.overflow,V.codeBlockOptions?.diffStyle??`split`,Hi(),Bi(),Vi(),se.value,At.value,OO.value]}(n),i=zn.length<=e.length&&(o=r,(a=Bn).length===o.length&&a.every((e,t)=>Object.is(e,o[t])));var a,o;let s=i&&Vn===t?e.length:i?Mi(e.length):0,c=i?Array.from(Un):[];zn.length=e.length;for(let t=s;t<e.length;t++)zn[t]=Ui(e[t],t,n);for(let t of c)t>=0&&t<e.length&&t<s&&(zn[t]=Ui(e[t],t,n));Un.clear(),Bn=r,Vn=t,Hn.value=zn,ne(Hn)},{flush:`sync`});let Wi=O(()=>Hn.value);Xn=function(e){let t=!0,n=-1,r=[0],i=``,a=-1,o=new WeakMap;function s(e=0){t=!0,e<=0?n=0:(n<0||e<n)&&(n=e)}function c(t){let n=e.nodeHeights[t];if(Number.isFinite(n)&&n>0)return n;let r=e.parsedNodes.value[t],i=r?.type,a=!!e.hasCustomParagraphComponent?.call(e),s=e.estimatedNodeHeights.value[t],c=s?.height;if(!function(e,t,n){return!(!n||t?.kind!==`simple-text`||e!==`paragraph`&&e!==`list_item`&&e!==`list`)}(i,s,a)&&Number.isFinite(c)&&c>0)return c;let l=function(t,n){if(!t||typeof t!=`object`||!1===e.shouldCacheStaticFallbackHeight?.call(e))return ak(t,n);let r=t,i=o.get(r);if(i&&i.width===n)return i.height;let a=ak(t,n);return o.set(r,{width:n,height:a}),a}(r,e.getContainerWidth()||640);return i===`heading`||i===`paragraph`&&l<=28&&function(e,t){if(t)return!1;let n=e.children;return!Array.isArray(n)||!n.length||n.every(tk)}(r,a)?l:Math.max(e.averageNodeHeight.value,l)}function l(){let o=e.parsedNodes.value.length,l=e.getPrefixCacheKeyParts().join(`:`),u=r;i!==l&&(i=l,s(0));let d=e.averageNodeHeight.value;a!==d&&(a=d,s(0)),u.length>o+1&&(u.length=o+1,n>=0&&n>=u.length-1&&(t=!1));let f=u.length-1;if(!t){if(f===o)return u;n=f}let p=Math.min(n,f);u.length<o+1&&(u.length=o+1);for(let t=p;t<o;t++)u[t+1]=u[t]+(e.heightEstimationActive.value?c(t):e.nodeHeights[t]??d);return t=!1,n=o,u}function u(t){let n=e.parsedNodes.value.length;if(n<=0||t<=0)return 0;let r=l();if(t>=(r[n]??0))return n-1;let i=0,a=n-1,o=n-1;for(;i<=a;){let e=i+a>>1;(r[e+1]??0)>=t?(o=e,a=e-1):i=e+1}return o}function d(t,n){if(t>=n)return 0;if(e.heightEstimationActive.value)return function(t,n){let r=e.parsedNodes.value.length,i=ok(Math.trunc(t),0,r),a=ok(Math.trunc(n),i,r);if(i>=a)return 0;let o=l();return(o[a]??0)-(o[i]??0)}(t,n);if(e.heightTreeSize.value!==e.parsedNodes.value.length){let r=0;for(let i=t;i<n;i++)r+=e.nodeHeights[i]??e.averageNodeHeight.value;return r}let r=e.heightSumTree.value,i=e.heightKnownTree.value;if(!r.length||!i.length){let r=0;for(let i=t;i<n;i++)r+=e.nodeHeights[i]??e.averageNodeHeight.value;return r}return e.fenwickRangeSum(r,t,n)+(n-t-e.fenwickRangeSum(i,t,n))*e.averageNodeHeight.value}function f(t){if(t<=0)return 0;let n=e.parsedNodes.value;if(e.heightEstimationActive.value)return u(t);if(e.heightTreeSize.value===n.length&&e.heightSumTree.value.length&&e.heightKnownTree.value.length){let r=e.averageNodeHeight.value,i=e.heightSumTree.value,a=e.heightKnownTree.value,o=t=>t<=0?0:e.fenwickRangeSum(i,0,t)+(t-e.fenwickRangeSum(a,0,t))*r,s=0,c=n.length-1,l=n.length-1;for(;s<=c;){let e=s+c>>1;o(e+1)>=t?(l=e,c=e-1):s=e+1}return l}let r=t;for(let t=0;t<n.length;t++){let n=e.nodeHeights[t]??e.averageNodeHeight.value;if(r<=n)return t;r-=n}return Math.max(0,n.length-1)}function p(){if(!e.heightEstimationActive.value)return 0;let t=0,n=e.estimatedNodeHeights.value;for(let r=0;r<n.length;r++){if(!n[r])continue;let i=e.nodeHeights[r];Number.isFinite(i)&&i>0||t++}return t}return{markFallbackHeightPrefixDirty:s,getFallbackNodeHeight:c,estimateHeightRange:d,estimateIndexForOffset:f,estimateIndexForOffsetFromEnd:function(t){let n=e.parsedNodes.value;if(!n.length)return 0;if(t<=0)return Math.max(0,n.length-1);if(e.heightEstimationActive.value){let e=l()[n.length]??0;return u(Math.max(0,e-t))}if(e.heightTreeSize.value===n.length){let e=d(0,n.length);return f(Math.max(0,e-t))}let r=t;for(let t=n.length-1;t>=0;t--){let n=e.nodeHeights[t]??e.averageNodeHeight.value;if(r<=n)return t;r-=n}return 0},getEstimatedNodeHeightCount:p,buildVirtualHeightSummary:function(t){let n=e.parsedNodes.value.length;return{totalNodes:n,measuredCount:e.heightStats.count,estimatedCount:p(),averageNodeHeight:e.averageNodeHeight.value,topSpacerHeight:t.topSpacerHeight,bottomSpacerHeight:t.bottomSpacerHeight,estimatedTotalHeight:d(0,n),width:t.width??e.getContainerWidth()}}}}({parsedNodes:K,nodeHeights:pr,heightStats:mr,heightTreeSize:hr,heightSumTree:gr,heightKnownTree:_r,averageNodeHeight:vr,heightEstimationActive:$t,estimatedNodeHeights:Wi,getContainerWidth:nn,shouldCacheStaticFallbackHeight:()=>!s.nodes?.length,hasCustomParagraphComponent:()=>!!At.value.paragraph,getPrefixCacheKeyParts:()=>{let e=$O(Ne.value||G(`getFallbackHeightPrefix.clientWidth`,()=>H.value?.clientWidth||0));return[s.virtualScroll?.measurementKey==null?``:String(s.virtualScroll.measurementKey),e,+!!$t.value,OO.value,+!!At.value.paragraph]},fenwickRangeSum:Dr}),Me=!0,P(()=>K.value.length,(e,t)=>{var n;er(t!=null&&e>=t?Mi(e):0),e<=0?Mr():(e<hr.value&&(n=e,jr(),Ar(()=>br(n))),Sr(e))},{immediate:!0});let Gi=O(()=>{if(!q.value)return K.value.map((e,t)=>({node:e,index:t}));let e=K.value.length,t=ji(Gr.start,0,e),n=ji(Gr.end,t,e);return K.value.slice(t,n).map((e,n)=>({node:e,index:t+n}))}),Ki=O(()=>q.value?nr(0,Math.min(Gr.start,K.value.length)):0),qi=O(()=>{if(!q.value)return 0;let e=K.value.length;return nr(Math.min(Gr.end,e),e)});function Ji(){return Xn.buildVirtualHeightSummary({topSpacerHeight:Ki.value,bottomSpacerHeight:qi.value,width:na()})}function Yi(){let e=K.value;return Q(Z({},Ji()),{probe:{paragraphReady:!!Pe.value.paragraph,listItemReady:!!Pe.value.listItem,listWrapperOverhead:Pe.value.listWrapperOverhead,headingReadyLevels:Object.entries(Pe.value.headings).filter(([,e])=>!!e).map(([e])=>Number(e))},nodes:e.map((e,t)=>({index:t,type:e.type,estimateKind:Wi.value[t]?.kind??null,rendererKind:Wi.value[t]?.rendererKind??null,estimatedHeight:Wi.value[t]?.height??null,estimatedContentHeight:Wi.value[t]?.contentHeight??null,measuredHeight:pr[t]??null}))})}function Xi(){return s.indexKey==null?Jt.value?`virtual-${J()}`:`markdown-renderer`:String(s.indexKey)}function Zi(e){let t=String(e),n=`${Xi()}-`;if(!t.startsWith(n))return null;let r=t.slice(n.length).match(/^(\d+)(?:$|-)/);if(!r)return null;let i=Number(r[1]);return!Number.isInteger(i)||i<0||i>=K.value.length?null:i}function J(){let e=s.virtualScroll?.sessionKey;return String(e!=null&&e!==``?e:s.indexKey??V.customId??Dt)}function Qi(){let e=s.virtualScroll?.threadKey;return e==null||e===``?void 0:String(e)}let $i=O(()=>Qi()??String(s.indexKey??V.customId??Dt));function ea(e){return(e??``)===(Qi()??``)}function ta(){var e=s.virtualScroll?.measurementKey,t=function(e){let t=e.codeBlockProps,n=e.codeBlockOptions,r=n?.parseDiffOptions;return[e.isDark?`dark`:`light`,e.renderCodeBlocksAsPre?`code-pre`:`code-rich`,!1===e.codeBlockStream?`code-static`:`code-stream`,rA(e.codeBlockMinWidth),rA(e.codeBlockMaxWidth),rA(n?.fontSize),rA(n?.lineHeight),rA(n?.fontFamily),rA(n?.maxHeight),rA(n?.tabSize),rA(n?.padding),rA(n?.overflow),rA(n?.disableLineNumbers),rA(n?.diffStyle),rA(n?.diffIndicators),rA(n?.hunkSeparators),rA(n?.expandUnchanged),rA(n?.collapsedContextThreshold),rA(n?.expansionLineCount),rA(r?.context),rA(t?.showHeader),rA(t?.showCopyButton),rA(t?.showExpandButton),rA(t?.showPreviewButton),rA(t?.showCollapseButton),rA(t?.showFontSizeButtons),rA(t?.showLineNumbers)].join(`\0`)}({renderCodeBlocksAsPre:se.value,isDark:V.isDark,codeBlockStream:V.codeBlockStream,codeBlockMinWidth:V.codeBlockMinWidth,codeBlockMaxWidth:V.codeBlockMaxWidth,codeBlockOptions:V.codeBlockOptions,codeBlockProps:V.codeBlockProps});return[e==null?``:String(e),t].join(`\0`)}function na(){return nn()}let ra=O(()=>$O(na())),ia=O(()=>[ta(),ra.value].join(`\0`)),aa=O(()=>Jt.value?[`virtual`,Qi()??``,J(),ia.value].join(`\0`):s.indexKey);function oa(){oi.value+=1}function sa(e){return!(!e||!Number.isInteger(e.index)||e.index<0||e.index>=K.value.length||e.sessionKey!==J()||e.threadKey!==Qi()||e.layoutEpochKey!==ia.value)}function ca(e){let t=String(e),n=ai.get(t);return n?sa(n)?n.index:null:Zi(t)}function la(e=`async-node`){(ii.size||ai.size)&&(si=0,ii.clear(),ai.clear(),oa(),Mo(e))}let ua=j(SC,null),da={reportHeight(e,t){if(!Zt.value)return;let n=ca(e);if(n==null)return;let r=qr.get(n);if(!r)return;let i=Number(t),a=Fr(n,r);(function(e,t,n={}){Ar(()=>Pr(e,t,n))})(n,Number.isFinite(i)&&i>0?Math.max(i,a||0):a)},markPending(e){if(!Zt.value)return;let t=Zi(e);t!=null&&function(e,t){let n=ai.get(e);if(n&&sa(n))return ii.set(e,Math.max(0,ii.get(e)??0)+1),si+=1,oa(),void Mo(`async-node`);ii.set(e,1),si+=1,ai.set(e,function(e){return{index:e,sessionKey:J(),threadKey:Qi(),layoutEpochKey:ia.value}}(t)),oa(),Mo(`async-node`)}(String(e),t)},markSettled(e){if(!Zt.value)return;let t=String(e),n=ca(e);if((n!=null||function(e){return ii.has(String(e))}(t))&&function(e){let t=ii.get(e)??0;return!(t<=0||(t<=1?(ii.delete(e),ai.delete(e)):ii.set(e,t-1),si=Math.max(0,si-1),oa(),t===1&&Mo(`async-node`),0))}(t)&&n!=null){let e=qr.get(n);e&&Bo(n,e)}}};function fa(e){if(e!==void 0)return e;let t=0;for(let e of qr.values())t+=G(`getVisibleDomHeight.offsetHeight`,()=>e.offsetHeight);return t}z(SC,{reportHeight(e,t){da.reportHeight(e,t),ua?.reportHeight(e,t)},markPending(e){da.markPending(e),ua?.markPending(e)},markSettled(e){da.markSettled(e),ua?.markSettled(e)}});let pa,ma=null,ha=null;function ga(e){return!1!==e&&e!=null&&e!==``}function _a(){return q.value?function(){if(!q.value)return!0;let e=K.value.length,t=ji(Gr.start,0,e),n=ji(Gr.end,t,e);if(t>=n)return!0;for(let e=t;e<n;e++)if(!jn.has(e)||Po(e)&&!qr.has(e))return!1;return!0}():Cn.value>=ui.value}function va(){return!0===tt.value&&!st.value&&ci.value===0&&ei.size===0&&Qr.size===0&&li==null&&_a()}function ya(){if(s.virtualScroll?.settleMode!==`manual`||ma===J()&&pa===Qi())return!0;let e=s.virtualScroll?.settledToken;return!!ga(e)&&ha===ns(e)}function ba(){return va()&&ya()}function xa(e,t){return t.totalNodes<=0?e===`final`?`final`:`estimate`:t.measuredCount>=t.totalNodes?e===`final`?`final`:`measured`:t.measuredCount>0||t.estimatedCount>0?`mixed`:`estimate`}function Sa(e=`manual`,t,n){let r=Ji(),i=function(e){return e||(!0===tt.value?!_a()||Qr.size>0||li!=null?`measuring`:ba()?`settled`:`settling`:K.value.length>0?`streaming`:`estimating`)}(t);return{sessionKey:J(),threadKey:Qi(),phase:i,nodeCount:r.totalNodes,liveRange:{start:Gr.start,end:Gr.end},renderedCount:Cn.value,measuredCount:r.measuredCount,estimatedCount:r.estimatedCount,averageNodeHeight:r.averageNodeHeight,topSpacerHeight:r.topSpacerHeight,bottomSpacerHeight:r.bottomSpacerHeight,visibleDomHeight:fa(n),totalHeight:wa(r),width:r.width,final:!0===tt.value,stable:ba(),confidence:xa(i,r),reason:e}}function Ca(){let e=Jn.value||Je(),t=H.value;if(!e||!t)return null;let n=e.ownerDocument||t.ownerDocument||document,r=e===n.documentElement||e===n.body||e===n.scrollingElement;return{root:e,doc:n,isViewportRoot:r,scrollTop:G(`getScrollBox.scrollTop`,()=>Xe(e,n,r)),scrollHeight:G(`getScrollBox.scrollHeight`,()=>r?Math.max(n.documentElement?.scrollHeight??0,n.body?.scrollHeight??0,e.scrollHeight??0):e.scrollHeight),clientHeight:G(`getScrollBox.clientHeight`,()=>r?n.documentElement?.clientHeight||e.clientHeight||0:e.clientHeight)}}function wa(e){let t=K.value.length,n=Math.max(0,nr(0,t)),r=G(`getRendererLogicalHeight.offsetHeight`,()=>H.value?.offsetHeight??0),i=Math.max(0,r>0?r:G(`getRendererLogicalHeight.scrollHeight`,()=>H.value?.scrollHeight??0));return t<=0?Math.ceil(r):q.value?n>0?Math.max(1,Math.ceil(n),function(){let e=Ki.value+qi.value;for(let t of jn.values())t&&(e+=Math.max(0,G(`getVirtualizedDomLogicalHeight.offsetHeight`,()=>t.offsetHeight||0)));return Math.ceil(Math.max(0,e))}(),function(e,t){return e<=0||t<=0?0:t<=e+Math.max(512,.05*e)?Math.ceil(t):0}(n,i)):Math.max(1,Math.ceil(i)):Zt.value?n>0||mr.count>0||(e?.estimatedCount??Xn.getEstimatedNodeHeightCount())>0?(Sn.value&&Cn.value,Math.max(1,Math.ceil(i),Math.ceil(n))):Math.ceil(i):Math.max(1,Math.ceil(i),Math.ceil(n))}function Ta(e){let t=H.value;if(!t)return null;let n=G(`getRendererBottomDistanceFromViewport.getBoundingClientRect`,()=>t.getBoundingClientRect());return function(e){return e.isViewportRoot?e.clientHeight:G(`getViewportBottomInRoot.getBoundingClientRect`,()=>e.root.getBoundingClientRect().bottom)}(e)-n.bottom}function Ea(e={}){let t=!1!==e.requireViewport,n=function(e=64){let t=Ca(),n=H.value;if(!t||!n)return!1;let r=function(e){if(e.isViewportRoot)return{top:0,bottom:e.clientHeight};let t=G(`getVirtualViewportRect.getBoundingClientRect`,()=>e.root.getBoundingClientRect());return{top:t.top,bottom:t.bottom}}(t),i=G(`isRendererNearVirtualViewport.getBoundingClientRect`,()=>n.getBoundingClientRect());return i.bottom>=r.top-e&&i.top<=r.bottom+e}();if(t&&!n)return null;let r=function(){let e=Ca(),t=H.value;if(!e||!t||Math.max(0,e.scrollHeight-e.scrollTop-e.clientHeight)>64)return null;let n=Ta(e);return n==null?null:n>=-8&&n<=160?{type:`bottom`,distanceFromBottomPx:Math.max(0,n)}:null}();if(r)return{anchor:r,captured:!0};let i=ur();if(i)return{anchor:{type:`node`,nodeIndex:i.nodeIndex,offsetWithinNodePx:i.offsetWithinNodePx},captured:n};if(!0===e.allowFallback){let e=function(){let e=K.value.length;return e<=0?null:{type:`node`,nodeIndex:ji(Wr.value,0,Math.max(0,e-1)),offsetWithinNodePx:0}}();return e?{anchor:e,captured:!1}:null}return null}function Da(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Oa(e,t){let n=e;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n^=31,n=Math.imul(n,16777619),n}let ka=new Set([`children`,`items`,`header`,`rows`,`cells`,`attrs`,`data`,`term`,`definition`]);function Aa(e,t=new WeakSet,n=0){if(e==null||typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`string`)return`s:${function(e){let t=e.length>8192?`${e.slice(0,8192)}...${e.length}`:e;return`${e.length}:${Da(t)}`}(e)}`;if(typeof e==`function`)return`fn`;if(typeof e!=`object`)return typeof e;if(t.has(e))return`cycle`;if(n>=6)return`max-depth`;t.add(e);try{if(Array.isArray(e)){if(e.length<=160){let r=[];for(let i=0;i<e.length;i++)r.push(Aa(e[i],t,n+1));return`a:${e.length}:${r.join(`,`)}`}let r=[],i=[],a=Math.max(0,e.length-32),o=2166136261;for(let s=0;s<e.length;s++){let c=Aa(e[s],t,n+1);o=Oa(o,c),s<32&&r.push(c),s>=a&&i.push(c)}return[`a:${e.length}`,`h=${r.join(`,`)}`,`t=${i.join(`,`)}`,`all=${(o>>>0).toString(36)}`].join(`:`)}let r=e,i=Object.keys(r).filter(e=>{let t=r[e];return e!==`parent`&&e!==`el`&&e!==`component`&&(t==null||typeof t==`string`||typeof t==`number`||typeof t==`boolean`||ka.has(e))}).sort();return`o:${i.length}:${i.map(e=>`${e}=${Aa(r[e],t,n+1)}`).join(`;`)}`}finally{t.delete(e)}}let ja=-1,Ma=new Map,Na=-1,Pa=``,Fa=[2166136261];function Ia(e){let t=K.value[e],n=Ft();if(ja!==n&&(ja=n,Ma.clear()),!t)return``;if(s.nodes?.length||V.parseOptions||V.customMarkdownIt||Mt.value.__markstreamHasCustomParserExtensions||Object.keys(At.value).length!==0)return Da(Aa(t));let r=Ma.get(e);if(r!==void 0)return r;let i=Da(Aa(t));return Ma.set(e,i),i}function La(e,t){let n=e;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return n>>>0}function Ra(){let e=je.value;if(Na===e)return Pa;let t=K.value.length,n=Mi(t);(Na!==e-1||n>t||Fa.length<n+1)&&(n=0),n===0?Fa=[2166136261]:Fa.length=n+1;for(let e=n;e<t;e++){let t=Ia(e);Fa[e+1]=La(Fa[e]??2166136261,t)}return Fa.length=t+1,Pa=((Fa[t]??2166136261)>>>0).toString(36),Na=e,Pa}function za(e,t={}){let n=!0===t.includeHeightCache,r=t.includeContentHash??n,i=n?function(e){let t=function(){let e=Number(s.virtualScroll?.heightCacheLimit??5e3);return!Number.isFinite(e)||e<=0?1/0:Math.max(1,Math.trunc(e))}();if(!Number.isFinite(t)||e.length<=t)return e;let n=new Map,r=e=>{!e||n.size>=t||n.set(e.index,e)},i=K.value.length,a=ji(Gr.start-2*sn.value,0,i),o=ji(Gr.end+2*sn.value,a,i);for(let t of e)t.index>=a&&t.index<o&&r(t);let c=Math.max(1,Math.ceil(e.length/t));for(let i=0;i<e.length&&n.size<t;i+=c)r(e[i]);for(let i=e.length-1;i>=0&&n.size<t;i-=c)r(e[i]);return Array.from(n.values()).sort((e,t)=>e.index-t.index).slice(0,t)}(Tr().map(e=>{let t=K.value[e.index];return t?Q(Z({},e),{nodeType:String(t.type??``),signature:Ia(e.index)}):null}).filter(e=>!!e)):[],a=Ea({allowFallback:!0===t.allowAnchorFallback,requireViewport:t.requireViewport});return a||i.length||!0===t.includeEmptyState?Q(Z({sessionKey:e.sessionKey,threadKey:e.threadKey},a?{anchor:a.anchor,anchorCaptured:a.captured}:{anchorCaptured:!1}),{metrics:e,width:e.width,contentHash:r?Ra():void 0,measurementKey:ta()||void 0,heightCache:i.length?i:void 0}):null}function Ba(e){var t,n;let r=Ca();if(!r)return;let i=function(e){let t=H.value;if(!t)return null;let n=Ze(t,e.root),r=K.value.length,i=G(`getRendererBottomOffsetWithinRoot.offsetHeight`,()=>t.offsetHeight||0),a=Math.max(0,i>0?i:r>0?G(`getRendererBottomOffsetWithinRoot.scrollHeight`,()=>t.scrollHeight||0):0),o=wa();return n+Math.max(a,o)}(r);if(i==null)return;let a=Math.max(0,e.distanceFromBottomPx),o=Math.max(0,i-r.clientHeight-a);(function(e){Qn=So()+120,$n=e})(o),r.isViewportRoot?(n=(t=r.doc.defaultView)?.scrollTo)==null||n.call(t,0,o):GO(r.root,r.doc,o,{isReverseFlexScrollRoot:Ye,getNormalizedScrollTop:Xe})}let Va=[];function Ha(){if(W)for(Zn!=null&&(hn?.(Zn),Zn=null);Va.length;){let e=Va.pop();e!=null&&window.clearTimeout(e)}}function Ua(e){let t=!!Yn.value;Yn.value=null,Qn=0,$n=null,Ha(),t&&e&&Mo(e)}function Wa(){if(!Yn.value||!W||Zn!=null)return;let e=()=>{Zn=null;let e=Yn.value;e&&Ba(e)};Zn=mn?mn(e):null,Zn??e()}function Ga(e,t={}){let n=K.value.length;return n<=0?[]:e.filter(e=>!(!Number.isInteger(e.index)||e.index<0||e.index>=n)&&!(!Number.isFinite(e.height)||e.height<=0)&&!(t.requireSignature&&!e.signature)&&!(t.requireCompatibilityMetadata&&!e.nodeType&&!e.signature)&&function(e){let t=K.value[e.index];return!(!t||e.nodeType&&e.nodeType!==String(t.type??``)||e.signature&&e.signature!==Ia(e.index))}(e))}function Ka(e){let t=$O(na()),n=$O(e);return t!==-1&&n!==-1&&t===n}function qa(e){let t=Number(e?.width);if(Number.isFinite(t)&&t>0)return t;let n=Number(e?.metrics?.width);return Number.isFinite(n)&&n>0?n:null}function Ja(e){return e.sessionKey===J()&&!!ea(e.threadKey)&&(e.measurementKey??``)===ta()&&!!Ka(qa(e))&&!!function(e){let t=e.heightCache;return!!t?.length&&(Ya(e)?t.some(e=>!!(e.nodeType||e.signature)):t.some(e=>!!e.signature))}(e)}function Ya(e){return!!(e.contentHash&&e.contentHash===Ra())}function Xa(e){return!Ya(e)}let Za=null,Qa=null,$a=null,eo=null,to=null;function no(e){let t=e.map(e=>[e.index,Math.round(10*e.height),e.nodeType??``,e.signature??``].join(``)).join(``),n=$O(na());return[Qi()??``,J(),ta(),K.value.length,n,e.length,Da(t)].join(`:`)}function ro(e=(e=>(e=s.virtualScroll)?.heightCache)()){if(!Zt.value||!e?.length||K.value.length<=0||!Ka((t=s.virtualScroll)?.heightCacheWidth))return!1;var t;let n=Ga(e,{requireSignature:!0});if(!n.length)return!1;let r=no(n);return r===Za?(Qa=`standalone`,!0):(Ir(n,{mode:`merge`}),er(),Za=r,Qa=`standalone`,Eo(),Mo(`restore`),!0)}function io(){let e=s.virtualScroll?.restoreAnchor;return e==null||!1===e?null:!0===e?`true`:String(e)}function ao(e,t={}){if(!Zt.value||!e||e.sessionKey!==J()||!ea(e.threadKey)||K.value.length<=0)return!1;let n=!!e.heightCache?.length&&!oo(),r=!e.anchor||!1===e.anchorCaptured&&!0!==t.allowUncapturedAnchor?null:e.anchor,i=!0===t.restoreAnchor&&!!r&&!oo()&&Number(qa(e))>0,a=!1;if(e.heightCache?.length&&Ja(e)){let t=Ga(e.heightCache,{requireCompatibilityMetadata:!e.contentHash,requireSignature:Xa(e)});t.length&&(Ir(t,{mode:`merge`}),er(),Za=no(t),Qa=`restore`,Eo(),a=!0)}if(n||i)return!1;if(!t.restoreAnchor||!r)return a&&Mo(`restore`),!0;let o=function(e,t){let n=e.anchor,r=n?n.type===`bottom`?`bottom:${Math.round(n.distanceFromBottomPx)}`:`node:${n.nodeIndex}:${Math.round(n.offsetWithinNodePx)}`:`none`;return[Qi()??``,J(),ta(),ra.value,t,r].join(`:`)}(e,t.restoreToken??`imperative`);return $a===o?(a&&Mo(`restore`),!0):($a=o,function(e){let t=()=>{if(e.type===`node`)return Ua(),void dr({nodeIndex:e.nodeIndex,offsetWithinNodePx:e.offsetWithinNodePx});if(cr(),ir.value=null,Yn.value=e,Ha(),Ba(e),W)for(let e of[0,120,280,480])Va.push(window.setTimeout(()=>{let e=Yn.value;e&&Ba(e)},e))};(function(e){if(!q.value)return!1;let t=K.value.length;return!(t<=0||(Wr.value=e.type===`node`?ji(e.nodeIndex,0,t-1):t-1,Kr(),0))})(e)?A(t):t()}(r),Mo(`restore`),!0)}function oo(){let e=na();return Number.isFinite(e)&&e>0}function so(e){return e.sessionKey===J()&&!!ea(e.threadKey)&&(K.value.length<=0||!(!e.heightCache?.length||oo())||!(!(e.anchor&&Number(qa(e))>0)||oo()))}function co(){Ln.length=0;for(let e of Object.keys(pr)){let t=Number(e);Number.isInteger(t)&&t>=0&&t<K.value.length&&Nr(t)}}function lo(){li!=null&&(hn?.(li),li=null),Lo()}function uo(){return!W||_n?Promise.resolve():new Promise(e=>{let t=!1,n=null,r=()=>{t||(t=!0,n!=null&&window.clearTimeout(n),e())};if(mn)return mn(r),void(n=window.setTimeout(r,50));n=window.setTimeout(r,0)})}function fo(e,t=Qi(),n=ia.value){return J()===e&&Qi()===t&&ia.value===n}function po(){return pT(this,arguments,function*(e={}){let t=J(),n=Qi(),r=ia.value,i=e.frames??2,a=e.timeoutMs??120,o=e.reason??`manual`,c=e.expectedSettledTokenKey,l=!0===e.flushPendingTimers,u=Sa(o),d=()=>Q(Z({},u),{phase:u.final?`settling`:u.phase,stable:!1,confidence:u.confidence===`final`?`mixed`:u.confidence,reason:o}),f=()=>fo(t,n,r)&&(c==null||wo()===c);for(let e=0;e<i;e++){if(yield A(),!f()||(yield uo(),!f()))return d();Vo(),lo()}if(yield function(e){return!W||e<=0?Promise.resolve():new Promise(t=>window.setTimeout(t,e))}(a),!f()||(l&&mi(),Vo(),lo(),!f()))return d();let p=va();p&&(ma=t,pa=n,s.virtualScroll?.settleMode===`manual`&&c!=null&&ga(s.virtualScroll?.settledToken)&&wo()===c&&(ha=ns(s.virtualScroll.settledToken)));let m=Sa(o,f()&&p&&ya()?`final`:void 0);return ko(m,!0),m})}let mo=`content`,ho=null,go=null,_o=0,vo=null,yo=null,bo=null,xo=null;function So(){return typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now()}function Co(e){let t=vo;if(!t)return!0;let n=s.virtualScroll?.heightDiffThresholdPx??1;return Math.abs(e.totalHeight-t.totalHeight)>n||e.sessionKey!==t.sessionKey||e.phase!==t.phase||e.stable!==t.stable||e.final!==t.final||e.threadKey!==t.threadKey||e.nodeCount!==t.nodeCount||e.measuredCount!==t.measuredCount||e.width!==t.width}function wo(e=(e=>(e=s.virtualScroll)?.settledToken)()){return rA(e)}function To(e,t){return[e,t.sessionKey,t.threadKey??``,ta(),Ra(),rA(s.virtualScroll?.settledToken),Math.round(t.totalHeight),Math.round(t.width)].join(`\0`)}function Eo(){bo=null,xo=null,yo=null}function Do(e){let t=e.heightCache;return t?.length?no(t):``}function Oo(e){let t=e.metrics,n=e.anchor?(r=e.anchor).type===`bottom`?`bottom:${Math.round(r.distanceFromBottomPx)}`:`node:${r.nodeIndex}:${Math.round(r.offsetWithinNodePx)}`:`none`;var r;return[e.sessionKey,e.threadKey??``,e.measurementKey??ta(),e.contentHash??``,Do(e),n,+!!e.anchorCaptured,t.liveRange.start,t.liveRange.end,t.renderedCount,t.nodeCount,Math.round(t.totalHeight),Math.round(t.width),t.phase,+!!t.stable].join(`\0`)}function ko(e,t=!1){if(!Zt.value||function(e=!1){return!e&&Jt.value&&!Qt.value}(t))return;let n=t||Co(e),r=function(e,t=!1){return t||e.stable||e.phase===`final`?{state:za(e,{includeHeightCache:!0})}:{state:za(e)}}(e,t).state,i=!!(r&&(n||function(e,t=!1){return!!t||Oo(e)!==yo}(r,t)));if(n&&(Se(e),vo=e,_o=So()),r&&i&&(Ce(r),r.anchor&&we(r.anchor),yo=Oo(r)),e.stable){let t=To(`settled`,e);if(t!==bo){bo=t;let n=za(e,{includeHeightCache:!0});n&&(Ce(n),yo=Oo(n)),function(e){d(`render-settled`,e)}(e)}}if(e.phase===`final`){let t=To(`final`,e);if(t!==xo){xo=t;let n=za(e,{includeHeightCache:!0});n&&(Ce(n),yo=Oo(n)),function(e){d(`render-final`,e)}(e)}}}function Ao(){ho!=null&&(hn?.(ho),ho=null),go!=null&&W&&(window.clearTimeout(go),go=null)}function jo(){ho=null,go=null;let e=So(),t;e-$r>=120&&($r=e,t=Vo()),(Qr.size>8||li==null)&&lo(),ko(Sa(mo,void 0,t))}function Mo(e){if(!Zt.value||(mo=e,ho!=null||go!=null))return;let t=Math.max(0,s.virtualScroll?.emitIntervalMs??32),n=Math.max(0,t-(So()-_o)),r=()=>{go=null,ho=mn?mn(jo):null,ho??jo()};W&&n>0?go=window.setTimeout(r,n):r()}function No(){Kn.value+=1}function Po(e){if(Sn.value&&e>=Cn.value){let t=K.value[e],n=!0===et.value&&!0!==tt.value&&e>=K.value.length-2,r=t?.type===`code_block`||t?.type===`image`||t?.type===`mermaid`||t?.type===`infographic`;if(!n||r)return!1}return!Lr.value||e<bn.value||!!(st.value&&!0!==tt.value&&!s.nodes?.length&&e>=K.value.length-sn.value)||bi.value.has(e)}function Fo(e){let t=Si.get(e);t&&(t(),Si.delete(e));let n=xi.get(e);n&&(n.destroy(),xi.delete(e)),wi(e)}function Io(e,t){let n=!1;if(t){let r=jn.get(e);if(r===t&&Mn.get(e)===Hr.value)return;jn.set(e,t),r!==t&&(n=!0)}else jn.delete(e)&&(n=!0);if(n&&No(),t||wi(e),!Vr.value||!pn)return Fo(e),t?Mn.set(e,Hr.value):Mn.delete(e),void(t&&Lr.value&&Ti(e,!0));if(!q.value&&Lr.value&&!ke.value&&xi.size>=U.value&&(ke.value||(ke.value=!0,Di()),!Vr.value||!pn))return Fo(e),Mn.set(e,Hr.value),void(t&&Ti(e,!0));if(e<bn.value&&!q.value||bi.value.has(e))return Fo(e),Mn.set(e,Hr.value),void Ti(e,!0);if(!t)return Fo(e),void Mn.delete(e);Fo(e);let r=pn(t,{rootMargin:Re.value});if(!r)return void Mn.delete(e);xi.set(e,r),Mn.set(e,Hr.value),Ti(e,r.isVisible.value),Lr.value&&function(e){if(!W||!Lr.value)return;wi(e);let t=e%17*23,n=window.setTimeout(()=>{if(Ci.delete(e),!Lr.value||bi.value.has(e))return;let t=jn.get(e);if(!t)return;let n=Je(t),r=t.ownerDocument||document,i=r.defaultView||window,a=!n||n===r.documentElement||n===r.body,o=!a&&n?G(`nodeVisibilityFallback.root.getBoundingClientRect`,()=>n.getBoundingClientRect()):null,s=a?0:o.top,c=a?G(`nodeVisibilityFallback.clientHeight`,()=>i.innerHeight??n?.clientHeight??0):o.bottom,l=G(`nodeVisibilityFallback.node.getBoundingClientRect`,()=>t.getBoundingClientRect());l.bottom>=s-500&&l.top<=c+500&&Ti(e,!0)},1800+t);Ci.set(e,n)}(e);let i=null;i=P(()=>r.isVisible.value,t=>{if(t){wi(e),Ti(e,!0),i?.(),Si.delete(e),xi.get(e)===r&&xi.delete(e);try{r.destroy()}catch{}}},{immediate:!0}),Si.set(e,i),q.value&&yi()}function Lo(){li=null,Ar(()=>{let e=!1;for(let[t,n]of Qr)Qr.delete(t),qr.get(t)===n.el&&Jr.get(t)===n.version&&(e=Pr(t,n.height,{allowShrink:n.allowShrink})||e);return e})}function Ro(){li!=null&&(hn?.(li),li=null),Qr.clear()}function zo(e,t,n){if(!Number.isFinite(n)||n<=0||qr.get(e)!==t)return;let r=Jr.get(e);if(r==null)return;let i=K.value[e],a=st.value&&!0!==tt.value&&!s.nodes?.length&&e>=K.value.length-2,o=!(!0===i?.loading||a),c=Qr.get(e),l=c?c.allowShrink&&o:o,u=c&&!l?Math.max(c.height,n):n;Qr.set(e,{height:u,allowShrink:l,version:r,el:t}),li??(li=mn?mn(Lo):null,li??Lo())}function Bo(e,t){zo(e,t,Fr(e,t))}function Vo(){let e=0;for(let[t,n]of qr){let r=Fr(t,n);e+=r,zo(t,n,r)}return e}function Ho(){Fn?.disconnect(),Fn=null,Nn.clear()}function Uo(){for(;Zr.length;)pi(Zr.pop())}P(Qt,e=>{e&&Mo(`content`)},{flush:`post`}),r({getVirtualMetrics:Sa,captureVirtualState:function(e={}){var t;return za(Sa(`manual`),{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!0===e.allowFallbackAnchor,requireViewport:!0===e.requireViewport,includeEmptyState:(t=e.includeEmptyState)==null||t})},restoreVirtualState:function(e,t={}){let n=!0===t.restoreAnchor,r=t.restoreToken==null?`imperative`:String(t.restoreToken);eo=e,to={restoreAnchor:n,restoreToken:r,allowUncapturedAnchor:!0===t.allowUncapturedAnchor},!ao(e,{restoreAnchor:n,restoreToken:r,allowUncapturedAnchor:!0===t.allowUncapturedAnchor})&&so(e)||(eo=null,to=null)},forceMeasure:function(e=`manual`){return pT(this,null,function*(){yield A(),yield uo(),Vo(),lo(),yield A();let t=Sa(e);return ko(t,!0),t})},settle:po,scrollToNode:function(e,t=`start`){Ua(),cr();let n=K.value.length;if(n<=0)return;let r=ji(e,0,n-1),i=()=>{let e=sr({nodeIndex:r,offsetWithinNodePx:0}),n=tr(r),i=Ca()?.clientHeight??0,a=ar(),o=e;if(t===`center`)o=e-i/2+n/2;else if(t===`end`)o=e-i+n;else if(t===`nearest`&&a!=null){if(e>=a&&e+n<=a+i)return;o=e<a?e:e-i+n}or(Math.max(0,o)),yi({immediate:!0}),q.value&&(Wr.value=r,Kr())};if(q.value)return Wr.value=r,Kr(),void A(i);i()}});let Wo=new Set;P(()=>cn.value,e=>{if(e)Yr.clear();else{Ho();for(let e of Xr.values())for(let t of e)pi(t);Xr.clear(),Jr.clear(),Uo(),Ro()}},{immediate:!0}),P(tt,e=>{e&&function(){if(W&&tt.value&&qr.size){Uo();for(let e of Fn?[80]:[80,240,640]){let t=fi(e,()=>{for(let[e,t]of qr)t&&Bo(e,t)},`final`);t!=null&&Zr.push(t)}}}(),Mo(e?`final`:`content`)});let Go=KO(()=>Mo(`content`),16),Ko=KO(()=>Mo(`batch`),16);P([()=>K.value.length,()=>Cn.value],()=>{Yn.value&&Wa(),Go()},{flush:`post`,immediate:!0}),P([()=>Gr.start,()=>Gr.end],()=>{Ko()},{flush:`post`});let{cleanupBatchScheduler:qo}=function(e){let{props:t,isClient:n,isTestEnv:r,parsedNodesIdentity:i,parsedNodeCount:a,desiredRenderedCount:o,datasetKey:s,batchingEnabled:c,incrementalRenderingActive:l,resolvedBatchSize:u,resolvedInitialBatch:d,renderedCount:f,adaptiveBatchSize:p,previousRenderContext:m,previousBatchConfig:h,requestFrame:g,cancelFrame:_,hasIdleCallback:v,cleanupNodeVisibility:y,onDatasetKeyChanged:b,onDatasetChanged:x}=e,S=null,C=`raf`,w=null,T=0,E=!1,D=!1,O=new Set,k=new Set;function j(){if(n){S!=null&&(C===`raf`&&_?_(S):C===`idle`&&typeof window.cancelIdleCallback==`function`?window.cancelIdleCallback(S):C===`timeout`&&window.clearTimeout(S),S=null),T+=1;for(let e of O)_&&_(e);for(let e of k)window.clearTimeout(e);O.clear(),k.clear(),w=null,E=!1,D=!1}}function M(){return typeof performance<`u`?performance.now():Date.now()}function N(e){(function(e){if(!l.value)return;let n=Math.max(2,t.renderBatchBudgetMs??6),r=Math.max(1,u.value||1),i=Math.max(1,Math.floor(r/4));e>1.5*n?p.value=Math.max(i,Math.floor(.8*p.value)):e<.6*n&&p.value<r&&(p.value=Math.min(r,Math.ceil(1.2*p.value)))})(e),E=!1;let n=D||f.value<o.value;D=!1,n&&ne()}function ee(e,i={}){if(!l.value)return;let a=o.value;if(f.value>=a)return;let s=Math.max(1,e),c=()=>{let e=M();S=null;let r=w??s;w=null;let i=M();f.value=Math.min(a,f.value+r),y(f.value),function(e,r){if(!n)return void N(r);E=!0;let i=++T;A().then(()=>{if(i!==T)return;let n=M(),a=Math.max(r,n-e),o=()=>{i===T&&N(a)};if(g){let e=null,n=null,r=!1,i=()=>{r||(r=!0,e!==null&&(O.delete(e),e=null),n!==null&&(k.delete(n),window.clearTimeout(n),n=null),o())};e=g(()=>{i()}),O.add(e),n=window.setTimeout(()=>{e!==null&&_&&_(e),i()},Math.max(32,t.renderBatchIdleTimeoutMs??120)),k.add(n);return}let s=window.setTimeout(()=>{k.delete(s),o()},0);k.add(s)})}(e,M()-i)};if(!n||i.immediate)return void c();let u=Math.max(0,t.renderBatchDelay??16);if(w=w==null?s:Math.max(w,s),S!=null)return;let d=typeof document<`u`&&document.visibilityState===`hidden`;if(!r&&!d&&v&&window.requestIdleCallback){let e=Math.max(0,t.renderBatchIdleTimeoutMs??120);C=`idle`,S=window.requestIdleCallback(()=>c(),{timeout:e})}else{if(g&&!r&&!d)return C=`raf`,void(S=g(()=>{u===0?c():(C=`timeout`,S=window.setTimeout(()=>c(),u))}));C=`timeout`,S=window.setTimeout(()=>c(),u)}}function te(e,t={}){E?D=!0:e==null?ne():ee(e,t)}function ne(){l.value&&ee(c.value?Math.max(1,Math.round(p.value)):Math.max(1,u.value))}return P([i,a,s,l,u,d,()=>t.renderBatchDelay],()=>{let e=a.value,r=m.value,i=s.value,c=!Object.is(i,r.key),g=e!==r.total,_=g&&e>r.total&&r.total>0&&!c,v=c||g;m.value={key:i,total:e};let S=h.value,C=t.renderBatchDelay??16,w=S.batchSize!==u.value||S.initial!==d.value||S.delay!==C||S.enabled!==l.value;h.value={batchSize:u.value,initial:d.value,delay:C,enabled:l.value},c&&b(e),(v||w||!l.value)&&j(),(v&&!_||w)&&(p.value=Math.max(1,u.value||1)),v&&!_&&x();let T=o.value;if(!e)return f.value=0,void y(0);if(!l.value)return f.value=T,void y(f.value);let E=c||r.total===0;f.value=E||w?Math.min(T,d.value):Math.min(f.value,T);let D=Math.max(1,d.value||u.value||e);f.value<T?te(D,{immediate:!n}):y(f.value)},{immediate:!0}),P(o,(e,t)=>{l.value&&(typeof t==`number`&&e<=t||e>f.value&&te())}),{cleanupBatchScheduler:j}}({props:V,isClient:W,isTestEnv:_n,parsedNodesIdentity:Lt,parsedNodeCount:Rt,desiredRenderedCount:ui,datasetKey:aa,batchingEnabled:xn,incrementalRenderingActive:Sn,resolvedBatchSize:yn,resolvedInitialBatch:bn,renderedCount:Cn,adaptiveBatchSize:Tn,previousRenderContext:wn,previousBatchConfig:En,requestFrame:mn,cancelFrame:hn,hasIdleCallback:gn,cleanupNodeVisibility:Ei,onDatasetKeyChanged:e=>{Ro(),Mr(),er(),Eo(),e>0&&xr(e)},onDatasetChanged:()=>{q.value&&yi({immediate:!0})}});P([Ur,q,()=>H.value,()=>ze()],([e,t])=>{if(!e)return Oi(),void vi();ki(),t?yi({immediate:!0}):vi()},{flush:`post`,immediate:!0});let Jo=!1;function Yo(){q.value&&W&&!Jo&&(Jo=!0,mn?mn(()=>{Jo=!1,yi({immediate:!0})}):queueMicrotask(()=>{Jo=!1,yi({immediate:!0})}))}P([()=>K.value.length,()=>q.value],([e,t])=>{t&&e&&W&&Yo()},{flush:`post`}),P($t,e=>{e&&function(){if(zt.value&&Bt.value&&Vt.value&&Ht.value?.[1])return;let e=f({type:`paragraph`,children:[{type:`text`,content:`Probe paragraph text`,raw:`Probe paragraph text`}],raw:`Probe paragraph text`}),t=f({type:`list_item`,children:[e],raw:`- Probe paragraph text`}),n=f({type:`list`,ordered:!1,items:[t],raw:`- Probe paragraph text`});zt.value=e,Bt.value=t,Vt.value=n;let r={1:null,2:null,3:null,4:null,5:null,6:null};for(let e=1;e<=6;e++)r[e]=f({type:`heading`,level:e,text:`Probe heading`,children:[{type:`text`,content:`Probe heading`,raw:`Probe heading`}],raw:`${`#`.repeat(e)} Probe heading`});Ht.value=r}()},{immediate:!0}),P([()=>H.value,Rr],()=>{if(!Rr.value)return Ri(),void(Ne.value=0);Ii(),Ri(),Rr.value&&H.value&&typeof ResizeObserver<`u`&&(Li=new ResizeObserver(()=>{Ii(),$t.value&&(ir.value&&lr(),Yn.value&&Wa(),Mo(`resize`))}),Li.observe(H.value))},{immediate:!0}),P([$t,rn,ia],()=>pT(null,null,function*(){if(!$t.value)return Pe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void er();yield A(),function(){if(!$t.value||typeof window>`u`)return Pe.value={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},void er();let e={paragraph:null,listItem:null,listWrapperOverhead:0,headings:{1:null,2:null,3:null,4:null,5:null,6:null}},t=Pi(Ni(Te.value),`.paragraph-node`);e.paragraph=VO(Te.value,t,`pre-wrap`);let n=Ni(Ee.value)?.querySelector(`.paragraph-node`);e.listItem=VO(Ee.value,n,`pre-wrap`);let r=G(`readSimpleTextProbeProfile.list.offsetHeight`,()=>De.value?.offsetHeight??0),i=G(`readSimpleTextProbeProfile.listItem.offsetHeight`,()=>Ee.value?.offsetHeight??0);e.listWrapperOverhead=Math.max(0,r-i);for(let t=1;t<=6;t++){let n=Pi(Ni(Oe[t]),`h${t}`);e.headings[t]=VO(Oe[t],n,`pre-wrap`)}Pe.value=e,er()}()}),{flush:`post`,immediate:!0}),P(()=>K.value.length,()=>{q.value&&Yo()}),P([$t,Ne],()=>{er(),q.value&&yi({immediate:!0}),ir.value&&lr(),Yn.value&&Wa(),Mo(`resize`)},{immediate:!1}),P(()=>Lr.value,e=>{if(e)for(let[e,t]of jn)Io(e,t);else if(Di(),q.value)yi({immediate:!0});else for(let[e,t]of jn)t&&Ti(e,!0)},{immediate:!1}),P([Re,U,()=>ze()],()=>{var e;(e=pn.refresh)==null||e.call(pn);for(let[e,t]of jn)Io(e,t)},{immediate:!1}),P([()=>V.viewportPriority,()=>K.value.length,U],([e,t,n])=>{if(!1!==e){if(ke.value&&(t<=200||t<=n)){ke.value=!1;for(let[e,t]of jn)Io(e,t)}}else ke.value=!1}),P(()=>Cn.value,()=>{q.value&&yi({immediate:!0})}),P([Wr,on,sn,()=>K.value.length,q],()=>{Kr()},{immediate:!0});let Xo=null,Zo=!1,Qo=null;function $o(){Xo=null,ma=null,pa=void 0,ha=null,Eo()}function es(){Ro(),Mr(),er(),Ln.length=0;let e=K.value.length;e>0&&xr(e),co()}function ts(){Ao(),mi(),vo=null,Za=null,Qa=null,$a=null,eo=null,to=null,Zo=!1,$o(),la(`restore`),cr(),Ua()}function ns(e){return[Qi()??``,J(),ta(),ra.value,wo(e),K.value.length,Math.round(nr(0,K.value.length)),Math.round(na()),mr.count,Math.round(mr.total)].join(`:`)}function rs(){return pT(this,null,function*(){let e=s.virtualScroll?.settledToken,t=wo(e),n=J(),r=Qi(),i=ia.value;if(Zt.value&&s.virtualScroll?.settleMode===`manual`&&ga(e)){if(va()){if(ns(e)!==ha&&!Zo){Zo=!0;try{let e=yield po({reason:`manual`,expectedSettledTokenKey:t}),a=wo()===t;fo(n,r,i)&&e.sessionKey===n&&e.threadKey===r&&a&&e.stable&&e.phase===`final`&&(ha=ns(s.virtualScroll?.settledToken))}finally{Zo=!1,yield A();let e=s.virtualScroll?.settledToken,t=ga(e)?ns(e):``;fo(n,r,i)&&t&&ha!==t&&rs()}}}else Mo(`manual`)}})}P(Zt,(e,t)=>{if(e!==t){if(!e)return ts(),void Ao();ts(),es(),Qo=ia.value,Mo(`content`)}},{flush:`post`}),P([Zt,ia],([e,t])=>{e?Qo==null?Qo=t:Qo!==t&&(Qo=t,function(e=`resize`){Ro(),Mr(),er(),Ln.length=0;let t=K.value.length;t>0&&xr(t),co(),Za=null,Qa=null,$a=null,vo=null,Zo=!1,$o(),ro(),A(()=>{Vo(),ir.value&&lr(),Yn.value&&Wa(),Mo(e)})}(`resize`)):Qo=null},{flush:`post`,immediate:!0}),P([Zt,()=>J(),()=>Qi()],([e])=>{e&&(ts(),es(),la(`content`),Mo(`content`))}),P([Zt,()=>J(),()=>Qi(),ia,()=>K.value.length],([e])=>{e&&function(e=`async-node`){let t=!1;for(let[e,n]of Array.from(ai.entries()))sa(n)||(si-=Math.max(0,ii.get(e)??0),ai.delete(e),ii.delete(e),t=!0);t&&(oa(),Mo(e))}(`async-node`)},{flush:`post`}),P([Zt,()=>s.virtualScroll?.sessionKey,()=>s.virtualScroll?.measurementKey,()=>s.indexKey,()=>je.value],([e])=>{e&&(Eo(),function(e=`content`){if(!Zt.value)return;let t=[],n=K.value.length,r=Mi(n),i=Ln.length-1,a=Math.max(n-1,i);for(let e=r;e<=a;e++){if(e>=n){e<=i&&Ln[e]!==void 0&&t.push(e);continue}let r=Ia(e),a=Ln[e];a!=null&&a!==r&&t.push(e),Ln[e]=r}if(i>=n){for(let e=n;e<=i;e++)Ln[e]=void 0;Ln.length=n}t.length&&(function(e,t={}){let n=Array.from(e,Number);kr(n);let r=0;if(Ar(()=>(r=wr(n,t),r>0)),r>0)(function(e){for(let t of e)Number.isInteger(t)&&t>=0&&t<Ln.length&&(Ln[t]=void 0)})(n);else for(let e of n)Un.delete(e)}(t,{notify:!1}),er(r),$o(),ir.value&&lr(),Yn.value&&Wa(),Mo(e))}(`content`))},{flush:`post`,immediate:!0}),P([Zt,()=>K.value.length,()=>J(),()=>Qi()],([e,t,n,r],[i,a,o,s])=>{e&&i&&n===o&&r===s&&t!==a&&$o()},{flush:`post`}),P([Zt,()=>s.virtualScroll?.heightCache,()=>s.virtualScroll?.heightCacheWidth,()=>s.virtualScroll?.restoreState,()=>s.virtualScroll?.measurementKey,()=>K.value.length,()=>J(),Ne],()=>{ro()},{flush:`post`,immediate:!0}),P(io,(e,t)=>{e==null&&t!=null&&(cr(),ir.value=null,Ua(),$a=null)},{flush:`post`}),P([Zt,()=>s.virtualScroll?.restoreState,()=>s.virtualScroll?.restoreAnchor,()=>s.virtualScroll?.measurementKey,()=>K.value.length,()=>J(),Ne],e=>pT(null,[e],function*([e,t]){if(!e||!t)return;yield A();let n=io();ao(t,{restoreAnchor:n!=null,restoreToken:n??void 0})}),{flush:`post`,immediate:!0}),P([Zt,Ne,()=>s.virtualScroll?.restoreState,()=>s.virtualScroll?.measurementKey],([e])=>{if(!e)return;let t=s.virtualScroll?.restoreState;t&&Za&&Qa===`restore`&&(Ja(t)||(es(),Za=null,Qa=null,Mo(`resize`)))},{flush:`post`}),P([Zt,()=>K.value.length,()=>J(),Ne],e=>pT(null,[e],function*([e]){let t=eo,n=to;e&&t&&(yield A(),!ao(t,{restoreAnchor:!0===n?.restoreAnchor,restoreToken:n?.restoreToken??`imperative`,allowUncapturedAnchor:!0===n?.allowUncapturedAnchor})&&so(t)||(eo=null,to=null))}),{flush:`post`,immediate:!0}),P([Zt,tt,()=>s.virtualScroll?.settleMode,()=>J(),()=>Qi(),ia,ci,ri,()=>Cn.value,ui,()=>mr.count,()=>mr.total],([e,t,n])=>{if(!e||!0!==t||n===`manual`||!ba())return;let r=function(){let e=K.value.length;return[Qi()??``,J(),ta(),ra.value,e,Math.round(nr(0,e)),Math.round(na()),mr.count,Math.round(mr.total)].join(`:`)}();Xo!==r&&(Xo=r,po({reason:`final`}).then(e=>{e.stable||Xo!==r||(Xo=null)}))},{flush:`post`,immediate:!0}),P([Zt,tt,()=>s.virtualScroll?.settleMode,()=>s.virtualScroll?.settledToken,()=>J(),()=>Qi(),ia,ci,ri,()=>Cn.value,ui,()=>K.value.length,()=>mr.count,()=>mr.total],()=>{rs()},{flush:`post`,immediate:!0}),P([()=>K.value.length,q,on,sn,()=>Gr.start,()=>Gr.end],([e,t,n,r,i,a])=>{He.value&&ht(`virtualization`,{nodes:e,virtualization:t,maxLiveNodes:n,buffer:r,focusIndex:Wr.value,scroll:t?(()=>{let e=Jn.value||Je();return e?{reverse:Ye(e),scrollTop:Math.round(e.scrollTop),scrollTopAbs:Math.round(Math.abs(e.scrollTop)),scrollHeight:Math.round(e.scrollHeight),clientHeight:Math.round(e.clientHeight)}:null})():null,liveRange:{start:i,end:a},rendered:Cn.value})}),P([()=>V.customId],([e],t,n)=>{if(!e||Ut)return;let r=function(e,t){return e?(CO.controllers[e]=t,()=>{CO.controllers[e]===t&&delete CO.controllers[e]}):()=>{}}(e,{captureRestoreAnchor:ur,restoreAnchor:dr,getAnchorDrift:fr,getReport:Yi});n(()=>{r()})},{immediate:!0}),u(()=>{(function(){if(Zt.value)try{Vo(),lo();let e=Sa(`manual`);Co(e)&&(Se(e),vo=e,_o=So());let t=za(e,{includeHeightCache:!0,includeContentHash:!0,allowAnchorFallback:!1,requireViewport:!0,includeEmptyState:!0});t&&(Ce(t),t.anchor&&we(t.anchor),yo=Oo(t))}catch{}})(),qo(),Di(),pt(),Ho();for(let e of Xr.values())for(let t of e)pi(t);Xr.clear(),Jr.clear(),Ln.length=0,Uo(),Ro(),Ri(),cr(),Ua(),Ao(),Oi(),vi()});let is=rD(`ViewportDeferredMermaidBlockNode`,re({loader:()=>pT(null,null,function*(){try{return(yield B(()=>import(`./index10-C9Xw5wOS.js`),__vite__mapDeps([11,0,1,8]))).default}catch(e){return console.warn(`[markstream-vue] Optional peer dependencies for MermaidBlockNode are missing. Falling back to preformatted code rendering. To enable Mermaid rendering, please install "mermaid".`,e),eD}}),loadingComponent:eA,delay:0}),eA),as=rD(`ViewportDeferredInfographicBlockNode`,re({loader:()=>pT(null,null,function*(){try{return(yield B(()=>import(`./index8-DLEM8iM5.js`),__vite__mapDeps([12,0,1]))).default}catch(e){return console.warn(`[markstream-vue] Failed to load InfographicBlockNode. Showing the Infographic source fallback. To enable Infographic rendering, install "@antv/infographic" and configure setInfographicLoader with a dynamic loader.`,e),$k}}),loadingComponent:$k,delay:0}),$k),os=rD(`ViewportDeferredD2BlockNode`,re({loader:()=>pT(null,null,function*(){try{return(yield B(()=>import(`./index9-CUy1AFI-.js`),__vite__mapDeps([13,0,1]))).default}catch(e){return console.warn(`[markstream-vue] Optional peer dependencies for D2BlockNode are missing. Falling back to preformatted code rendering. To enable D2 rendering, please install "@terrastruct/d2".`,e),eD}}),loadingComponent:Yk,delay:0}),Yk),ss={text:nD,paragraph:sO,heading:JD,code_block:oD,list:eO,list_item:$D,blockquote:ID,table:hO,definition_list:BD,footnote:GD,footnote_reference:FT,footnote_anchor:HD,admonition:_A,vmr_container:bO,hardbreak:jD,link:CD,image:RE,thematic_break:_O,math_inline:sD,math_block:cD,strong:gD,emphasis:kD,strikethrough:vD,highlight:DD,insert:TD,subscript:mD,superscript:fD,emoji:AT,checkbox:OT,checkbox_input:OT,inline_code:$T,html_inline:JT,reference:uD,html_block:iO},cs=O(()=>Xi()),ls=O(()=>UO(V.codeBlockProps)),us=O(()=>UO(V.codeBlockProps)),ds=O(()=>Q(Z(Z({stream:V.codeBlockStream,darkTheme:V.codeBlockDarkTheme,lightTheme:V.codeBlockLightTheme,themes:V.themes,minWidth:V.codeBlockMinWidth,maxWidth:V.codeBlockMaxWidth},typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{}),us.value),{codeBlockOptions:V.codeBlockOptions})),fs=O(()=>Q(Z(Z({},ds.value),ls.value),{codeBlockOptions:V.codeBlockOptions}));function ps(e){return typeof e==`boolean`?e:void 0}let ms=O(()=>{var e,t;let n=V.codeBlockProps||{},r={};r.showLineNumbers=ps(n.showLineNumbers)??!0!==V.codeBlockOptions?.disableLineNumbers,r.showHeader=(e=ps(n.showHeader))==null||e,r.showCopyButton=(t=ps(n.showCopyButton))==null||t,typeof n.clipboardWriter==`function`&&(r.clipboardWriter=n.clipboardWriter);let i=ps(n.showTooltips)??Ue.value;typeof i==`boolean`&&(r.showTooltips=i),r.codeBlockOptions=V.codeBlockOptions,r.isDark=V.isDark,r.darkTheme=n.darkTheme??V.codeBlockDarkTheme,r.lightTheme=n.lightTheme??V.codeBlockLightTheme,r.theme=n.theme,r.themes=n.themes??V.themes;let a=ps(n.diffInline);a!==void 0&&(r.diffInline=a),n.diffHideUnchangedRegions!==void 0&&(r.diffHideUnchangedRegions=n.diffHideUnchangedRegions);let o=function(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0}(n.reservedHeightPx);return o!==void 0&&(r.reservedHeightPx=o),r}),hs=O(()=>Z({},V.mermaidProps||{})),gs=O(()=>Z({},V.d2Props||{})),_s=O(()=>Z({},V.infographicProps||{})),vs,ys=O(()=>{let e=ae.value,t=V.fade,n=Nt.value.customHtmlTags;return vs?.typewriter===e&&vs.fade===t&&vs.customHtmlTags===n?vs:vs={typewriter:e,fade:t,customHtmlTags:n}}),bs=O(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltip:Ue.value}:{})),xs=O(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{})),Ss=O(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{})),Cs=O(()=>Z(Z({},ys.value),typeof Ue.value==`boolean`?{showTooltips:Ue.value}:{}));function ws(e){return Array.isArray(e.children)&&e.children.length>0}let Ts=new WeakMap,Es=new WeakMap,Ds=[],Os=[],ks=null,As=[];function js(e,t){let n=String(e?.code??``),r=Es.get(e);if(r&&r.code===n)return r.height;let i=t(n);return Es.set(e,{code:n,height:i}),i}function Ms(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}let Ns=O(()=>{let e=new Map,t=new Map;return K.value.forEach((n,r)=>{if(n.type!==`footnote`)return;let i=n.id,a=e.get(i)??0;t.set(r,a),e.set(i,a+1)}),t});function Ps(e,n){let r=function(e,t,n){let r=$t.value?Wi.value[t]:null;return[t,e.loading,r,n]}(e.node,e.index,n),i=Ts.get(e.node);if(i&&Ms(i.signature,r))return i.item;let a=function(e,t){if(e.type!==`code_block`)return In[t]=void 0,e;let n=e,r=[n.language,n.loading,n.diff,n.code,n.originalCode,n.updatedCode,n.raw,n.startLine,n.endLine,n.sourceMap?.startLine,n.sourceMap?.endLine],i=In[t];if(i&&r.every((e,t)=>e===i.signature[t]))return i.node;let a=Z({},n);return In[t]={signature:r,node:a},a}(e.node,e.index),o=Is(a),s=Vs(a,o);if((a.type===`html_block`||a.type===`html_inline`)&&s===ss[a.type]){let e=a,t=String(e.tag??``).trim().toLowerCase()||nf(e.content);if(t){let n=At.value[t];if(jt.value.has(t)&&n)s=n,a=Q(Z({},e),{type:t,tag:t,content:of(e.content,t)});else if(af(e.content??e.raw,t)){let t=String(e.content??e.raw??``);a.type===`html_inline`?(s=nD,a={type:`text`,content:t,raw:t}):(s=sO,a={type:`paragraph`,children:[{type:`text`,content:t,raw:t}],raw:t})}}}let c=a.type===`code_block`&&se.value&&s===aD&&!WO(At.value,o),l=Z({},function(e,t,n){let r=t??Is(e);if(e.type===`code_block`){let t=r?WO(At.value,r):void 0;if(n&&se.value&&!t&&n===aD)return ms.value;if(n&&r&&n===t)return r===`mermaid`?Rs(e):r===`infographic`?zs(e):r===`d2`||r===`d2lang`?Bs(e):fs.value;if(n&&n===At.value.code_block)return fs.value}return r===`mermaid`?Rs(e):r===`infographic`?zs(e):r===`d2`||r===`d2lang`?Bs(e):e.type===`link`?bs.value:e.type===`list`?xs.value:e.type===`blockquote`?Ss.value:e.type===`table`?Cs.value:e.type===`code_block`?ds.value:ys.value}(a,o,s)),u=$t.value?Wi.value[e.index]:null;a.type===`code_block`&&u?.kind===`code-block`&&(l=Q(Z({},l),c?{reservedHeightPx:u.contentHeight}:{estimatedHeightPx:u.height,estimatedContentHeightPx:u.contentHeight,estimatedDiffInline:u.diffInline})),c||a.type!==`code_block`||o!==`mermaid`||gw(l.estimatedPreviewHeightPx)!=null||(l=Q(Z({},l),{estimatedPreviewHeightPx:xw(js(a,vw))})),c||a.type!==`code_block`||o!==`infographic`||gw(l.estimatedPreviewHeightPx)!=null||(l=Q(Z({},l),{estimatedPreviewHeightPx:Cw(js(a,yw))})),a.type===`math_block`&&(l=Q(Z({},l),{cacheScope:kt}));let d=function(e,t){let n=String(e.type);return!bT(n)&&At.value[n]===t}(a,s),f=d?HT(a,We.value):void 0,p=a.loading,g=e.index;a.type===`footnote`&&s===GD&&(g=`footnote-${a.id}-${Ns.value.get(e.index)}`);let _=`${cs.value}-${g}`,v=Z({node:a,loading:p,"index-key":_},a.type===`reference`?{"data-markstream-reference-id":String(a.id)}:{}),b={"custom-id":V.customId,"is-dark":V.isDark},S={onCopy:m,onHandleArtifactClick:h},C={onClick:Hs,onMouseover:Gs,onMouseout:Ks},w={onMouseover:y,onMouseout:x},T=Z(Z({},f??{}),l),E=t(v,l,b,S),D=t(T,v,b,S),O={slotRef:t=>Io(e.index,t),contentRef:t=>function(e,t,n){if(n?Wo.add(t):Wo.delete(t),n&&!cn.value&&!Yr.has(e))return;if(n){let t=K.value[e],r=Yr.get(e);if(r&&r.el===n&&r.node===t&&r.loading===t?.loading)return}n||function(e){let t=`${Xi()}-${e}`,n=!1;for(let r of Array.from(ii.keys()))(ai.get(r)?.index===e||r===t||r.startsWith(`${t}-`))&&(si-=Math.max(0,ii.get(r)??0),ii.delete(r),ai.delete(r),n=!0);n&&(oa(),Mo(`async-node`))}(e),Qr.delete(e),function(e){let t=(Jr.get(e)??0)+1;Jr.set(e,t)}(e);let r=Xr.get(e);if(r){for(let e of r)pi(e);Xr.delete(e)}if(function(e){let t=Nn.get(e);t&&(Fn?.unobserve(t),Pn.delete(t),Nn.delete(e))}(e),!n||!cn.value)return qr.delete(e),Jr.delete(e),void Yr.delete(e);qr.set(e,n),Yr.set(e,{el:n,node:K.value[e],loading:K.value[e]?.loading});let i=()=>{Bo(e,n)};queueMicrotask(i);let a=(Fn||typeof ResizeObserver>`u`||(Fn=new ResizeObserver(e=>{if(e.length)for(let t of e){let e=Pn.get(t.target),n=Nn.get(e??-1);e!=null&&n&&Bo(e,n)}else Vo()})),Fn);if(a&&(Nn.set(e,n),Pn.set(n,e),a.observe(n)),typeof window<`u`){let t=K.value[e]?.type===`code_block`?[16,80,240,800]:tt.value?[80]:[];if(t.length){let n=t.map(e=>fi(e,i,`node-resize`)).filter(e=>e!=null);n.length&&Xr.set(e,n)}}}(e.index,O.vnodeKey,t),node:a,sourceLoading:p,index:e.index,component:s,bindings:l,customBindings:T,nodeProps:E,customNodeProps:D,fragmentNodeProps:t(E,C),customFragmentNodeProps:t(D,C),minimalNodeProps:t(E,w),rendersCustomNode:d,hasSlotChildren:ws(a),slotContent:String(a.content??``),isCodeBlock:a.type===`code_block`,indexKey:_,vnodeKey:`${$i.value}\0${g}\0${a.type}`};return Ts.set(e.node,{signature:r,item:O}),O}let Fs=O(()=>{let e=ks,t=function(){let e=[se.value,At.value,jt.value,We.value,$i.value,cs.value,kt,zi.value,V.customId,V.isDark,ms.value,ds.value,fs.value,hs.value,_s.value,gs.value,ys.value,bs.value,xs.value,Ss.value,Cs.value,$t.value,OO.value,Ne.value];return ks&&Ms(ks,e)?ks:(ks=e,e)}(),n=e!==t;if(ks=t,q.value)return Gi.value.map(e=>Ps(e,t));let r=K.value,i=r.length,a=!1;Ds.length>i&&(Ds.length=i,Os.length=i,a=!0);let o=Ds,s=Math.min(o.length,i),c=n?0:s;if(!n)for(let e=0;e<s;e++){let t=r[e];if(t.type===`code_block`){if(o[e]?.node!==In[e]?.node||Os[e]!==t||!Object.is(o[e]?.sourceLoading,t.loading)){c=e;break}}else if(o[e]?.node!==t||!Object.is(o[e]?.sourceLoading,t.loading)){c=e;break}}if(!a&&c===i)return As;for(let e=c;e<i;e++)o[e]=Ps({node:r[e],index:e},t),Os[e]=r[e];let l=o.slice();return As=l,l});function Is(e){return e?.type===`code_block`?String(e.language??``).trim().toLowerCase():``}function Ls(e,t,n,r){let i=Z({},e.value);return gw(i.estimatedPreviewHeightPx)??(i.estimatedPreviewHeightPx=r(js(t,n),void 0,i.maxHeight===`none`?null:gw(i.maxHeight)??void 0)),i}function Rs(e){return Ls(hs,e,vw,xw)}function zs(e){return Ls(_s,e,yw,Cw)}function Bs(e){return Ls(gs,e,Ow,ww)}function Vs(e,t){if(!e)return yO;let n=At.value,r=n[String(e.type)];if(e.type===`code_block`){let i=t??Is(e);return(i?WO(n,i):void 0)||(se.value?n.code_block||aD:i===`mermaid`?n.mermaid||is:i===`infographic`?n.infographic||as:i===`d2`||i===`d2lang`?n.d2||os:r||n.code_block||zi.value)}return r||ss[String(e.type)]||yO}function Hs(e){let t=e.target instanceof Element?e.target.closest(`[data-markstream-reference-id]`):null,n=e.currentTarget,r=t&&n instanceof Element&&n.contains(t)?t.dataset.markstreamReferenceId:void 0;d(`click`,e,r)}function Us(e){var t;(t=e.target)!=null&&t.closest(`[data-node-index]`)&&d(`mouseover`,e)}function Ws(e){var t;(t=e.target)!=null&&t.closest(`[data-node-index]`)&&d(`mouseout`,e)}function Gs(e){d(`mouseover`,e)}function Ks(e){d(`mouseout`,e)}let qs=I(null),Js=I(!1),Ys=I(null),Xs=O(()=>!(V.domMode!==`minimal`||Ve.value||!1!==V.fade||ae.value||Js.value||Dn.value||q.value||Yt.value||Kt.value||fn.value||Object.keys(At.value).length!==0)),Zs,Qs=null,$s=0,ec=0,tc=0,nc=[`code_block`,`admonition`,`table`,`math_block`,`html_block`,`image`,`thematic_break`],rc=new Set(nc),ic=[`.typewriter-cursor`,`.height-estimation-probes`,...nc.map(e=>`[data-node-type="${e}"]`),`script`,`style`].join(`,`);function ac(e){if(!e||typeof e!=`object`)return!1;let t=e.type;return typeof t==`string`&&rc.has(t)}function oc(e){if(!e||typeof e!=`object`)return 0;let t=e,n=t.raw??t.content??t.code;if(typeof n==`string`)return n.length;let r=t.children;if(Array.isArray(r))return r.reduce((e,t)=>e+oc(t),0);let i=t.items;return Array.isArray(i)?i.reduce((e,t)=>e+oc(t),0):0}function sc(){Zs&&=(clearTimeout(Zs),void 0)}function cc(){$s+=1,Qs!=null&&(hn?.(Qs),Qs=null)}function lc(){cc(),pc(),qs.value&&(qs.value.style.visibility=`hidden`)}function uc(e){if(e.nodeType!==Node.TEXT_NODE||!(e.textContent??``).trim())return!1;let t=e.parentElement;return!!t&&!t.closest(ic)}function dc(e){let t=e.lastChild;for(;t;){if(uc(t))return t;if(t.nodeType===Node.ELEMENT_NODE){let e=t;if(!e.matches(ic)&&e.lastChild){t=e.lastChild;continue}}for(;t&&t!==e&&!t.previousSibling;)t=t.parentNode;if(!t||t===e)break;t=t.previousSibling}return null}function fc(){let e=Fs.value;for(let t=e.length-1;t>=0;t--){let n=e[t];if(!n||ac(n.node)||!Po(n.index))continue;let r=jn.get(n.index);if(!r)continue;let i=dc(r);if(i)return i}return null}function pc(){Ys.value&&=(Ys.value.classList.remove(oA),null)}function mc(){if(ie.value!==`simple`||!W||!Js.value||!H.value)return void pc();let e=fc(),t=e?function(e){let t=e.parentElement?.closest(`.text-node`);return t instanceof HTMLElement?t:e.parentElement}(e):null;t!==Ys.value&&(pc(),t&&(t.classList.add(oA),Ys.value=t))}function hc(){if(ie.value!==`precise`||!W||!Js.value||Qs!=null)return;let e=$s,t=()=>{Qs=null,e===$s&&function(){if(ie.value!==`precise`||!(W&&Js.value&&H.value&&qs.value))return;let e=H.value,t=qs.value;t.style.visibility=`hidden`;let n=fc();if(!n)return;let r=0,i=0,a=20,o=!1;if(n?.textContent){let t=n.textContent.length,s=document.createRange();s.setStart(n,Math.max(0,t-1)),s.setEnd(n,t);let c=typeof s.getClientRects==`function`?s.getClientRects():void 0,l=c?.[c.length-1]??n.parentElement?.getBoundingClientRect();if(l){let t=G(`typewriterCursor.root.getBoundingClientRect`,()=>e.getBoundingClientRect());r=l.right-t.left+e.scrollLeft,i=l.top-t.top+e.scrollTop,a=l.height||a,o=!0}s.detach()}o&&(t.style.transform=`translate(${Math.max(0,r)}px, ${Math.max(0,i)}px)`,t.style.height=`${a}px`,t.style.visibility=`visible`)}()};mn?Qs=mn(t):t()}return P([$e,()=>s.content,()=>s.nodes,()=>V.typewriter,tt],()=>pT(null,null,function*(){if(!W||Ve.value||!Ke.value)return;if(!ae.value)return void((Js.value||Zs||Qs!=null||Ys.value||qs.value)&&(Js.value=!1,sc(),lc()));if(tt.value)return Js.value=!1,sc(),void lc();if(s.nodes?.length)return Js.value=!1,sc(),lc(),ec=(s.content??``).length,void(tc=$e.value.length);let e=function(){return s.nodes?.length?s.nodes.reduce((e,t)=>e+oc(t),0):(s.content??``).length}(),t=function(){return s.nodes?.length?s.nodes.reduce((e,t)=>e+oc(t),0):$e.value.length}(),n=!ac(K.value[K.value.length-1]),r=e>ec,i=t>tc;if(!ae.value||!n||!r&&!i)return ae.value&&n||(Js.value=!1,lc()),ec=e,void(tc=t);ec=e,tc=t,Js.value=!0,ie.value===`precise`&&qs.value&&(qs.value.style.visibility=`hidden`),sc(),yield A(),ie.value===`simple`?mc():(pc(),hc()),Zs=setTimeout(()=>{Zs=void 0,Js.value=!1},3e3)}),{flush:`post`,immediate:!0}),P(Js,e=>pT(null,null,function*(){e?(yield A(),ie.value===`simple`?mc():(pc(),ie.value===`precise`&&hc())):lc()}),{flush:`post`}),P(ie,()=>pT(null,null,function*(){if(W&&!Ve.value&&Ke.value&&Js.value){if(yield A(),ie.value===`simple`)return cc(),void mc();pc(),ie.value===`precise`?hc():lc()}}),{flush:`post`}),P([()=>Cn.value,()=>Gr.start,()=>Gr.end],()=>pT(null,null,function*(){W&&!Ve.value&&Ke.value&&Js.value&&(yield A(),ie.value===`simple`?mc():(pc(),ie.value===`precise`&&hc()))}),{flush:`post`}),u(()=>{sc(),cc(),pc(),Ot.clear()}),(e,n)=>{let r=g(`NodeRenderer`,!0);return k(Ve)?(p(!0),R(E,{key:0},_(Fs.value,e=>(p(),R(E,{key:e.vnodeKey},[e.rendersCustomNode?(p(),S(v(e.component),t({key:0,ref_for:!0},e.customFragmentNodeProps),{default:b(()=>[e.hasSlotChildren?(p(),S(r,t({key:0,ref_for:!0},It.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):e.slotContent?(p(),S(r,t({key:1,ref_for:!0},It.value,{content:e.slotContent,final:!e.node.loading,"index-key":`${e.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:2},1040)):(p(),S(v(e.component),t({key:1,ref_for:!0},e.fragmentNodeProps),null,16))],64))),128)):(p(),R(`div`,{key:1,ref_key:`containerRef`,ref:H,class:C([`markstream-vue markdown-renderer`,[{dark:V.isDark},{virtualized:q.value},{"virtual-scroll-coordinated":Qt.value},{"stable-layout":Br.value},{"typewriter-simple-cursor":Js.value&&ie.value===`simple`}]]),"data-custom-id":V.customId,onClick:Hs,onMouseover:Us,onMouseout:Ws},[en.value||q.value?(p(),R(E,{key:0},[en.value?(p(),S(Qk,{key:0,width:rn.value,"flow-root":q.value||Qt.value,"paragraph-node":zt.value,"list-item-node":Bt.value,"list-node":Vt.value,"heading-nodes":Ht.value,"set-paragraph-wrapper":hi,"set-list-item-wrapper":gi,"set-list-wrapper":_i,"set-heading-wrapper":Fi},null,8,[`width`,`flow-root`,`paragraph-node`,`list-item-node`,`list-node`,`heading-nodes`])):L(``,!0),q.value?(p(),R(`div`,{key:1,class:`node-spacer`,style:F({height:`${Ki.value}px`}),"aria-hidden":`true`},null,4)):L(``,!0)],64)):L(``,!0),Xs.value?(p(!0),R(E,{key:1},_(Fs.value,e=>(p(),R(E,{key:e.vnodeKey},[Po(e.index)?(p(),S(v(e.component),t({key:0,ref_for:!0},e.minimalNodeProps),null,16)):L(``,!0)],64))),128)):(p(!0),R(E,{key:2},_(Fs.value,e=>(p(),R(`div`,{key:e.vnodeKey,ref_for:!0,ref:e.slotRef,class:`node-slot`,"data-node-index":e.index,"data-node-type":e.node.type},[k(Wo).has(e.vnodeKey)||Po(e.index)?(p(),R(`div`,{key:0,ref_for:!0,ref:e.contentRef,class:`node-content`},[e.isCodeBlock?e.rendersCustomNode?(p(),S(v(e.component),t({key:1,ref_for:!0},e.customNodeProps),{default:b(()=>[e.hasSlotChildren?(p(),S(r,t({key:0,ref_for:!0},It.value,{nodes:e.node.children,"index-key":e.indexKey,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`nodes`,`index-key`])):e.slotContent?(p(),S(r,t({key:1,ref_for:!0},It.value,{content:e.slotContent,final:!e.node.loading,"index-key":`${e.indexKey}-content`,"smooth-streaming":!1,"batch-rendering":!1,"defer-nodes-until-visible":!1,"render-as-fragment":!0}),null,16,[`content`,`final`,`index-key`])):L(``,!0)]),_:2},1040)):(p(),S(v(e.component),t({key:2,ref_for:!0},e.nodeProps),null,16)):(p(),S(tA,{key:0,item:e,"source-nodes":s.nodes,fade:V.fade,"nested-renderer-props":e.rendersCustomNode?It.value:void 0},null,8,[`item`,`source-nodes`,`fade`,`nested-renderer-props`]))],512)):(p(),R(`div`,{key:1,class:`node-placeholder`,style:F({height:`${tr(e.index)}px`})},null,4))],8,aA))),128)),Js.value&&ie.value===`precise`?(p(),R(`span`,{key:3,ref_key:`typewriterCursorRef`,ref:qs,class:`typewriter-cursor`,"aria-hidden":`true`},null,512)):L(``,!0),q.value?(p(),R(`div`,{key:4,class:`node-spacer`,style:F({height:`${qi.value}px`}),"aria-hidden":`true`},null,4)):L(``,!0)],42,iA))}}})),[[`__scopeId`,`data-v-f4ebaa7e`]]),cA=sA;cA.install=e=>{let t=new Set([`MarkdownRender`,`NodeRenderer`,cA.__name,cA.name].filter(e=>!!e));for(let n of t)e.component(n,sA)};var lA=Object.freeze(Object.defineProperty({__proto__:null,default:cA},Symbol.toStringTag,{value:`Module`})),uA={key:0,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},dA={key:1,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},fA={key:2,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},pA={key:3,xmlns:`http://www.w3.org/2000/svg`,width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,class:`admonition-icon`},mA={class:`admonition-title`},hA=[`aria-expanded`,`aria-controls`],gA=[`id`],_A=$(h({__name:`AdmonitionNode`,props:{node:{},indexKey:{},isDark:{type:Boolean},typewriter:{type:Boolean},fade:{type:Boolean},customId:{}},emits:[`copy`],setup(e,{emit:t}){var n;let i=e,a=t,o=O(()=>{if(i.node.title&&i.node.title.trim().length)return i.node.title;let e=i.node.kind||`note`;return e.charAt(0).toUpperCase()+e.slice(1)}),s=I(!!i.node.collapsible&&!((n=i.node.open)==null||n));function c(){i.node.collapsible&&(s.value=!s.value)}let l=`admonition-${Math.random().toString(36).slice(2,9)}`;return(t,n)=>(p(),R(`div`,{class:C([`admonition`,[`admonition-${i.node.kind}`]])},[D(`div`,{id:l,class:`admonition-legend`},[i.node.kind===`note`||i.node.kind===`info`?(p(),R(`svg`,uA,[...n[1]||=[D(`circle`,{cx:`12`,cy:`12`,r:`10`},null,-1),D(`path`,{d:`M12 16v-4`},null,-1),D(`path`,{d:`M12 8h.01`},null,-1)]])):i.node.kind===`tip`?(p(),R(`svg`,dA,[...n[2]||=[D(`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`},null,-1),D(`path`,{d:`M9 18h6`},null,-1),D(`path`,{d:`M10 22h4`},null,-1)]])):i.node.kind===`warning`||i.node.kind===`caution`?(p(),R(`svg`,fA,[...n[3]||=[D(`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`},null,-1),D(`path`,{d:`M12 9v4`},null,-1),D(`path`,{d:`M12 17h.01`},null,-1)]])):i.node.kind===`danger`||i.node.kind===`error`?(p(),R(`svg`,pA,[...n[4]||=[D(`polygon`,{points:`7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2`},null,-1),D(`path`,{d:`M12 8v4`},null,-1),D(`path`,{d:`M12 16h.01`},null,-1)]])):L(``,!0),D(`span`,mA,w(o.value),1),i.node.collapsible?(p(),R(`button`,{key:4,class:`admonition-toggle`,"aria-expanded":!s.value,"aria-controls":`${l}-content`,onClick:c},[(p(),R(`svg`,{style:F({rotate:s.value?`0deg`:`90deg`}),xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...n[5]||=[D(`path`,{d:`m9 18 6-6-6-6`},null,-1)]],4))],8,hA)):L(``,!0)]),y(D(`div`,{id:`${l}-content`,class:`admonition-content`,"aria-labelledby":l},[r(k(cA),{"index-key":`admonition-${e.indexKey}`,nodes:i.node.children,"custom-id":i.customId,typewriter:i.typewriter,fade:i.fade,onCopy:n[0]||=e=>a(`copy`,e)},null,8,[`index-key`,`nodes`,`custom-id`,`typewriter`,`fade`])],8,gA),[[M,!s.value]])],2))}}),[[`__scopeId`,`data-v-a83480e1`]]);_A.install=e=>{e.component(_A.__name,_A)};var vA=()=>B(()=>import(`./d2_markstream-vue-xMoF3M5G.js`),[]),yA=null,bA=vA,xA=null,SA=!1,CA=!1,wA=0;function TA(e){bA=e,wA++,yA=null,xA=null,SA=!1,CA=!1}function EA(){TA(null)}function DA(){return pT(this,null,function*(){if(yA)return yA;let e=bA,t=wA;return e?e===vA&&SA?null:xA||(xA=pT(null,null,function*(){let n;try{n=yield e()}catch(n){if(e===vA)return t===wA&&e===bA&&(SA=!0,function(e){CA||(CA=!0,console.warn(`[markstream-vue] Optional dependency "@terrastruct/d2" is not installed. D2 blocks will render as source.`,e))}(n)),null;throw n}finally{t===wA&&e===bA&&(xA=null)}return t!==wA||e!==bA?null:n?(yA=function(e){if(!e)return e;if(e.D2&&typeof e.D2==`function`)return e.D2;if(e.default&&e.default.D2&&typeof e.default.D2==`function`)return e.default.D2;let t=e.default??e;return typeof t==`function`?t:t?.D2&&typeof t.D2==`function`?t.D2:t}(n),yA):null}),xA):null})}var OA=null,kA=null,AA=null,jA=0;function MA(e){kA=e??null,OA=null,AA=null,jA++}function NA(){MA()}function PA(){return typeof kA==`function`}function FA(){return pT(this,null,function*(){if(OA)return OA;let e=kA,t=jA;return e?AA||(AA=pT(null,null,function*(){let n=yield e();if(t!==jA||e!==kA)return null;let r=function(e){if(!e)return null;let t=e.default??e,n=typeof t==`function`&&typeof t.prototype?.render==`function`?t:e.Infographic??t?.Infographic;return typeof n==`function`?n:null}(n);return t!==jA||e!==kA?null:r?(OA=r,OA):null}).finally(()=>{t===jA&&e===kA&&(AA=null)}),AA):null})}function IA(e){let t=Number.parseFloat(String(e??``));return Number.isFinite(t)?t:0}function LA(e,t){e?.(t)}function RA(e,t){return e?(LA(t,`readElementBoxHeight.offsetHeight`),Math.ceil(Math.max(0,e.offsetHeight||0))):0}function zA(e,t){let n=RA(e,t);if(!e||typeof window>`u`||typeof window.getComputedStyle!=`function`)return n;LA(t,`readElementOuterHeight.getComputedStyle`);let r=window.getComputedStyle(e),i=IA(r.marginTop),a=IA(r.marginBottom);return Math.ceil(Math.max(0,n+i+a))}function BA(e,t,n){if(!e)return 0;let r=function(e){return e?e.matches?.call(e,`.markstream-vue.markdown-renderer`)?e:e.querySelector(`.markstream-vue.markdown-renderer`):null}(e);if(!r)return 0;let i=Number.isFinite(n)?Number(n):zA(e,t),a=RA(r,t);return Math.max(0,i-a)}function VA(e,t,n){let r=n.getKey?.call(n,e,t)??e.id??t;return String(r)}function HA(e,t,n){return n.getKind?.call(n,e,t)??String(e.kind??``)}function UA(e,t,n){let r=n.getContent?.call(n,e,t)??e.content;return typeof r==`string`?r:``}function WA(e,t,n){let r=n.getFinal?.call(n,e,t);if(typeof r==`boolean`)return r;let i=e.final;return typeof i!=`boolean`||i}function GA(e,t,n){return n.getRevision?.call(n,e,t)??e.revision}function KA(e,t,n){let r=HA(e,t,n);return r===`assistant-markdown`||r===`markdown`||!r&&UA(e,t,n).length>0}function qA(e,t,n){let r=n.estimateItemHeight?.call(n,e,t);if(Number.isFinite(r)&&r>0)return r;let i=HA(e,t,n);return i===`assistant-markdown`||i===`markdown`?360:i===`system-divider`?44:i===`tool-call`?72:i===`thinking`?92:i===`error`?76:i===`user-message`?88:UA(e,t,n).length>0?360:96}var JA=Symbol(`markstreamLanguageIconResolver`),YA=null;function XA(){return YA}function ZA(e){return pT(this,null,function*(){let t=YA;if(t&&typeof t.setRenderOptions==`function`)try{yield t.setRenderOptions({theme:e})}catch{}})}function QA(e){return re(e)}QA(()=>B(()=>import(`./index3-dduGUVTy.js`),__vite__mapDeps([14,7,0,1,6,8,3,4]))),QA(()=>B(()=>import(`./index5-Cxc_iCM3.js`),__vite__mapDeps([10,0,1]))),QA(()=>B(()=>import(`./index6-DsTT-iog.js`),__vite__mapDeps([9,0,1]))),QA(()=>B(()=>import(`./index10-C9Xw5wOS.js`),__vite__mapDeps([11,0,1,8]))),QA(()=>B(()=>import(`./index8-DLEM8iM5.js`),__vite__mapDeps([12,0,1]))),QA(()=>B(()=>import(`./index9-CUy1AFI-.js`),__vite__mapDeps([13,0,1]))),QA(()=>B(()=>import(`./index4-qdeznE4u.js`),__vite__mapDeps([15,2,0,1,3,4]))),QA(()=>B(()=>import(`./index7-Bgw61c0t.js`),__vite__mapDeps([16,0,1])));var $A=[`data-language`],ej=[`innerHTML`],tj={key:1};CT(`litepaseo`,{code_block:h({inheritAttrs:!1,__name:`CodeBlock`,props:{node:{}},setup(e){let t=e,n=O(()=>ae(t.node.diff?`diff`:String(t.node.language??``))),r=O(()=>String(t.node.code??``).replace(/\n$/,``)),i=O(()=>oe(r.value,n.value));return(e,t)=>(p(),R(`pre`,{class:`code`,"data-language":n.value??void 0},[i.value===null?(p(),R(`code`,tj,w(r.value),1)):(p(),R(`code`,{key:0,class:`hljs`,innerHTML:i.value},null,8,ej))],8,$A))}})});var nj=h({__name:`MarkdownMessage`,props:{content:{},final:{type:Boolean}},setup(e){QC(),Kw(),EA(),NA();let t=Object.freeze({showLineNumbers:!1,showHeader:!1,showCopyButton:!1});return(n,r)=>(p(),S(k(cA),{class:`prose`,mode:`chat`,"is-dark":k(ie),content:e.content,final:e.final,"smooth-streaming":!1,typewriter:!1,fade:!1,"code-block-stream":!1,"render-code-blocks-as-pre":!0,"code-block-props":k(t),"batch-rendering":!1,"defer-nodes-until-visible":!1,"node-virtual":!1,"viewport-priority":!1,"html-policy":`escape`,"custom-id":`litepaseo`},null,8,[`is-dark`,`content`,`final`,`code-block-props`]))}});export{ot as $,_w as A,nw as B,XO as C,iT as D,OE as E,vw as F,FC as G,dw as H,Cw as I,NC as J,zC as K,fw as L,yw as M,xw as N,aT as O,gw as P,mC as Q,tw as R,KA as S,hE as T,LC as U,ew as V,VC as W,SC as X,BC as Y,RC as Z,BA as _,XA as a,pe as at,ZA as b,ME as c,yt as ct,kE as d,nj as default,mt as dt,xe as et,qA as f,vt as ft,JA as g,eD as h,HA as i,ft as it,Sw as j,Xw as k,FA as l,dt as lt,WA as m,jE as n,ve as nt,zA as o,se as ot,GA as p,Qt as pt,MC as q,UA as r,de as rt,VA as s,ce as st,DA as t,st as tt,PA as u,pt as ut,$ as v,gE as w,SE as x,cA as y,hw as z};
|