srcly 1.0.0__tar.gz → 1.2.0__tar.gz
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.
- {srcly-1.0.0 → srcly-1.2.0}/PKG-INFO +1 -1
- srcly-1.0.0/app/static/assets/CodeModal-BaYjncYj.js → srcly-1.2.0/app/static/assets/CodeModal-B3bjl-Ss.js +1 -1
- srcly-1.2.0/app/static/assets/CompareApp-BsjkqC-L.js +3 -0
- srcly-1.2.0/app/static/assets/DependencyView-BDDpKKk8.js +1 -0
- srcly-1.0.0/app/static/assets/ScatterView-4PHaFV2z.js → srcly-1.2.0/app/static/assets/ScatterView-CLYnewZq.js +1 -1
- srcly-1.0.0/app/static/assets/chevron-left-CGokVLxh.js → srcly-1.2.0/app/static/assets/chevron-left-BvHMpJKL.js +1 -1
- srcly-1.2.0/app/static/assets/index-CJ-sdGl0.css +1 -0
- srcly-1.2.0/app/static/assets/index-DLPxgS2d.js +2 -0
- srcly-1.2.0/app/static/assets/layout-v5JPUzcA.js +1 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/index.html +2 -2
- {srcly-1.0.0 → srcly-1.2.0}/pyproject.toml +1 -1
- srcly-1.0.0/app/static/assets/CompareApp-Omwsxouz.js +0 -3
- srcly-1.0.0/app/static/assets/DependencyView-CKkGFSEj.js +0 -1
- srcly-1.0.0/app/static/assets/index-DoC5YIyS.css +0 -1
- srcly-1.0.0/app/static/assets/index-E273RRji.js +0 -2
- srcly-1.0.0/app/static/assets/layout-CKrLZkty.js +0 -1
- {srcly-1.0.0 → srcly-1.2.0}/.gitignore +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/README.md +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/.gitignore +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/__init__.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/config.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/main.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/models.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/routers/analysis.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/routers/compare.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/routers/files.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/routers/metrics.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/routers/scans.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/run.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/activity.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/analysis.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/analysis_types.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/cache.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/comment_noise.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/compare/__init__.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/compare/diff.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/compare/git_refs.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/compare/github.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/compare/jobs.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/compare/service.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/compare/snapshots.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/compare/sources.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/css/css_analysis.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/deps/__init__.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/deps/common.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/deps/graph.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/deps/python_deps.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/deps/tsconfig.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/deps/typescript_deps.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/findings/__init__.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/findings/builtin_ts.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/findings/jobs.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/findings/model.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/findings/overlay.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/findings/ruff.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/findings/runner.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/findings/tools.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/findings/typescript.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/ipynb/ipynb_analysis.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/markdown/markdown_analysis.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/markers.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/metric_catalog.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/python/python_analysis.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/quadrants.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/reporting.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/scan_jobs.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/scan_progress.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/scan_workers.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/typescript/components.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/services/typescript/typescript_analysis.py +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/bash-DgJyDXW6.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/css-PZBBrkI0.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/github-light-Rcb2q3L5.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/highlight.worker-C64dOQ1-.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/html-DOf0XnR2.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/javascript-WyGyM1wV.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/json-B8JryHcM.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/jsx-8cLv2Six.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/markdown-DX-TNHnc.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/python-B6Ihcp-E.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/toml-Ms459DBw.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/tsx-D6116Ycy.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/typescript-BqvgUolh.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/wasm-CG6Dc4jp.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/assets/yaml-Bopit2L3.js +0 -0
- {srcly-1.0.0 → srcly-1.2.0}/app/static/favicon.svg +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as A,m as ge,I as Fe,a as Y,b as he,o as ct,t as j,i as z,S as Q,P as Fr,F as De,O as cl,d as xn,u as Je,e as fl,f as re,g as Mr,h as at,x as Or,s as ne,j as ze,k as we,l as hl,n as dt,p as vt,q as je,T as dl,r as se,v as pl,w as Dn,y as Rr,z as it,A as ml,L as gl,E as yl,$ as Ze,B as xl,C as Kn,D as bn,G as bl,M as Qn,H as Nr,J as kl,K as Br,N as wl,Q as vl,R as Yn,U as Sl,V as Cl,W as Il,X as El}from"./index-E273RRji.js";import{c as Al}from"./chevron-left-CGokVLxh.js";var jr={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};jr.node;var _l=e=>A(Fe,ge(e,{icon:jr})),Ll=_l,Hr={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};Hr.node;var Pl=e=>A(Fe,ge(e,{icon:Hr})),Tl=Pl,qr={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};qr.node;var $l=e=>A(Fe,ge(e,{icon:qr})),zl=$l,Ur={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};Ur.node;var Dl=e=>A(Fe,ge(e,{icon:Ur})),Fl=Dl,Vr={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};Vr.node;var Ml=e=>A(Fe,ge(e,{icon:Vr})),Ol=Ml,Wr={name:"import",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]};Wr.node;var Rl=e=>A(Fe,ge(e,{icon:Wr})),Nl=Rl,Kr={name:"list-indent-decrease",size:24,node:[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]],aliases:["outdent","indent-decrease"]};Kr.node;var Bl=e=>A(Fe,ge(e,{icon:Kr})),jl=Bl,Qr={name:"shapes",size:24,node:[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]};Qr.node;var Hl=e=>A(Fe,ge(e,{icon:Qr})),ql=Hl,Yr={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]};Yr.node;var Ul=e=>A(Fe,ge(e,{icon:Yr})),Vl=Ul,Xr={name:"type",size:24,node:[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]};Xr.node;var Wl=e=>A(Fe,ge(e,{icon:Xr})),Kl=Wl;function Ql(e){const[n,t]=Y(!1),r=()=>t(!1);return he(()=>{e.contentKey();const l=e.isOpen(),o=e.viewMode(),i=e.hasSelection(),a=e.loading();if(!l||o!=="preview"||!i||a){t(!1);return}n()||queueMicrotask(()=>{const u=e.contentContainerEl();if(!u)return;const s=u.querySelector(".md-selected-range");s&&(t(!0),s.scrollIntoView({block:"center"}))})}),{resetAutoScroll:r}}async function Yl(e){const n=e.fetchImpl??fetch,t=new URLSearchParams({path:e.path});e.ref&&t.set("ref",e.ref);const r=await n(`/api/files/content?${t}`,{signal:e.signal});if(!r.ok)throw new Error(`Failed to load file: ${r.status} ${r.statusText}`);return await r.text()}async function Xl(e){const n=new URLSearchParams({path:e.path});e.ref&&n.set("ref",e.ref);const t=await fetch(`/api/files/markers?${n}`,{signal:e.signal});if(!t.ok)throw new Error(`Failed to locate metrics: ${t.status} ${t.statusText}`);return(await t.json()).markers??{}}function Gl(e){const[n,t]=Y(""),[r,l]=Y(!1),[o,i]=Y(null),[a,u]=Y(null),[s,f]=Y(0),c=()=>f(d=>d+1);return he(()=>{if(s(),!e.isOpen()||!e.filePath()){t(""),i(null),l(!1),u(null);return}const d=e.filePath(),h=e.gitRef?.()??null,p=new AbortController;l(!0),i(null),t(""),u(null),(async()=>{try{const x=await Yl({path:d,ref:h,fetchImpl:e.fetchImpl,signal:p.signal});if(p.signal.aborted)return;t(x),u(x.split(/\r?\n/).length)}catch(x){if(x?.name==="AbortError")return;i(x.message??String(x))}finally{p.signal.aborted||l(!1)}})(),ct(()=>p.abort())}),{rawCode:n,loading:r,error:o,totalLines:a,reload:c}}function kn(e){const n=e.toLowerCase();return n.endsWith(".tsx")?"tsx":n.endsWith(".ts")?"ts":n.endsWith(".jsx")?"jsx":n.endsWith(".js")?"js":n.endsWith(".json")?"json":n.endsWith(".py")||n.endsWith(".ipynb")?"python":n.endsWith(".md")?"md":n.endsWith(".html")||n.endsWith(".htm")?"html":n.endsWith(".css")?"css":n.endsWith(".yaml")||n.endsWith(".yml")?"yaml":n.endsWith(".toml")?"toml":n.endsWith(".sh")||n.endsWith(".bash")||n.endsWith(".zsh")?"bash":"txt"}function Jl(e){const[n,t]=Y(""),[r,l]=Y(null),[o,i]=Y(null),[a,u]=Y(!1),[s,f]=Y(null);let c,d=0;const h=()=>c||(c=new Worker(new URL("/assets/highlight.worker-C64dOQ1-.js",import.meta.url),{type:"module"}),c.onmessage=p=>{const x=p.data;if(x.id===d){if(x.error){f(`Could not highlight this file: ${x.error}`),t("");return}f(null),t(x.html??""),l(x.start??null),i(x.end??null),u(!!x.wasIndentationReduced)}},c.onerror=p=>{d++,c?.terminate(),c=void 0,f(`Syntax highlighting failed: ${p.message}`),t("")},c);return he(()=>{const p=e.rawCode(),x=e.filePath(),v=e.lineFilterEnabled(),b=e.lineOffset(),I=e.reduceIndentation(),k=e.targetStart(),E=e.targetEnd(),$=++d;if(f(null),!p||!x){t(""),l(null),i(null),u(!1);return}const w=typeof k=="number"&&typeof E=="number"?{start:k,end:E}:null;try{h().postMessage({id:$,text:p,language:kn(x),useLineFilter:v,offset:b,target:w,reduceIndentation:I})}catch(_){f(`Could not start syntax highlighting: ${String(_)}`)}}),ct(()=>{d++,c?.terminate()}),{highlightedHtml:n,displayStartLine:r,displayEndLine:o,wasIndentationReduced:a,highlightError:s}}function Zl(e){const[n,t]=Y(null);return he(()=>{const r=e.filePath(),l=e.gitRef?.()??null;if(t(null),!r)return;const o=new AbortController;Xl({path:r,ref:l,signal:o.signal}).then(i=>!o.signal.aborted&&t(i)).catch(()=>{}),ct(()=>o.abort())}),n}function Te(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const n=Number(e);if(Number.isFinite(n))return n}return null}function St(e){const n=e;return n?.name==="(body)"||n?.type==="function_body"||n?.type==="file_body"}function He(e){const n=e;if(!n||!Array.isArray(n.children))return[];const t=n.children.filter(r=>!St(r));if(t.length===0){const r=n.children.find(l=>St(l)&&Array.isArray(l.children)&&l.children.length>0);if(r)return r.children.filter(l=>!St(l))}return t}function eo(e,n){if(!e)return[];if(!n)return[e];const t=n.start,r=n.end,l=[e];let o=e,i=0;for(;i<100;){i++;const a=He(o);if(!a?.length)break;const u=a.reduce((x,v)=>{const b=Te(v?.start_line),I=Te(v?.end_line);if(!v||b===null||I===null||!(b<=t&&I>=r))return x;if(!x)return v;const E=Te(x?.start_line),$=Te(x?.end_line);if(E===null||$===null)return v;const w=$-E,_=I-b;if(_<w)return v;if(_>w)return x;const L=E===t&&$===r,T=b===t&&I===r;return T!==L&&T?v:x},null);if(!u)break;const s=Te(o?.start_line),f=Te(o?.end_line),c=Te(u?.start_line),d=Te(u?.end_line),h=s!==null&&f!==null?f-s:Number.POSITIVE_INFINITY,p=c!==null&&d!==null?d-c:Number.POSITIVE_INFINITY;if(p>h||p===h&&!He(u).some(b=>{const I=Te(b?.start_line),k=Te(b?.end_line);return!b||I===null||k===null||!(I<=t&&k>=r)?!1:k-I<p}))break;l.push(u),o=u}return l}function Jt(e){return e?`${e?.type??""}|${e?.name??""}|${e?.start_line??""}|${e?.end_line??""}`:""}function to(e,n){return!e||!n?!1:e===n?!0:Jt(e)!==""&&Jt(e)===Jt(n)}function no(e,n){if(!e||!n)return null;const t=[],r=new Set,l=i=>{if(!i||r.has(i))return!1;if(r.add(i),to(i,n))return t.push(i),!0;const a=He(i);for(const u of a)if(l(u))return t.push(i),!0;return!1};return l(e)?t.reverse():null}const ro={complexity_avg:"complexity"};function Gr(e,n){return e?e[ro[n]??n]??[]:[]}function io(e,n){return Gr(e,n).length>0}function lo(e){const n=new Map;for(const t of e){const r=n.get(t.line)??{endLine:t.line,notes:[]};r.endLine=Math.max(r.endLine,t.end_line),t.note&&r.notes.push(t.note),n.set(t.line,r)}return[...n.entries()].sort(([t],[r])=>t-r).map(([t,r])=>({line:t,endLine:r.endLine,notes:oo(r.notes)}))}function oo(e){const n=new Map;for(const t of e)n.set(t,(n.get(t)??0)+1);return[...n.entries()].map(([t,r])=>r>1?`${t} ×${r}`:t)}function ao(e,n,t){return e.filter(r=>r.endLine>=n&&r.line<=t)}function uo(e,n,t){if(!e.length)return null;if(n===null)return t===1?e[0]:e[e.length-1];if(t===1)return e.find(r=>r.line>n)??e[0];for(let r=e.length-1;r>=0;r--)if(e[r].line<n)return e[r];return e[e.length-1]}function so(e){const n=new Map;for(const t of e)for(let r=t.line;r<=t.endLine;r++)n.has(r)||n.set(r,{note:r===t.line?t.notes.join(", "):"",first:r===t.line});return n}var co=j('<div class="flex h-7 items-center rounded-md border border-[var(--plc-border)] bg-[var(--plc-surface-muted)] p-0.5">'),fo=j("<button type=button>"),ho=j('<div class="px-2 pb-1 pt-0.5 text-[11px] text-[var(--plc-on-subtle)]">Context lines'),po=j('<header class="flex h-12 shrink-0 items-center gap-3 border-b border-[var(--plc-border)] bg-[var(--plc-surface)] pl-4 pr-2 text-sm"><div class="flex min-w-0 flex-1 items-baseline gap-2"><span class="shrink-0 font-semibold text-[var(--plc-on-surface)]"></span><span class="min-w-0 truncate text-[12px] text-[var(--plc-on-subtle)] [direction:rtl] text-left"><span dir=ltr></span></span></div><div class="flex items-center gap-1"></div><div class="flex items-center gap-0.5 border-l border-[var(--plc-border)] pl-2"><a target=_blank aria-label="Open in VS Code"title="Open in VS Code"class="inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--plc-on-muted)] transition-colors duration-150 hover:bg-[var(--plc-surface-hover)] hover:text-[var(--plc-on-surface)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--plc-border-focus)]">'),mo=j('<button type=button title="Context lines around the selection"class="flex h-7 items-center gap-0.5 rounded-md px-1.5 text-[12px] font-medium tabular-nums text-[var(--plc-on-muted)] transition-colors duration-150 hover:bg-[var(--plc-surface-hover)] hover:text-[var(--plc-on-surface)] disabled:pointer-events-none disabled:opacity-40">±');const go=[0,4,10,25];function Xn(e){return(()=>{var n=co();return z(n,A(De,{get each(){return e.options},children:t=>(()=>{var r=fo();return r.$$click=()=>e.onChange(t.value),z(r,()=>t.label),re(l=>{var o=t.disabled,i=t.title,a=e.value===t.value,u=ze("h-full rounded-[5px] px-2.5 text-[12px] font-medium transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-40",e.value===t.value?"bg-[var(--plc-surface)] text-[var(--plc-on-surface)] shadow-[0_1px_2px_rgba(15,23,42,0.08)]":"text-[var(--plc-on-subtle)] hover:text-[var(--plc-on-surface)] enabled:active:bg-[var(--plc-surface-hover)]");return o!==l.e&&(r.disabled=l.e=o),i!==l.t&&ne(r,"title",l.t=i),a!==l.a&&ne(r,"aria-pressed",l.a=a),u!==l.o&&we(r,l.o=u),l},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()})),n})()}function yo(e){const[n,t]=Y(!1);let r;return A(at,{get label(){return e.label},onClick:()=>{e.onClick(),t(!0),clearTimeout(r),r=window.setTimeout(()=>t(!1),1200)},get children(){return A(Q,{get when(){return n()},get fallback(){return e.icon},get children(){return A(hl,{size:15,class:"text-[var(--plc-success)] plc-pop-in","aria-hidden":"true"})}})}})}function xo(e){const[n,t]=Y(!1),r=()=>{const l=e.rootPath?.replace(/\/+$/,""),o=l&&e.filePath.startsWith(`${l}/`)?e.filePath.slice(l.length+1):e.filePath,i=o.lastIndexOf(e.baseName);return i>0?o.slice(0,i):""};return(()=>{var l=po(),o=l.firstChild,i=o.firstChild,a=i.nextSibling,u=a.firstChild,s=o.nextSibling,f=s.nextSibling,c=f.firstChild;return z(i,()=>e.baseName),z(u,r),z(l,A(Q,{get when(){return e.isMarkdown()},get children(){return A(Xn,{get value(){return e.viewMode()},get onChange(){return e.setViewMode},options:[{value:"code",label:"Code"},{value:"preview",label:"Preview"}]})}}),s),z(s,A(Xn,{get value(){return e.lineFilterEnabled()&&e.hasLineRange()?"selection":"file"},onChange:d=>e.setLineFilterEnabled(d==="selection"),get options(){return[{value:"selection",label:"Selection",disabled:!e.hasLineRange(),title:e.hasLineRange()?"Show only the selected scope":"Pick a symbol to limit the view"},{value:"file",label:"Whole file"}]}}),null),z(s,A(Mr,{placement:"bottom-end",get isOpen(){return n()},onOpenChange:t,trigger:d=>(()=>{var h=mo();h.firstChild,xn(h,"click",d.onClick,!0);var p=d.ref;return typeof p=="function"?Je(p,h):d.ref=h,z(h,()=>e.lineOffset(),null),z(h,A(fl,{size:12,"aria-hidden":"true"}),null),re(()=>h.disabled=!e.lineFilterEnabled()||!e.hasLineRange()),h})(),get children(){return A(Fr,{width:"sm",get children(){return[ho(),A(De,{each:go,children:d=>A(cl,{get selected(){return e.lineOffset()===d},onClick:()=>{e.setLineOffset(d),t(!1)},children:d===0?"None":`±${d} lines`})})]}})}}),null),z(s,A(at,{label:"Reduce indent",title:"Reduce indent: strip the common leading whitespace",get"aria-pressed"(){return e.reduceIndentation()},onClick:()=>e.setReduceIndentation(!e.reduceIndentation()),get class(){return e.reduceIndentation()?"bg-[var(--plc-surface-muted)] text-[var(--plc-on-surface)] hover:bg-[var(--plc-border)]":""},get children(){return A(jl,{size:15,"aria-hidden":"true"})}}),null),z(f,A(yo,{label:"Copy file contents",get icon(){return A(zl,{size:15,"aria-hidden":"true"})},onClick:()=>navigator.clipboard.writeText(e.rawCode())}),c),z(c,A(Fl,{size:15,"aria-hidden":"true"})),z(f,A(at,{label:"Close (Esc)",get onClick(){return e.onClose},get children(){return A(Or,{size:16,"aria-hidden":"true"})}}),null),re(d=>{var h=e.filePath,p=e.viewMode()!=="code",x=`vscode://file/${e.filePath}`;return h!==d.e&&ne(a,"title",d.e=h),p!==d.t&&s.classList.toggle("invisible",d.t=p),x!==d.a&&ne(c,"href",d.a=x),d},{e:void 0,t:void 0,a:void 0}),l})()}dt(["click"]);const bo={type:"type",interface:"interface",class:"class",object:"object",obj:"object"};function ko(e){const n=String(e?.name??"");if(e?.type==="file")return{kind:"file",name:n};if(n==="(imports)")return{kind:"imports",name:"imports"};const t=n.match(/^(.*) \((type|interface|class|object|obj)\)$/);if(t)return{kind:bo[t[2]],name:t[1]};const r=n.match(/^\((class|async)\) (.*)$/);return r?{kind:r[1]==="class"?"class":"function",name:r[2]}:n.startsWith("<")?{kind:"jsx",name:n}:e?.type==="class"?{kind:"class",name:n}:{kind:"function",name:n}}var wo=j('<mark class="rounded-[2px] bg-[var(--plc-warning-border)] text-inherit">'),vo=j('<div class="border-b border-[var(--plc-divider)] p-2">'),So=j('<div class="flex items-center justify-between border-b border-[var(--plc-divider)] px-3 pb-1.5 pt-2 text-[11px] text-[var(--plc-on-subtle)]"><span></span><span title="Cyclomatic complexity">CCN'),Co=j('<div class="px-3 py-6 text-center text-[12px] text-[var(--plc-on-subtle)]">No symbols match “<!>”'),Io=j('<div class="min-h-0 flex-1 overflow-y-auto px-1 py-1"role=listbox>'),Eo=j('<div class="border-t border-[var(--plc-divider)] px-3 py-1.5 text-[11px] text-[var(--plc-on-subtle)]">↑↓ move · ←→ fold · Enter open · Esc close'),Ao=j('<span class="shrink-0 text-[11px] font-normal text-[var(--plc-on-subtle)]">'),_o=j('<span class="min-w-0 shrink truncate text-[11px] font-normal text-[var(--plc-on-subtle)]">in '),Lo=j('<div role=option><span class="flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--plc-on-subtle)] hover:bg-[var(--plc-border)] hover:text-[var(--plc-on-surface)]"></span><span class="flex shrink-0 opacity-70"></span><span class="min-w-0 truncate"></span><span class="ml-auto shrink-0 pl-3 text-[11px] font-normal tabular-nums text-[var(--plc-on-subtle)]">');const Po={file:Ol,function:Vl,class:Ll,type:Kl,interface:ql,object:pl,jsx:Tl,imports:Nl};function To(e,n){const t=n?e.toLowerCase().indexOf(n.toLowerCase()):-1;return t<0?e:[se(()=>e.slice(0,t)),(()=>{var r=wo();return z(r,()=>e.slice(t,t+n.length)),r})(),se(()=>e.slice(t+n.length))]}function $o(e){const[n,t]=Y(""),[r,l]=Y(new Set),[o,i]=Y(0);let a;he(vt(()=>e.isOpen,p=>{if(!p)return;t("");const x=e.root(),v=x&&e.activeNode()?no(x,e.activeNode())??[]:[];l(new Set(v.slice(0,-1)));const b=u().findIndex(I=>I.node===e.activeNode());i(Math.max(0,b)),queueMicrotask(()=>a?.querySelector("[data-active=true]")?.scrollIntoView({block:"center"}))}));const u=je(()=>{const p=e.root();if(!p)return[];const x=n().trim().toLowerCase(),v=[];if(x){const k=(E,$)=>{for(const w of He(E)){const _=String(w.name??"");_.toLowerCase().includes(x)&&v.push({node:w,depth:0,hasChildren:!1,context:$.join(" › ")}),k(w,[...$,_])}};return k(p,[]),v}v.push({node:p,depth:0,hasChildren:!1});const b=r(),I=(k,E)=>{for(const $ of He(k)){const w=He($).length>0;v.push({node:$,depth:E,hasChildren:w}),w&&b.has($)&&I($,E+1)}};return I(p,0),v});he(vt(n,()=>i(0)));const s=(p,x)=>{const v=new Set(r());x??!v.has(p)?v.add(p):v.delete(p),l(v)},f=p=>{p&&(e.onSelect(p.node===e.root()?null:p.node),e.onOpenChange(!1))},c=p=>{const x=u().length;x&&(i(Math.max(0,Math.min(x-1,p))),queueMicrotask(()=>a?.querySelector(`[data-row="${o()}"]`)?.scrollIntoView({block:"nearest"})))},d=p=>{const x=u()[o()];if(p.key==="ArrowDown")c(o()+1);else if(p.key==="ArrowUp")c(o()-1);else if(p.key==="Enter")f(x);else if(p.key==="ArrowRight"&&x?.hasChildren&&!n())s(x.node,!0);else if(p.key==="ArrowLeft"&&x?.hasChildren&&!n())s(x.node,!1);else return;p.preventDefault()},h=p=>p===e.activeNode()||!e.activeNode()&&p===e.root();return A(Mr,{placement:"bottom-start",get isOpen(){return e.isOpen},get onOpenChange(){return e.onOpenChange},get trigger(){return e.trigger},get children(){return A(Fr,{width:"xl",class:"flex max-h-[min(560px,70vh)] flex-col p-0",get children(){return[(()=>{var p=vo();return z(p,A(dl,{size:"sm",placeholder:"Go to symbol…",get value(){return n()},ref:x=>queueMicrotask(()=>x.focus()),onInput:x=>t(x.currentTarget.value),onKeyDown:d})),p})(),(()=>{var p=So(),x=p.firstChild;return z(x,(()=>{var v=se(()=>!!n().trim());return()=>v()?`${u().length} ${u().length===1?"match":"matches"}`:"Outline"})()),p})(),(()=>{var p=Io(),x=a;return typeof x=="function"?Je(x,p):a=p,z(p,A(Q,{get when(){return!u().length},get children(){var v=Co(),b=v.firstChild,I=b.nextSibling;return I.nextSibling,z(v,()=>n().trim(),I),v}}),null),z(p,A(De,{get each(){return u()},children:(v,b)=>{const I=()=>v.node?.metrics?.complexity,k=ko(v.node),E=Po[k.kind],$=k.kind==="type"||k.kind==="interface"||k.kind==="object"||k.kind==="class"?k.kind:null;return(()=>{var w=Lo(),_=w.firstChild,L=_.nextSibling,T=L.nextSibling,y=T.nextSibling;return w.$$click=()=>f(v),w.$$mousemove=()=>i(b()),_.$$click=C=>{v.hasChildren&&(C.stopPropagation(),s(v.node))},z(_,A(Q,{get when(){return v.hasChildren},get children(){return A(Dn,{size:13,"aria-hidden":"true",get class(){return ze("transition-transform duration-150",r().has(v.node)&&"rotate-90")}})}})),z(L,A(E,{size:13,"aria-hidden":"true"})),z(T,(()=>{var C=se(()=>v.node===e.root());return()=>C()?e.baseName:To(k.name,n().trim())})()),z(w,A(Q,{when:$,get children(){var C=Ao();return z(C,$),C}}),y),z(w,A(Q,{get when(){return v.context},get children(){var C=_o();return C.firstChild,z(C,()=>v.context,null),C}}),y),z(y,A(Q,{get when(){return se(()=>v.node!==e.root()&&typeof I()=="number")()&&I()>1},get children(){return Rr("complexity",I())}})),re(C=>{var F=h(v.node),R=b(),O=h(v.node),B=ze("flex h-7 cursor-pointer items-center gap-1 rounded-md pr-2 text-[12px] transition-colors duration-100",h(v.node)?"bg-[var(--plc-surface-selected)] font-semibold text-[var(--plc-accent)]":o()===b()?"bg-[var(--plc-surface-muted)] text-[var(--plc-on-surface)]":"text-[var(--plc-on-muted)]"),Z=`${v.depth*14+4}px`;return F!==C.e&&ne(w,"aria-selected",C.e=F),R!==C.t&&ne(w,"data-row",C.t=R),O!==C.a&&ne(w,"data-active",C.a=O),B!==C.o&&we(w,C.o=B),Z!==C.i&&it(w,"padding-left",C.i=Z),C},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),w})()}}),null),p})(),Eo()]}})}})}dt(["mousemove","click"]);var zo=j('<div class="flex h-9 items-center gap-1 border-b border-[var(--plc-border)] bg-[var(--plc-surface)]/95 pl-1.5 pr-2 backdrop-blur"><div class="flex min-w-0 flex-1 items-center gap-0.5 overflow-hidden">'),Do=j("<button type=button>");function Fo(e){if(!e)return"";const n=e.split(/[\\/]/);return n[n.length-1]||e}function Zt(e){return e?`${e?.type??""}|${e?.name??""}|${e?.start_line??""}|${e?.end_line??""}`:""}function Mo(e,n){return!e||!n?!1:e===n?!0:Zt(e)!==""&&Zt(e)===Zt(n)}function Oo(e,n){if(!e||!n)return null;const t=[],r=new Set,l=i=>{if(!i||r.has(i))return!1;if(r.add(i),Mo(i,n))return t.push(i),!0;const a=He(i);for(const u of a)if(l(u))return t.push(i),!0;return!1};return l(e)?t.reverse():null}function Ro(e){const n=je(()=>{const o=e.root(),i=e.selectedNode?.()??null;return!o||!i?null:Oo(o,i)}),t=je(()=>{const o=n();if(o&&o.length)return o.filter(f=>!St(f));const i=e.root(),a=e.selection?.()??null,u=e.currentLine();if(!i||typeof u!="number"||u<=0)return[];const s=a&&typeof a.start=="number"&&typeof a.end=="number"?a:{start:u,end:u};return eo(i,s).filter(f=>!St(f))}),r=()=>Fo(e.filePath()),l=()=>t().length?t():[null];return(()=>{var o=zo(),i=o.firstChild;return z(o,()=>e.leading,i),z(i,A(De,{get each(){return l()},children:(a,u)=>{const s=()=>u()===l().length-1,f=()=>u()===0?r()||a?.name||"file":a.name;return[(()=>{var c=Do();return c.$$click=()=>{s()||e.onSelectScope(u()===0?null:a)},z(c,f),re(d=>{var h=f(),p=`truncate rounded px-1 py-0.5 text-[12px] transition-colors duration-150 ${s()?"max-w-[18rem] shrink-0 cursor-default font-semibold text-[var(--plc-on-surface)]":"min-w-[2rem] shrink text-[var(--plc-accent)] hover:bg-[var(--plc-surface-hover)] hover:text-[var(--plc-accent-hover)]"}`;return h!==d.e&&ne(c,"title",d.e=h),p!==d.t&&we(c,d.t=p),d},{e:void 0,t:void 0}),c})(),A(Q,{get when(){return!s()},get children(){return A(Dn,{size:12,class:"shrink-0 text-[var(--plc-on-disabled)]","aria-hidden":"true"})}})]}})),z(o,()=>e.trailing,null),o})()}dt(["click"]);var No=j('<div class="code-modal-content pb-2 pt-1">'),Bo=j('<div class="flex h-full min-h-0 gap-1"><div class="min-w-0 flex-1 overflow-auto rounded-lg border border-[var(--plc-border)] bg-[var(--plc-code-bg)]"><div class="sticky top-0 z-20"></div></div><div aria-hidden=true>'),jo=j("<button type=button aria-label=Outline>"),Ho=j('<div class="flex shrink-0 items-center gap-2 pl-2 text-[12px]"><span>'),qo=j('<button type=button class="px-1 text-[var(--plc-accent)] transition-colors duration-150 hover:text-[var(--plc-accent-hover)]"title="Show the whole file">+<!> in file'),Uo=j('<div class="flex items-center gap-0.5"><span class="pr-1 font-medium text-[var(--plc-on-surface)] max-xl:hidden"></span><span class="min-w-[3.25rem] text-center tabular-nums text-[var(--plc-on-muted)]">'),Vo=j('<div class="absolute inset-x-0 bg-[var(--plc-accent-border)]">'),Wo=j("<button type=button tabindex=-1>");function Ko(e){const[n,t]=Y(1);let r,l,o;const i=()=>!e.loading()&&!e.error()&&e.highlightedHtml(),a=()=>{const k=r;if(!k)return;const E=k.querySelectorAll("span.line");if(!E.length)return;const w=E[0].getBoundingClientRect().height||16,_=l?.offsetHeight??0,L=k.getBoundingClientRect().top+_+2;let T=Math.floor(k.scrollTop/w);T=Math.max(0,Math.min(E.length-1,T));const y=Math.max(0,T-30),C=Math.min(E.length-1,T+30);let F=T;for(let R=y;R<=C;R++)if(E[R].getBoundingClientRect().bottom>L){F=R;break}t(e.displayStartLine()+F)};he(()=>{e.highlightedHtml(),e.displayStartLine(),queueMicrotask(()=>a())}),he(()=>{const k=r;if(!k)return;let E=0;const $=()=>{E||(E=requestAnimationFrame(()=>{E=0,a()}))};k.addEventListener("scroll",$,{passive:!0}),ct(()=>{k.removeEventListener("scroll",$),E&&cancelAnimationFrame(E)})}),he(()=>{e.highlightedHtml();const k=e.overlay(),E=e.displayStartLine(),$=k?so(k.hits):null,w=k?.cursorLine??null;queueMicrotask(()=>{c();const _=o?.querySelectorAll("span.line");_&&_.forEach((L,T)=>{const y=E+T,C=$?.get(y);L.classList.toggle("metric-hit",!!C),L.classList.toggle("metric-hit-current",C!==void 0&&w!==null&&u(k.hits,w,y)),C?.first&&C.note?L.dataset.note=C.note:delete L.dataset.note})})});const u=(k,E,$)=>{const w=k.find(_=>_.line===E);return!!(w&&$>=w.line&&$<=w.endLine)},[s,f]=Y({header:0,first:0,lineH:0,span:1}),c=()=>{const k=r,E=o?.querySelector("span.line");if(!k||!o||!E)return;const $=l?.offsetHeight??0,w=o.getBoundingClientRect(),_=E.getBoundingClientRect();f({header:$,first:_.top-w.top,lineH:_.height||1,span:Math.max(o.offsetHeight,k.clientHeight-$,1)})};he(()=>{const k=r;if(!k)return;const E=new ResizeObserver(()=>c());E.observe(k),ct(()=>E.disconnect())});const d=k=>s().first+(k-e.displayStartLine())*s().lineH,h=k=>`${d(k)/s().span*100}%`,p=(k,E)=>`max(2px, ${(E-k+1)*s().lineH/s().span*100}%)`,x=()=>{const k=e.targetStartLine(),E=e.targetEndLine();return typeof k!="number"||typeof E!="number"||k<=e.displayStartLine()&&E>=e.displayEndLine()?null:{s:Math.max(k,e.displayStartLine()),e:Math.min(E,e.displayEndLine())}},v=()=>He(e.fileNode()).length>0,b=()=>{const k=e.overlay();if(!k||k.cursorLine===null)return null;const E=k.hits.findIndex($=>$.line===k.cursorLine);return E<0?null:E+1},I=()=>{const k=e.totalLines();if(!k)return"";const E=e.displayStartLine(),$=e.displayEndLine();return E<=1&&$>=k?`${k.toLocaleString()} lines`:`${E}–${$} of ${k.toLocaleString()}`};return(()=>{var k=Bo(),E=k.firstChild,$=E.firstChild,w=E.nextSibling;return Je(_=>r=_,E),Je(_=>l=_,$),z($,A(Ro,{get root(){return e.fileNode},get selectedNode(){return e.selectedScopeNode},get filePath(){return e.filePath},currentLine:n,selection:()=>{const _=e.targetStartLine?.(),L=e.targetEndLine?.();return typeof _=="number"&&typeof L=="number"?{start:_,end:L}:null},get onSelectScope(){return e.onSelectScope},get leading(){return A($o,{get root(){return e.fileNode},get activeNode(){return e.selectedScopeNode},get baseName(){return e.baseName},get isOpen(){return e.outlineOpen()},get onOpenChange(){return e.setOutlineOpen},get onSelect(){return e.onSelectScope},trigger:_=>(()=>{var L=jo();xn(L,"click",_.onClick,!0);var T=_.ref;return typeof T=="function"?Je(T,L):_.ref=L,z(L,A(ml,{size:15,"aria-hidden":"true"})),re(y=>{var C=!v(),F=v()?"Outline: go to symbol (/)":"No symbols in this file",R=ze("flex h-7 shrink-0 items-center gap-1 rounded-md px-1.5 text-[12px] font-medium transition-colors duration-150 disabled:opacity-40",_.isOpen?"bg-[var(--plc-surface-selected)] text-[var(--plc-accent)]":"text-[var(--plc-on-muted)] hover:bg-[var(--plc-surface-hover)] hover:text-[var(--plc-on-surface)]");return C!==y.e&&(L.disabled=y.e=C),F!==y.t&&ne(L,"title",y.t=F),R!==y.a&&we(L,y.a=R),y},{e:void 0,t:void 0,a:void 0}),L})()})},get trailing(){return(()=>{var _=Ho(),L=_.firstChild;return z(_,A(Q,{get when(){return e.overlay()},children:T=>(()=>{var y=Uo(),C=y.firstChild,F=C.nextSibling;return z(C,()=>T().label),z(y,A(at,{label:"Previous ([)",size:"xs",get disabled(){return!T().hits.length},onClick:()=>e.onStep(-1),get children(){return A(Al,{size:14,"aria-hidden":"true"})}}),F),z(F,(()=>{var R=se(()=>!T().hits.length);return()=>R()?"none here":se(()=>b()===null)()?`${T().hits.length} here`:`${b()} / ${T().hits.length}`})()),z(y,A(at,{label:"Next (])",size:"xs",get disabled(){return!T().hits.length},onClick:()=>e.onStep(1),get children(){return A(Dn,{size:14,"aria-hidden":"true"})}}),null),z(y,A(Q,{get when(){return T().outside>0},get children(){var R=qo(),O=R.firstChild,B=O.nextSibling;return B.nextSibling,xn(R,"click",e.onShowWholeFile,!0),z(R,()=>T().outside,B),R}}),null),z(y,A(at,{label:"Clear overlay (Esc)",size:"xs",get onClick(){return e.onClearOverlay},get children(){return A(Or,{size:13,"aria-hidden":"true"})}}),null),y})()}),L),z(L,I),re(()=>we(L,ze("tabular-nums text-[var(--plc-on-subtle)]",e.overlay()&&"max-xl:hidden"))),_})()}})),z(E,A(Q,{get when(){return e.loading()||!e.highlightedHtml()&&!e.error()},get children(){return A(gl,{label:"Loading file…"})}}),null),z(E,A(Q,{get when(){return se(()=>!e.loading())()&&e.error()},get children(){return A(yl,{get message(){return e.error()},class:"min-h-32"})}}),null),z(E,A(Q,{get when(){return i()},get children(){var _=No();return Je(L=>o=L,_),re(L=>{var T=e.overlay()?.tone??void 0,y=e.highlightedHtml();return T!==L.e&&ne(_,"data-tone",L.e=T),y!==L.t&&(_.innerHTML=L.t=y),L},{e:void 0,t:void 0}),_}}),null),z(w,A(Q,{get when(){return x()},children:_=>(()=>{var L=Vo();return re(T=>{var y=h(_().s),C=p(_().s,_().e);return y!==T.e&&it(L,"top",T.e=y),C!==T.t&&it(L,"height",T.t=C),T},{e:void 0,t:void 0}),L})()}),null),z(w,A(Q,{get when(){return e.overlay()},children:_=>A(De,{get each(){return _().hits},children:L=>(()=>{var T=Wo();return T.$$click=()=>e.onJumpToHit(L.line),re(y=>{var C=`Line ${L.line}${L.notes.length?`: ${L.notes.join(", ")}`:""}`,F=ze("absolute inset-x-0 transition-opacity duration-150",_().tone==="good"?"bg-[var(--plc-accent)]":"bg-[var(--plc-warning)]",L.line===_().cursorLine?"opacity-100 ring-1 ring-[var(--plc-on-surface)]":"opacity-60 hover:opacity-100"),R=h(L.line),O=p(L.line,L.endLine);return C!==y.e&&ne(T,"title",y.e=C),F!==y.t&&we(T,y.t=F),R!==y.a&&it(T,"top",y.a=R),O!==y.o&&it(T,"height",y.o=O),y},{e:void 0,t:void 0,a:void 0,o:void 0}),T})()})}),null),re(_=>{var L=ze("relative mb-px w-2.5 shrink-0 rounded-sm transition-colors duration-150",e.overlay()||x()?"bg-[var(--plc-surface-muted)]":"bg-transparent"),T=`${s().header+1}px`;return L!==_.e&&we(w,_.e=L),T!==_.t&&it(w,"margin-top",_.t=T),_},{e:void 0,t:void 0}),k})()}dt(["click"]);const Qo={};function Fn(e,n){const t=Qo,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,l=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Jr(e,r,l)}function Jr(e,n,t){if(Yo(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Gn(e.children,n,t)}return Array.isArray(e)?Gn(e,n,t):""}function Gn(e,n,t){const r=[];let l=-1;for(;++l<e.length;)r[l]=Jr(e[l],n,t);return r.join("")}function Yo(e){return!!(e&&typeof e=="object")}const Jn=document.createElement("i");function Mn(e){const n="&"+e+";";Jn.innerHTML=n;const t=Jn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ve(e,n,t,r){const l=e.length;let o=0,i;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,t=t>0?t:0,r.length<1e4)i=Array.from(r),i.unshift(n,t),e.splice(...i);else for(t&&e.splice(n,t);o<r.length;)i=r.slice(o,o+1e4),i.unshift(n,0),e.splice(...i),o+=1e4,n+=1e4}function Ce(e,n){return e.length>0?(ve(e,e.length,0,n),e):n}const Zn={}.hasOwnProperty;function Zr(e){const n={};let t=-1;for(;++t<e.length;)Xo(n,e[t]);return n}function Xo(e,n){let t;for(t in n){const l=(Zn.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let i;if(o)for(i in o){Zn.call(l,i)||(l[i]=[]);const a=o[i];Go(l[i],Array.isArray(a)?a:a?[a]:[])}}}function Go(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ve(e,0,0,r)}function ei(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Le(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const de=Qe(/[A-Za-z]/),fe=Qe(/[\dA-Za-z]/),Jo=Qe(/[#-'*+\--9=?A-Z^-~]/);function Bt(e){return e!==null&&(e<32||e===127)}const wn=Qe(/\d/),Zo=Qe(/[\dA-Fa-f]/),ea=Qe(/[!-/:-@[-`{-~]/);function N(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function V(e){return e===-2||e===-1||e===32}const Vt=Qe(new RegExp("\\p{P}|\\p{S}","u")),et=Qe(/\s/);function Qe(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function pt(e){const n=[];let t=-1,r=0,l=0;for(;++t<e.length;){const o=e.charCodeAt(t);let i="";if(o===37&&fe(e.charCodeAt(t+1))&&fe(e.charCodeAt(t+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(i=String.fromCharCode(o,a),l=1):i="�"}else i=String.fromCharCode(o);i&&(n.push(e.slice(r,t),encodeURIComponent(i)),r=t+l+1,i=""),l&&(t+=l,l=0)}return n.join("")+e.slice(r)}function K(e,n,t,r){const l=r?r-1:Number.POSITIVE_INFINITY;let o=0;return i;function i(u){return V(u)?(e.enter(t),a(u)):n(u)}function a(u){return V(u)&&o++<l?(e.consume(u),a):(e.exit(t),n(u))}}const ta={tokenize:na};function na(e){const n=e.attempt(this.parser.constructs.contentInitial,r,l);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),K(e,n,"linePrefix")}function l(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,i(a)}function i(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return N(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),i)}}const ra={tokenize:ia},er={tokenize:la};function ia(e){const n=this,t=[];let r=0,l,o,i;return a;function a(k){if(r<t.length){const E=t[r];return n.containerState=E[1],e.attempt(E[0].continuation,u,s)(k)}return s(k)}function u(k){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,l&&I();const E=n.events.length;let $=E,w;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){w=n.events[$][1].end;break}b(r);let _=E;for(;_<n.events.length;)n.events[_][1].end={...w},_++;return ve(n.events,$+1,0,n.events.slice(E)),n.events.length=_,s(k)}return a(k)}function s(k){if(r===t.length){if(!l)return d(k);if(l.currentConstruct&&l.currentConstruct.concrete)return p(k);n.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(er,f,c)(k)}function f(k){return l&&I(),b(r),d(k)}function c(k){return n.parser.lazy[n.now().line]=r!==t.length,i=n.now().offset,p(k)}function d(k){return n.containerState={},e.attempt(er,h,p)(k)}function h(k){return r++,t.push([n.currentConstruct,n.containerState]),d(k)}function p(k){if(k===null){l&&I(),b(0),e.consume(k);return}return l=l||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),x(k)}function x(k){if(k===null){v(e.exit("chunkFlow"),!0),b(0),e.consume(k);return}return N(k)?(e.consume(k),v(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(k),x)}function v(k,E){const $=n.sliceStream(k);if(E&&$.push(null),k.previous=o,o&&(o.next=k),o=k,l.defineSkip(k.start),l.write($),n.parser.lazy[k.start.line]){let w=l.events.length;for(;w--;)if(l.events[w][1].start.offset<i&&(!l.events[w][1].end||l.events[w][1].end.offset>i))return;const _=n.events.length;let L=_,T,y;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){if(T){y=n.events[L][1].end;break}T=!0}for(b(r),w=_;w<n.events.length;)n.events[w][1].end={...y},w++;ve(n.events,L+1,0,n.events.slice(_)),n.events.length=w}}function b(k){let E=t.length;for(;E-- >k;){const $=t[E];n.containerState=$[1],$[0].exit.call(n,e)}t.length=k}function I(){l.write([null]),o=void 0,l=void 0,n.containerState._closeFlow=void 0}}function la(e,n,t){return K(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ft(e){if(e===null||J(e)||et(e))return 1;if(Vt(e))return 2}function Wt(e,n,t){const r=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const vn={name:"attention",resolveAll:oa,tokenize:aa};function oa(e,n){let t=-1,r,l,o,i,a,u,s,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},d={...e[t][1].start};tr(c,-u),tr(d,u),i={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},l={type:u>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[r][1].end={...i.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=Ce(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=Ce(s,[["enter",l,n],["enter",i,n],["exit",i,n],["enter",o,n]]),s=Ce(s,Wt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=Ce(s,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",l,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,s=Ce(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,ve(e,r-1,t-r+3,s),t=r+s.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function aa(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,l=ft(r);let o;return i;function i(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=ft(u),c=!f||f===2&&l||t.includes(u),d=!l||l===2&&f||t.includes(r);return s._open=!!(o===42?c:c&&(l||!d)),s._close=!!(o===42?d:d&&(f||!c)),n(u)}}function tr(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const ua={name:"autolink",tokenize:sa};function sa(e,n,t){let r=0;return l;function l(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return de(h)?(e.consume(h),i):h===64?t(h):s(h)}function i(h){return h===43||h===45||h===46||fe(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||fe(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||Bt(h)?t(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):Jo(h)?(e.consume(h),s):t(h)}function f(h){return fe(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):d(h)}function d(h){if((h===45||fe(h))&&r++<63){const p=h===45?d:c;return e.consume(h),p}return t(h)}}const Lt={partial:!0,tokenize:ca};function ca(e,n,t){return r;function r(o){return V(o)?K(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||N(o)?n(o):t(o)}}const ti={continuation:{tokenize:ha},exit:da,name:"blockQuote",tokenize:fa};function fa(e,n,t){const r=this;return l;function l(i){if(i===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return t(i)}function o(i){return V(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(i))}}function ha(e,n,t){const r=this;return l;function l(i){return V(i)?K(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(ti,n,t)(i)}}function da(e){e.exit("blockQuote")}const ni={name:"characterEscape",tokenize:pa};function pa(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return ea(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ri={name:"characterReference",tokenize:ma};function ma(e,n,t){const r=this;let l=0,o,i;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,i=fe,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=Zo,f):(e.enter("characterReferenceValue"),o=7,i=wn,f(c))}function f(c){if(c===59&&l){const d=e.exit("characterReferenceValue");return i===fe&&!Mn(r.sliceSerialize(d))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return i(c)&&l++<o?(e.consume(c),f):t(c)}}const nr={partial:!0,tokenize:ya},rr={concrete:!0,name:"codeFenced",tokenize:ga};function ga(e,n,t){const r=this,l={partial:!0,tokenize:$};let o=0,i=0,a;return u;function u(w){return s(w)}function s(w){const _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(w)}function f(w){return w===a?(i++,e.consume(w),f):i<3?t(w):(e.exit("codeFencedFenceSequence"),V(w)?K(e,c,"whitespace")(w):c(w))}function c(w){return w===null||N(w)?(e.exit("codeFencedFence"),r.interrupt?n(w):e.check(nr,x,E)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||N(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(w)):V(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),K(e,h,"whitespace")(w)):w===96&&w===a?t(w):(e.consume(w),d)}function h(w){return w===null||N(w)?c(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||N(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(w)):w===96&&w===a?t(w):(e.consume(w),p)}function x(w){return e.attempt(l,E,v)(w)}function v(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b}function b(w){return o>0&&V(w)?K(e,I,"linePrefix",o+1)(w):I(w)}function I(w){return w===null||N(w)?e.check(nr,x,E)(w):(e.enter("codeFlowValue"),k(w))}function k(w){return w===null||N(w)?(e.exit("codeFlowValue"),I(w)):(e.consume(w),k)}function E(w){return e.exit("codeFenced"),n(w)}function $(w,_,L){let T=0;return y;function y(B){return w.enter("lineEnding"),w.consume(B),w.exit("lineEnding"),C}function C(B){return w.enter("codeFencedFence"),V(B)?K(w,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):F(B)}function F(B){return B===a?(w.enter("codeFencedFenceSequence"),R(B)):L(B)}function R(B){return B===a?(T++,w.consume(B),R):T>=i?(w.exit("codeFencedFenceSequence"),V(B)?K(w,O,"whitespace")(B):O(B)):L(B)}function O(B){return B===null||N(B)?(w.exit("codeFencedFence"),_(B)):L(B)}}}function ya(e,n,t){const r=this;return l;function l(i){return i===null?t(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o)}function o(i){return r.parser.lazy[r.now().line]?t(i):n(i)}}const en={name:"codeIndented",tokenize:ba},xa={partial:!0,tokenize:ka};function ba(e,n,t){const r=this;return l;function l(s){return e.enter("codeIndented"),K(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?i(s):t(s)}function i(s){return s===null?u(s):N(s)?e.attempt(xa,i,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||N(s)?(e.exit("codeFlowValue"),i(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function ka(e,n,t){const r=this;return l;function l(i){return r.parser.lazy[r.now().line]?t(i):N(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),l):K(e,o,"linePrefix",5)(i)}function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(i):N(i)?l(i):t(i)}}const wa={name:"codeText",previous:Sa,resolve:va,tokenize:Ca};function va(e){let n=e.length-4,t=3,r,l;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)l===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(l=r):(r===n||e[r][1].type==="lineEnding")&&(e[l][1].type="codeTextData",r!==l+2&&(e[l][1].end=e[r-1][1].end,e.splice(l+2,r-l-2),n-=r-l-2,r=l+2),l=void 0);return e}function Sa(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ca(e,n,t){let r=0,l,o;return i;function i(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),l=0,f(c)):N(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||N(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),l++,f):l===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",s(c))}}class Ia{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const l=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return r&&bt(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),bt(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),bt(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);bt(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);bt(this.left,t.reverse())}}}function bt(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function ii(e){const n={};let t=-1,r,l,o,i,a,u,s;const f=new Ia(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Ea(f,t)),t=n[t],s=!0);else if(r[1]._container){for(o=t,l=void 0;o--;)if(i=f.get(o),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(l&&(f.get(l)[1].type="lineEndingBlank"),i[1].type="lineEnding",l=o);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;l&&(r[1].end={...f.get(l)[1].start},a=f.slice(l,t),a.unshift(r),f.splice(l,t-l+1,a))}}return ve(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function Ea(e,n){const t=e.get(n)[1],r=e.get(n)[2];let l=n-1;const o=[];let i=t._tokenizer;i||(i=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const a=i.events,u=[],s={};let f,c,d=-1,h=t,p=0,x=0;const v=[x];for(;h;){for(;e.get(++l)[1]!==h;);o.push(l),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&i.defineSkip(h.start),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(f),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(x=d+1,v.push(x),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(i.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),d=v.length;d--;){const b=a.slice(v[d],v[d+1]),I=o.pop();u.push([I,I+b.length-1]),e.splice(I,2,b)}for(u.reverse(),d=-1;++d<u.length;)s[p+u[d][0]]=p+u[d][1],p+=u[d][1]-u[d][0]-1;return s}const Aa={resolve:La,tokenize:Pa},_a={partial:!0,tokenize:Ta};function La(e){return ii(e),e}function Pa(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),l(a)}function l(a){return a===null?o(a):N(a)?e.check(_a,i,o)(a):(e.consume(a),l)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function i(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,l}}function Ta(e,n,t){const r=this;return l;function l(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),K(e,o,"linePrefix")}function o(i){if(i===null||N(i))return t(i);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(i):e.interrupt(r.parser.constructs.flow,t,n)(i)}}function li(e,n,t,r,l,o,i,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(b){return b===60?(e.enter(r),e.enter(l),e.enter(o),e.consume(b),e.exit(o),d):b===null||b===32||b===41||Bt(b)?t(b):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(b))}function d(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(l),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===62?(e.exit("chunkString"),e.exit(a),d(b)):b===null||b===60||N(b)?t(b):(e.consume(b),b===92?p:h)}function p(b){return b===60||b===62||b===92?(e.consume(b),h):h(b)}function x(b){return!f&&(b===null||b===41||J(b))?(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),n(b)):f<s&&b===40?(e.consume(b),f++,x):b===41?(e.consume(b),f--,x):b===null||b===32||b===40||Bt(b)?t(b):(e.consume(b),b===92?v:x)}function v(b){return b===40||b===41||b===92?(e.consume(b),x):x(b)}}function oi(e,n,t,r,l,o){const i=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(l),e.consume(h),e.exit(l),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in i.parser.constructs?t(h):h===93?(e.exit(o),e.enter(l),e.consume(h),e.exit(l),e.exit(r),n):N(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||N(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!V(h)),h===92?d:c)}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function ai(e,n,t,r,l,o){let i;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(l),e.consume(d),e.exit(l),i=d===40?41:d,u):t(d)}function u(d){return d===i?(e.enter(l),e.consume(d),e.exit(l),e.exit(r),n):(e.enter(o),s(d))}function s(d){return d===i?(e.exit(o),u(i)):d===null?t(d):N(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),K(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===i||d===null||N(d)?(e.exit("chunkString"),s(d)):(e.consume(d),d===92?c:f)}function c(d){return d===i||d===92?(e.consume(d),f):f(d)}}function Ct(e,n){let t;return r;function r(l){return N(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t=!0,r):V(l)?K(e,r,t?"linePrefix":"lineSuffix")(l):n(l)}}const $a={name:"definition",tokenize:Da},za={partial:!0,tokenize:Fa};function Da(e,n,t){const r=this;let l;return o;function o(h){return e.enter("definition"),i(h)}function i(h){return oi.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return l=Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):t(h)}function u(h){return J(h)?Ct(e,s)(h):s(h)}function s(h){return li(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(za,c,c)(h)}function c(h){return V(h)?K(e,d,"whitespace")(h):d(h)}function d(h){return h===null||N(h)?(e.exit("definition"),r.parser.defined.push(l),n(h)):t(h)}}function Fa(e,n,t){return r;function r(a){return J(a)?Ct(e,l)(a):t(a)}function l(a){return ai(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return V(a)?K(e,i,"whitespace")(a):i(a)}function i(a){return a===null||N(a)?n(a):t(a)}}const Ma={name:"hardBreakEscape",tokenize:Oa};function Oa(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return N(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const Ra={name:"headingAtx",resolve:Na,tokenize:Ba};function Na(e,n){let t=e.length-2,r=3,l,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(l={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ve(e,r,t-r+1,[["enter",l,n],["enter",o,n],["exit",o,n],["exit",l,n]])),e}function Ba(e,n,t){let r=0;return l;function l(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),i(f)}function i(f){return f===35&&r++<6?(e.consume(f),i):f===null||J(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||N(f)?(e.exit("atxHeading"),n(f)):V(f)?K(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||J(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const ja=["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"],ir=["pre","script","style","textarea"],Ha={concrete:!0,name:"htmlFlow",resolveTo:Va,tokenize:Wa},qa={partial:!0,tokenize:Qa},Ua={partial:!0,tokenize:Ka};function Va(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Wa(e,n,t){const r=this;let l,o,i,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),d):g===47?(e.consume(g),o=!0,x):g===63?(e.consume(g),l=3,r.interrupt?n:m):de(g)?(e.consume(g),i=String.fromCharCode(g),v):t(g)}function d(g){return g===45?(e.consume(g),l=2,h):g===91?(e.consume(g),l=5,a=0,p):de(g)?(e.consume(g),l=4,r.interrupt?n:m):t(g)}function h(g){return g===45?(e.consume(g),r.interrupt?n:m):t(g)}function p(g){const pe="CDATA[";return g===pe.charCodeAt(a++)?(e.consume(g),a===pe.length?r.interrupt?n:F:p):t(g)}function x(g){return de(g)?(e.consume(g),i=String.fromCharCode(g),v):t(g)}function v(g){if(g===null||g===47||g===62||J(g)){const pe=g===47,xe=i.toLowerCase();return!pe&&!o&&ir.includes(xe)?(l=1,r.interrupt?n(g):F(g)):ja.includes(i.toLowerCase())?(l=6,pe?(e.consume(g),b):r.interrupt?n(g):F(g)):(l=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(g):o?I(g):k(g))}return g===45||fe(g)?(e.consume(g),i+=String.fromCharCode(g),v):t(g)}function b(g){return g===62?(e.consume(g),r.interrupt?n:F):t(g)}function I(g){return V(g)?(e.consume(g),I):y(g)}function k(g){return g===47?(e.consume(g),y):g===58||g===95||de(g)?(e.consume(g),E):V(g)?(e.consume(g),k):y(g)}function E(g){return g===45||g===46||g===58||g===95||fe(g)?(e.consume(g),E):$(g)}function $(g){return g===61?(e.consume(g),w):V(g)?(e.consume(g),$):k(g)}function w(g){return g===null||g===60||g===61||g===62||g===96?t(g):g===34||g===39?(e.consume(g),u=g,_):V(g)?(e.consume(g),w):L(g)}function _(g){return g===u?(e.consume(g),u=null,T):g===null||N(g)?t(g):(e.consume(g),_)}function L(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||J(g)?$(g):(e.consume(g),L)}function T(g){return g===47||g===62||V(g)?k(g):t(g)}function y(g){return g===62?(e.consume(g),C):t(g)}function C(g){return g===null||N(g)?F(g):V(g)?(e.consume(g),C):t(g)}function F(g){return g===45&&l===2?(e.consume(g),Z):g===60&&l===1?(e.consume(g),te):g===62&&l===4?(e.consume(g),ie):g===63&&l===3?(e.consume(g),m):g===93&&l===5?(e.consume(g),ae):N(g)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(qa,ce,R)(g)):g===null||N(g)?(e.exit("htmlFlowData"),R(g)):(e.consume(g),F)}function R(g){return e.check(Ua,O,ce)(g)}function O(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),B}function B(g){return g===null||N(g)?R(g):(e.enter("htmlFlowData"),F(g))}function Z(g){return g===45?(e.consume(g),m):F(g)}function te(g){return g===47?(e.consume(g),i="",X):F(g)}function X(g){if(g===62){const pe=i.toLowerCase();return ir.includes(pe)?(e.consume(g),ie):F(g)}return de(g)&&i.length<8?(e.consume(g),i+=String.fromCharCode(g),X):F(g)}function ae(g){return g===93?(e.consume(g),m):F(g)}function m(g){return g===62?(e.consume(g),ie):g===45&&l===2?(e.consume(g),m):F(g)}function ie(g){return g===null||N(g)?(e.exit("htmlFlowData"),ce(g)):(e.consume(g),ie)}function ce(g){return e.exit("htmlFlow"),n(g)}}function Ka(e,n,t){const r=this;return l;function l(i){return N(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):t(i)}function o(i){return r.parser.lazy[r.now().line]?t(i):n(i)}}function Qa(e,n,t){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Lt,n,t)}}const Ya={name:"htmlText",tokenize:Xa};function Xa(e,n,t){const r=this;let l,o,i;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),$):m===63?(e.consume(m),k):de(m)?(e.consume(m),L):t(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,p):de(m)?(e.consume(m),I):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),d):N(m)?(i=c,te(m)):(e.consume(m),c)}function d(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?Z(m):m===45?d(m):c(m)}function p(m){const ie="CDATA[";return m===ie.charCodeAt(o++)?(e.consume(m),o===ie.length?x:p):t(m)}function x(m){return m===null?t(m):m===93?(e.consume(m),v):N(m)?(i=x,te(m)):(e.consume(m),x)}function v(m){return m===93?(e.consume(m),b):x(m)}function b(m){return m===62?Z(m):m===93?(e.consume(m),b):x(m)}function I(m){return m===null||m===62?Z(m):N(m)?(i=I,te(m)):(e.consume(m),I)}function k(m){return m===null?t(m):m===63?(e.consume(m),E):N(m)?(i=k,te(m)):(e.consume(m),k)}function E(m){return m===62?Z(m):k(m)}function $(m){return de(m)?(e.consume(m),w):t(m)}function w(m){return m===45||fe(m)?(e.consume(m),w):_(m)}function _(m){return N(m)?(i=_,te(m)):V(m)?(e.consume(m),_):Z(m)}function L(m){return m===45||fe(m)?(e.consume(m),L):m===47||m===62||J(m)?T(m):t(m)}function T(m){return m===47?(e.consume(m),Z):m===58||m===95||de(m)?(e.consume(m),y):N(m)?(i=T,te(m)):V(m)?(e.consume(m),T):Z(m)}function y(m){return m===45||m===46||m===58||m===95||fe(m)?(e.consume(m),y):C(m)}function C(m){return m===61?(e.consume(m),F):N(m)?(i=C,te(m)):V(m)?(e.consume(m),C):T(m)}function F(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),l=m,R):N(m)?(i=F,te(m)):V(m)?(e.consume(m),F):(e.consume(m),O)}function R(m){return m===l?(e.consume(m),l=void 0,B):m===null?t(m):N(m)?(i=R,te(m)):(e.consume(m),R)}function O(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||J(m)?T(m):(e.consume(m),O)}function B(m){return m===47||m===62||J(m)?T(m):t(m)}function Z(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function te(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),X}function X(m){return V(m)?K(e,ae,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ae(m)}function ae(m){return e.enter("htmlTextData"),i(m)}}const On={name:"labelEnd",resolveAll:eu,resolveTo:tu,tokenize:nu},Ga={tokenize:ru},Ja={tokenize:iu},Za={tokenize:lu};function eu(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const l=r.type==="labelImage"?4:2;r.type="data",n+=l}}return e.length!==t.length&&ve(e,0,e.length,t),e}function tu(e,n){let t=e.length,r=0,l,o,i,a;for(;t--;)if(l=e[t][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[t][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(i){if(e[t][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=t,l.type!=="labelLink")){r=2;break}}else l.type==="labelEnd"&&(i=t);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[i-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=Ce(a,e.slice(o+1,o+r+3)),a=Ce(a,[["enter",f,n]]),a=Ce(a,Wt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,i-3),n)),a=Ce(a,[["exit",f,n],e[i-2],e[i-1],["exit",s,n]]),a=Ce(a,e.slice(i+1)),a=Ce(a,[["exit",u,n]]),ve(e,o,e.length,a),e}function nu(e,n,t){const r=this;let l=r.events.length,o,i;for(;l--;)if((r.events[l][1].type==="labelImage"||r.events[l][1].type==="labelLink")&&!r.events[l][1]._balanced){o=r.events[l][1];break}return a;function a(d){return o?o._inactive?c(d):(i=r.parser.defined.includes(Le(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),u):t(d)}function u(d){return d===40?e.attempt(Ga,f,i?f:c)(d):d===91?e.attempt(Ja,f,i?s:c)(d):i?f(d):c(d)}function s(d){return e.attempt(Za,f,c)(d)}function f(d){return n(d)}function c(d){return o._balanced=!0,t(d)}}function ru(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),l}function l(c){return J(c)?Ct(e,o)(c):o(c)}function o(c){return c===41?f(c):li(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function i(c){return J(c)?Ct(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?ai(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return J(c)?Ct(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function iu(e,n,t){const r=this;return l;function l(a){return oi.call(r,e,o,i,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function i(a){return t(a)}}function lu(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const ou={name:"labelStartImage",resolveAll:On.resolveAll,tokenize:au};function au(e,n,t){const r=this;return l;function l(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),i):t(a)}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const uu={name:"labelStartLink",resolveAll:On.resolveAll,tokenize:su};function su(e,n,t){const r=this;return l;function l(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),o}function o(i){return i===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(i):n(i)}}const tn={name:"lineEnding",tokenize:cu};function cu(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),K(e,n,"linePrefix")}}const Nt={name:"thematicBreak",tokenize:fu};function fu(e,n,t){let r=0,l;return o;function o(s){return e.enter("thematicBreak"),i(s)}function i(s){return l=s,a(s)}function a(s){return s===l?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||N(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===l?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),V(s)?K(e,a,"whitespace")(s):a(s))}}const me={continuation:{tokenize:mu},exit:yu,name:"list",tokenize:pu},hu={partial:!0,tokenize:xu},du={partial:!0,tokenize:gu};function pu(e,n,t){const r=this,l=r.events[r.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,i=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:wn(h)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Nt,t,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return t(h)}function u(h){return wn(h)&&++i<10?(e.consume(h),u):(!r.interrupt||i<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):t(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Lt,r.interrupt?t:f,e.attempt(hu,d,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function c(h){return V(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d):t(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function mu(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Lt,l,o);function l(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,K(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!V(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(du,n,i)(a))}function i(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,K(e,e.attempt(me,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function gu(e,n,t){const r=this;return K(e,l,"listItemIndent",r.containerState.size+1);function l(o){const i=r.events[r.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?n(o):t(o)}}function yu(e){e.exit(this.containerState.type)}function xu(e,n,t){const r=this;return K(e,l,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const i=r.events[r.events.length-1];return!V(o)&&i&&i[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const lr={name:"setextUnderline",resolveTo:bu,tokenize:ku};function bu(e,n){let t=e.length,r,l,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(l=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",i,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=i,e.push(["exit",i,n]),e}function ku(e,n,t){const r=this;let l;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),l=s,i(s)):t(s)}function i(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===l?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),V(s)?K(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||N(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const wu={tokenize:vu};function vu(e){const n=this,t=e.attempt(Lt,r,e.attempt(this.parser.constructs.flowInitial,l,K(e,e.attempt(this.parser.constructs.flow,l,e.attempt(Aa,l)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Su={resolveAll:si()},Cu=ui("string"),Iu=ui("text");function ui(e){return{resolveAll:si(e==="text"?Eu:void 0),tokenize:n};function n(t){const r=this,l=this.parser.constructs[e],o=t.attempt(l,i,a);return i;function i(f){return s(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return s(f)?(t.exit("data"),o(f)):(t.consume(f),u)}function s(f){if(f===null)return!0;const c=l[f];let d=-1;if(c)for(;++d<c.length;){const h=c[d];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function si(e){return n;function n(t,r){let l=-1,o;for(;++l<=t.length;)o===void 0?t[l]&&t[l][1].type==="data"&&(o=l,l++):(!t[l]||t[l][1].type!=="data")&&(l!==o+2&&(t[o][1].end=t[l-1][1].end,t.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(t,r):t}}function Eu(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],l=n.sliceStream(r);let o=l.length,i=-1,a=0,u;for(;o--;){const s=l[o];if(typeof s=="string"){for(i=s.length;s.charCodeAt(i-1)===32;)a++,i--;if(i)break;i=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:r.start._bufferIndex+i,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Au={42:me,43:me,45:me,48:me,49:me,50:me,51:me,52:me,53:me,54:me,55:me,56:me,57:me,62:ti},_u={91:$a},Lu={[-2]:en,[-1]:en,32:en},Pu={35:Ra,42:Nt,45:[lr,Nt],60:Ha,61:lr,95:Nt,96:rr,126:rr},Tu={38:ri,92:ni},$u={[-5]:tn,[-4]:tn,[-3]:tn,33:ou,38:ri,42:vn,60:[ua,Ya],91:uu,92:[Ma,ni],93:On,95:vn,96:wa},zu={null:[vn,Su]},Du={null:[42,95]},Fu={null:[]},Mu=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Du,contentInitial:_u,disable:Fu,document:Au,flow:Pu,flowInitial:Lu,insideSpan:zu,string:Tu,text:$u},Symbol.toStringTag,{value:"Module"}));function Ou(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const l={},o=[];let i=[],a=[];const u={attempt:_($),check:_(w),consume:I,enter:k,exit:E,interrupt:_(w,{interrupt:!0})},s={code:null,containerState:{},defineSkip:x,events:[],now:p,parser:e,previous:null,sliceSerialize:d,sliceStream:h,write:c};let f=n.tokenize.call(s,u);return n.resolveAll&&o.push(n),s;function c(C){return i=Ce(i,C),v(),i[i.length-1]!==null?[]:(L(n,0),s.events=Wt(o,s.events,s),s.events)}function d(C,F){return Nu(h(C),F)}function h(C){return Ru(i,C)}function p(){const{_bufferIndex:C,_index:F,line:R,column:O,offset:B}=r;return{_bufferIndex:C,_index:F,line:R,column:O,offset:B}}function x(C){l[C.line]=C.column,y()}function v(){let C;for(;r._index<i.length;){const F=i[r._index];if(typeof F=="string")for(C=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===C&&r._bufferIndex<F.length;)b(F.charCodeAt(r._bufferIndex));else b(F)}}function b(C){f=f(C)}function I(C){N(C)?(r.line++,r.column=1,r.offset+=C===-3?2:1,y()):C!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=C}function k(C,F){const R=F||{};return R.type=C,R.start=p(),s.events.push(["enter",R,s]),a.push(R),R}function E(C){const F=a.pop();return F.end=p(),s.events.push(["exit",F,s]),F}function $(C,F){L(C,F.from)}function w(C,F){F.restore()}function _(C,F){return R;function R(O,B,Z){let te,X,ae,m;return Array.isArray(O)?ce(O):"tokenize"in O?ce([O]):ie(O);function ie(ue){return Oe;function Oe(Ee){const Ue=Ee!==null&&ue[Ee],Ve=Ee!==null&&ue.null,Ye=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(Ve)?Ve:Ve?[Ve]:[]];return ce(Ye)(Ee)}}function ce(ue){return te=ue,X=0,ue.length===0?Z:g(ue[X])}function g(ue){return Oe;function Oe(Ee){return m=T(),ae=ue,ue.partial||(s.currentConstruct=ue),ue.name&&s.parser.constructs.disable.null.includes(ue.name)?xe():ue.tokenize.call(F?Object.assign(Object.create(s),F):s,u,pe,xe)(Ee)}}function pe(ue){return C(ae,m),B}function xe(ue){return m.restore(),++X<te.length?g(te[X]):Z}}}function L(C,F){C.resolveAll&&!o.includes(C)&&o.push(C),C.resolve&&ve(s.events,F,s.events.length-F,C.resolve(s.events.slice(F),s)),C.resolveTo&&(s.events=C.resolveTo(s.events,s))}function T(){const C=p(),F=s.previous,R=s.currentConstruct,O=s.events.length,B=Array.from(a);return{from:O,restore:Z};function Z(){r=C,s.previous=F,s.currentConstruct=R,s.events.length=O,a=B,y()}}function y(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}function Ru(e,n){const t=n.start._index,r=n.start._bufferIndex,l=n.end._index,o=n.end._bufferIndex;let i;if(t===l)i=[e[t].slice(r,o)];else{if(i=e.slice(t,l),r>-1){const a=i[0];typeof a=="string"?i[0]=a.slice(r):i.shift()}o>0&&i.push(e[l].slice(0,o))}return i}function Nu(e,n){let t=-1;const r=[];let l;for(;++t<e.length;){const o=e[t];let i;if(typeof o=="string")i=o;else switch(o){case-5:{i="\r";break}case-4:{i=`
|
|
1
|
+
import{c as A,m as ge,I as Fe,a as Y,b as he,o as ct,t as j,i as z,S as Q,P as Fr,F as De,O as cl,d as xn,u as Je,e as fl,f as re,g as Mr,h as at,x as Or,s as ne,j as ze,k as we,l as hl,n as dt,p as vt,q as je,T as dl,r as se,v as pl,w as Dn,y as Rr,z as it,A as ml,L as gl,E as yl,$ as Ze,B as xl,C as Kn,D as bn,G as bl,M as Qn,H as Nr,J as kl,K as Br,N as wl,Q as vl,R as Yn,U as Sl,V as Cl,W as Il,X as El}from"./index-DLPxgS2d.js";import{c as Al}from"./chevron-left-BvHMpJKL.js";var jr={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};jr.node;var _l=e=>A(Fe,ge(e,{icon:jr})),Ll=_l,Hr={name:"code-xml",size:24,node:[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],aliases:["code-2"]};Hr.node;var Pl=e=>A(Fe,ge(e,{icon:Hr})),Tl=Pl,qr={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};qr.node;var $l=e=>A(Fe,ge(e,{icon:qr})),zl=$l,Ur={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};Ur.node;var Dl=e=>A(Fe,ge(e,{icon:Ur})),Fl=Dl,Vr={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};Vr.node;var Ml=e=>A(Fe,ge(e,{icon:Vr})),Ol=Ml,Wr={name:"import",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]};Wr.node;var Rl=e=>A(Fe,ge(e,{icon:Wr})),Nl=Rl,Kr={name:"list-indent-decrease",size:24,node:[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]],aliases:["outdent","indent-decrease"]};Kr.node;var Bl=e=>A(Fe,ge(e,{icon:Kr})),jl=Bl,Qr={name:"shapes",size:24,node:[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]};Qr.node;var Hl=e=>A(Fe,ge(e,{icon:Qr})),ql=Hl,Yr={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]};Yr.node;var Ul=e=>A(Fe,ge(e,{icon:Yr})),Vl=Ul,Xr={name:"type",size:24,node:[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]};Xr.node;var Wl=e=>A(Fe,ge(e,{icon:Xr})),Kl=Wl;function Ql(e){const[n,t]=Y(!1),r=()=>t(!1);return he(()=>{e.contentKey();const l=e.isOpen(),o=e.viewMode(),i=e.hasSelection(),a=e.loading();if(!l||o!=="preview"||!i||a){t(!1);return}n()||queueMicrotask(()=>{const u=e.contentContainerEl();if(!u)return;const s=u.querySelector(".md-selected-range");s&&(t(!0),s.scrollIntoView({block:"center"}))})}),{resetAutoScroll:r}}async function Yl(e){const n=e.fetchImpl??fetch,t=new URLSearchParams({path:e.path});e.ref&&t.set("ref",e.ref);const r=await n(`/api/files/content?${t}`,{signal:e.signal});if(!r.ok)throw new Error(`Failed to load file: ${r.status} ${r.statusText}`);return await r.text()}async function Xl(e){const n=new URLSearchParams({path:e.path});e.ref&&n.set("ref",e.ref);const t=await fetch(`/api/files/markers?${n}`,{signal:e.signal});if(!t.ok)throw new Error(`Failed to locate metrics: ${t.status} ${t.statusText}`);return(await t.json()).markers??{}}function Gl(e){const[n,t]=Y(""),[r,l]=Y(!1),[o,i]=Y(null),[a,u]=Y(null),[s,f]=Y(0),c=()=>f(d=>d+1);return he(()=>{if(s(),!e.isOpen()||!e.filePath()){t(""),i(null),l(!1),u(null);return}const d=e.filePath(),h=e.gitRef?.()??null,p=new AbortController;l(!0),i(null),t(""),u(null),(async()=>{try{const x=await Yl({path:d,ref:h,fetchImpl:e.fetchImpl,signal:p.signal});if(p.signal.aborted)return;t(x),u(x.split(/\r?\n/).length)}catch(x){if(x?.name==="AbortError")return;i(x.message??String(x))}finally{p.signal.aborted||l(!1)}})(),ct(()=>p.abort())}),{rawCode:n,loading:r,error:o,totalLines:a,reload:c}}function kn(e){const n=e.toLowerCase();return n.endsWith(".tsx")?"tsx":n.endsWith(".ts")?"ts":n.endsWith(".jsx")?"jsx":n.endsWith(".js")?"js":n.endsWith(".json")?"json":n.endsWith(".py")||n.endsWith(".ipynb")?"python":n.endsWith(".md")?"md":n.endsWith(".html")||n.endsWith(".htm")?"html":n.endsWith(".css")?"css":n.endsWith(".yaml")||n.endsWith(".yml")?"yaml":n.endsWith(".toml")?"toml":n.endsWith(".sh")||n.endsWith(".bash")||n.endsWith(".zsh")?"bash":"txt"}function Jl(e){const[n,t]=Y(""),[r,l]=Y(null),[o,i]=Y(null),[a,u]=Y(!1),[s,f]=Y(null);let c,d=0;const h=()=>c||(c=new Worker(new URL("/assets/highlight.worker-C64dOQ1-.js",import.meta.url),{type:"module"}),c.onmessage=p=>{const x=p.data;if(x.id===d){if(x.error){f(`Could not highlight this file: ${x.error}`),t("");return}f(null),t(x.html??""),l(x.start??null),i(x.end??null),u(!!x.wasIndentationReduced)}},c.onerror=p=>{d++,c?.terminate(),c=void 0,f(`Syntax highlighting failed: ${p.message}`),t("")},c);return he(()=>{const p=e.rawCode(),x=e.filePath(),v=e.lineFilterEnabled(),b=e.lineOffset(),I=e.reduceIndentation(),k=e.targetStart(),E=e.targetEnd(),$=++d;if(f(null),!p||!x){t(""),l(null),i(null),u(!1);return}const w=typeof k=="number"&&typeof E=="number"?{start:k,end:E}:null;try{h().postMessage({id:$,text:p,language:kn(x),useLineFilter:v,offset:b,target:w,reduceIndentation:I})}catch(_){f(`Could not start syntax highlighting: ${String(_)}`)}}),ct(()=>{d++,c?.terminate()}),{highlightedHtml:n,displayStartLine:r,displayEndLine:o,wasIndentationReduced:a,highlightError:s}}function Zl(e){const[n,t]=Y(null);return he(()=>{const r=e.filePath(),l=e.gitRef?.()??null;if(t(null),!r)return;const o=new AbortController;Xl({path:r,ref:l,signal:o.signal}).then(i=>!o.signal.aborted&&t(i)).catch(()=>{}),ct(()=>o.abort())}),n}function Te(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()){const n=Number(e);if(Number.isFinite(n))return n}return null}function St(e){const n=e;return n?.name==="(body)"||n?.type==="function_body"||n?.type==="file_body"}function He(e){const n=e;if(!n||!Array.isArray(n.children))return[];const t=n.children.filter(r=>!St(r));if(t.length===0){const r=n.children.find(l=>St(l)&&Array.isArray(l.children)&&l.children.length>0);if(r)return r.children.filter(l=>!St(l))}return t}function eo(e,n){if(!e)return[];if(!n)return[e];const t=n.start,r=n.end,l=[e];let o=e,i=0;for(;i<100;){i++;const a=He(o);if(!a?.length)break;const u=a.reduce((x,v)=>{const b=Te(v?.start_line),I=Te(v?.end_line);if(!v||b===null||I===null||!(b<=t&&I>=r))return x;if(!x)return v;const E=Te(x?.start_line),$=Te(x?.end_line);if(E===null||$===null)return v;const w=$-E,_=I-b;if(_<w)return v;if(_>w)return x;const L=E===t&&$===r,T=b===t&&I===r;return T!==L&&T?v:x},null);if(!u)break;const s=Te(o?.start_line),f=Te(o?.end_line),c=Te(u?.start_line),d=Te(u?.end_line),h=s!==null&&f!==null?f-s:Number.POSITIVE_INFINITY,p=c!==null&&d!==null?d-c:Number.POSITIVE_INFINITY;if(p>h||p===h&&!He(u).some(b=>{const I=Te(b?.start_line),k=Te(b?.end_line);return!b||I===null||k===null||!(I<=t&&k>=r)?!1:k-I<p}))break;l.push(u),o=u}return l}function Jt(e){return e?`${e?.type??""}|${e?.name??""}|${e?.start_line??""}|${e?.end_line??""}`:""}function to(e,n){return!e||!n?!1:e===n?!0:Jt(e)!==""&&Jt(e)===Jt(n)}function no(e,n){if(!e||!n)return null;const t=[],r=new Set,l=i=>{if(!i||r.has(i))return!1;if(r.add(i),to(i,n))return t.push(i),!0;const a=He(i);for(const u of a)if(l(u))return t.push(i),!0;return!1};return l(e)?t.reverse():null}const ro={complexity_avg:"complexity"};function Gr(e,n){return e?e[ro[n]??n]??[]:[]}function io(e,n){return Gr(e,n).length>0}function lo(e){const n=new Map;for(const t of e){const r=n.get(t.line)??{endLine:t.line,notes:[]};r.endLine=Math.max(r.endLine,t.end_line),t.note&&r.notes.push(t.note),n.set(t.line,r)}return[...n.entries()].sort(([t],[r])=>t-r).map(([t,r])=>({line:t,endLine:r.endLine,notes:oo(r.notes)}))}function oo(e){const n=new Map;for(const t of e)n.set(t,(n.get(t)??0)+1);return[...n.entries()].map(([t,r])=>r>1?`${t} ×${r}`:t)}function ao(e,n,t){return e.filter(r=>r.endLine>=n&&r.line<=t)}function uo(e,n,t){if(!e.length)return null;if(n===null)return t===1?e[0]:e[e.length-1];if(t===1)return e.find(r=>r.line>n)??e[0];for(let r=e.length-1;r>=0;r--)if(e[r].line<n)return e[r];return e[e.length-1]}function so(e){const n=new Map;for(const t of e)for(let r=t.line;r<=t.endLine;r++)n.has(r)||n.set(r,{note:r===t.line?t.notes.join(", "):"",first:r===t.line});return n}var co=j('<div class="flex h-7 items-center rounded-md border border-[var(--plc-border)] bg-[var(--plc-surface-muted)] p-0.5">'),fo=j("<button type=button>"),ho=j('<div class="px-2 pb-1 pt-0.5 text-[11px] text-[var(--plc-on-subtle)]">Context lines'),po=j('<header class="flex h-12 shrink-0 items-center gap-3 border-b border-[var(--plc-border)] bg-[var(--plc-surface)] pl-4 pr-2 text-sm"><div class="flex min-w-0 flex-1 items-baseline gap-2"><span class="shrink-0 font-semibold text-[var(--plc-on-surface)]"></span><span class="min-w-0 truncate text-[12px] text-[var(--plc-on-subtle)] [direction:rtl] text-left"><span dir=ltr></span></span></div><div class="flex items-center gap-1"></div><div class="flex items-center gap-0.5 border-l border-[var(--plc-border)] pl-2"><a target=_blank aria-label="Open in VS Code"title="Open in VS Code"class="inline-flex h-7 w-7 items-center justify-center rounded-md text-[var(--plc-on-muted)] transition-colors duration-150 hover:bg-[var(--plc-surface-hover)] hover:text-[var(--plc-on-surface)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--plc-border-focus)]">'),mo=j('<button type=button title="Context lines around the selection"class="flex h-7 items-center gap-0.5 rounded-md px-1.5 text-[12px] font-medium tabular-nums text-[var(--plc-on-muted)] transition-colors duration-150 hover:bg-[var(--plc-surface-hover)] hover:text-[var(--plc-on-surface)] disabled:pointer-events-none disabled:opacity-40">±');const go=[0,4,10,25];function Xn(e){return(()=>{var n=co();return z(n,A(De,{get each(){return e.options},children:t=>(()=>{var r=fo();return r.$$click=()=>e.onChange(t.value),z(r,()=>t.label),re(l=>{var o=t.disabled,i=t.title,a=e.value===t.value,u=ze("h-full rounded-[5px] px-2.5 text-[12px] font-medium transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-40",e.value===t.value?"bg-[var(--plc-surface)] text-[var(--plc-on-surface)] shadow-[0_1px_2px_rgba(15,23,42,0.08)]":"text-[var(--plc-on-subtle)] hover:text-[var(--plc-on-surface)] enabled:active:bg-[var(--plc-surface-hover)]");return o!==l.e&&(r.disabled=l.e=o),i!==l.t&&ne(r,"title",l.t=i),a!==l.a&&ne(r,"aria-pressed",l.a=a),u!==l.o&&we(r,l.o=u),l},{e:void 0,t:void 0,a:void 0,o:void 0}),r})()})),n})()}function yo(e){const[n,t]=Y(!1);let r;return A(at,{get label(){return e.label},onClick:()=>{e.onClick(),t(!0),clearTimeout(r),r=window.setTimeout(()=>t(!1),1200)},get children(){return A(Q,{get when(){return n()},get fallback(){return e.icon},get children(){return A(hl,{size:15,class:"text-[var(--plc-success)] plc-pop-in","aria-hidden":"true"})}})}})}function xo(e){const[n,t]=Y(!1),r=()=>{const l=e.rootPath?.replace(/\/+$/,""),o=l&&e.filePath.startsWith(`${l}/`)?e.filePath.slice(l.length+1):e.filePath,i=o.lastIndexOf(e.baseName);return i>0?o.slice(0,i):""};return(()=>{var l=po(),o=l.firstChild,i=o.firstChild,a=i.nextSibling,u=a.firstChild,s=o.nextSibling,f=s.nextSibling,c=f.firstChild;return z(i,()=>e.baseName),z(u,r),z(l,A(Q,{get when(){return e.isMarkdown()},get children(){return A(Xn,{get value(){return e.viewMode()},get onChange(){return e.setViewMode},options:[{value:"code",label:"Code"},{value:"preview",label:"Preview"}]})}}),s),z(s,A(Xn,{get value(){return e.lineFilterEnabled()&&e.hasLineRange()?"selection":"file"},onChange:d=>e.setLineFilterEnabled(d==="selection"),get options(){return[{value:"selection",label:"Selection",disabled:!e.hasLineRange(),title:e.hasLineRange()?"Show only the selected scope":"Pick a symbol to limit the view"},{value:"file",label:"Whole file"}]}}),null),z(s,A(Mr,{placement:"bottom-end",get isOpen(){return n()},onOpenChange:t,trigger:d=>(()=>{var h=mo();h.firstChild,xn(h,"click",d.onClick,!0);var p=d.ref;return typeof p=="function"?Je(p,h):d.ref=h,z(h,()=>e.lineOffset(),null),z(h,A(fl,{size:12,"aria-hidden":"true"}),null),re(()=>h.disabled=!e.lineFilterEnabled()||!e.hasLineRange()),h})(),get children(){return A(Fr,{width:"sm",get children(){return[ho(),A(De,{each:go,children:d=>A(cl,{get selected(){return e.lineOffset()===d},onClick:()=>{e.setLineOffset(d),t(!1)},children:d===0?"None":`±${d} lines`})})]}})}}),null),z(s,A(at,{label:"Reduce indent",title:"Reduce indent: strip the common leading whitespace",get"aria-pressed"(){return e.reduceIndentation()},onClick:()=>e.setReduceIndentation(!e.reduceIndentation()),get class(){return e.reduceIndentation()?"bg-[var(--plc-surface-muted)] text-[var(--plc-on-surface)] hover:bg-[var(--plc-border)]":""},get children(){return A(jl,{size:15,"aria-hidden":"true"})}}),null),z(f,A(yo,{label:"Copy file contents",get icon(){return A(zl,{size:15,"aria-hidden":"true"})},onClick:()=>navigator.clipboard.writeText(e.rawCode())}),c),z(c,A(Fl,{size:15,"aria-hidden":"true"})),z(f,A(at,{label:"Close (Esc)",get onClick(){return e.onClose},get children(){return A(Or,{size:16,"aria-hidden":"true"})}}),null),re(d=>{var h=e.filePath,p=e.viewMode()!=="code",x=`vscode://file/${e.filePath}`;return h!==d.e&&ne(a,"title",d.e=h),p!==d.t&&s.classList.toggle("invisible",d.t=p),x!==d.a&&ne(c,"href",d.a=x),d},{e:void 0,t:void 0,a:void 0}),l})()}dt(["click"]);const bo={type:"type",interface:"interface",class:"class",object:"object",obj:"object"};function ko(e){const n=String(e?.name??"");if(e?.type==="file")return{kind:"file",name:n};if(n==="(imports)")return{kind:"imports",name:"imports"};const t=n.match(/^(.*) \((type|interface|class|object|obj)\)$/);if(t)return{kind:bo[t[2]],name:t[1]};const r=n.match(/^\((class|async)\) (.*)$/);return r?{kind:r[1]==="class"?"class":"function",name:r[2]}:n.startsWith("<")?{kind:"jsx",name:n}:e?.type==="class"?{kind:"class",name:n}:{kind:"function",name:n}}var wo=j('<mark class="rounded-[2px] bg-[var(--plc-warning-border)] text-inherit">'),vo=j('<div class="border-b border-[var(--plc-divider)] p-2">'),So=j('<div class="flex items-center justify-between border-b border-[var(--plc-divider)] px-3 pb-1.5 pt-2 text-[11px] text-[var(--plc-on-subtle)]"><span></span><span title="Cyclomatic complexity">CCN'),Co=j('<div class="px-3 py-6 text-center text-[12px] text-[var(--plc-on-subtle)]">No symbols match “<!>”'),Io=j('<div class="min-h-0 flex-1 overflow-y-auto px-1 py-1"role=listbox>'),Eo=j('<div class="border-t border-[var(--plc-divider)] px-3 py-1.5 text-[11px] text-[var(--plc-on-subtle)]">↑↓ move · ←→ fold · Enter open · Esc close'),Ao=j('<span class="shrink-0 text-[11px] font-normal text-[var(--plc-on-subtle)]">'),_o=j('<span class="min-w-0 shrink truncate text-[11px] font-normal text-[var(--plc-on-subtle)]">in '),Lo=j('<div role=option><span class="flex h-5 w-5 shrink-0 items-center justify-center rounded text-[var(--plc-on-subtle)] hover:bg-[var(--plc-border)] hover:text-[var(--plc-on-surface)]"></span><span class="flex shrink-0 opacity-70"></span><span class="min-w-0 truncate"></span><span class="ml-auto shrink-0 pl-3 text-[11px] font-normal tabular-nums text-[var(--plc-on-subtle)]">');const Po={file:Ol,function:Vl,class:Ll,type:Kl,interface:ql,object:pl,jsx:Tl,imports:Nl};function To(e,n){const t=n?e.toLowerCase().indexOf(n.toLowerCase()):-1;return t<0?e:[se(()=>e.slice(0,t)),(()=>{var r=wo();return z(r,()=>e.slice(t,t+n.length)),r})(),se(()=>e.slice(t+n.length))]}function $o(e){const[n,t]=Y(""),[r,l]=Y(new Set),[o,i]=Y(0);let a;he(vt(()=>e.isOpen,p=>{if(!p)return;t("");const x=e.root(),v=x&&e.activeNode()?no(x,e.activeNode())??[]:[];l(new Set(v.slice(0,-1)));const b=u().findIndex(I=>I.node===e.activeNode());i(Math.max(0,b)),queueMicrotask(()=>a?.querySelector("[data-active=true]")?.scrollIntoView({block:"center"}))}));const u=je(()=>{const p=e.root();if(!p)return[];const x=n().trim().toLowerCase(),v=[];if(x){const k=(E,$)=>{for(const w of He(E)){const _=String(w.name??"");_.toLowerCase().includes(x)&&v.push({node:w,depth:0,hasChildren:!1,context:$.join(" › ")}),k(w,[...$,_])}};return k(p,[]),v}v.push({node:p,depth:0,hasChildren:!1});const b=r(),I=(k,E)=>{for(const $ of He(k)){const w=He($).length>0;v.push({node:$,depth:E,hasChildren:w}),w&&b.has($)&&I($,E+1)}};return I(p,0),v});he(vt(n,()=>i(0)));const s=(p,x)=>{const v=new Set(r());x??!v.has(p)?v.add(p):v.delete(p),l(v)},f=p=>{p&&(e.onSelect(p.node===e.root()?null:p.node),e.onOpenChange(!1))},c=p=>{const x=u().length;x&&(i(Math.max(0,Math.min(x-1,p))),queueMicrotask(()=>a?.querySelector(`[data-row="${o()}"]`)?.scrollIntoView({block:"nearest"})))},d=p=>{const x=u()[o()];if(p.key==="ArrowDown")c(o()+1);else if(p.key==="ArrowUp")c(o()-1);else if(p.key==="Enter")f(x);else if(p.key==="ArrowRight"&&x?.hasChildren&&!n())s(x.node,!0);else if(p.key==="ArrowLeft"&&x?.hasChildren&&!n())s(x.node,!1);else return;p.preventDefault()},h=p=>p===e.activeNode()||!e.activeNode()&&p===e.root();return A(Mr,{placement:"bottom-start",get isOpen(){return e.isOpen},get onOpenChange(){return e.onOpenChange},get trigger(){return e.trigger},get children(){return A(Fr,{width:"xl",class:"flex max-h-[min(560px,70vh)] flex-col p-0",get children(){return[(()=>{var p=vo();return z(p,A(dl,{size:"sm",placeholder:"Go to symbol…",get value(){return n()},ref:x=>queueMicrotask(()=>x.focus()),onInput:x=>t(x.currentTarget.value),onKeyDown:d})),p})(),(()=>{var p=So(),x=p.firstChild;return z(x,(()=>{var v=se(()=>!!n().trim());return()=>v()?`${u().length} ${u().length===1?"match":"matches"}`:"Outline"})()),p})(),(()=>{var p=Io(),x=a;return typeof x=="function"?Je(x,p):a=p,z(p,A(Q,{get when(){return!u().length},get children(){var v=Co(),b=v.firstChild,I=b.nextSibling;return I.nextSibling,z(v,()=>n().trim(),I),v}}),null),z(p,A(De,{get each(){return u()},children:(v,b)=>{const I=()=>v.node?.metrics?.complexity,k=ko(v.node),E=Po[k.kind],$=k.kind==="type"||k.kind==="interface"||k.kind==="object"||k.kind==="class"?k.kind:null;return(()=>{var w=Lo(),_=w.firstChild,L=_.nextSibling,T=L.nextSibling,y=T.nextSibling;return w.$$click=()=>f(v),w.$$mousemove=()=>i(b()),_.$$click=C=>{v.hasChildren&&(C.stopPropagation(),s(v.node))},z(_,A(Q,{get when(){return v.hasChildren},get children(){return A(Dn,{size:13,"aria-hidden":"true",get class(){return ze("transition-transform duration-150",r().has(v.node)&&"rotate-90")}})}})),z(L,A(E,{size:13,"aria-hidden":"true"})),z(T,(()=>{var C=se(()=>v.node===e.root());return()=>C()?e.baseName:To(k.name,n().trim())})()),z(w,A(Q,{when:$,get children(){var C=Ao();return z(C,$),C}}),y),z(w,A(Q,{get when(){return v.context},get children(){var C=_o();return C.firstChild,z(C,()=>v.context,null),C}}),y),z(y,A(Q,{get when(){return se(()=>v.node!==e.root()&&typeof I()=="number")()&&I()>1},get children(){return Rr("complexity",I())}})),re(C=>{var F=h(v.node),R=b(),O=h(v.node),B=ze("flex h-7 cursor-pointer items-center gap-1 rounded-md pr-2 text-[12px] transition-colors duration-100",h(v.node)?"bg-[var(--plc-surface-selected)] font-semibold text-[var(--plc-accent)]":o()===b()?"bg-[var(--plc-surface-muted)] text-[var(--plc-on-surface)]":"text-[var(--plc-on-muted)]"),Z=`${v.depth*14+4}px`;return F!==C.e&&ne(w,"aria-selected",C.e=F),R!==C.t&&ne(w,"data-row",C.t=R),O!==C.a&&ne(w,"data-active",C.a=O),B!==C.o&&we(w,C.o=B),Z!==C.i&&it(w,"padding-left",C.i=Z),C},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),w})()}}),null),p})(),Eo()]}})}})}dt(["mousemove","click"]);var zo=j('<div class="flex h-9 items-center gap-1 border-b border-[var(--plc-border)] bg-[var(--plc-surface)]/95 pl-1.5 pr-2 backdrop-blur"><div class="flex min-w-0 flex-1 items-center gap-0.5 overflow-hidden">'),Do=j("<button type=button>");function Fo(e){if(!e)return"";const n=e.split(/[\\/]/);return n[n.length-1]||e}function Zt(e){return e?`${e?.type??""}|${e?.name??""}|${e?.start_line??""}|${e?.end_line??""}`:""}function Mo(e,n){return!e||!n?!1:e===n?!0:Zt(e)!==""&&Zt(e)===Zt(n)}function Oo(e,n){if(!e||!n)return null;const t=[],r=new Set,l=i=>{if(!i||r.has(i))return!1;if(r.add(i),Mo(i,n))return t.push(i),!0;const a=He(i);for(const u of a)if(l(u))return t.push(i),!0;return!1};return l(e)?t.reverse():null}function Ro(e){const n=je(()=>{const o=e.root(),i=e.selectedNode?.()??null;return!o||!i?null:Oo(o,i)}),t=je(()=>{const o=n();if(o&&o.length)return o.filter(f=>!St(f));const i=e.root(),a=e.selection?.()??null,u=e.currentLine();if(!i||typeof u!="number"||u<=0)return[];const s=a&&typeof a.start=="number"&&typeof a.end=="number"?a:{start:u,end:u};return eo(i,s).filter(f=>!St(f))}),r=()=>Fo(e.filePath()),l=()=>t().length?t():[null];return(()=>{var o=zo(),i=o.firstChild;return z(o,()=>e.leading,i),z(i,A(De,{get each(){return l()},children:(a,u)=>{const s=()=>u()===l().length-1,f=()=>u()===0?r()||a?.name||"file":a.name;return[(()=>{var c=Do();return c.$$click=()=>{s()||e.onSelectScope(u()===0?null:a)},z(c,f),re(d=>{var h=f(),p=`truncate rounded px-1 py-0.5 text-[12px] transition-colors duration-150 ${s()?"max-w-[18rem] shrink-0 cursor-default font-semibold text-[var(--plc-on-surface)]":"min-w-[2rem] shrink text-[var(--plc-accent)] hover:bg-[var(--plc-surface-hover)] hover:text-[var(--plc-accent-hover)]"}`;return h!==d.e&&ne(c,"title",d.e=h),p!==d.t&&we(c,d.t=p),d},{e:void 0,t:void 0}),c})(),A(Q,{get when(){return!s()},get children(){return A(Dn,{size:12,class:"shrink-0 text-[var(--plc-on-disabled)]","aria-hidden":"true"})}})]}})),z(o,()=>e.trailing,null),o})()}dt(["click"]);var No=j('<div class="code-modal-content pb-2 pt-1">'),Bo=j('<div class="flex h-full min-h-0 gap-1"><div class="min-w-0 flex-1 overflow-auto rounded-lg border border-[var(--plc-border)] bg-[var(--plc-code-bg)]"><div class="sticky top-0 z-20"></div></div><div aria-hidden=true>'),jo=j("<button type=button aria-label=Outline>"),Ho=j('<div class="flex shrink-0 items-center gap-2 pl-2 text-[12px]"><span>'),qo=j('<button type=button class="px-1 text-[var(--plc-accent)] transition-colors duration-150 hover:text-[var(--plc-accent-hover)]"title="Show the whole file">+<!> in file'),Uo=j('<div class="flex items-center gap-0.5"><span class="pr-1 font-medium text-[var(--plc-on-surface)] max-xl:hidden"></span><span class="min-w-[3.25rem] text-center tabular-nums text-[var(--plc-on-muted)]">'),Vo=j('<div class="absolute inset-x-0 bg-[var(--plc-accent-border)]">'),Wo=j("<button type=button tabindex=-1>");function Ko(e){const[n,t]=Y(1);let r,l,o;const i=()=>!e.loading()&&!e.error()&&e.highlightedHtml(),a=()=>{const k=r;if(!k)return;const E=k.querySelectorAll("span.line");if(!E.length)return;const w=E[0].getBoundingClientRect().height||16,_=l?.offsetHeight??0,L=k.getBoundingClientRect().top+_+2;let T=Math.floor(k.scrollTop/w);T=Math.max(0,Math.min(E.length-1,T));const y=Math.max(0,T-30),C=Math.min(E.length-1,T+30);let F=T;for(let R=y;R<=C;R++)if(E[R].getBoundingClientRect().bottom>L){F=R;break}t(e.displayStartLine()+F)};he(()=>{e.highlightedHtml(),e.displayStartLine(),queueMicrotask(()=>a())}),he(()=>{const k=r;if(!k)return;let E=0;const $=()=>{E||(E=requestAnimationFrame(()=>{E=0,a()}))};k.addEventListener("scroll",$,{passive:!0}),ct(()=>{k.removeEventListener("scroll",$),E&&cancelAnimationFrame(E)})}),he(()=>{e.highlightedHtml();const k=e.overlay(),E=e.displayStartLine(),$=k?so(k.hits):null,w=k?.cursorLine??null;queueMicrotask(()=>{c();const _=o?.querySelectorAll("span.line");_&&_.forEach((L,T)=>{const y=E+T,C=$?.get(y);L.classList.toggle("metric-hit",!!C),L.classList.toggle("metric-hit-current",C!==void 0&&w!==null&&u(k.hits,w,y)),C?.first&&C.note?L.dataset.note=C.note:delete L.dataset.note})})});const u=(k,E,$)=>{const w=k.find(_=>_.line===E);return!!(w&&$>=w.line&&$<=w.endLine)},[s,f]=Y({header:0,first:0,lineH:0,span:1}),c=()=>{const k=r,E=o?.querySelector("span.line");if(!k||!o||!E)return;const $=l?.offsetHeight??0,w=o.getBoundingClientRect(),_=E.getBoundingClientRect();f({header:$,first:_.top-w.top,lineH:_.height||1,span:Math.max(o.offsetHeight,k.clientHeight-$,1)})};he(()=>{const k=r;if(!k)return;const E=new ResizeObserver(()=>c());E.observe(k),ct(()=>E.disconnect())});const d=k=>s().first+(k-e.displayStartLine())*s().lineH,h=k=>`${d(k)/s().span*100}%`,p=(k,E)=>`max(2px, ${(E-k+1)*s().lineH/s().span*100}%)`,x=()=>{const k=e.targetStartLine(),E=e.targetEndLine();return typeof k!="number"||typeof E!="number"||k<=e.displayStartLine()&&E>=e.displayEndLine()?null:{s:Math.max(k,e.displayStartLine()),e:Math.min(E,e.displayEndLine())}},v=()=>He(e.fileNode()).length>0,b=()=>{const k=e.overlay();if(!k||k.cursorLine===null)return null;const E=k.hits.findIndex($=>$.line===k.cursorLine);return E<0?null:E+1},I=()=>{const k=e.totalLines();if(!k)return"";const E=e.displayStartLine(),$=e.displayEndLine();return E<=1&&$>=k?`${k.toLocaleString()} lines`:`${E}–${$} of ${k.toLocaleString()}`};return(()=>{var k=Bo(),E=k.firstChild,$=E.firstChild,w=E.nextSibling;return Je(_=>r=_,E),Je(_=>l=_,$),z($,A(Ro,{get root(){return e.fileNode},get selectedNode(){return e.selectedScopeNode},get filePath(){return e.filePath},currentLine:n,selection:()=>{const _=e.targetStartLine?.(),L=e.targetEndLine?.();return typeof _=="number"&&typeof L=="number"?{start:_,end:L}:null},get onSelectScope(){return e.onSelectScope},get leading(){return A($o,{get root(){return e.fileNode},get activeNode(){return e.selectedScopeNode},get baseName(){return e.baseName},get isOpen(){return e.outlineOpen()},get onOpenChange(){return e.setOutlineOpen},get onSelect(){return e.onSelectScope},trigger:_=>(()=>{var L=jo();xn(L,"click",_.onClick,!0);var T=_.ref;return typeof T=="function"?Je(T,L):_.ref=L,z(L,A(ml,{size:15,"aria-hidden":"true"})),re(y=>{var C=!v(),F=v()?"Outline: go to symbol (/)":"No symbols in this file",R=ze("flex h-7 shrink-0 items-center gap-1 rounded-md px-1.5 text-[12px] font-medium transition-colors duration-150 disabled:opacity-40",_.isOpen?"bg-[var(--plc-surface-selected)] text-[var(--plc-accent)]":"text-[var(--plc-on-muted)] hover:bg-[var(--plc-surface-hover)] hover:text-[var(--plc-on-surface)]");return C!==y.e&&(L.disabled=y.e=C),F!==y.t&&ne(L,"title",y.t=F),R!==y.a&&we(L,y.a=R),y},{e:void 0,t:void 0,a:void 0}),L})()})},get trailing(){return(()=>{var _=Ho(),L=_.firstChild;return z(_,A(Q,{get when(){return e.overlay()},children:T=>(()=>{var y=Uo(),C=y.firstChild,F=C.nextSibling;return z(C,()=>T().label),z(y,A(at,{label:"Previous ([)",size:"xs",get disabled(){return!T().hits.length},onClick:()=>e.onStep(-1),get children(){return A(Al,{size:14,"aria-hidden":"true"})}}),F),z(F,(()=>{var R=se(()=>!T().hits.length);return()=>R()?"none here":se(()=>b()===null)()?`${T().hits.length} here`:`${b()} / ${T().hits.length}`})()),z(y,A(at,{label:"Next (])",size:"xs",get disabled(){return!T().hits.length},onClick:()=>e.onStep(1),get children(){return A(Dn,{size:14,"aria-hidden":"true"})}}),null),z(y,A(Q,{get when(){return T().outside>0},get children(){var R=qo(),O=R.firstChild,B=O.nextSibling;return B.nextSibling,xn(R,"click",e.onShowWholeFile,!0),z(R,()=>T().outside,B),R}}),null),z(y,A(at,{label:"Clear overlay (Esc)",size:"xs",get onClick(){return e.onClearOverlay},get children(){return A(Or,{size:13,"aria-hidden":"true"})}}),null),y})()}),L),z(L,I),re(()=>we(L,ze("tabular-nums text-[var(--plc-on-subtle)]",e.overlay()&&"max-xl:hidden"))),_})()}})),z(E,A(Q,{get when(){return e.loading()||!e.highlightedHtml()&&!e.error()},get children(){return A(gl,{label:"Loading file…"})}}),null),z(E,A(Q,{get when(){return se(()=>!e.loading())()&&e.error()},get children(){return A(yl,{get message(){return e.error()},class:"min-h-32"})}}),null),z(E,A(Q,{get when(){return i()},get children(){var _=No();return Je(L=>o=L,_),re(L=>{var T=e.overlay()?.tone??void 0,y=e.highlightedHtml();return T!==L.e&&ne(_,"data-tone",L.e=T),y!==L.t&&(_.innerHTML=L.t=y),L},{e:void 0,t:void 0}),_}}),null),z(w,A(Q,{get when(){return x()},children:_=>(()=>{var L=Vo();return re(T=>{var y=h(_().s),C=p(_().s,_().e);return y!==T.e&&it(L,"top",T.e=y),C!==T.t&&it(L,"height",T.t=C),T},{e:void 0,t:void 0}),L})()}),null),z(w,A(Q,{get when(){return e.overlay()},children:_=>A(De,{get each(){return _().hits},children:L=>(()=>{var T=Wo();return T.$$click=()=>e.onJumpToHit(L.line),re(y=>{var C=`Line ${L.line}${L.notes.length?`: ${L.notes.join(", ")}`:""}`,F=ze("absolute inset-x-0 transition-opacity duration-150",_().tone==="good"?"bg-[var(--plc-accent)]":"bg-[var(--plc-warning)]",L.line===_().cursorLine?"opacity-100 ring-1 ring-[var(--plc-on-surface)]":"opacity-60 hover:opacity-100"),R=h(L.line),O=p(L.line,L.endLine);return C!==y.e&&ne(T,"title",y.e=C),F!==y.t&&we(T,y.t=F),R!==y.a&&it(T,"top",y.a=R),O!==y.o&&it(T,"height",y.o=O),y},{e:void 0,t:void 0,a:void 0,o:void 0}),T})()})}),null),re(_=>{var L=ze("relative mb-px w-2.5 shrink-0 rounded-sm transition-colors duration-150",e.overlay()||x()?"bg-[var(--plc-surface-muted)]":"bg-transparent"),T=`${s().header+1}px`;return L!==_.e&&we(w,_.e=L),T!==_.t&&it(w,"margin-top",_.t=T),_},{e:void 0,t:void 0}),k})()}dt(["click"]);const Qo={};function Fn(e,n){const t=Qo,r=typeof t.includeImageAlt=="boolean"?t.includeImageAlt:!0,l=typeof t.includeHtml=="boolean"?t.includeHtml:!0;return Jr(e,r,l)}function Jr(e,n,t){if(Yo(e)){if("value"in e)return e.type==="html"&&!t?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Gn(e.children,n,t)}return Array.isArray(e)?Gn(e,n,t):""}function Gn(e,n,t){const r=[];let l=-1;for(;++l<e.length;)r[l]=Jr(e[l],n,t);return r.join("")}function Yo(e){return!!(e&&typeof e=="object")}const Jn=document.createElement("i");function Mn(e){const n="&"+e+";";Jn.innerHTML=n;const t=Jn.textContent;return t.charCodeAt(t.length-1)===59&&e!=="semi"||t===n?!1:t}function ve(e,n,t,r){const l=e.length;let o=0,i;if(n<0?n=-n>l?0:l+n:n=n>l?l:n,t=t>0?t:0,r.length<1e4)i=Array.from(r),i.unshift(n,t),e.splice(...i);else for(t&&e.splice(n,t);o<r.length;)i=r.slice(o,o+1e4),i.unshift(n,0),e.splice(...i),o+=1e4,n+=1e4}function Ce(e,n){return e.length>0?(ve(e,e.length,0,n),e):n}const Zn={}.hasOwnProperty;function Zr(e){const n={};let t=-1;for(;++t<e.length;)Xo(n,e[t]);return n}function Xo(e,n){let t;for(t in n){const l=(Zn.call(e,t)?e[t]:void 0)||(e[t]={}),o=n[t];let i;if(o)for(i in o){Zn.call(l,i)||(l[i]=[]);const a=o[i];Go(l[i],Array.isArray(a)?a:a?[a]:[])}}}function Go(e,n){let t=-1;const r=[];for(;++t<n.length;)(n[t].add==="after"?e:r).push(n[t]);ve(e,0,0,r)}function ei(e,n){const t=Number.parseInt(e,n);return t<9||t===11||t>13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Le(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const de=Qe(/[A-Za-z]/),fe=Qe(/[\dA-Za-z]/),Jo=Qe(/[#-'*+\--9=?A-Z^-~]/);function Bt(e){return e!==null&&(e<32||e===127)}const wn=Qe(/\d/),Zo=Qe(/[\dA-Fa-f]/),ea=Qe(/[!-/:-@[-`{-~]/);function N(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function V(e){return e===-2||e===-1||e===32}const Vt=Qe(new RegExp("\\p{P}|\\p{S}","u")),et=Qe(/\s/);function Qe(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function pt(e){const n=[];let t=-1,r=0,l=0;for(;++t<e.length;){const o=e.charCodeAt(t);let i="";if(o===37&&fe(e.charCodeAt(t+1))&&fe(e.charCodeAt(t+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(i=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(t+1);o<56320&&a>56319&&a<57344?(i=String.fromCharCode(o,a),l=1):i="�"}else i=String.fromCharCode(o);i&&(n.push(e.slice(r,t),encodeURIComponent(i)),r=t+l+1,i=""),l&&(t+=l,l=0)}return n.join("")+e.slice(r)}function K(e,n,t,r){const l=r?r-1:Number.POSITIVE_INFINITY;let o=0;return i;function i(u){return V(u)?(e.enter(t),a(u)):n(u)}function a(u){return V(u)&&o++<l?(e.consume(u),a):(e.exit(t),n(u))}}const ta={tokenize:na};function na(e){const n=e.attempt(this.parser.constructs.contentInitial,r,l);let t;return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),K(e,n,"linePrefix")}function l(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=u),t=u,i(a)}function i(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return N(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),i)}}const ra={tokenize:ia},er={tokenize:la};function ia(e){const n=this,t=[];let r=0,l,o,i;return a;function a(k){if(r<t.length){const E=t[r];return n.containerState=E[1],e.attempt(E[0].continuation,u,s)(k)}return s(k)}function u(k){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,l&&I();const E=n.events.length;let $=E,w;for(;$--;)if(n.events[$][0]==="exit"&&n.events[$][1].type==="chunkFlow"){w=n.events[$][1].end;break}b(r);let _=E;for(;_<n.events.length;)n.events[_][1].end={...w},_++;return ve(n.events,$+1,0,n.events.slice(E)),n.events.length=_,s(k)}return a(k)}function s(k){if(r===t.length){if(!l)return d(k);if(l.currentConstruct&&l.currentConstruct.concrete)return p(k);n.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(er,f,c)(k)}function f(k){return l&&I(),b(r),d(k)}function c(k){return n.parser.lazy[n.now().line]=r!==t.length,i=n.now().offset,p(k)}function d(k){return n.containerState={},e.attempt(er,h,p)(k)}function h(k){return r++,t.push([n.currentConstruct,n.containerState]),d(k)}function p(k){if(k===null){l&&I(),b(0),e.consume(k);return}return l=l||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),x(k)}function x(k){if(k===null){v(e.exit("chunkFlow"),!0),b(0),e.consume(k);return}return N(k)?(e.consume(k),v(e.exit("chunkFlow")),r=0,n.interrupt=void 0,a):(e.consume(k),x)}function v(k,E){const $=n.sliceStream(k);if(E&&$.push(null),k.previous=o,o&&(o.next=k),o=k,l.defineSkip(k.start),l.write($),n.parser.lazy[k.start.line]){let w=l.events.length;for(;w--;)if(l.events[w][1].start.offset<i&&(!l.events[w][1].end||l.events[w][1].end.offset>i))return;const _=n.events.length;let L=_,T,y;for(;L--;)if(n.events[L][0]==="exit"&&n.events[L][1].type==="chunkFlow"){if(T){y=n.events[L][1].end;break}T=!0}for(b(r),w=_;w<n.events.length;)n.events[w][1].end={...y},w++;ve(n.events,L+1,0,n.events.slice(_)),n.events.length=w}}function b(k){let E=t.length;for(;E-- >k;){const $=t[E];n.containerState=$[1],$[0].exit.call(n,e)}t.length=k}function I(){l.write([null]),o=void 0,l=void 0,n.containerState._closeFlow=void 0}}function la(e,n,t){return K(e,e.attempt(this.parser.constructs.document,n,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ft(e){if(e===null||J(e)||et(e))return 1;if(Vt(e))return 2}function Wt(e,n,t){const r=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!r.includes(o)&&(n=o(n,t),r.push(o))}return n}const vn={name:"attention",resolveAll:oa,tokenize:aa};function oa(e,n){let t=-1,r,l,o,i,a,u,s,f;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;const c={...e[r][1].end},d={...e[t][1].start};tr(c,-u),tr(d,u),i={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[t][1].start},end:d},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[t][1].start}},l={type:u>1?"strong":"emphasis",start:{...i.start},end:{...a.end}},e[r][1].end={...i.start},e[t][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=Ce(s,[["enter",e[r][1],n],["exit",e[r][1],n]])),s=Ce(s,[["enter",l,n],["enter",i,n],["exit",i,n],["enter",o,n]]),s=Ce(s,Wt(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),s=Ce(s,[["exit",o,n],["enter",a,n],["exit",a,n],["exit",l,n]]),e[t][1].end.offset-e[t][1].start.offset?(f=2,s=Ce(s,[["enter",e[t][1],n],["exit",e[t][1],n]])):f=0,ve(e,r-1,t-r+3,s),t=r+s.length-f-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function aa(e,n){const t=this.parser.constructs.attentionMarkers.null,r=this.previous,l=ft(r);let o;return i;function i(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=ft(u),c=!f||f===2&&l||t.includes(u),d=!l||l===2&&f||t.includes(r);return s._open=!!(o===42?c:c&&(l||!d)),s._close=!!(o===42?d:d&&(f||!c)),n(u)}}function tr(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const ua={name:"autolink",tokenize:sa};function sa(e,n,t){let r=0;return l;function l(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return de(h)?(e.consume(h),i):h===64?t(h):s(h)}function i(h){return h===43||h===45||h===46||fe(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||fe(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):h===null||h===32||h===60||Bt(h)?t(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):Jo(h)?(e.consume(h),s):t(h)}function f(h){return fe(h)?c(h):t(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),n):d(h)}function d(h){if((h===45||fe(h))&&r++<63){const p=h===45?d:c;return e.consume(h),p}return t(h)}}const Lt={partial:!0,tokenize:ca};function ca(e,n,t){return r;function r(o){return V(o)?K(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||N(o)?n(o):t(o)}}const ti={continuation:{tokenize:ha},exit:da,name:"blockQuote",tokenize:fa};function fa(e,n,t){const r=this;return l;function l(i){if(i===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(i),e.exit("blockQuoteMarker"),o}return t(i)}function o(i){return V(i)?(e.enter("blockQuotePrefixWhitespace"),e.consume(i),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(i))}}function ha(e,n,t){const r=this;return l;function l(i){return V(i)?K(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i):o(i)}function o(i){return e.attempt(ti,n,t)(i)}}function da(e){e.exit("blockQuote")}const ni={name:"characterEscape",tokenize:pa};function pa(e,n,t){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return ea(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):t(o)}}const ri={name:"characterReference",tokenize:ma};function ma(e,n,t){const r=this;let l=0,o,i;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,i=fe,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,i=Zo,f):(e.enter("characterReferenceValue"),o=7,i=wn,f(c))}function f(c){if(c===59&&l){const d=e.exit("characterReferenceValue");return i===fe&&!Mn(r.sliceSerialize(d))?t(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return i(c)&&l++<o?(e.consume(c),f):t(c)}}const nr={partial:!0,tokenize:ya},rr={concrete:!0,name:"codeFenced",tokenize:ga};function ga(e,n,t){const r=this,l={partial:!0,tokenize:$};let o=0,i=0,a;return u;function u(w){return s(w)}function s(w){const _=r.events[r.events.length-1];return o=_&&_[1].type==="linePrefix"?_[2].sliceSerialize(_[1],!0).length:0,a=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(w)}function f(w){return w===a?(i++,e.consume(w),f):i<3?t(w):(e.exit("codeFencedFenceSequence"),V(w)?K(e,c,"whitespace")(w):c(w))}function c(w){return w===null||N(w)?(e.exit("codeFencedFence"),r.interrupt?n(w):e.check(nr,x,E)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),d(w))}function d(w){return w===null||N(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(w)):V(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),K(e,h,"whitespace")(w)):w===96&&w===a?t(w):(e.consume(w),d)}function h(w){return w===null||N(w)?c(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||N(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(w)):w===96&&w===a?t(w):(e.consume(w),p)}function x(w){return e.attempt(l,E,v)(w)}function v(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b}function b(w){return o>0&&V(w)?K(e,I,"linePrefix",o+1)(w):I(w)}function I(w){return w===null||N(w)?e.check(nr,x,E)(w):(e.enter("codeFlowValue"),k(w))}function k(w){return w===null||N(w)?(e.exit("codeFlowValue"),I(w)):(e.consume(w),k)}function E(w){return e.exit("codeFenced"),n(w)}function $(w,_,L){let T=0;return y;function y(B){return w.enter("lineEnding"),w.consume(B),w.exit("lineEnding"),C}function C(B){return w.enter("codeFencedFence"),V(B)?K(w,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):F(B)}function F(B){return B===a?(w.enter("codeFencedFenceSequence"),R(B)):L(B)}function R(B){return B===a?(T++,w.consume(B),R):T>=i?(w.exit("codeFencedFenceSequence"),V(B)?K(w,O,"whitespace")(B):O(B)):L(B)}function O(B){return B===null||N(B)?(w.exit("codeFencedFence"),_(B)):L(B)}}}function ya(e,n,t){const r=this;return l;function l(i){return i===null?t(i):(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o)}function o(i){return r.parser.lazy[r.now().line]?t(i):n(i)}}const en={name:"codeIndented",tokenize:ba},xa={partial:!0,tokenize:ka};function ba(e,n,t){const r=this;return l;function l(s){return e.enter("codeIndented"),K(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?i(s):t(s)}function i(s){return s===null?u(s):N(s)?e.attempt(xa,i,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||N(s)?(e.exit("codeFlowValue"),i(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),n(s)}}function ka(e,n,t){const r=this;return l;function l(i){return r.parser.lazy[r.now().line]?t(i):N(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),l):K(e,o,"linePrefix",5)(i)}function o(i){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(i):N(i)?l(i):t(i)}}const wa={name:"codeText",previous:Sa,resolve:va,tokenize:Ca};function va(e){let n=e.length-4,t=3,r,l;if((e[t][1].type==="lineEnding"||e[t][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=t;++r<n;)if(e[r][1].type==="codeTextData"){e[t][1].type="codeTextPadding",e[n][1].type="codeTextPadding",t+=2,n-=2;break}}for(r=t-1,n++;++r<=n;)l===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(l=r):(r===n||e[r][1].type==="lineEnding")&&(e[l][1].type="codeTextData",r!==l+2&&(e[l][1].end=e[r-1][1].end,e.splice(l+2,r-l-2),n-=r-l-2,r=l+2),l=void 0);return e}function Sa(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ca(e,n,t){let r=0,l,o;return i;function i(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?t(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),l=0,f(c)):N(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||N(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),l++,f):l===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(c)):(o.type="codeTextData",s(c))}}class Ia{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,t){const r=t??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,t,r){const l=t||0;this.setCursor(Math.trunc(n));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return r&&bt(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),bt(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),bt(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const t=this.left.splice(n,Number.POSITIVE_INFINITY);bt(this.right,t.reverse())}else{const t=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);bt(this.left,t.reverse())}}}function bt(e,n){let t=0;if(n.length<1e4)e.push(...n);else for(;t<n.length;)e.push(...n.slice(t,t+1e4)),t+=1e4}function ii(e){const n={};let t=-1,r,l,o,i,a,u,s;const f=new Ia(e);for(;++t<f.length;){for(;t in n;)t=n[t];if(r=f.get(t),t&&r[1].type==="chunkFlow"&&f.get(t-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,Ea(f,t)),t=n[t],s=!0);else if(r[1]._container){for(o=t,l=void 0;o--;)if(i=f.get(o),i[1].type==="lineEnding"||i[1].type==="lineEndingBlank")i[0]==="enter"&&(l&&(f.get(l)[1].type="lineEndingBlank"),i[1].type="lineEnding",l=o);else if(!(i[1].type==="linePrefix"||i[1].type==="listItemIndent"))break;l&&(r[1].end={...f.get(l)[1].start},a=f.slice(l,t),a.unshift(r),f.splice(l,t-l+1,a))}}return ve(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function Ea(e,n){const t=e.get(n)[1],r=e.get(n)[2];let l=n-1;const o=[];let i=t._tokenizer;i||(i=r.parser[t.contentType](t.start),t._contentTypeTextTrailing&&(i._contentTypeTextTrailing=!0));const a=i.events,u=[],s={};let f,c,d=-1,h=t,p=0,x=0;const v=[x];for(;h;){for(;e.get(++l)[1]!==h;);o.push(l),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&i.defineSkip(h.start),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=!0),i.write(f),h._isInFirstContentOfListItem&&(i._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=t;++d<a.length;)a[d][0]==="exit"&&a[d-1][0]==="enter"&&a[d][1].type===a[d-1][1].type&&a[d][1].start.line!==a[d][1].end.line&&(x=d+1,v.push(x),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(i.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),d=v.length;d--;){const b=a.slice(v[d],v[d+1]),I=o.pop();u.push([I,I+b.length-1]),e.splice(I,2,b)}for(u.reverse(),d=-1;++d<u.length;)s[p+u[d][0]]=p+u[d][1],p+=u[d][1]-u[d][0]-1;return s}const Aa={resolve:La,tokenize:Pa},_a={partial:!0,tokenize:Ta};function La(e){return ii(e),e}function Pa(e,n){let t;return r;function r(a){return e.enter("content"),t=e.enter("chunkContent",{contentType:"content"}),l(a)}function l(a){return a===null?o(a):N(a)?e.check(_a,i,o)(a):(e.consume(a),l)}function o(a){return e.exit("chunkContent"),e.exit("content"),n(a)}function i(a){return e.consume(a),e.exit("chunkContent"),t.next=e.enter("chunkContent",{contentType:"content",previous:t}),t=t.next,l}}function Ta(e,n,t){const r=this;return l;function l(i){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),K(e,o,"linePrefix")}function o(i){if(i===null||N(i))return t(i);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?n(i):e.interrupt(r.parser.constructs.flow,t,n)(i)}}function li(e,n,t,r,l,o,i,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(b){return b===60?(e.enter(r),e.enter(l),e.enter(o),e.consume(b),e.exit(o),d):b===null||b===32||b===41||Bt(b)?t(b):(e.enter(r),e.enter(i),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(b))}function d(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(l),e.exit(r),n):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===62?(e.exit("chunkString"),e.exit(a),d(b)):b===null||b===60||N(b)?t(b):(e.consume(b),b===92?p:h)}function p(b){return b===60||b===62||b===92?(e.consume(b),h):h(b)}function x(b){return!f&&(b===null||b===41||J(b))?(e.exit("chunkString"),e.exit(a),e.exit(i),e.exit(r),n(b)):f<s&&b===40?(e.consume(b),f++,x):b===41?(e.consume(b),f--,x):b===null||b===32||b===40||Bt(b)?t(b):(e.consume(b),b===92?v:x)}function v(b){return b===40||b===41||b===92?(e.consume(b),x):x(b)}}function oi(e,n,t,r,l,o){const i=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(l),e.consume(h),e.exit(l),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in i.parser.constructs?t(h):h===93?(e.exit(o),e.enter(l),e.consume(h),e.exit(l),e.exit(r),n):N(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||N(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!V(h)),h===92?d:c)}function d(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function ai(e,n,t,r,l,o){let i;return a;function a(d){return d===34||d===39||d===40?(e.enter(r),e.enter(l),e.consume(d),e.exit(l),i=d===40?41:d,u):t(d)}function u(d){return d===i?(e.enter(l),e.consume(d),e.exit(l),e.exit(r),n):(e.enter(o),s(d))}function s(d){return d===i?(e.exit(o),u(i)):d===null?t(d):N(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),K(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===i||d===null||N(d)?(e.exit("chunkString"),s(d)):(e.consume(d),d===92?c:f)}function c(d){return d===i||d===92?(e.consume(d),f):f(d)}}function Ct(e,n){let t;return r;function r(l){return N(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t=!0,r):V(l)?K(e,r,t?"linePrefix":"lineSuffix")(l):n(l)}}const $a={name:"definition",tokenize:Da},za={partial:!0,tokenize:Fa};function Da(e,n,t){const r=this;let l;return o;function o(h){return e.enter("definition"),i(h)}function i(h){return oi.call(r,e,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return l=Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):t(h)}function u(h){return J(h)?Ct(e,s)(h):s(h)}function s(h){return li(e,f,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(za,c,c)(h)}function c(h){return V(h)?K(e,d,"whitespace")(h):d(h)}function d(h){return h===null||N(h)?(e.exit("definition"),r.parser.defined.push(l),n(h)):t(h)}}function Fa(e,n,t){return r;function r(a){return J(a)?Ct(e,l)(a):t(a)}function l(a){return ai(e,o,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return V(a)?K(e,i,"whitespace")(a):i(a)}function i(a){return a===null||N(a)?n(a):t(a)}}const Ma={name:"hardBreakEscape",tokenize:Oa};function Oa(e,n,t){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return N(o)?(e.exit("hardBreakEscape"),n(o)):t(o)}}const Ra={name:"headingAtx",resolve:Na,tokenize:Ba};function Na(e,n){let t=e.length-2,r=3,l,o;return e[r][1].type==="whitespace"&&(r+=2),t-2>r&&e[t][1].type==="whitespace"&&(t-=2),e[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&e[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(l={type:"atxHeadingText",start:e[r][1].start,end:e[t][1].end},o={type:"chunkText",start:e[r][1].start,end:e[t][1].end,contentType:"text"},ve(e,r,t-r+1,[["enter",l,n],["enter",o,n],["exit",o,n],["exit",l,n]])),e}function Ba(e,n,t){let r=0;return l;function l(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),i(f)}function i(f){return f===35&&r++<6?(e.consume(f),i):f===null||J(f)?(e.exit("atxHeadingSequence"),a(f)):t(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||N(f)?(e.exit("atxHeading"),n(f)):V(f)?K(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||J(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const ja=["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"],ir=["pre","script","style","textarea"],Ha={concrete:!0,name:"htmlFlow",resolveTo:Va,tokenize:Wa},qa={partial:!0,tokenize:Qa},Ua={partial:!0,tokenize:Ka};function Va(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function Wa(e,n,t){const r=this;let l,o,i,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),d):g===47?(e.consume(g),o=!0,x):g===63?(e.consume(g),l=3,r.interrupt?n:m):de(g)?(e.consume(g),i=String.fromCharCode(g),v):t(g)}function d(g){return g===45?(e.consume(g),l=2,h):g===91?(e.consume(g),l=5,a=0,p):de(g)?(e.consume(g),l=4,r.interrupt?n:m):t(g)}function h(g){return g===45?(e.consume(g),r.interrupt?n:m):t(g)}function p(g){const pe="CDATA[";return g===pe.charCodeAt(a++)?(e.consume(g),a===pe.length?r.interrupt?n:F:p):t(g)}function x(g){return de(g)?(e.consume(g),i=String.fromCharCode(g),v):t(g)}function v(g){if(g===null||g===47||g===62||J(g)){const pe=g===47,xe=i.toLowerCase();return!pe&&!o&&ir.includes(xe)?(l=1,r.interrupt?n(g):F(g)):ja.includes(i.toLowerCase())?(l=6,pe?(e.consume(g),b):r.interrupt?n(g):F(g)):(l=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(g):o?I(g):k(g))}return g===45||fe(g)?(e.consume(g),i+=String.fromCharCode(g),v):t(g)}function b(g){return g===62?(e.consume(g),r.interrupt?n:F):t(g)}function I(g){return V(g)?(e.consume(g),I):y(g)}function k(g){return g===47?(e.consume(g),y):g===58||g===95||de(g)?(e.consume(g),E):V(g)?(e.consume(g),k):y(g)}function E(g){return g===45||g===46||g===58||g===95||fe(g)?(e.consume(g),E):$(g)}function $(g){return g===61?(e.consume(g),w):V(g)?(e.consume(g),$):k(g)}function w(g){return g===null||g===60||g===61||g===62||g===96?t(g):g===34||g===39?(e.consume(g),u=g,_):V(g)?(e.consume(g),w):L(g)}function _(g){return g===u?(e.consume(g),u=null,T):g===null||N(g)?t(g):(e.consume(g),_)}function L(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||J(g)?$(g):(e.consume(g),L)}function T(g){return g===47||g===62||V(g)?k(g):t(g)}function y(g){return g===62?(e.consume(g),C):t(g)}function C(g){return g===null||N(g)?F(g):V(g)?(e.consume(g),C):t(g)}function F(g){return g===45&&l===2?(e.consume(g),Z):g===60&&l===1?(e.consume(g),te):g===62&&l===4?(e.consume(g),ie):g===63&&l===3?(e.consume(g),m):g===93&&l===5?(e.consume(g),ae):N(g)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(qa,ce,R)(g)):g===null||N(g)?(e.exit("htmlFlowData"),R(g)):(e.consume(g),F)}function R(g){return e.check(Ua,O,ce)(g)}function O(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),B}function B(g){return g===null||N(g)?R(g):(e.enter("htmlFlowData"),F(g))}function Z(g){return g===45?(e.consume(g),m):F(g)}function te(g){return g===47?(e.consume(g),i="",X):F(g)}function X(g){if(g===62){const pe=i.toLowerCase();return ir.includes(pe)?(e.consume(g),ie):F(g)}return de(g)&&i.length<8?(e.consume(g),i+=String.fromCharCode(g),X):F(g)}function ae(g){return g===93?(e.consume(g),m):F(g)}function m(g){return g===62?(e.consume(g),ie):g===45&&l===2?(e.consume(g),m):F(g)}function ie(g){return g===null||N(g)?(e.exit("htmlFlowData"),ce(g)):(e.consume(g),ie)}function ce(g){return e.exit("htmlFlow"),n(g)}}function Ka(e,n,t){const r=this;return l;function l(i){return N(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),o):t(i)}function o(i){return r.parser.lazy[r.now().line]?t(i):n(i)}}function Qa(e,n,t){return r;function r(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Lt,n,t)}}const Ya={name:"htmlText",tokenize:Xa};function Xa(e,n,t){const r=this;let l,o,i;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),$):m===63?(e.consume(m),k):de(m)?(e.consume(m),L):t(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,p):de(m)?(e.consume(m),I):t(m)}function f(m){return m===45?(e.consume(m),h):t(m)}function c(m){return m===null?t(m):m===45?(e.consume(m),d):N(m)?(i=c,te(m)):(e.consume(m),c)}function d(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?Z(m):m===45?d(m):c(m)}function p(m){const ie="CDATA[";return m===ie.charCodeAt(o++)?(e.consume(m),o===ie.length?x:p):t(m)}function x(m){return m===null?t(m):m===93?(e.consume(m),v):N(m)?(i=x,te(m)):(e.consume(m),x)}function v(m){return m===93?(e.consume(m),b):x(m)}function b(m){return m===62?Z(m):m===93?(e.consume(m),b):x(m)}function I(m){return m===null||m===62?Z(m):N(m)?(i=I,te(m)):(e.consume(m),I)}function k(m){return m===null?t(m):m===63?(e.consume(m),E):N(m)?(i=k,te(m)):(e.consume(m),k)}function E(m){return m===62?Z(m):k(m)}function $(m){return de(m)?(e.consume(m),w):t(m)}function w(m){return m===45||fe(m)?(e.consume(m),w):_(m)}function _(m){return N(m)?(i=_,te(m)):V(m)?(e.consume(m),_):Z(m)}function L(m){return m===45||fe(m)?(e.consume(m),L):m===47||m===62||J(m)?T(m):t(m)}function T(m){return m===47?(e.consume(m),Z):m===58||m===95||de(m)?(e.consume(m),y):N(m)?(i=T,te(m)):V(m)?(e.consume(m),T):Z(m)}function y(m){return m===45||m===46||m===58||m===95||fe(m)?(e.consume(m),y):C(m)}function C(m){return m===61?(e.consume(m),F):N(m)?(i=C,te(m)):V(m)?(e.consume(m),C):T(m)}function F(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(e.consume(m),l=m,R):N(m)?(i=F,te(m)):V(m)?(e.consume(m),F):(e.consume(m),O)}function R(m){return m===l?(e.consume(m),l=void 0,B):m===null?t(m):N(m)?(i=R,te(m)):(e.consume(m),R)}function O(m){return m===null||m===34||m===39||m===60||m===61||m===96?t(m):m===47||m===62||J(m)?T(m):(e.consume(m),O)}function B(m){return m===47||m===62||J(m)?T(m):t(m)}function Z(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),n):t(m)}function te(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),X}function X(m){return V(m)?K(e,ae,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):ae(m)}function ae(m){return e.enter("htmlTextData"),i(m)}}const On={name:"labelEnd",resolveAll:eu,resolveTo:tu,tokenize:nu},Ga={tokenize:ru},Ja={tokenize:iu},Za={tokenize:lu};function eu(e){let n=-1;const t=[];for(;++n<e.length;){const r=e[n][1];if(t.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const l=r.type==="labelImage"?4:2;r.type="data",n+=l}}return e.length!==t.length&&ve(e,0,e.length,t),e}function tu(e,n){let t=e.length,r=0,l,o,i,a;for(;t--;)if(l=e[t][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[t][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(i){if(e[t][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=t,l.type!=="labelLink")){r=2;break}}else l.type==="labelEnd"&&(i=t);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[i][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[i-2][1].start}};return a=[["enter",u,n],["enter",s,n]],a=Ce(a,e.slice(o+1,o+r+3)),a=Ce(a,[["enter",f,n]]),a=Ce(a,Wt(n.parser.constructs.insideSpan.null,e.slice(o+r+4,i-3),n)),a=Ce(a,[["exit",f,n],e[i-2],e[i-1],["exit",s,n]]),a=Ce(a,e.slice(i+1)),a=Ce(a,[["exit",u,n]]),ve(e,o,e.length,a),e}function nu(e,n,t){const r=this;let l=r.events.length,o,i;for(;l--;)if((r.events[l][1].type==="labelImage"||r.events[l][1].type==="labelLink")&&!r.events[l][1]._balanced){o=r.events[l][1];break}return a;function a(d){return o?o._inactive?c(d):(i=r.parser.defined.includes(Le(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelEnd"),u):t(d)}function u(d){return d===40?e.attempt(Ga,f,i?f:c)(d):d===91?e.attempt(Ja,f,i?s:c)(d):i?f(d):c(d)}function s(d){return e.attempt(Za,f,c)(d)}function f(d){return n(d)}function c(d){return o._balanced=!0,t(d)}}function ru(e,n,t){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),l}function l(c){return J(c)?Ct(e,o)(c):o(c)}function o(c){return c===41?f(c):li(e,i,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function i(c){return J(c)?Ct(e,u)(c):f(c)}function a(c){return t(c)}function u(c){return c===34||c===39||c===40?ai(e,s,t,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return J(c)?Ct(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),n):t(c)}}function iu(e,n,t){const r=this;return l;function l(a){return oi.call(r,e,o,i,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Le(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(a):t(a)}function i(a){return t(a)}}function lu(e,n,t){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),n):t(o)}}const ou={name:"labelStartImage",resolveAll:On.resolveAll,tokenize:au};function au(e,n,t){const r=this;return l;function l(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),i):t(a)}function i(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(a):n(a)}}const uu={name:"labelStartLink",resolveAll:On.resolveAll,tokenize:su};function su(e,n,t){const r=this;return l;function l(i){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(i),e.exit("labelMarker"),e.exit("labelLink"),o}function o(i){return i===94&&"_hiddenFootnoteSupport"in r.parser.constructs?t(i):n(i)}}const tn={name:"lineEnding",tokenize:cu};function cu(e,n){return t;function t(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),K(e,n,"linePrefix")}}const Nt={name:"thematicBreak",tokenize:fu};function fu(e,n,t){let r=0,l;return o;function o(s){return e.enter("thematicBreak"),i(s)}function i(s){return l=s,a(s)}function a(s){return s===l?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||N(s))?(e.exit("thematicBreak"),n(s)):t(s)}function u(s){return s===l?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),V(s)?K(e,a,"whitespace")(s):a(s))}}const me={continuation:{tokenize:mu},exit:yu,name:"list",tokenize:pu},hu={partial:!0,tokenize:xu},du={partial:!0,tokenize:gu};function pu(e,n,t){const r=this,l=r.events[r.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,i=0;return a;function a(h){const p=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:wn(h)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(Nt,t,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return t(h)}function u(h){return wn(h)&&++i<10?(e.consume(h),u):(!r.interrupt||i<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):t(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Lt,r.interrupt?t:f,e.attempt(hu,d,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,d(h)}function c(h){return V(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),d):t(h)}function d(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(h)}}function mu(e,n,t){const r=this;return r.containerState._closeFlow=void 0,e.check(Lt,l,o);function l(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,K(e,n,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!V(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(du,n,i)(a))}function i(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,K(e,e.attempt(me,n,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function gu(e,n,t){const r=this;return K(e,l,"listItemIndent",r.containerState.size+1);function l(o){const i=r.events[r.events.length-1];return i&&i[1].type==="listItemIndent"&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?n(o):t(o)}}function yu(e){e.exit(this.containerState.type)}function xu(e,n,t){const r=this;return K(e,l,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const i=r.events[r.events.length-1];return!V(o)&&i&&i[1].type==="listItemPrefixWhitespace"?n(o):t(o)}}const lr={name:"setextUnderline",resolveTo:bu,tokenize:ku};function bu(e,n){let t=e.length,r,l,o;for(;t--;)if(e[t][0]==="enter"){if(e[t][1].type==="content"){r=t;break}e[t][1].type==="paragraph"&&(l=t)}else e[t][1].type==="content"&&e.splice(t,1),!o&&e[t][1].type==="definition"&&(o=t);const i={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",i,n]),e.splice(o+1,0,["exit",e[r][1],n]),e[r][1].end={...e[o][1].end}):e[r][1]=i,e.push(["exit",i,n]),e}function ku(e,n,t){const r=this;let l;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),l=s,i(s)):t(s)}function i(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===l?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),V(s)?K(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||N(s)?(e.exit("setextHeadingLine"),n(s)):t(s)}}const wu={tokenize:vu};function vu(e){const n=this,t=e.attempt(Lt,r,e.attempt(this.parser.constructs.flowInitial,l,K(e,e.attempt(this.parser.constructs.flow,l,e.attempt(Aa,l)),"linePrefix")));return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),n.currentConstruct=void 0,t}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n.currentConstruct=void 0,t}}const Su={resolveAll:si()},Cu=ui("string"),Iu=ui("text");function ui(e){return{resolveAll:si(e==="text"?Eu:void 0),tokenize:n};function n(t){const r=this,l=this.parser.constructs[e],o=t.attempt(l,i,a);return i;function i(f){return s(f)?o(f):a(f)}function a(f){if(f===null){t.consume(f);return}return t.enter("data"),t.consume(f),u}function u(f){return s(f)?(t.exit("data"),o(f)):(t.consume(f),u)}function s(f){if(f===null)return!0;const c=l[f];let d=-1;if(c)for(;++d<c.length;){const h=c[d];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function si(e){return n;function n(t,r){let l=-1,o;for(;++l<=t.length;)o===void 0?t[l]&&t[l][1].type==="data"&&(o=l,l++):(!t[l]||t[l][1].type!=="data")&&(l!==o+2&&(t[o][1].end=t[l-1][1].end,t.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(t,r):t}}function Eu(e,n){let t=0;for(;++t<=e.length;)if((t===e.length||e[t][1].type==="lineEnding")&&e[t-1][1].type==="data"){const r=e[t-1][1],l=n.sliceStream(r);let o=l.length,i=-1,a=0,u;for(;o--;){const s=l[o];if(typeof s=="string"){for(i=s.length;s.charCodeAt(i-1)===32;)a++,i--;if(i)break;i=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(n._contentTypeTextTrailing&&t===e.length&&(a=0),a){const s={type:t===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?i:r.start._bufferIndex+i,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(t,0,["enter",s,n],["exit",s,n]),t+=2)}t++}return e}const Au={42:me,43:me,45:me,48:me,49:me,50:me,51:me,52:me,53:me,54:me,55:me,56:me,57:me,62:ti},_u={91:$a},Lu={[-2]:en,[-1]:en,32:en},Pu={35:Ra,42:Nt,45:[lr,Nt],60:Ha,61:lr,95:Nt,96:rr,126:rr},Tu={38:ri,92:ni},$u={[-5]:tn,[-4]:tn,[-3]:tn,33:ou,38:ri,42:vn,60:[ua,Ya],91:uu,92:[Ma,ni],93:On,95:vn,96:wa},zu={null:[vn,Su]},Du={null:[42,95]},Fu={null:[]},Mu=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Du,contentInitial:_u,disable:Fu,document:Au,flow:Pu,flowInitial:Lu,insideSpan:zu,string:Tu,text:$u},Symbol.toStringTag,{value:"Module"}));function Ou(e,n,t){let r={_bufferIndex:-1,_index:0,line:t&&t.line||1,column:t&&t.column||1,offset:t&&t.offset||0};const l={},o=[];let i=[],a=[];const u={attempt:_($),check:_(w),consume:I,enter:k,exit:E,interrupt:_(w,{interrupt:!0})},s={code:null,containerState:{},defineSkip:x,events:[],now:p,parser:e,previous:null,sliceSerialize:d,sliceStream:h,write:c};let f=n.tokenize.call(s,u);return n.resolveAll&&o.push(n),s;function c(C){return i=Ce(i,C),v(),i[i.length-1]!==null?[]:(L(n,0),s.events=Wt(o,s.events,s),s.events)}function d(C,F){return Nu(h(C),F)}function h(C){return Ru(i,C)}function p(){const{_bufferIndex:C,_index:F,line:R,column:O,offset:B}=r;return{_bufferIndex:C,_index:F,line:R,column:O,offset:B}}function x(C){l[C.line]=C.column,y()}function v(){let C;for(;r._index<i.length;){const F=i[r._index];if(typeof F=="string")for(C=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===C&&r._bufferIndex<F.length;)b(F.charCodeAt(r._bufferIndex));else b(F)}}function b(C){f=f(C)}function I(C){N(C)?(r.line++,r.column=1,r.offset+=C===-3?2:1,y()):C!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===i[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=C}function k(C,F){const R=F||{};return R.type=C,R.start=p(),s.events.push(["enter",R,s]),a.push(R),R}function E(C){const F=a.pop();return F.end=p(),s.events.push(["exit",F,s]),F}function $(C,F){L(C,F.from)}function w(C,F){F.restore()}function _(C,F){return R;function R(O,B,Z){let te,X,ae,m;return Array.isArray(O)?ce(O):"tokenize"in O?ce([O]):ie(O);function ie(ue){return Oe;function Oe(Ee){const Ue=Ee!==null&&ue[Ee],Ve=Ee!==null&&ue.null,Ye=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(Ve)?Ve:Ve?[Ve]:[]];return ce(Ye)(Ee)}}function ce(ue){return te=ue,X=0,ue.length===0?Z:g(ue[X])}function g(ue){return Oe;function Oe(Ee){return m=T(),ae=ue,ue.partial||(s.currentConstruct=ue),ue.name&&s.parser.constructs.disable.null.includes(ue.name)?xe():ue.tokenize.call(F?Object.assign(Object.create(s),F):s,u,pe,xe)(Ee)}}function pe(ue){return C(ae,m),B}function xe(ue){return m.restore(),++X<te.length?g(te[X]):Z}}}function L(C,F){C.resolveAll&&!o.includes(C)&&o.push(C),C.resolve&&ve(s.events,F,s.events.length-F,C.resolve(s.events.slice(F),s)),C.resolveTo&&(s.events=C.resolveTo(s.events,s))}function T(){const C=p(),F=s.previous,R=s.currentConstruct,O=s.events.length,B=Array.from(a);return{from:O,restore:Z};function Z(){r=C,s.previous=F,s.currentConstruct=R,s.events.length=O,a=B,y()}}function y(){r.line in l&&r.column<2&&(r.column=l[r.line],r.offset+=l[r.line]-1)}}function Ru(e,n){const t=n.start._index,r=n.start._bufferIndex,l=n.end._index,o=n.end._bufferIndex;let i;if(t===l)i=[e[t].slice(r,o)];else{if(i=e.slice(t,l),r>-1){const a=i[0];typeof a=="string"?i[0]=a.slice(r):i.shift()}o>0&&i.push(e[l].slice(0,o))}return i}function Nu(e,n){let t=-1;const r=[];let l;for(;++t<e.length;){const o=e[t];let i;if(typeof o=="string")i=o;else switch(o){case-5:{i="\r";break}case-4:{i=`
|
|
2
2
|
`;break}case-3:{i=`\r
|
|
3
3
|
`;break}case-2:{i=n?" ":" ";break}case-1:{if(!n&&l)continue;i=" ";break}default:i=String.fromCharCode(o)}l=o===-2,r.push(i)}return r.join("")}function Bu(e){const r={constructs:Zr([Mu,...(e||{}).extensions||[]]),content:l(ta),defined:[],document:l(ra),flow:l(wu),lazy:{},string:l(Cu),text:l(Iu)};return r;function l(o){return i;function i(a){return Ou(r,o,a)}}}function ju(e){for(;!ii(e););return e}const or=/[\0\t\n\r]/g;function Hu(){let e=1,n="",t=!0,r;return l;function l(o,i,a){const u=[];let s,f,c,d,h;for(o=n+(typeof o=="string"?o.toString():new TextDecoder(i||void 0).decode(o)),c=0,n="",t&&(o.charCodeAt(0)===65279&&c++,t=void 0);c<o.length;){if(or.lastIndex=c,s=or.exec(o),d=s&&s.index!==void 0?s.index:o.length,h=o.charCodeAt(d),!s){n=o.slice(c);break}if(h===10&&c===d&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<d&&(u.push(o.slice(c,d)),e+=d-c),h){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=d+1}return a&&(r&&u.push(-5),n&&u.push(n),u.push(null)),u}}const qu=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Uu(e){return e.replace(qu,Vu)}function Vu(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){const l=t.charCodeAt(1),o=l===120||l===88;return ei(t.slice(o?2:1),o?16:10)}return Mn(t)||e}function It(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ar(e.position):"start"in e||"end"in e?ar(e):"line"in e||"column"in e?Sn(e):""}function Sn(e){return ur(e&&e.line)+":"+ur(e&&e.column)}function ar(e){return Sn(e&&e.start)+"-"+Sn(e&&e.end)}function ur(e){return e&&typeof e=="number"?e:1}const ci={}.hasOwnProperty;function Wu(e,n,t){return typeof n!="string"&&(t=n,n=void 0),Ku(t)(ju(Bu(t).document().write(Hu()(e,n,!0))))}function Ku(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(le),autolinkProtocol:T,autolinkEmail:T,atxHeading:o(gt),blockQuote:o(Ve),characterEscape:T,characterReference:T,codeFenced:o(Ye),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:o(Ye,i),codeText:o(Xt,i),codeTextData:T,data:T,codeFlowValue:T,definition:o(Gt),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:o($t),hardBreakEscape:o(zt),hardBreakTrailing:o(zt),htmlFlow:o(M,i),htmlFlowData:T,htmlText:o(M,i),htmlTextData:T,image:o(U),label:i,link:o(le),listItem:o(Pe),listItemValue:d,listOrdered:o(Ae,c),listUnordered:o(Ae),paragraph:o(Dt),reference:g,referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:o(gt),strong:o(al),thematicBreak:o(sl)},exit:{atxHeading:u(),atxHeadingSequence:$,autolink:u(),autolinkEmail:Ue,autolinkProtocol:Ee,blockQuote:u(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:xe,characterReferenceMarkerNumeric:xe,characterReferenceValue:ue,characterReference:Oe,codeFenced:u(v),codeFencedFence:x,codeFencedFenceInfo:h,codeFencedFenceMeta:p,codeFlowValue:y,codeIndented:u(b),codeText:u(B),codeTextData:y,data:y,definition:u(),definitionDestinationString:E,definitionLabelString:I,definitionTitleString:k,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(R),htmlFlowData:y,htmlText:u(O),htmlTextData:y,image:u(te),label:ae,labelText:X,lineEnding:C,link:u(Z),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:pe,resourceDestinationString:m,resourceTitleString:ie,resource:ce,setextHeading:u(L),setextHeadingLineSequence:_,setextHeadingText:w,strong:u(),thematicBreak:u()}};fi(n,(e||{}).mdastExtensions||[]);const t={};return r;function r(S){let D={type:"root",children:[]};const H={stack:[D],tokenStack:[],config:n,enter:a,exit:s,buffer:i,resume:f,data:t},W=[];let G=-1;for(;++G<S.length;)if(S[G][1].type==="listOrdered"||S[G][1].type==="listUnordered")if(S[G][0]==="enter")W.push(G);else{const _e=W.pop();G=l(S,_e,G)}for(G=-1;++G<S.length;){const _e=n[S[G][0]];ci.call(_e,S[G][1].type)&&_e[S[G][1].type].call(Object.assign({sliceSerialize:S[G][2].sliceSerialize},H),S[G][1])}if(H.tokenStack.length>0){const _e=H.tokenStack[H.tokenStack.length-1];(_e[1]||sr).call(H,void 0,_e[0])}for(D.position={start:We(S.length>0?S[0][1].start:{line:1,column:1,offset:0}),end:We(S.length>0?S[S.length-2][1].end:{line:1,column:1,offset:0})},G=-1;++G<n.transforms.length;)D=n.transforms[G](D)||D;return D}function l(S,D,H){let W=D-1,G=-1,_e=!1,Xe,Re,yt,xt;for(;++W<=H;){const be=S[W];switch(be[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{be[0]==="enter"?G++:G--,xt=void 0;break}case"lineEndingBlank":{be[0]==="enter"&&(Xe&&!xt&&!G&&!yt&&(yt=W),xt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:xt=void 0}if(!G&&be[0]==="enter"&&be[1].type==="listItemPrefix"||G===-1&&be[0]==="exit"&&(be[1].type==="listUnordered"||be[1].type==="listOrdered")){if(Xe){let nt=W;for(Re=void 0;nt--;){const Ne=S[nt];if(Ne[1].type==="lineEnding"||Ne[1].type==="lineEndingBlank"){if(Ne[0]==="exit")continue;Re&&(S[Re][1].type="lineEndingBlank",_e=!0),Ne[1].type="lineEnding",Re=nt}else if(!(Ne[1].type==="linePrefix"||Ne[1].type==="blockQuotePrefix"||Ne[1].type==="blockQuotePrefixWhitespace"||Ne[1].type==="blockQuoteMarker"||Ne[1].type==="listItemIndent"))break}yt&&(!Re||yt<Re)&&(Xe._spread=!0),Xe.end=Object.assign({},Re?S[Re][1].start:be[1].end),S.splice(Re||W,0,["exit",Xe,be[2]]),W++,H++}if(be[1].type==="listItemPrefix"){const nt={type:"listItem",_spread:!1,start:Object.assign({},be[1].start),end:void 0};Xe=nt,S.splice(W,0,["enter",nt,be[2]]),W++,H++,yt=void 0,xt=!0}}}return S[D][1]._spread=_e,H}function o(S,D){return H;function H(W){a.call(this,S(W),W),D&&D.call(this,W)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(S,D,H){this.stack[this.stack.length-1].children.push(S),this.stack.push(S),this.tokenStack.push([D,H||void 0]),S.position={start:We(D.start),end:void 0}}function u(S){return D;function D(H){S&&S.call(this,H),s.call(this,H)}}function s(S,D){const H=this.stack.pop(),W=this.tokenStack.pop();if(W)W[0].type!==S.type&&(D?D.call(this,S,W[0]):(W[1]||sr).call(this,S,W[0]));else throw new Error("Cannot close `"+S.type+"` ("+It({start:S.start,end:S.end})+"): it’s not open");H.position.end=We(S.end)}function f(){return Fn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function d(S){if(this.data.expectingFirstListItemValue){const D=this.stack[this.stack.length-2];D.start=Number.parseInt(this.sliceSerialize(S),10),this.data.expectingFirstListItemValue=void 0}}function h(){const S=this.resume(),D=this.stack[this.stack.length-1];D.lang=S}function p(){const S=this.resume(),D=this.stack[this.stack.length-1];D.meta=S}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const S=this.resume(),D=this.stack[this.stack.length-1];D.value=S.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const S=this.resume(),D=this.stack[this.stack.length-1];D.value=S.replace(/(\r?\n|\r)$/g,"")}function I(S){const D=this.resume(),H=this.stack[this.stack.length-1];H.label=D,H.identifier=Le(this.sliceSerialize(S)).toLowerCase()}function k(){const S=this.resume(),D=this.stack[this.stack.length-1];D.title=S}function E(){const S=this.resume(),D=this.stack[this.stack.length-1];D.url=S}function $(S){const D=this.stack[this.stack.length-1];if(!D.depth){const H=this.sliceSerialize(S).length;D.depth=H}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function _(S){const D=this.stack[this.stack.length-1];D.depth=this.sliceSerialize(S).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function T(S){const H=this.stack[this.stack.length-1].children;let W=H[H.length-1];(!W||W.type!=="text")&&(W=ul(),W.position={start:We(S.start),end:void 0},H.push(W)),this.stack.push(W)}function y(S){const D=this.stack.pop();D.value+=this.sliceSerialize(S),D.position.end=We(S.end)}function C(S){const D=this.stack[this.stack.length-1];if(this.data.atHardBreak){const H=D.children[D.children.length-1];H.position.end=We(S.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(D.type)&&(T.call(this,S),y.call(this,S))}function F(){this.data.atHardBreak=!0}function R(){const S=this.resume(),D=this.stack[this.stack.length-1];D.value=S}function O(){const S=this.resume(),D=this.stack[this.stack.length-1];D.value=S}function B(){const S=this.resume(),D=this.stack[this.stack.length-1];D.value=S}function Z(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const D=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=D,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function te(){const S=this.stack[this.stack.length-1];if(this.data.inReference){const D=this.data.referenceType||"shortcut";S.type+="Reference",S.referenceType=D,delete S.url,delete S.title}else delete S.identifier,delete S.label;this.data.referenceType=void 0}function X(S){const D=this.sliceSerialize(S),H=this.stack[this.stack.length-2];H.label=Uu(D),H.identifier=Le(D).toLowerCase()}function ae(){const S=this.stack[this.stack.length-1],D=this.resume(),H=this.stack[this.stack.length-1];if(this.data.inReference=!0,H.type==="link"){const W=S.children;H.children=W}else H.alt=D}function m(){const S=this.resume(),D=this.stack[this.stack.length-1];D.url=S}function ie(){const S=this.resume(),D=this.stack[this.stack.length-1];D.title=S}function ce(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function pe(S){const D=this.resume(),H=this.stack[this.stack.length-1];H.label=D,H.identifier=Le(this.sliceSerialize(S)).toLowerCase(),this.data.referenceType="full"}function xe(S){this.data.characterReferenceType=S.type}function ue(S){const D=this.sliceSerialize(S),H=this.data.characterReferenceType;let W;H?(W=ei(D,H==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):W=Mn(D);const G=this.stack[this.stack.length-1];G.value+=W}function Oe(S){const D=this.stack.pop();D.position.end=We(S.end)}function Ee(S){y.call(this,S);const D=this.stack[this.stack.length-1];D.url=this.sliceSerialize(S)}function Ue(S){y.call(this,S);const D=this.stack[this.stack.length-1];D.url="mailto:"+this.sliceSerialize(S)}function Ve(){return{type:"blockquote",children:[]}}function Ye(){return{type:"code",lang:null,meta:null,value:""}}function Xt(){return{type:"inlineCode",value:""}}function Gt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function $t(){return{type:"emphasis",children:[]}}function gt(){return{type:"heading",depth:0,children:[]}}function zt(){return{type:"break"}}function M(){return{type:"html",value:""}}function U(){return{type:"image",title:null,url:"",alt:null}}function le(){return{type:"link",title:null,url:"",children:[]}}function Ae(S){return{type:"list",ordered:S.type==="listOrdered",start:null,spread:S._spread,children:[]}}function Pe(S){return{type:"listItem",spread:S._spread,checked:null,children:[]}}function Dt(){return{type:"paragraph",children:[]}}function al(){return{type:"strong",children:[]}}function ul(){return{type:"text",value:""}}function sl(){return{type:"thematicBreak"}}}function We(e){return{line:e.line,column:e.column,offset:e.offset}}function fi(e,n){let t=-1;for(;++t<n.length;){const r=n[t];Array.isArray(r)?fi(e,r):Qu(e,r)}}function Qu(e,n){let t;for(t in n)if(ci.call(n,t))switch(t){case"canContainEols":{const r=n[t];r&&e[t].push(...r);break}case"transforms":{const r=n[t];r&&e[t].push(...r);break}case"enter":case"exit":{const r=n[t];r&&Object.assign(e[t],r);break}}}function sr(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+It({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+It({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+It({start:n.start,end:n.end})+") is still open")}function Yu(e){const n=this;n.parser=t;function t(r){return Wu(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function Xu(e,n){const t={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,t),e.applyData(n,t)}function Gu(e,n){const t={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,t),[e.applyData(n,t),{type:"text",value:`
|
|
4
4
|
`}]}function Ju(e,n){const t=n.value?n.value+`
|