const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B0ormpAm.js","assets/index-Bh7OCVQ6.js","assets/index-BlLFpInm.css","assets/index-LhKTwHBG.js","assets/index-5pRcGjrK.js","assets/index-toAgSog8.js","assets/index-DuwFEVsx.js","assets/index-B2CPrvxQ.js","assets/index-C2zGUHGQ.js","assets/index-CYSLvMxp.js","assets/index-eC7dsKua.js","assets/index-KrlGGYSI.js","assets/index-7CO1rqmB.js","assets/index-B08WtdHY.js","assets/index-B1uOYh0y.js","assets/index-N3Iua89b.js","assets/index-B0kct9eQ.js","assets/dockerfile-BKs6k2Af.js","assets/simple-mode-GW_nhZxv.js","assets/factor-kuTfRLto.js","assets/nsis-LdVXkNf5.js","assets/pug-DeIclll2.js","assets/javascript-iXu5QeM3.js","assets/index-CH-Gehkm.js","assets/index-DjcPgQmx.js"])))=>i.map(i=>d[i]); var bv=Object.defineProperty;var Ef=t=>{throw TypeError(t)};var vv=(t,e,i)=>e in t?bv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var Ze=(t,e,i)=>vv(t,typeof e!="symbol"?e+"":e,i),va=(t,e,i)=>e.has(t)||Ef("Cannot "+i);var S=(t,e,i)=>(va(t,e,"read from private field"),i?i.call(t):e.get(t)),oe=(t,e,i)=>e.has(t)?Ef("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,i),U=(t,e,i,n)=>(va(t,e,"write to private field"),n?n.call(t,i):e.set(t,i),i),j=(t,e,i)=>(va(t,e,"access private method"),i);var mo=(t,e,i,n)=>({set _(r){U(t,e,r,i)},get _(){return S(t,e,n)}});import{d as Te,B as H,s as $,D as te,G as Ae,H as Mn,ao as ys,z as ct,y as pe,F as Ct,M as Gs,bf as yv,a9 as si,aQ as Tn,P as li,j as He,I as xs,bg as xv,aD as A,an as kv}from"./index-Bh7OCVQ6.js";const Sv=t=>{const e=typeof t;return e!=="function"&&e!=="object"||t===null},wv=t=>{const e=t.flags===""?void 0:t.flags;return new RegExp(t.source,e)},Ur=(t,e=new WeakMap)=>{if(t===null||Sv(t))return t;if(e.has(t))return e.get(t);if(t instanceof RegExp)return wv(t);if(t instanceof Date)return new Date(t.getTime());if(t instanceof Function)return t;if(t instanceof Map){const n=new Map;return e.set(t,n),t.forEach((r,s)=>{n.set(s,Ur(r,e))}),n}if(t instanceof Set){const n=new Set;e.set(t,n);for(const r of t)n.add(Ur(r,e));return n}if(Array.isArray(t)){const n=[];return e.set(t,n),t.forEach(r=>{n.push(Ur(r,e))}),n}const i={};e.set(t,i);for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=Ur(t[n],e));return i},Kp=(t,e=200)=>{let i=0;return(...n)=>new Promise(r=>{i&&(clearTimeout(i),r("cancel")),i=window.setTimeout(()=>{t.apply(void 0,n),i=0,r("done")},e)})},$v=(t,e={_blank:!0,nofollow:!0})=>{const i=document.createElement("a");i.href=t,e._blank&&(i.target="_blank"),e.nofollow&&(i.rel="noopener noreferrer"),i.click()},Jp=()=>{let t=-1;return(e,i,n,r=100)=>{const s=()=>{n&&(typeof r=="number"?setTimeout(n,r):n())};t!==-1&&(cancelAnimationFrame(t),s());let o=e.scrollTop;const l=()=>{t=-1;const a=i-o;o=o+a/5,Math.abs(a)<1?(e.scrollTo(0,i),s()):(e.scrollTo(0,o),t=requestAnimationFrame(l))};t=requestAnimationFrame(l)}},Qv=(t,e=200)=>{let i=0,n=null;const r=s=>{i===0&&(i=s),s-i>=e?(t.apply(void 0,n),n=null,i=0):window.requestAnimationFrame(r)};return(...s)=>{n===null&&window.requestAnimationFrame(r),n=s}},_v=t=>{const e=i=>{const{scrollHeight:n,scrollWidth:r,offsetHeight:s,offsetWidth:o,scrollLeft:l,scrollTop:a}=t,u=i.x,c=i.y,h=d=>{const p=a+c-d.y,m=l+u-d.x,O=n-s,g=r-o,b={};m>=0&&m<=g&&(b.left=m),p>=0&&p<=O&&(b.top=p),t.scroll(b)};document.addEventListener("mousemove",h);const f=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f)};return t.addEventListener("mousedown",e),()=>{t.removeEventListener("mousedown",e)}},mu=()=>`${Date.now().toString(36)}${Math.random().toString(36).substring(2)}`,fl=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Pv=new Set(["__proto__","constructor","prototype"]),Cv=t=>!Pv.has(t),Gl=(t,e,i={})=>{if(Array.isArray(t)&&Array.isArray(e))return Ou(t,e,i);const{excludeKeys:n}=i,r=t,s=e;for(const o of Object.keys(s)){if(!Cv(o))continue;const l=s[o],a=r[o];n&&n(o)?r[o]=l:Array.isArray(l)&&Array.isArray(a)?r[o]=Ou(a,l,i):fl(l)&&fl(a)?r[o]=Gl(a,l,i):r[o]=l}return t},Ou=(t,e,i)=>{const n=t.slice();return e.forEach((r,s)=>{const o=n[s];Array.isArray(r)&&Array.isArray(o)?n[s]=Ou(o,r,i):fl(r)&&fl(o)?n[s]=Gl(o,r,i):n[s]=r}),n},x="md-editor",Pe="https://unpkg.com",Tv=`${Pe}/@highlightjs/cdn-assets@11.10.0/highlight.min.js`,Rf={main:`${Pe}/prettier@3.3.3/standalone.js`,markdown:`${Pe}/prettier@3.3.3/plugins/markdown.js`},Av={css:`${Pe}/cropperjs@1.6.2/dist/cropper.min.css`,js:`${Pe}/cropperjs@1.6.2/dist/cropper.min.js`},Ev=`${Pe}/screenfull@5.2.0/dist/screenfull.js`,Rv=`${Pe}/mermaid@11.9.0/dist/mermaid.min.js`,Dv={js:`${Pe}/katex@0.16.22/dist/katex.min.js`,css:`${Pe}/katex@0.16.22/dist/katex.min.css`},gu={a11y:{light:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/a11y-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/a11y-dark.min.css`},atom:{light:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/atom-one-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/atom-one-dark.min.css`},github:{light:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/github.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/github-dark.min.css`},gradient:{light:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/gradient-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/gradient-dark.min.css`},kimbie:{light:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/kimbie-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/kimbie-dark.min.css`},paraiso:{light:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/paraiso-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/paraiso-dark.min.css`},qtcreator:{light:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/qtcreator-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/qtcreator-dark.min.css`},stackoverflow:{light:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/stackoverflow-light.min.css`,dark:`${Pe}/@highlightjs/cdn-assets@11.10.0/styles/stackoverflow-dark.min.css`}},Lv={highlight:{js:{integrity:"sha384-GdEWAbCjn+ghjX0gLx7/N1hyTVmPAjdC2OvoAA0RyNcAOhqwtT8qnbCxWle2+uJX",crossOrigin:"anonymous"},css:{a11y:{light:{integrity:"sha384-qdZDAN3jffvh670RHw1wxLekabidEFaNRninYgIzBvMbL6WlHdXeHS/Bt+vx33lN",crossOrigin:"anonymous"},dark:{integrity:"sha384-2QAAjX8pqaM5azX68KWI2wExF6Q13kY4kEiQFY4b/1zPe6rpgmTByNpDEllH3sb+",crossOrigin:"anonymous"}},atom:{light:{integrity:"sha384-w6Ujm1VWa9HYFqGc89oAPn/DWDi2gUamjNrq9DRvEYm2X3ClItg9Y9xs1ViVo5b5",crossOrigin:"anonymous"},dark:{integrity:"sha384-oaMLBGEzBOJx3UHwac0cVndtX5fxGQIfnAeFZ35RTgqPcYlbprH9o9PUV/F8Le07",crossOrigin:"anonymous"}},github:{light:{integrity:"sha384-eFTL69TLRZTkNfYZOLM+G04821K1qZao/4QLJbet1pP4tcF+fdXq/9CdqAbWRl/L",crossOrigin:"anonymous"},dark:{integrity:"sha384-wH75j6z1lH97ZOpMOInqhgKzFkAInZPPSPlZpYKYTOqsaizPvhQZmAtLcPKXpLyH",crossOrigin:"anonymous"}},gradient:{light:{integrity:"sha384-yErHBR8aEZPxRl3XmR8dGSRAclMlnSRRw8sXQLcmPWzWUvb56BzQmBw3EWHl7QGI",crossOrigin:"anonymous"},dark:{integrity:"sha384-lUCvtSOdvDbp5hLWKgwz/taFu1HxlpqES2OVP5UG2JMTfnU481gXcBhGF9lAGoSr",crossOrigin:"anonymous"}},kimbie:{light:{integrity:"sha384-tloeSLUPczAvoZ48TUz+OxRie0oYLCRwlkadUXovGzzJEIbNQB2TkfUuvJ6SW5Mi",crossOrigin:"anonymous"},dark:{integrity:"sha384-o5F1vUaMNOmou1sQrsWiFo4/QUGSV0svqNZW+EesmKxWC8MpFJcveBhAyfvTHbGb",crossOrigin:"anonymous"}},paraiso:{light:{integrity:"sha384-5j6QHU2Hwg1ehtlIQNDebhETDB8bga3/88hzBFsMRaGmgQHCftqIN7GZNDNw0vTL",crossOrigin:"anonymous"},dark:{integrity:"sha384-I5vnnMQu0LWDQnHpT61xyoMwKarAB8jpZkB2ioFOlmzUFnIFaV4QbUwlBBOMKhTH",crossOrigin:"anonymous"}},qtcreator:{light:{integrity:"sha384-iEBgHrwi8Hv4dSZBz+MOGvS05rF7I7fGKM2fASQyE9jn2Istg9Qd5dSoK18WyRTB",crossOrigin:"anonymous"},dark:{integrity:"sha384-D6LXJGWNR4QV7gnpuP3ccbvOYoR02td3cU0y7lESABPg/tzCSC4m+y+M2TtrmpHc",crossOrigin:"anonymous"}},stackoverflow:{light:{integrity:"sha384-FMwt7cTGo4aLxZnno5k0xTj0W4gmi48Kwept+y/oQmE6cFk36Kr+QJZOKNOQwORe",crossOrigin:"anonymous"},dark:{integrity:"sha384-iL+x+BroCyHm/p2c6sMA9umXhdCWp2cKe4QUjPeMzHgwXAk+ZxHyIGP3NZTZensU",crossOrigin:"anonymous"}}}},prettier:{standaloneJs:{integrity:"sha384-92h6ALm8/lHpNGn6MfGlgZ+I8c/4yn/nSN8dV9ZmDxqbP9L93gk/Jj2i0LtV+AVd",crossOrigin:"anonymous"},parserMarkdownJs:{integrity:"sha384-5ufuUgoSsr/2oihBZ5d+c+yt0qaUmzLtUz41VZNJ4txtyJ6mBve3ZwuKoq/IygYX",crossOrigin:"anonymous"}},cropper:{js:{integrity:"sha384-jrOgQzBlDeUNdmQn3rUt/PZD+pdcRBdWd/HWRqRo+n2OR2QtGyjSaJC0GiCeH+ir",crossOrigin:"anonymous"},css:{integrity:"sha384-6LFfkTKLRlzFtgx8xsWyBdKGpcMMQTkv+dB7rAbugeJAu1Ym2q1Aji1cjHBG12Xh",crossOrigin:"anonymous"}},screenfull:{js:{integrity:"sha384-Qfbv8upMDu/ikv42M0Jnym2hahbDQ77Nm8PGU0G+iA6UIwt1+scE6P1qKXA0anWU",crossOrigin:"anonymous"}},mermaid:{js:{integrity:"sha384-UzWEhMP22MxNnr2bzqAdmtf1FDy5iKDUq6hLXJFLqC7dfGkc6W/hshbx9m71zyt5",crossOrigin:"anonymous"}},katex:{js:{integrity:"sha384-cMkvdD8LoxVzGF/RPUKAcvmm49FQ0oxwDF3BGKtDXcEc+T1b2N+teh/OJfpU0jr6",crossOrigin:"anonymous"},css:{integrity:"sha384-5TcZemv2l/9On385z///+d7MSYlvIEw9FuZTIdZ14vJLqWphw7e7ZPuOiCHJcFCP",crossOrigin:"anonymous"}}},wc=["bold","underline","italic","strikeThrough","-","title","sub","sup","quote","unorderedList","orderedList","task","-","codeRow","code","link","image","table","mermaid","katex","-","revoke","next","save","=","prettier","pageFullscreen","fullscreen","preview","previewOnly","htmlPreview","catalog","github"],$c=["markdownTotal","=","scrollSwitch"],dl={"zh-CN":{toolbarTips:{bold:"加粗",underline:"下划线",italic:"斜体",strikeThrough:"删除线",title:"标题",sub:"下标",sup:"上标",quote:"引用",unorderedList:"无序列表",orderedList:"有序列表",task:"任务列表",codeRow:"行内代码",code:"块级代码",link:"链接",image:"图片",table:"表格",mermaid:"mermaid图",katex:"katex公式",revoke:"后退",next:"前进",save:"保存",prettier:"美化",pageFullscreen:"浏览器全屏",fullscreen:"屏幕全屏",preview:"预览",previewOnly:"仅预览",htmlPreview:"html代码预览",catalog:"目录",github:"源码地址"},titleItem:{h1:"一级标题",h2:"二级标题",h3:"三级标题",h4:"四级标题",h5:"五级标题",h6:"六级标题"},imgTitleItem:{link:"添加链接",upload:"上传图片",clip2upload:"裁剪上传"},linkModalTips:{linkTitle:"添加链接",imageTitle:"添加图片",descLabel:"链接描述:",descLabelPlaceHolder:"请输入描述...",urlLabel:"链接地址:",urlLabelPlaceHolder:"请输入链接...",buttonOK:"确定"},clipModalTips:{title:"裁剪图片上传",buttonUpload:"上传"},copyCode:{text:"复制代码",successTips:"已复制!",failTips:"复制失败!"},mermaid:{flow:"流程图",sequence:"时序图",gantt:"甘特图",class:"类图",state:"状态图",pie:"饼图",relationship:"关系图",journey:"旅程图"},katex:{inline:"行内公式",block:"块级公式"},footer:{markdownTotal:"字数",scrollAuto:"同步滚动"}},"en-US":{toolbarTips:{bold:"bold",underline:"underline",italic:"italic",strikeThrough:"strikeThrough",title:"title",sub:"subscript",sup:"superscript",quote:"quote",unorderedList:"unordered list",orderedList:"ordered list",task:"task list",codeRow:"inline code",code:"block-level code",link:"link",image:"image",table:"table",mermaid:"mermaid",katex:"formula",revoke:"revoke",next:"undo revoke",save:"save",prettier:"prettier",pageFullscreen:"fullscreen in page",fullscreen:"fullscreen",preview:"preview",previewOnly:"preview only",htmlPreview:"html preview",catalog:"catalog",github:"source code"},titleItem:{h1:"Lv1 Heading",h2:"Lv2 Heading",h3:"Lv3 Heading",h4:"Lv4 Heading",h5:"Lv5 Heading",h6:"Lv6 Heading"},imgTitleItem:{link:"Add Image Link",upload:"Upload Images",clip2upload:"Crop And Upload"},linkModalTips:{linkTitle:"Add Link",imageTitle:"Add Image",descLabel:"Desc:",descLabelPlaceHolder:"Enter a description...",urlLabel:"Link:",urlLabelPlaceHolder:"Enter a link...",buttonOK:"OK"},clipModalTips:{title:"Crop Image",buttonUpload:"Upload"},copyCode:{text:"Copy",successTips:"Copied!",failTips:"Copy failed!"},mermaid:{flow:"flow",sequence:"sequence",gantt:"gantt",class:"class",state:"state",pie:"pie",relationship:"relationship",journey:"journey"},katex:{inline:"inline",block:"block"},footer:{markdownTotal:"Character Count",scrollAuto:"Scroll Auto"}}},Me={editorExtensions:{highlight:{js:Tv,css:gu},prettier:{standaloneJs:Rf.main,parserMarkdownJs:Rf.markdown},cropper:{...Av},screenfull:{js:Ev},mermaid:{js:Rv,enableZoom:!0},katex:{...Dv}},editorExtensionsAttrs:{},editorConfig:{languageUserDefined:{},mermaidTemplate:{},renderDelay:500,zIndex:2e4},codeMirrorExtensions:(t,e)=>e,markdownItConfig:()=>{},markdownItPlugins:t=>t,mermaidConfig:t=>t,katexConfig:t=>t},Mv=t=>Gl(Me,t,{excludeKeys(e){return/[iI]{1}nstance/.test(e)}}),Oo=.1,ht=({instance:t,ctx:e,props:i={}},n="default")=>{const r=(t==null?void 0:t.$slots[n])||(e==null?void 0:e.slots[n]);return(r?r(t):"")||i[n]},Zv={overlay:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},relative:{type:String,default:"html"},disabled:{type:Boolean,default:void 0}},Bn=Te({name:`${x}-dropdown`,props:Zv,setup(t,e){const i=`${x}-dropdown-hidden`,n=ct({overlayClass:[i],overlayStyle:{},triggerHover:!1,overlayHover:!1}),r=pe(),s=pe(),o=()=>{var c,h;if(t.disabled)return!1;n.triggerHover=!0;const f=r.value,d=s.value;if(!f||!d)return;const p=f.getBoundingClientRect(),m=f.offsetTop,O=f.offsetLeft,g=p.height,b=p.width,y=f.getRootNode(),w=((c=y.querySelector(t.relative))==null?void 0:c.scrollLeft)||0,v=((h=y.querySelector(t.relative))==null?void 0:h.clientWidth)||0;let Q=O-d.offsetWidth/2+b/2-w;Q+d.offsetWidth>w+v&&(Q=w+v-d.offsetWidth),Q<0&&(Q=0),n.overlayStyle={...n.overlayStyle,top:m+g+"px",left:Q+"px"},t.onChange(!0)},l=()=>{if(t.disabled)return!1;n.overlayHover=!0};te(()=>t.visible,c=>{c?n.overlayClass=n.overlayClass.filter(h=>h!==i):n.overlayClass.push(i)});let a=-1;const u=c=>{r.value===c.target?n.triggerHover=!1:n.overlayHover=!1,clearTimeout(a),a=window.setTimeout(()=>{!n.overlayHover&&!n.triggerHover&&t.onChange(!1)},10)};return Ae(()=>{r.value.addEventListener("mouseenter",o),r.value.addEventListener("mouseleave",u),s.value.addEventListener("mouseenter",l),s.value.addEventListener("mouseleave",u)}),Mn(()=>{r.value.removeEventListener("mouseenter",o),r.value.removeEventListener("mouseleave",u),s.value.removeEventListener("mouseenter",l),s.value.removeEventListener("mouseleave",u)}),()=>{const c=ht({ctx:e}),h=ht({props:t,ctx:e},"overlay"),f=ys(c instanceof Array?c[0]:c,{ref:r,key:"cloned-dropdown-trigger"}),d=$("div",{class:[`${x}-dropdown`,n.overlayClass],style:n.overlayStyle,ref:s},[$("div",{class:`${x}-dropdown-overlay`},[h instanceof Array?h[0]:h])]);return[f,d]}}}),Iv={title:{type:String,default:""},visible:{type:Boolean,default:void 0},trigger:{type:[String,Object],default:void 0},onChange:{type:Function,default:void 0},overlay:{type:[String,Object],default:void 0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},rs=Te({name:"DropdownToolbar",props:Iv,emits:["onChange"],setup(t,e){const i=H("editorId");return()=>{const n=ht({props:t,ctx:e},"trigger"),r=ht({props:t,ctx:e},"overlay"),s=ht({props:t,ctx:e});return $(Bn,{relative:`#${i}-toolbar-wrapper`,visible:t.visible,onChange:o=>{var l;(l=t.onChange)==null||l.call(t,o),e.emit("onChange",o)},overlay:r,disabled:t.disabled},{default:()=>[$("div",{class:[`${x}-toolbar-item`,t.disabled&&`${x}-disabled`],title:t.title||""},[s||n])]})}}});rs.install=t=>(t.component(rs.name,rs),t);var Xv=Object.defineProperty,zv=(t,e,i)=>e in t?Xv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,jv=(t,e,i)=>zv(t,e+"",i);class Fv{constructor(){jv(this,"pools",{})}remove(e,i,n){const s=this.pools[e]&&this.pools[e][i];s&&(this.pools[e][i]=s.filter(o=>o!==n))}clear(e){this.pools[e]={}}on(e,i){return this.pools[e]||(this.pools[e]={}),this.pools[e][i.name]||(this.pools[e][i.name]=[]),this.pools[e][i.name].push(i.callback),this.pools[e][i.name].includes(i.callback)}emit(e,i,...n){this.pools[e]||(this.pools[e]={});const s=this.pools[e][i];s&&s.forEach(o=>{try{o(...n)}catch(l){console.error(`${i} monitor event exception!`,l)}})}}const X=new Fv,Ul="onSave",Qc="changeCatalogVisible",em="changeFullscreen",Df="pageFullscreenChanged",Lf="fullscreenChanged",Mf="previewChanged",Zf="previewOnlyChanged",If="htmlPreviewChanged",Xf="catalogVisibleChanged",Go="buildFinished",hn="errorCatcher",xe="replace",Hl="uploadImage",bu="openModals",tm="ctrlZ",im="ctrlShiftZ",ss="catalogChanged",nm="pushCatalog",_c="rerender",rm="eventListener",sm="taskStateChanged",om="sendEditorView",pl="getEditorView",Bv={copy:``,"collapse-tips":``,pin:'',"pin-off":''},os=(t,e)=>typeof e[t]=="string"?e[t]:Bv[t],zf=(t,e)=>{const i=n=>{const r=t.parentElement||document.body,s=r.offsetWidth,o=r.offsetHeight,{clientWidth:l,clientHeight:a}=document.documentElement,u=n.offsetX,c=n.offsetY,h=d=>{let p=d.x+document.body.scrollLeft-document.body.clientLeft-u,m=d.y+document.body.scrollTop-document.body.clientTop-c;p=p<1?1:p{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",f)};document.addEventListener("mouseup",f)};return t.addEventListener("mousedown",i),()=>{t.removeEventListener("mousedown",i)}},zt=(t,e,i="")=>{var n;const r=document.getElementById(e.id);if(r)i!==""&&(Reflect.get(window,i)?(n=e.onload)==null||n.call(r,new Event("load")):e.onload&&r.addEventListener("load",e.onload));else{const s={...e};s.onload=null;const o=qv(t,s);e.onload&&o.addEventListener("load",e.onload),document.head.appendChild(o)}},Vv=(t,e)=>{const i=document.getElementById(e.id);i==null||i.remove(),zt(t,e)},qv=(t,e)=>{const i=document.createElement(t);return Object.keys(e).forEach(n=>{e[n]!==void 0&&(i[n]=e[n])}),i},jf=(()=>{const t=i=>{if(!i)return()=>{};const n=i.firstChild;let r=1,s=0,o=0,l=!1,a,u,c,h=1;const f=()=>{n.style.transform=`translate(${s}px, ${o}px) scale(${r})`},d=v=>{v.touches.length===1?(l=!0,a=v.touches[0].clientX-s,u=v.touches[0].clientY-o):v.touches.length===2&&(c=Math.hypot(v.touches[0].clientX-v.touches[1].clientX,v.touches[0].clientY-v.touches[1].clientY),h=r)},p=v=>{if(v.preventDefault(),l&&v.touches.length===1)s=v.touches[0].clientX-a,o=v.touches[0].clientY-u,f();else if(v.touches.length===2){const P=Math.hypot(v.touches[0].clientX-v.touches[1].clientX,v.touches[0].clientY-v.touches[1].clientY)/c,_=r;r=h*(1+(P-1));const R=(v.touches[0].clientX+v.touches[1].clientX)/2,L=(v.touches[0].clientY+v.touches[1].clientY)/2,I=n.getBoundingClientRect(),T=(R-I.left)/_,M=(L-I.top)/_;s-=T*(r-_),o-=M*(r-_),f()}},m=()=>{l=!1},O=v=>{v.preventDefault();const Q=.02,P=r;v.deltaY<0?r+=Q:r=Math.max(.1,r-Q);const _=n.getBoundingClientRect(),R=v.clientX-_.left,L=v.clientY-_.top;s-=R/P*(r-P),o-=L/P*(r-P),f()},g=v=>{l=!0,a=v.clientX-s,u=v.clientY-o},b=v=>{l&&(s=v.clientX-a,o=v.clientY-u,f())},y=()=>{l=!1},w=()=>{l=!1};return i.addEventListener("touchstart",d,{passive:!1}),i.addEventListener("touchmove",p,{passive:!1}),i.addEventListener("touchend",m),i.addEventListener("wheel",O,{passive:!1}),i.addEventListener("mousedown",g),i.addEventListener("mousemove",b),i.addEventListener("mouseup",y),i.addEventListener("mouseleave",w),()=>{i.removeEventListener("touchstart",d),i.removeEventListener("touchmove",p),i.removeEventListener("touchend",m),i.removeEventListener("wheel",O),i.removeEventListener("mousedown",g),i.removeEventListener("mousemove",b),i.removeEventListener("mouseup",y),i.removeEventListener("mouseleave",w)}};return(i,n)=>{const r=new Map;return i==null||i.forEach(s=>{let o=s.querySelector(`.${x}-mermaid-action`);o||(s.insertAdjacentHTML("beforeend",`
${os("pin-off",n.customIcon)}
`),o=s.querySelector(`.${x}-mermaid-action`));const l=()=>{const a=r.get(s);if(a!=null&&a.removeEvent)a.removeEvent(),s.removeAttribute("data-grab"),r.set(s,{removeClick:a.removeClick}),o.innerHTML=os("pin-off",n.customIcon);else{const u=t(s);s.setAttribute("data-grab",""),r.set(s,{removeEvent:u,removeClick:a==null?void 0:a.removeClick}),o.innerHTML=os("pin",n.customIcon)}};o.addEventListener("click",l),r.set(s,{removeClick:()=>o.removeEventListener("click",l)})}),()=>{r.forEach(({removeEvent:s,removeClick:o})=>{s==null||s(),o==null||o()}),r.clear()}}})();/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */var gn=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{},n=window.Promise||function(T){function M(){}T(M,M)},r=function(T){var M=T.target;if(M===R){p();return}y.indexOf(M)!==-1&&m({target:M})},s=function(){if(!(v||!_.original)){var T=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(Q-T)>P.scrollOffset&&setTimeout(p,150)}},o=function(T){var M=T.key||T.keyCode;(M==="Escape"||M==="Esc"||M===27)&&p()},l=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=T;if(T.background&&(R.style.background=T.background),T.container&&T.container instanceof Object&&(M.container=gn({},P.container,T.container)),T.template){var F=Uo(T.template)?T.template:document.querySelector(T.template);M.template=F}return P=gn({},P,M),y.forEach(function(B){B.dispatchEvent(jn("medium-zoom:update",{detail:{zoom:L}}))}),L},a=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return t(gn({},P,T))},u=function(){for(var T=arguments.length,M=Array(T),F=0;F0?M.reduce(function(Y,J){return[].concat(Y,Bf(J))},[]):y;return B.forEach(function(Y){Y.classList.remove("medium-zoom-image"),Y.dispatchEvent(jn("medium-zoom:detach",{detail:{zoom:L}}))}),y=y.filter(function(Y){return B.indexOf(Y)===-1}),L},h=function(T,M){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return y.forEach(function(B){B.addEventListener("medium-zoom:"+T,M,F)}),w.push({type:"medium-zoom:"+T,listener:M,options:F}),L},f=function(T,M){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return y.forEach(function(B){B.removeEventListener("medium-zoom:"+T,M,F)}),w=w.filter(function(B){return!(B.type==="medium-zoom:"+T&&B.listener.toString()===M.toString())}),L},d=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=T.target,F=function(){var Y={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},J=void 0,ee=void 0;if(P.container)if(P.container instanceof Object)Y=gn({},Y,P.container),J=Y.width-Y.left-Y.right-P.margin*2,ee=Y.height-Y.top-Y.bottom-P.margin*2;else{var re=Uo(P.container)?P.container:document.querySelector(P.container),ue=re.getBoundingClientRect(),ye=ue.width,Oe=ue.height,le=ue.left,Se=ue.top;Y=gn({},Y,{width:ye,height:Oe,left:le,top:Se})}J=J||Y.width-P.margin*2,ee=ee||Y.height-P.margin*2;var et=_.zoomedHd||_.original,Pi=Ff(et)?J:et.naturalWidth||J,dn=Ff(et)?ee:et.naturalHeight||ee,pn=et.getBoundingClientRect(),ao=pn.top,uo=pn.left,In=pn.width,Xn=pn.height,co=Math.min(Math.max(In,Pi),J)/In,ho=Math.min(Math.max(Xn,dn),ee)/Xn,zn=Math.min(co,ho),fo=(-uo+(J-In)/2+P.margin+Y.left)/zn,po=(-ao+(ee-Xn)/2+P.margin+Y.top)/zn,zr="scale("+zn+") translate3d("+fo+"px, "+po+"px, 0)";_.zoomed.style.transform=zr,_.zoomedHd&&(_.zoomedHd.style.transform=zr)};return new n(function(B){if(M&&y.indexOf(M)===-1){B(L);return}var Y=function ye(){v=!1,_.zoomed.removeEventListener("transitionend",ye),_.original.dispatchEvent(jn("medium-zoom:opened",{detail:{zoom:L}})),B(L)};if(_.zoomed){B(L);return}if(M)_.original=M;else if(y.length>0){var J=y;_.original=J[0]}else{B(L);return}if(_.original.dispatchEvent(jn("medium-zoom:open",{detail:{zoom:L}})),Q=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,v=!0,_.zoomed=Nv(_.original),document.body.appendChild(R),P.template){var ee=Uo(P.template)?P.template:document.querySelector(P.template);_.template=document.createElement("div"),_.template.appendChild(ee.content.cloneNode(!0)),document.body.appendChild(_.template)}if(_.original.parentElement&&_.original.parentElement.tagName==="PICTURE"&&_.original.currentSrc&&(_.zoomed.src=_.original.currentSrc),document.body.appendChild(_.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),_.original.classList.add("medium-zoom-image--hidden"),_.zoomed.classList.add("medium-zoom-image--opened"),_.zoomed.addEventListener("click",p),_.zoomed.addEventListener("transitionend",Y),_.original.getAttribute("data-zoom-src")){_.zoomedHd=_.zoomed.cloneNode(),_.zoomedHd.removeAttribute("srcset"),_.zoomedHd.removeAttribute("sizes"),_.zoomedHd.removeAttribute("loading"),_.zoomedHd.src=_.zoomed.getAttribute("data-zoom-src"),_.zoomedHd.onerror=function(){clearInterval(re),console.warn("Unable to reach the zoom image target "+_.zoomedHd.src),_.zoomedHd=null,F()};var re=setInterval(function(){_.zoomedHd.complete&&(clearInterval(re),_.zoomedHd.classList.add("medium-zoom-image--opened"),_.zoomedHd.addEventListener("click",p),document.body.appendChild(_.zoomedHd),F())},10)}else if(_.original.hasAttribute("srcset")){_.zoomedHd=_.zoomed.cloneNode(),_.zoomedHd.removeAttribute("sizes"),_.zoomedHd.removeAttribute("loading");var ue=_.zoomedHd.addEventListener("load",function(){_.zoomedHd.removeEventListener("load",ue),_.zoomedHd.classList.add("medium-zoom-image--opened"),_.zoomedHd.addEventListener("click",p),document.body.appendChild(_.zoomedHd),F()})}else F()})},p=function(){return new n(function(T){if(v||!_.original){T(L);return}var M=function F(){_.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(_.zoomed),_.zoomedHd&&document.body.removeChild(_.zoomedHd),document.body.removeChild(R),_.zoomed.classList.remove("medium-zoom-image--opened"),_.template&&document.body.removeChild(_.template),v=!1,_.zoomed.removeEventListener("transitionend",F),_.original.dispatchEvent(jn("medium-zoom:closed",{detail:{zoom:L}})),_.original=null,_.zoomed=null,_.zoomedHd=null,_.template=null,T(L)};v=!0,document.body.classList.remove("medium-zoom--opened"),_.zoomed.style.transform="",_.zoomedHd&&(_.zoomedHd.style.transform=""),_.template&&(_.template.style.transition="opacity 150ms",_.template.style.opacity=0),_.original.dispatchEvent(jn("medium-zoom:close",{detail:{zoom:L}})),_.zoomed.addEventListener("transitionend",M)})},m=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=T.target;return _.original?p():d({target:M})},O=function(){return P},g=function(){return y},b=function(){return _.original},y=[],w=[],v=!1,Q=0,P=i,_={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(e)==="[object Object]"?P=e:(e||typeof e=="string")&&u(e),P=gn({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},P);var R=Yv(P.background);document.addEventListener("click",r),document.addEventListener("keyup",o),document.addEventListener("scroll",s),window.addEventListener("resize",p);var L={open:d,close:p,toggle:m,update:l,clone:a,attach:u,detach:c,on:h,off:f,getOptions:O,getImages:g,getZoomedImage:b};return L};function Uv(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var Hv=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";Uv(Hv);async function Kv(t){if(typeof t=="string"){if(window.isSecureContext&&navigator.clipboard)return await navigator.clipboard.writeText(t);{const e=document.createElement("textarea");let i=!1;if(e.value=t,e.style.position="fixed",e.style.opacity=0,e.style.zIndex="-10000",e.style.top="-10000",document.body.appendChild(e),e.select(),i=document.execCommand("copy"),document.body.removeChild(e),i)return;throw new Error('Failed to copy content via "execCommand"!')}}}const Vf={};function Jv(t){let e=Vf[t];if(e)return e;e=Vf[t]=[];for(let i=0;i<128;i++){const n=String.fromCharCode(i);e.push(n)}for(let i=0;i=55296&&c<=57343?r+="���":r+=String.fromCharCode(c),s+=6;continue}}if((l&248)===240&&s+91114111?r+="����":(h-=65536,r+=String.fromCharCode(55296+(h>>10),56320+(h&1023))),s+=9;continue}}r+="�"}return r})}pr.defaultChars=";/?:@&=+$,#";pr.componentChars="";const qf={};function ey(t){let e=qf[t];if(e)return e;e=qf[t]=[];for(let i=0;i<128;i++){const n=String.fromCharCode(i);/^[0-9a-z]$/i.test(n)?e.push(n):e.push("%"+("0"+i.toString(16).toUpperCase()).slice(-2))}for(let i=0;i"u"&&(i=!0);const n=ey(e);let r="";for(let s=0,o=t.length;s=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1=56320&&a<=57343){r+=encodeURIComponent(t[s]+t[s+1]),s++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(t[s])}return r}Us.defaultChars=";/?:@&=+$,-_.!~*'()#";Us.componentChars="-_.!~*'()";function Pc(t){let e="";return e+=t.protocol||"",e+=t.slashes?"//":"",e+=t.auth?t.auth+"@":"",t.hostname&&t.hostname.indexOf(":")!==-1?e+="["+t.hostname+"]":e+=t.hostname||"",e+=t.port?":"+t.port:"",e+=t.pathname||"",e+=t.search||"",e+=t.hash||"",e}function ml(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const ty=/^([a-z0-9.+-]+:)/i,iy=/:[0-9]*$/,ny=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ry=["<",">",'"',"`"," ","\r",` `," "],sy=["{","}","|","\\","^","`"].concat(ry),oy=["'"].concat(sy),Wf=["%","/","?",";","#"].concat(oy),Yf=["/","?","#"],ly=255,Nf=/^[+a-z0-9A-Z_-]{0,63}$/,ay=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Gf={javascript:!0,"javascript:":!0},Uf={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function Cc(t,e){if(t&&t instanceof ml)return t;const i=new ml;return i.parse(t,e),i}ml.prototype.parse=function(t,e){let i,n,r,s=t;if(s=s.trim(),!e&&t.split("#").length===1){const u=ny.exec(s);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let o=ty.exec(s);if(o&&(o=o[0],i=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(e||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=s.substr(0,2)==="//",r&&!(o&&Gf[o])&&(s=s.substr(2),this.slashes=!0)),!Gf[o]&&(r||o&&!Uf[o])){let u=-1;for(let p=0;p127?b+="x":b+=g[y];if(!b.match(Nf)){const y=p.slice(0,m),w=p.slice(m+1),v=g.match(ay);v&&(y.push(v[1]),w.unshift(v[2])),w.length&&(s=w.join(".")+s),this.hostname=y.join(".");break}}}}this.hostname.length>ly&&(this.hostname=""),d&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const a=s.indexOf("?");return a!==-1&&(this.search=s.substr(a),s=s.slice(0,a)),s&&(this.pathname=s),Uf[i]&&this.hostname&&!this.pathname&&(this.pathname=""),this};ml.prototype.parseHost=function(t){let e=iy.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};const uy=Object.freeze(Object.defineProperty({__proto__:null,decode:pr,encode:Us,format:Pc,parse:Cc},Symbol.toStringTag,{value:"Module"})),lm=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,am=/[\0-\x1F\x7F-\x9F]/,cy=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Tc=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,um=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,cm=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,hy=Object.freeze(Object.defineProperty({__proto__:null,Any:lm,Cc:am,Cf:cy,P:Tc,S:um,Z:cm},Symbol.toStringTag,{value:"Module"})),fy=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),dy=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(t=>t.charCodeAt(0)));var ya;const py=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),my=(ya=String.fromCodePoint)!==null&&ya!==void 0?ya:function(t){let e="";return t>65535&&(t-=65536,e+=String.fromCharCode(t>>>10&1023|55296),t=56320|t&1023),e+=String.fromCharCode(t),e};function Oy(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=py.get(t))!==null&&e!==void 0?e:t}var Ye;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(Ye||(Ye={}));const gy=32;var en;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(en||(en={}));function vu(t){return t>=Ye.ZERO&&t<=Ye.NINE}function by(t){return t>=Ye.UPPER_A&&t<=Ye.UPPER_F||t>=Ye.LOWER_A&&t<=Ye.LOWER_F}function vy(t){return t>=Ye.UPPER_A&&t<=Ye.UPPER_Z||t>=Ye.LOWER_A&&t<=Ye.LOWER_Z||vu(t)}function yy(t){return t===Ye.EQUALS||vy(t)}var Be;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(Be||(Be={}));var Ei;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(Ei||(Ei={}));class xy{constructor(e,i,n){this.decodeTree=e,this.emitCodePoint=i,this.errors=n,this.state=Be.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ei.Strict}startEntity(e){this.decodeMode=e,this.state=Be.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,i){switch(this.state){case Be.EntityStart:return e.charCodeAt(i)===Ye.NUM?(this.state=Be.NumericStart,this.consumed+=1,this.stateNumericStart(e,i+1)):(this.state=Be.NamedEntity,this.stateNamedEntity(e,i));case Be.NumericStart:return this.stateNumericStart(e,i);case Be.NumericDecimal:return this.stateNumericDecimal(e,i);case Be.NumericHex:return this.stateNumericHex(e,i);case Be.NamedEntity:return this.stateNamedEntity(e,i)}}stateNumericStart(e,i){return i>=e.length?-1:(e.charCodeAt(i)|gy)===Ye.LOWER_X?(this.state=Be.NumericHex,this.consumed+=1,this.stateNumericHex(e,i+1)):(this.state=Be.NumericDecimal,this.stateNumericDecimal(e,i))}addToNumericResult(e,i,n,r){if(i!==n){const s=n-i;this.result=this.result*Math.pow(r,s)+parseInt(e.substr(i,s),r),this.consumed+=s}}stateNumericHex(e,i){const n=i;for(;i>14;for(;i>14,s!==0){if(o===Ye.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ei.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:i,decodeTree:n}=this,r=(n[i]&en.VALUE_LENGTH)>>14;return this.emitNamedEntityData(i,r,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,i,n){const{decodeTree:r}=this;return this.emitCodePoint(i===1?r[e]&~en.VALUE_LENGTH:r[e+1],n),i===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Be.NamedEntity:return this.result!==0&&(this.decodeMode!==Ei.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Be.NumericDecimal:return this.emitNumericEntity(0,2);case Be.NumericHex:return this.emitNumericEntity(0,3);case Be.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Be.EntityStart:return 0}}}function hm(t){let e="";const i=new xy(t,n=>e+=my(n));return function(r,s){let o=0,l=0;for(;(l=r.indexOf("&",l))>=0;){e+=r.slice(o,l),i.startEntity(s);const u=i.write(r,l+1);if(u<0){o=l+i.end();break}o=l+u,l=u===0?o+1:o}const a=e+r.slice(o);return e="",a}}function ky(t,e,i,n){const r=(e&en.BRANCH_LENGTH)>>7,s=e&en.JUMP_TABLE;if(r===0)return s!==0&&n===s?i:-1;if(s){const a=n-s;return a<0||a>=r?-1:t[i+a]-1}let o=i,l=o+r-1;for(;o<=l;){const a=o+l>>>1,u=t[a];if(un)l=a-1;else return t[a+r]}return-1}const fm=hm(fy);hm(dy);function Sy(t,e=Ei.Legacy){return fm(t,e)}function wy(t){return fm(t,Ei.Strict)}function $y(t){return Object.prototype.toString.call(t)}function Ac(t){return $y(t)==="[object String]"}const Qy=Object.prototype.hasOwnProperty;function _y(t,e){return Qy.call(t,e)}function Kl(t){return Array.prototype.slice.call(arguments,1).forEach(function(i){if(i){if(typeof i!="object")throw new TypeError(i+"must be object");Object.keys(i).forEach(function(n){t[n]=i[n]})}}),t}function dm(t,e,i){return[].concat(t.slice(0,e),i,t.slice(e+1))}function Ec(t){return!(t>=55296&&t<=57343||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534||t>=0&&t<=8||t===11||t>=14&&t<=31||t>=127&&t<=159||t>1114111)}function ks(t){if(t>65535){t-=65536;const e=55296+(t>>10),i=56320+(t&1023);return String.fromCharCode(e,i)}return String.fromCharCode(t)}const pm=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Py=/&([a-z#][a-z0-9]{1,31});/gi,Cy=new RegExp(pm.source+"|"+Py.source,"gi"),Ty=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Ay(t,e){if(e.charCodeAt(0)===35&&Ty.test(e)){const n=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Ec(n)?ks(n):t}const i=Sy(t);return i!==t?i:t}function Ey(t){return t.indexOf("\\")<0?t:t.replace(pm,"$1")}function mr(t){return t.indexOf("\\")<0&&t.indexOf("&")<0?t:t.replace(Cy,function(e,i,n){return i||Ay(e,n)})}const Ry=/[&<>"]/,Dy=/[&<>"]/g,Ly={"&":"&","<":"<",">":">",'"':"""};function My(t){return Ly[t]}function sn(t){return Ry.test(t)?t.replace(Dy,My):t}const Zy=/[.?*+^$[\]\\(){}|-]/g;function Iy(t){return t.replace(Zy,"\\$&")}function Qe(t){switch(t){case 9:case 32:return!0}return!1}function Ss(t){if(t>=8192&&t<=8202)return!0;switch(t){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function mm(t){return Tc.test(t)||um.test(t)}function ws(t){return mm(ks(t))}function $s(t){switch(t){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Jl(t){return t=t.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(t=t.replace(/ẞ/g,"ß")),t.toLowerCase().toUpperCase()}function Hf(t){return t===32||t===9||t===10||t===13}function ea(t){let e=0;for(;e=e&&Hf(t.charCodeAt(i));i--);return t.slice(e,i+1)}const Xy={mdurl:uy,ucmicro:hy},zy=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:dm,asciiTrim:ea,assign:Kl,escapeHtml:sn,escapeRE:Iy,fromCodePoint:ks,has:_y,isMdAsciiPunct:$s,isPunctChar:mm,isPunctCharCode:ws,isSpace:Qe,isString:Ac,isValidEntityCode:Ec,isWhiteSpace:Ss,lib:Xy,normalizeReference:Jl,unescapeAll:mr,unescapeMd:Ey},Symbol.toStringTag,{value:"Module"}));function jy(t,e,i){let n,r,s,o;const l=t.posMax,a=t.pos;for(t.pos=e+1,n=1;t.pos32))return s;if(n===41){if(o===0)break;o--}r++}return e===r||o!==0||(s.str=mr(t.slice(e,r)),s.pos=r,s.ok=!0),s}function By(t,e,i,n){let r,s=e;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)o.str=n.str,o.marker=n.marker;else{if(s>=i)return o;let l=t.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return o;e++,s++,l===40&&(l=41),o.marker=l}for(;s"+sn(s.content)+""};Qi.code_block=function(t,e,i,n,r){const s=t[e];return""+sn(t[e].content)+` `};Qi.fence=function(t,e,i,n,r){const s=t[e],o=s.info?mr(s.info).trim():"";let l="",a="";if(o){const c=o.split(/(\s+)/g);l=c[0],a=c.slice(2).join("")}let u;if(i.highlight?u=i.highlight(s.content,l,a)||sn(s.content):u=sn(s.content),u.indexOf("${u} `}return`
${u}
`};Qi.image=function(t,e,i,n,r){const s=t[e];return s.attrs[s.attrIndex("alt")][1]=r.renderInlineAsText(s.children,i,n),r.renderToken(t,e,i)};Qi.hardbreak=function(t,e,i){return i.xhtmlOut?`
`:`
`};Qi.softbreak=function(t,e,i){return i.breaks?i.xhtmlOut?`
`:`
`:` `};Qi.text=function(t,e){return sn(t[e].content)};Qi.html_block=function(t,e){return t[e].content};Qi.html_inline=function(t,e){return t[e].content};function Ar(){this.rules=Kl({},Qi)}Ar.prototype.renderAttrs=function(e){let i,n,r;if(!e.attrs)return"";for(r="",i=0,n=e.attrs.length;i `:">",s};Ar.prototype.renderInline=function(t,e,i){let n="";const r=this.rules;for(let s=0,o=t.length;s=0&&(n=this.attrs[i][1]),n};ui.prototype.attrJoin=function(e,i){const n=this.attrIndex(e);n<0?this.attrPush([e,i]):this.attrs[n][1]=this.attrs[n][1]+" "+i};function Om(t,e,i){this.src=t,this.env=i,this.tokens=[],this.inlineMode=!1,this.md=e}Om.prototype.Token=ui;const qy=/\r\n?|\n/g,Wy=/\0/g;function Yy(t){let e;e=t.src.replace(qy,` `),e=e.replace(Wy,"�"),t.src=e}function Ny(t){let e;t.inlineMode?(e=new t.Token("inline","",0),e.content=t.src,e.map=[0,1],e.children=[],t.tokens.push(e)):t.md.block.parse(t.src,t.md,t.env,t.tokens)}function Gy(t){const e=t.tokens;for(let i=0,n=e.length;i\s]/i.test(t)}function Hy(t){return/^<\/a\s*>/i.test(t)}function Ky(t){const e=t.tokens;if(t.md.options.linkify)for(let i=0,n=e.length;i=0;o--){const l=r[o];if(l.type==="link_close"){for(o--;r[o].level!==l.level&&r[o].type!=="link_open";)o--;continue}if(l.type==="html_inline"&&(Uy(l.content)&&s>0&&s--,Hy(l.content)&&s++),!(s>0)&&l.type==="text"&&t.md.linkify.test(l.content)){const a=l.content;let u=t.md.linkify.match(a);const c=[];let h=l.level,f=0;u.length>0&&u[0].index===0&&o>0&&r[o-1].type==="text_special"&&(u=u.slice(1));for(let d=0;df){const v=new t.Token("text","",0);v.content=a.slice(f,g),v.level=h,c.push(v)}const b=new t.Token("link_open","a",1);b.attrs=[["href",m]],b.level=h++,b.markup="linkify",b.info="auto",c.push(b);const y=new t.Token("text","",0);y.content=O,y.level=h,c.push(y);const w=new t.Token("link_close","a",-1);w.level=--h,w.markup="linkify",w.info="auto",c.push(w),f=u[d].lastIndex}if(f=0;i--){const n=t[i];n.type==="text"&&!e&&(n.content=n.content.replace(ex,ix)),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}function rx(t){let e=0;for(let i=t.length-1;i>=0;i--){const n=t[i];n.type==="text"&&!e&&gm.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),n.type==="link_open"&&n.info==="auto"&&e--,n.type==="link_close"&&n.info==="auto"&&e++}}function sx(t){let e;if(t.md.options.typographer)for(e=t.tokens.length-1;e>=0;e--)t.tokens[e].type==="inline"&&(Jy.test(t.tokens[e].content)&&nx(t.tokens[e].children),gm.test(t.tokens[e].content)&&rx(t.tokens[e].children))}const ox=/['"]/,Kf=/['"]/g,Jf="’";function bo(t,e,i,n){t[e]||(t[e]=[]),t[e].push({pos:i,ch:n})}function lx(t,e){let i="",n=0;e.sort((r,s)=>r.pos-s.pos);for(let r=0;r=0&&!(n[i].level<=l);i--);if(n.length=i+1,o.type!=="text")continue;const a=o.content;let u=0;const c=a.length;e:for(;u=0)m=a.charCodeAt(h.index-1);else for(i=s-1;i>=0&&!(t[i].type==="softbreak"||t[i].type==="hardbreak");i--)if(t[i].content){m=t[i].content.charCodeAt(t[i].content.length-1);break}let O=32;if(u=48&&m<=57&&(d=f=!1),f&&d&&(f=g,d=b),!f&&!d){p&&bo(r,s,h.index,Jf);continue}if(d)for(i=n.length-1;i>=0;i--){let v=n[i];if(n[i].level=0;e--)t.tokens[e].type!=="inline"||!ox.test(t.tokens[e].content)||ax(t.tokens[e].children,t)}function cx(t){let e,i;const n=t.tokens,r=n.length;for(let s=0;s0&&this.level++,this.tokens.push(n),n};_i.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};_i.prototype.skipEmptyLines=function(e){for(let i=this.lineMax;ei;)if(!Qe(this.src.charCodeAt(--e)))return e+1;return e};_i.prototype.skipChars=function(e,i){for(let n=this.src.length;en;)if(i!==this.src.charCodeAt(--e))return e+1;return e};_i.prototype.getLines=function(e,i,n,r){if(e>=i)return"";const s=new Array(i-e);for(let o=0,l=e;ln?s[o]=new Array(a-n+1).join(" ")+this.src.slice(c,h):s[o]=this.src.slice(c,h)}return s.join("")};_i.prototype.Token=ui;const hx=65536;function ka(t,e){const i=t.bMarks[e]+t.tShift[e],n=t.eMarks[e];return t.src.slice(i,n)}function ed(t){const e=[],i=t.length;let n=0,r=t.charCodeAt(n),s=!1,o=0,l="";for(;ni)return!1;let r=e+1;if(t.sCount[r]=4)return!1;let s=t.bMarks[r]+t.tShift[r];if(s>=t.eMarks[r])return!1;const o=t.src.charCodeAt(s++);if(o!==124&&o!==45&&o!==58||s>=t.eMarks[r])return!1;const l=t.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!Qe(l)||o===45&&Qe(l))return!1;for(;s=4)return!1;u=ed(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();const h=u.length;if(h===0||h!==c.length)return!1;if(n)return!0;const f=t.parentType;t.parentType="table";const d=t.md.block.ruler.getRules("blockquote"),p=t.push("table_open","table",1),m=[e,0];p.map=m;const O=t.push("thead_open","thead",1);O.map=[e,e+1];const g=t.push("tr_open","tr",1);g.map=[e,e+1];for(let w=0;w=4||(u=ed(a),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),y+=h-u.length,y>hx))break;if(r===e+2){const Q=t.push("tbody_open","tbody",1);Q.map=b=[e+2,0]}const v=t.push("tr_open","tr",1);v.map=[r,r+1];for(let Q=0;Q=4){n++,r=n;continue}break}t.line=r;const s=t.push("code_block","code",0);return s.content=t.getLines(e,r,4+t.blkIndent,!1)+` `,s.map=[e,t.line],!0}function px(t,e,i,n){let r=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||r+3>s)return!1;const o=t.src.charCodeAt(r);if(o!==126&&o!==96)return!1;let l=r;r=t.skipChars(r,o);let a=r-l;if(a<3)return!1;const u=t.src.slice(l,r),c=t.src.slice(r,s);if(o===96&&c.indexOf(String.fromCharCode(o))>=0)return!1;if(n)return!0;let h=e,f=!1;for(;h++,!(h>=i||(r=l=t.bMarks[h]+t.tShift[h],s=t.eMarks[h],r=4)&&(r=t.skipChars(r,o),!(r-l=4||t.src.charCodeAt(r)!==62)return!1;if(n)return!0;const l=[],a=[],u=[],c=[],h=t.md.block.ruler.getRules("blockquote"),f=t.parentType;t.parentType="blockquote";let d=!1,p;for(p=e;p=s)break;if(t.src.charCodeAt(r++)===62&&!y){let v=t.sCount[p]+1,Q,P;t.src.charCodeAt(r)===32?(r++,v++,P=!1,Q=!0):t.src.charCodeAt(r)===9?(Q=!0,(t.bsCount[p]+v)%4===3?(r++,v++,P=!1):P=!0):Q=!1;let _=v;for(l.push(t.bMarks[p]),t.bMarks[p]=r;r=s,a.push(t.bsCount[p]),t.bsCount[p]=t.sCount[p]+1+(Q?1:0),u.push(t.sCount[p]),t.sCount[p]=_-v,c.push(t.tShift[p]),t.tShift[p]=r-t.bMarks[p];continue}if(d)break;let w=!1;for(let v=0,Q=h.length;v";const g=[e,0];O.map=g,t.md.block.tokenize(t,e,p);const b=t.push("blockquote_close","blockquote",-1);b.markup=">",t.lineMax=o,t.parentType=f,g[1]=t.line;for(let y=0;y=4)return!1;let s=t.bMarks[e]+t.tShift[e];const o=t.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==95)return!1;let l=1;for(;s=n)return-1;let s=t.src.charCodeAt(r++);if(s<48||s>57)return-1;for(;;){if(r>=n)return-1;if(s=t.src.charCodeAt(r++),s>=48&&s<=57){if(r-i>=10)return-1;continue}if(s===41||s===46)break;return-1}return r=4||t.listIndent>=0&&t.sCount[a]-t.listIndent>=4&&t.sCount[a]=t.blkIndent&&(c=!0);let h,f,d;if((d=id(t,a))>=0){if(h=!0,o=t.bMarks[a]+t.tShift[a],f=Number(t.src.slice(o,d-1)),c&&f!==1)return!1}else if((d=td(t,a))>=0)h=!1;else return!1;if(c&&t.skipSpaces(d)>=t.eMarks[a])return!1;if(n)return!0;const p=t.src.charCodeAt(d-1),m=t.tokens.length;h?(l=t.push("ordered_list_open","ol",1),f!==1&&(l.attrs=[["start",f]])):l=t.push("bullet_list_open","ul",1);const O=[a,0];l.map=O,l.markup=String.fromCharCode(p);let g=!1;const b=t.md.block.ruler.getRules("list"),y=t.parentType;for(t.parentType="list";a=r?P=1:P=v-w,P>4&&(P=1);const _=w+P;l=t.push("list_item_open","li",1),l.markup=String.fromCharCode(p);const R=[a,0];l.map=R,h&&(l.info=t.src.slice(o,d-1));const L=t.tight,I=t.tShift[a],T=t.sCount[a],M=t.listIndent;if(t.listIndent=t.blkIndent,t.blkIndent=_,t.tight=!0,t.tShift[a]=Q-t.bMarks[a],t.sCount[a]=v,Q>=r&&t.isEmpty(a+1)?t.line=Math.min(t.line+2,i):t.md.block.tokenize(t,a,i,!0),(!t.tight||g)&&(u=!1),g=t.line-a>1&&t.isEmpty(t.line-1),t.blkIndent=t.listIndent,t.listIndent=M,t.tShift[a]=I,t.sCount[a]=T,t.tight=L,l=t.push("list_item_close","li",-1),l.markup=String.fromCharCode(p),a=t.line,R[1]=a,a>=i||t.sCount[a]=4)break;let F=!1;for(let B=0,Y=b.length;B=4||t.src.charCodeAt(r)!==91)return!1;function l(b){const y=t.lineMax;if(b>=y||t.isEmpty(b))return null;let w=!1;if(t.sCount[b]-t.blkIndent>3&&(w=!0),t.sCount[b]<0&&(w=!0),!w){const P=t.md.block.ruler.getRules("reference"),_=t.parentType;t.parentType="reference";let R=!1;for(let L=0,I=P.length;L"u"&&(t.env.references={}),typeof t.env.references[g]>"u"&&(t.env.references[g]={title:O,href:h}),t.line=o),!0):!1}const yx=["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"],xx="[a-zA-Z_:][a-zA-Z0-9:._-]*",kx="[^\"'=<>`\\x00-\\x20]+",Sx="'[^']*'",wx='"[^"]*"',$x="(?:"+kx+"|"+Sx+"|"+wx+")",Qx="(?:\\s+"+xx+"(?:\\s*=\\s*"+$x+")?)",bm="<[A-Za-z][A-Za-z0-9\\-]*"+Qx+"*\\s*\\/?>",vm="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",_x="",Px="<[?][\\s\\S]*?[?]>",Cx="]*>",Tx="",Ax=new RegExp("^(?:"+bm+"|"+vm+"|"+_x+"|"+Px+"|"+Cx+"|"+Tx+")"),Ex=new RegExp("^(?:"+bm+"|"+vm+")"),mn=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(Ex.source+"\\s*$"),/^$/,!1]];function Rx(t,e,i,n){let r=t.bMarks[e]+t.tShift[e],s=t.eMarks[e];if(t.sCount[e]-t.blkIndent>=4||!t.md.options.html||t.src.charCodeAt(r)!==60)return!1;let o=t.src.slice(r,s),l=0;for(;l=4)return!1;let o=t.src.charCodeAt(r);if(o!==35||r>=s)return!1;let l=1;for(o=t.src.charCodeAt(++r);o===35&&r6||rr&&Qe(t.src.charCodeAt(a-1))&&(s=a),t.line=e+1;const u=t.push("heading_open","h"+String(l),1);u.markup="########".slice(0,l),u.map=[e,t.line];const c=t.push("inline","",0);c.content=ea(t.src.slice(r,s)),c.map=[e,t.line],c.children=[];const h=t.push("heading_close","h"+String(l),-1);return h.markup="########".slice(0,l),!0}function Lx(t,e,i){const n=t.md.block.ruler.getRules("paragraph");if(t.sCount[e]-t.blkIndent>=4)return!1;const r=t.parentType;t.parentType="paragraph";let s=0,o,l=e+1;for(;l3)continue;if(t.sCount[l]>=t.blkIndent){let d=t.bMarks[l]+t.tShift[l];const p=t.eMarks[l];if(d=p))){s=o===61?1:2;break}}if(t.sCount[l]<0)continue;let f=!1;for(let d=0,p=n.length;d3||t.sCount[s]<0)continue;let u=!1;for(let c=0,h=n.length;c=i||t.sCount[o]=s){t.line=i;break}const a=t.line;let u=!1;for(let c=0;c=t.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");t.tight=!l,t.isEmpty(t.line-1)&&(l=!0),o=t.line,o0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(r),n};Hs.prototype.scanDelims=function(t,e){const i=this.posMax,n=this.src.charCodeAt(t);let r;if(t===0)r=32;else if(t===1)r=this.src.charCodeAt(0),(r&63488)===55296&&(r=65533);else if(r=this.src.charCodeAt(t-1),(r&64512)===56320){const O=this.src.charCodeAt(t-2);r=(O&64512)===55296?65536+(O-55296<<10)+(r-56320):65533}else(r&64512)===55296&&(r=65533);let s=t;for(;s0)return!1;const i=t.pos,n=t.posMax;if(i+3>n||t.src.charCodeAt(i)!==58||t.src.charCodeAt(i+1)!==47||t.src.charCodeAt(i+2)!==47)return!1;const r=t.pending.match(Xx);if(!r)return!1;const s=r[1],o=t.md.linkify.matchAtStart(t.src.slice(i-s.length));if(!o)return!1;let l=o.url;if(l.length<=s.length)return!1;let a=l.length;for(;a>0&&l.charCodeAt(a-1)===42;)a--;a!==l.length&&(l=l.slice(0,a));const u=t.md.normalizeLink(l);if(!t.md.validateLink(u))return!1;if(!e){t.pending=t.pending.slice(0,-s.length);const c=t.push("link_open","a",1);c.attrs=[["href",u]],c.markup="linkify",c.info="auto";const h=t.push("text","",0);h.content=t.md.normalizeLinkText(l);const f=t.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return t.pos+=l.length-s.length,!0}function jx(t,e){let i=t.pos;if(t.src.charCodeAt(i)!==10)return!1;const n=t.pending.length-1,r=t.posMax;if(!e)if(n>=0&&t.pending.charCodeAt(n)===32)if(n>=1&&t.pending.charCodeAt(n-1)===32){let s=n-1;for(;s>=1&&t.pending.charCodeAt(s-1)===32;)s--;t.pending=t.pending.slice(0,s),t.push("hardbreak","br",0)}else t.pending=t.pending.slice(0,-1),t.push("softbreak","br",0);else t.push("softbreak","br",0);for(i++;i?@[]^_`{|}~-".split("").forEach(function(t){Dc[t.charCodeAt(0)]=1});function Fx(t,e){let i=t.pos;const n=t.posMax;if(t.src.charCodeAt(i)!==92||(i++,i>=n))return!1;let r=t.src.charCodeAt(i);if(r===10){for(e||t.push("hardbreak","br",0),i++;i=55296&&r<=56319&&i+1=56320&&l<=57343&&(s+=t.src[i+1],i++)}const o="\\"+s;if(!e){const l=t.push("text_special","",0);r<256&&Dc[r]!==0?l.content=s:l.content=o,l.markup=o,l.info="escape"}return t.pos=i+1,!0}function Bx(t,e){let i=t.pos;if(t.src.charCodeAt(i)!==96)return!1;const r=i;i++;const s=t.posMax;for(;i=0;n--){const r=e[n];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const s=e[r.end],o=n>0&&e[n-1].end===r.end+1&&e[n-1].marker===r.marker&&e[n-1].token===r.token-1&&e[r.end+1].token===s.token+1,l=String.fromCharCode(r.marker),a=t.tokens[r.token];a.type=o?"strong_open":"em_open",a.tag=o?"strong":"em",a.nesting=1,a.markup=o?l+l:l,a.content="";const u=t.tokens[s.token];u.type=o?"strong_close":"em_close",u.tag=o?"strong":"em",u.nesting=-1,u.markup=o?l+l:l,u.content="",o&&(t.tokens[e[n-1].token].content="",t.tokens[e[r.end+1].token].content="",n--)}}function Yx(t){const e=t.tokens_meta,i=t.tokens_meta.length;rd(t,t.delimiters);for(let n=0;n=h)return!1;if(a=p,r=t.md.helpers.parseLinkDestination(t.src,p,t.posMax),r.ok){for(o=t.md.normalizeLink(r.str),t.md.validateLink(o)?p=r.pos:o="",a=p;p=h||t.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof t.env.references>"u")return!1;if(p=0?n=t.src.slice(a,p++):p=d+1):p=d+1,n||(n=t.src.slice(f,d)),s=t.env.references[Jl(n)],!s)return t.pos=c,!1;o=s.href,l=s.title}if(!e){t.pos=f,t.posMax=d;const m=t.push("link_open","a",1),O=[["href",o]];m.attrs=O,l&&O.push(["title",l]),t.linkLevel++,t.md.inline.tokenize(t),t.linkLevel--,t.push("link_close","a",-1)}return t.pos=p,t.posMax=h,!0}function Gx(t,e){let i,n,r,s,o,l,a,u,c="";const h=t.pos,f=t.posMax;if(t.src.charCodeAt(t.pos)!==33||t.src.charCodeAt(t.pos+1)!==91)return!1;const d=t.pos+2,p=t.md.helpers.parseLinkLabel(t,t.pos+1,!1);if(p<0)return!1;if(s=p+1,s=f)return!1;for(u=s,l=t.md.helpers.parseLinkDestination(t.src,s,t.posMax),l.ok&&(c=t.md.normalizeLink(l.str),t.md.validateLink(c)?s=l.pos:c=""),u=s;s=f||t.src.charCodeAt(s)!==41)return t.pos=h,!1;s++}else{if(typeof t.env.references>"u")return!1;if(s=0?r=t.src.slice(u,s++):s=p+1):s=p+1,r||(r=t.src.slice(d,p)),o=t.env.references[Jl(r)],!o)return t.pos=h,!1;c=o.href,a=o.title}if(!e){n=t.src.slice(d,p);const m=[];t.md.inline.parse(n,t.md,t.env,m);const O=t.push("image","img",0),g=[["src",c],["alt",""]];O.attrs=g,O.children=m,O.content=n,a&&g.push(["title",a])}return t.pos=s,t.posMax=f,!0}const Ux=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Hx=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Kx(t,e){let i=t.pos;if(t.src.charCodeAt(i)!==60)return!1;const n=t.pos,r=t.posMax;for(;;){if(++i>=r)return!1;const o=t.src.charCodeAt(i);if(o===60)return!1;if(o===62)break}const s=t.src.slice(n+1,i);if(Hx.test(s)){const o=t.md.normalizeLink(s);if(!t.md.validateLink(o))return!1;if(!e){const l=t.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const a=t.push("text","",0);a.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}if(Ux.test(s)){const o=t.md.normalizeLink("mailto:"+s);if(!t.md.validateLink(o))return!1;if(!e){const l=t.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const a=t.push("text","",0);a.content=t.md.normalizeLinkText(s);const u=t.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return t.pos+=s.length+2,!0}return!1}function Jx(t){return/^\s]/i.test(t)}function e2(t){return/^<\/a\s*>/i.test(t)}function t2(t){const e=t|32;return e>=97&&e<=122}function i2(t,e){if(!t.md.options.html)return!1;const i=t.posMax,n=t.pos;if(t.src.charCodeAt(n)!==60||n+2>=i)return!1;const r=t.src.charCodeAt(n+1);if(r!==33&&r!==63&&r!==47&&!t2(r))return!1;const s=t.src.slice(n).match(Ax);if(!s)return!1;if(!e){const o=t.push("html_inline","",0);o.content=s[0],Jx(o.content)&&t.linkLevel++,e2(o.content)&&t.linkLevel--}return t.pos+=s[0].length,!0}const n2=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,r2=/^&([a-z][a-z0-9]{1,31});/i;function s2(t,e){const i=t.pos,n=t.posMax;if(t.src.charCodeAt(i)!==38||i+1>=n)return!1;if(t.src.charCodeAt(i+1)===35){const s=t.src.slice(i).match(n2);if(s){if(!e){const o=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=t.push("text_special","",0);l.content=Ec(o)?ks(o):ks(65533),l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}else{const s=t.src.slice(i).match(r2);if(s){const o=wy(s[0]);if(o!==s[0]){if(!e){const l=t.push("text_special","",0);l.content=o,l.markup=s[0],l.info="entity"}return t.pos+=s[0].length,!0}}}return!1}function sd(t){const e={},i=t.length;if(!i)return;let n=0,r=-2;const s=[];for(let o=0;oa;u-=s[u]+1){const h=t[u];if(h.marker===l.marker&&h.open&&h.end<0){let f=!1;if((h.close||l.open)&&(h.length+l.length)%3===0&&(h.length%3!==0||l.length%3!==0)&&(f=!0),!f){const d=u>0&&!t[u-1].open?s[u-1]+1:0;s[o]=o-u+d,s[u]=d,l.open=!1,h.end=o,h.close=!1,c=-1,r=-2;break}}}c!==-1&&(e[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}function o2(t){const e=t.tokens_meta,i=t.tokens_meta.length;sd(t.delimiters);for(let n=0;n0&&n++,r[e].type==="text"&&e+1=t.pos)throw new Error("inline rule didn't increment state.pos");break}}else t.pos=t.posMax;o||t.pos++,s[e]=t.pos};Ks.prototype.tokenize=function(t){const e=this.ruler.getRules(""),i=e.length,n=t.posMax,r=t.md.options.maxNesting;for(;t.pos=t.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(t.pos>=n)break;continue}t.pending+=t.src[t.pos++]}t.pending&&t.pushPending()};Ks.prototype.parse=function(t,e,i,n){const r=new this.State(t,e,i,n);this.tokenize(r);const s=this.ruler2.getRules(""),o=s.length;for(let l=0;l|$))`,e.tpl_email_fuzzy=`(^|${i}|"|\\(|${e.src_ZCc})(${e.src_email_name}@${e.tpl_host_fuzzy_strict})`,e.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${e.src_ZPCc}))((?![$+<=>^\`||])${e.tpl_host_port_fuzzy_strict}${e.src_path})`,e.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${e.src_ZPCc}))((?![$+<=>^\`||])${e.tpl_host_port_no_ip_fuzzy_strict}${e.src_path})`,e}function yu(t){return Array.prototype.slice.call(arguments,1).forEach(function(i){i&&Object.keys(i).forEach(function(n){t[n]=i[n]})}),t}function ia(t){return Object.prototype.toString.call(t)}function u2(t){return ia(t)==="[object String]"}function c2(t){return ia(t)==="[object Object]"}function h2(t){return ia(t)==="[object RegExp]"}function od(t){return ia(t)==="[object Function]"}function f2(t){return t.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const km={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function d2(t){return Object.keys(t||{}).reduce(function(e,i){return e||km.hasOwnProperty(i)},!1)}const p2={"http:":{validate:function(t,e,i){const n=t.slice(e);return i.re.http||(i.re.http=new RegExp(`^\\/\\/${i.re.src_auth}${i.re.src_host_port_strict}${i.re.src_path}`,"i")),i.re.http.test(n)?n.match(i.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(t,e,i){const n=t.slice(e);return i.re.no_http||(i.re.no_http=new RegExp("^"+i.re.src_auth+`(?:localhost|(?:(?:${i.re.src_domain})\\.)+${i.re.src_domain_root})`+i.re.src_port+i.re.src_host_terminator+i.re.src_path,"i")),i.re.no_http.test(n)?e>=3&&t[e-3]===":"||e>=3&&t[e-3]==="/"?0:n.match(i.re.no_http)[0].length:0}},"mailto:":{validate:function(t,e,i){const n=t.slice(e);return i.re.mailto||(i.re.mailto=new RegExp(`^${i.re.src_email_name}@${i.re.src_host_strict}`,"i")),i.re.mailto.test(n)?n.match(i.re.mailto)[0].length:0}}},m2="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",O2="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function g2(t){return function(e,i){const n=e.slice(i);return t.test(n)?n.match(t)[0].length:0}}function ld(){return function(t,e){e.normalize(t)}}function Ol(t){const e=t.re=a2(t.__opts__),i=t.__tlds__.slice();t.onCompile(),t.__tlds_replaced__||i.push(m2),i.push(e.src_xn),e.src_tlds=i.join("|");function n(l){return l.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(n(e.tpl_email_fuzzy),"i"),e.email_fuzzy_global=RegExp(n(e.tpl_email_fuzzy),"ig"),e.link_fuzzy=RegExp(n(e.tpl_link_fuzzy),"i"),e.link_fuzzy_global=RegExp(n(e.tpl_link_fuzzy),"ig"),e.link_no_ip_fuzzy=RegExp(n(e.tpl_link_no_ip_fuzzy),"i"),e.link_no_ip_fuzzy_global=RegExp(n(e.tpl_link_no_ip_fuzzy),"ig"),e.host_fuzzy_test=RegExp(n(e.tpl_host_fuzzy_test),"i");const r=[];t.__compiled__={};function s(l,a){throw new Error(`(LinkifyIt) Invalid schema "${l}": ${a}`)}Object.keys(t.__schemas__).forEach(function(l){const a=t.__schemas__[l];if(a===null)return;const u={validate:null,link:null};if(t.__compiled__[l]=u,c2(a)){h2(a.validate)?u.validate=g2(a.validate):od(a.validate)?u.validate=a.validate:s(l,a),od(a.normalize)?u.normalize=a.normalize:a.normalize?s(l,a):u.normalize=ld();return}if(u2(a)){r.push(l);return}s(l,a)}),r.forEach(function(l){t.__compiled__[t.__schemas__[l]]&&(t.__compiled__[l].validate=t.__compiled__[t.__schemas__[l]].validate,t.__compiled__[l].normalize=t.__compiled__[t.__schemas__[l]].normalize)}),t.__compiled__[""]={validate:null,normalize:ld()};const o=Object.keys(t.__compiled__).filter(function(l){return l.length>0&&t.__compiled__[l]}).map(f2).join("|");t.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${e.src_ZPCc}))(${o})`,"i"),t.re.schema_search=RegExp(`(^|(?!_)(?:[><|]|${e.src_ZPCc}))(${o})`,"ig"),t.re.schema_at_start=RegExp(`^${t.re.schema_search.source}`,"i"),t.re.pretest=RegExp(`(${t.re.schema_test.source})|(${t.re.host_fuzzy_test.source})|@`,"i")}function Sm(t,e,i,n){const r=t.slice(i,n);this.schema=e.toLowerCase(),this.index=i,this.lastIndex=n,this.raw=r,this.text=r,this.url=r}function Lt(t,e){if(!(this instanceof Lt))return new Lt(t,e);e||d2(t)&&(e=t,t={}),this.__opts__=yu({},km,e),this.__schemas__=yu({},p2,t),this.__compiled__={},this.__tlds__=O2,this.__tlds_replaced__=!1,this.re={},Ol(this)}Lt.prototype.add=function(e,i){return this.__schemas__[e]=i,Ol(this),this};Lt.prototype.set=function(e){return this.__opts__=yu(this.__opts__,e),this};Lt.prototype.test=function(e){if(!e.length)return!1;let i,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(i=n.exec(e))!==null;)if(this.testSchemaAt(e,i[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&e.indexOf("@")>=0&&e.match(this.re.email_fuzzy)!==null)};Lt.prototype.pretest=function(e){return this.re.pretest.test(e)};Lt.prototype.testSchemaAt=function(e,i,n){return this.__compiled__[i.toLowerCase()]?this.__compiled__[i.toLowerCase()].validate(e,n,this):0};Lt.prototype.match=function(e){const i=[],n=[],r=[],s=[];let o,l,a;function u(f,d){return f?d?f.index!==d.index?f.index=d.lastIndex?f:d:f:d}if(!e.length)return null;if(this.re.schema_test.test(e))for(a=this.re.schema_search,a.lastIndex=0;(o=a.exec(e))!==null;)l=this.testSchemaAt(e,o[2],a.lastIndex),l&&n.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+l});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(a=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,a.lastIndex=0;(o=a.exec(e))!==null;)r.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(a=this.re.email_fuzzy_global,a.lastIndex=0;(o=a.exec(e))!==null;)s.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const c=[0,0,0];let h=0;for(;;){const f=[n[c[0]],s[c[1]],r[c[2]]],d=u(u(f[0],f[1]),f[2]);if(!d)break;if(d===f[0]?c[0]++:d===f[1]?c[1]++:c[2]++,d.index= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$a=vi-Lc,yi=Math.floor,Qa=String.fromCharCode;function Yi(t){throw new RangeError(S2[t])}function w2(t,e){const i=[];let n=t.length;for(;n--;)i[n]=e(t[n]);return i}function _m(t,e){const i=t.split("@");let n="";i.length>1&&(n=i[0]+"@",t=i[1]),t=t.replace(k2,".");const r=t.split("."),s=w2(r,e).join(".");return n+s}function Pm(t){const e=[];let i=0;const n=t.length;for(;i=55296&&r<=56319&&iString.fromCodePoint(...t),Q2=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:vi},ad=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Cm=function(t,e,i){let n=0;for(t=i?yi(t/v2):t>>1,t+=yi(t/e);t>$a*Qs>>1;n+=vi)t=yi(t/$a);return yi(n+($a+1)*t/(t+b2))},Tm=function(t){const e=[],i=t.length;let n=0,r=$m,s=wm,o=t.lastIndexOf(Qm);o<0&&(o=0);for(let l=0;l=128&&Yi("not-basic"),e.push(t.charCodeAt(l));for(let l=o>0?o+1:0;l=i&&Yi("invalid-input");const f=Q2(t.charCodeAt(l++));f>=vi&&Yi("invalid-input"),f>yi((Kn-n)/c)&&Yi("overflow"),n+=f*c;const d=h<=s?Lc:h>=s+Qs?Qs:h-s;if(fyi(Kn/p)&&Yi("overflow"),c*=p}const u=e.length+1;s=Cm(n-a,u,a==0),yi(n/u)>Kn-r&&Yi("overflow"),r+=yi(n/u),n%=u,e.splice(n++,0,r)}return String.fromCodePoint(...e)},Am=function(t){const e=[];t=Pm(t);const i=t.length;let n=$m,r=0,s=wm;for(const a of t)a<128&&e.push(Qa(a));const o=e.length;let l=o;for(o&&e.push(Qm);l=n&&cyi((Kn-r)/u)&&Yi("overflow"),r+=(a-n)*u,n=a;for(const c of t)if(cKn&&Yi("overflow"),c===n){let h=r;for(let f=vi;;f+=vi){const d=f<=s?Lc:f>=s+Qs?Qs:f-s;if(h=0))try{e.hostname=Em.toASCII(e.hostname)}catch{}return Us(Pc(e))}function Z2(t){const e=Cc(t,!0);if(e.hostname&&(!e.protocol||Rm.indexOf(e.protocol)>=0))try{e.hostname=Em.toUnicode(e.hostname)}catch{}return pr(Pc(e),pr.defaultChars+"%")}function Wt(t,e){if(!(this instanceof Wt))return new Wt(t,e);e||Ac(t)||(e=t||{},t="default"),this.inline=new Ks,this.block=new ta,this.core=new Rc,this.renderer=new Ar,this.linkify=new Lt,this.validateLink=L2,this.normalizeLink=M2,this.normalizeLinkText=Z2,this.utils=zy,this.helpers=Kl({},Vy),this.options={},this.configure(t),e&&this.set(e)}Wt.prototype.set=function(t){return Kl(this.options,t),this};Wt.prototype.configure=function(t){const e=this;if(Ac(t)){const i=t;if(t=E2[i],!t)throw new Error('Wrong `markdown-it` preset "'+i+'", check name')}if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");return t.options&&e.set(t.options),t.components&&Object.keys(t.components).forEach(function(i){t.components[i].rules&&e[i].ruler.enableOnly(t.components[i].rules),t.components[i].rules2&&e[i].ruler2.enableOnly(t.components[i].rules2)}),this};Wt.prototype.enable=function(t,e){let i=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(r){i=i.concat(this[r].ruler.enable(t,!0))},this),i=i.concat(this.inline.ruler2.enable(t,!0));const n=t.filter(function(r){return i.indexOf(r)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};Wt.prototype.disable=function(t,e){let i=[];Array.isArray(t)||(t=[t]),["core","block","inline"].forEach(function(r){i=i.concat(this[r].ruler.disable(t,!0))},this),i=i.concat(this.inline.ruler2.disable(t,!0));const n=t.filter(function(r){return i.indexOf(r)<0});if(n.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};Wt.prototype.use=function(t){const e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this};Wt.prototype.parse=function(t,e){if(typeof t!="string")throw new Error("Input data should be a String");const i=new this.core.State(t,this,e);return this.core.process(i),i.tokens};Wt.prototype.render=function(t,e){return e=e||{},this.renderer.render(this.parse(t,e),this.options,e)};Wt.prototype.parseInline=function(t,e){const i=new this.core.State(t,this,e);return i.inlineMode=!0,this.core.process(i),i.tokens};Wt.prototype.renderInline=function(t,e){return e=e||{},this.renderer.render(this.parseInline(t,e),this.options,e)};const ud=new Set([!0,!1,"alt","title"]);function Dm(t,e){return(Array.isArray(t)?t:[]).filter(([i])=>i!==e)}function Lm(t,e){t&&t.attrs&&(t.attrs=Dm(t.attrs,e))}function I2(t,e){if(!ud.has(t))throw new TypeError(`figcaption must be one of: ${[...ud]}.`);if(t==="alt")return e.content;const i=e.attrs.find(([n])=>n==="title");return Array.isArray(i)&&i[1]?(Lm(e,"title"),i[1]):void 0}function X2(t,e){e=e||{},t.core.ruler.before("linkify","image_figures",function(i){let n=1;for(let r=1,s=i.tokens.length;rc.match(u)).map(c=>Array.from(c))}if(e.tabindex&&(i.tokens[r-1].attrPush(["tabindex",n]),n++),e.lazy&&(a.attrs.some(([u])=>u==="loading")||a.attrs.push(["loading","lazy"])),e.async&&(a.attrs.some(([u])=>u==="decoding")||a.attrs.push(["decoding","async"])),e.classes&&typeof e.classes=="string"){let u=!1;for(let c=0,h=a.attrs.length;cc==="src");a.attrs.push(["data-src",u[1]]),Lm(a,"src")}}})}const z2=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function j2(t,e){const i=t.posMax,n=t.pos;if(t.src.charCodeAt(n)!==126||e||n+2>=i)return!1;t.pos=n+1;let r=!1;for(;t.pos?@[\]^_`{|}~-])/g;function V2(t,e){const i=t.posMax,n=t.pos;if(t.src.charCodeAt(n)!==94||e||n+2>=i)return!1;t.pos=n+1;let r=!1;for(;t.pos{const i=t.split(","),n=i[0].match(/:(.*?);/);if(n){const r=n[1],s=atob(i[1]);let o=s.length;const l=new Uint8Array(o);for(;o--;)l[o]=s.charCodeAt(o);return new File([l],e,{type:r})}return null},Y2=(t,e)=>{if(!t)return t;const i=e.split(` `),n=['"),`${t}${n.join("")}`},N2=(t,e)=>{if(!t||!e)return 0;const i=t==null?void 0:t.getBoundingClientRect();if(e===document.documentElement)return i.top-e.clientTop;const n=e==null?void 0:e.getBoundingClientRect();return i.top-n.top},cd=(()=>{let t=0;return()=>++t})();var G2={hasSubscribers:!1},U2=G2,H2=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Mm=new Set,hd=typeof process=="object"&&process?process:{},K2=(t,e,i,n)=>{typeof hd.emitWarning=="function"?hd.emitWarning(t,e,i,n):console.error(`[${i}] ${e}: ${t}`)},J2=t=>!Mm.has(t),Bi=t=>!!t&&t===Math.floor(t)&&t>0&&isFinite(t),Zm=t=>Bi(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ho:null:null,Ho=class extends Array{constructor(t){super(t),this.fill(0)}},wi,ar,ek=(wi=class{constructor(e,i){Ze(this,"heap");Ze(this,"length");if(!S(wi,ar))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0}static create(e){let i=Zm(e);if(!i)return[];U(wi,ar,!0);let n=new wi(e,i);return U(wi,ar,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ar=new WeakMap,oe(wi,ar,!1),wi),Up,Hp,Xt,wt,Ut,Sn,Ht,ur,cr,Kt,je,Jt,Ie,_e,ne,ot,$t,it,Ve,ei,qe,ti,ii,Qt,_t,ni,hr,lt,wn,Z,xu,$n,Ai,Ys,Pt,Im,Qn,fr,Ns,Vi,qi,ku,Vn,Ko,Xm,zm,Jo,we,Su,jm,Fm,Hr,wu,Kr,Wi,$u,dr,tk=(dr=class{constructor(e){oe(this,Z);oe(this,Xt);oe(this,wt);oe(this,Ut);oe(this,Sn);oe(this,Ht);oe(this,ur);oe(this,cr);oe(this,Kt);Ze(this,"ttl");Ze(this,"ttlResolution");Ze(this,"ttlAutopurge");Ze(this,"updateAgeOnGet");Ze(this,"updateAgeOnHas");Ze(this,"allowStale");Ze(this,"noDisposeOnSet");Ze(this,"noUpdateTTL");Ze(this,"maxEntrySize");Ze(this,"sizeCalculation");Ze(this,"noDeleteOnFetchRejection");Ze(this,"noDeleteOnStaleGet");Ze(this,"allowStaleOnFetchAbort");Ze(this,"allowStaleOnFetchRejection");Ze(this,"ignoreFetchAbort");Ze(this,"backgroundFetchSize");oe(this,je);oe(this,Jt);oe(this,Ie);oe(this,_e);oe(this,ne);oe(this,ot);oe(this,$t);oe(this,it);oe(this,Ve);oe(this,ei);oe(this,qe);oe(this,ti);oe(this,ii);oe(this,Qt);oe(this,_t);oe(this,ni);oe(this,hr);oe(this,lt);oe(this,wn);oe(this,$n,()=>{});oe(this,Ai,()=>{});oe(this,Ys,()=>{});oe(this,Pt,()=>!1);oe(this,Qn,e=>{});oe(this,fr,(e,i,n)=>{});oe(this,Ns,(e,i,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Ze(this,Up,"LRUCache");let{max:i=0,ttl:n,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:a,dispose:u,onInsert:c,disposeAfter:h,noDisposeOnSet:f,noUpdateTTL:d,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:O,fetchMethod:g,memoMethod:b,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:Q,ignoreFetchAbort:P,backgroundFetchSize:_=1,perf:R}=e;if(this.backgroundFetchSize=_,R!==void 0&&typeof(R==null?void 0:R.now)!="function")throw new TypeError("perf option must have a now() method if specified");if(U(this,Kt,R??H2),i!==0&&!Bi(i))throw new TypeError("max option must be a nonnegative integer");let L=i?Zm(i):Array;if(!L)throw new Error("invalid max value: "+i);if(U(this,Xt,i),U(this,wt,p),this.maxEntrySize=m||S(this,wt),this.sizeCalculation=O,this.sizeCalculation){if(!S(this,wt)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(U(this,cr,b),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(U(this,ur,g),U(this,hr,!!g),U(this,Ie,new Map),U(this,_e,Array.from({length:i}).fill(void 0)),U(this,ne,Array.from({length:i}).fill(void 0)),U(this,ot,new L(i)),U(this,$t,new L(i)),U(this,it,0),U(this,Ve,0),U(this,ei,ek.create(i)),U(this,je,0),U(this,Jt,0),typeof u=="function"&&U(this,Ut,u),typeof c=="function"&&U(this,Sn,c),typeof h=="function"?(U(this,Ht,h),U(this,qe,[])):(U(this,Ht,void 0),U(this,qe,void 0)),U(this,ni,!!S(this,Ut)),U(this,wn,!!S(this,Sn)),U(this,lt,!!S(this,Ht)),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!Q,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(S(this,wt)!==0&&!Bi(S(this,wt)))throw new TypeError("maxSize must be a positive integer if specified");if(!Bi(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");j(this,Z,Im).call(this)}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=Bi(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Bi(this.ttl))throw new TypeError("ttl must be a positive integer if specified");j(this,Z,xu).call(this)}if(S(this,Xt)===0&&this.ttl===0&&S(this,wt)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!S(this,Xt)&&!S(this,wt)){let I="LRU_CACHE_UNBOUNDED";J2(I)&&(Mm.add(I),K2("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",I,dr))}}get perf(){return S(this,Kt)}static unsafeExposeInternals(e){return{starts:S(e,ii),ttls:S(e,Qt),autopurgeTimers:S(e,_t),sizes:S(e,ti),keyMap:S(e,Ie),keyList:S(e,_e),valList:S(e,ne),next:S(e,ot),prev:S(e,$t),get head(){return S(e,it)},get tail(){return S(e,Ve)},free:S(e,ei),isBackgroundFetch:i=>{var n;return j(n=e,Z,we).call(n,i)},backgroundFetch:(i,n,r,s)=>{var o;return j(o=e,Z,Jo).call(o,i,n,r,s)},moveToTail:i=>{var n;return j(n=e,Z,Kr).call(n,i)},indexes:i=>{var n;return j(n=e,Z,Vi).call(n,i)},rindexes:i=>{var n;return j(n=e,Z,qi).call(n,i)},isStale:i=>{var n;return S(n=e,Pt).call(n,i)}}}get max(){return S(this,Xt)}get maxSize(){return S(this,wt)}get calculatedSize(){return S(this,Jt)}get size(){return S(this,je)}get fetchMethod(){return S(this,ur)}get memoMethod(){return S(this,cr)}get dispose(){return S(this,Ut)}get onInsert(){return S(this,Sn)}get disposeAfter(){return S(this,Ht)}getRemainingTTL(e){return S(this,Ie).has(e)?1/0:0}*entries(){for(let e of j(this,Z,Vi).call(this))S(this,ne)[e]!==void 0&&S(this,_e)[e]!==void 0&&!j(this,Z,we).call(this,S(this,ne)[e])&&(yield[S(this,_e)[e],S(this,ne)[e]])}*rentries(){for(let e of j(this,Z,qi).call(this))S(this,ne)[e]!==void 0&&S(this,_e)[e]!==void 0&&!j(this,Z,we).call(this,S(this,ne)[e])&&(yield[S(this,_e)[e],S(this,ne)[e]])}*keys(){for(let e of j(this,Z,Vi).call(this)){let i=S(this,_e)[e];i!==void 0&&!j(this,Z,we).call(this,S(this,ne)[e])&&(yield i)}}*rkeys(){for(let e of j(this,Z,qi).call(this)){let i=S(this,_e)[e];i!==void 0&&!j(this,Z,we).call(this,S(this,ne)[e])&&(yield i)}}*values(){for(let e of j(this,Z,Vi).call(this))S(this,ne)[e]!==void 0&&!j(this,Z,we).call(this,S(this,ne)[e])&&(yield S(this,ne)[e])}*rvalues(){for(let e of j(this,Z,qi).call(this))S(this,ne)[e]!==void 0&&!j(this,Z,we).call(this,S(this,ne)[e])&&(yield S(this,ne)[e])}[(Hp=Symbol.iterator,Up=Symbol.toStringTag,Hp)](){return this.entries()}find(e,i={}){for(let n of j(this,Z,Vi).call(this)){let r=S(this,ne)[n],s=j(this,Z,we).call(this,r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,S(this,_e)[n],this))return j(this,Z,Hr).call(this,S(this,_e)[n],i)}}forEach(e,i=this){for(let n of j(this,Z,Vi).call(this)){let r=S(this,ne)[n],s=j(this,Z,we).call(this,r)?r.__staleWhileFetching:r;s!==void 0&&e.call(i,s,S(this,_e)[n],this)}}rforEach(e,i=this){for(let n of j(this,Z,qi).call(this)){let r=S(this,ne)[n],s=j(this,Z,we).call(this,r)?r.__staleWhileFetching:r;s!==void 0&&e.call(i,s,S(this,_e)[n],this)}}purgeStale(){let e=!1;for(let i of j(this,Z,qi).call(this,{allowStale:!0}))S(this,Pt).call(this,i)&&(j(this,Z,Wi).call(this,S(this,_e)[i],"expire"),e=!0);return e}info(e){let i=S(this,Ie).get(e);if(i===void 0)return;let n=S(this,ne)[i],r=j(this,Z,we).call(this,n)?n.__staleWhileFetching:n;if(r===void 0)return;let s={value:r};if(S(this,Qt)&&S(this,ii)){let o=S(this,Qt)[i],l=S(this,ii)[i];if(o&&l){let a=o-(S(this,Kt).now()-l);s.ttl=a,s.start=Date.now()}}return S(this,ti)&&(s.size=S(this,ti)[i]),s}dump(){let e=[];for(let i of j(this,Z,Vi).call(this,{allowStale:!0})){let n=S(this,_e)[i],r=S(this,ne)[i],s=j(this,Z,we).call(this,r)?r.__staleWhileFetching:r;if(s===void 0||n===void 0)continue;let o={value:s};if(S(this,Qt)&&S(this,ii)){o.ttl=S(this,Qt)[i];let l=S(this,Kt).now()-S(this,ii)[i];o.start=Math.floor(Date.now()-l)}S(this,ti)&&(o.size=S(this,ti)[i]),e.unshift([n,o])}return e}load(e){this.clear();for(let[i,n]of e){if(n.start){let r=Date.now()-n.start;n.start=S(this,Kt).now()-r}j(this,Z,Vn).call(this,i,n.value,n)}}set(e,i,n={}){let{status:r=void 0}=n;return n.status=r,r&&(r.op="set",r.key=e,i!==void 0&&(r.value=i),r.cache=this),j(this,Z,Vn).call(this,e,i,n)}pop(){var e;try{for(;S(this,je);){let i=S(this,ne)[S(this,it)];if(j(this,Z,Ko).call(this,!0),j(this,Z,we).call(this,i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(S(this,lt)&&S(this,qe)){let i=S(this,qe),n;for(;n=i==null?void 0:i.shift();)(e=S(this,Ht))==null||e.call(this,...n)}}}has(e,i={}){let{status:n=void 0}=i;return i.status=n,n&&(n.op="has",n.key=e,n.cache=this),j(this,Z,Xm).call(this,e,i)}peek(e,i={}){let{status:n=void 0}=i;return n&&(n.op="peek",n.key=e,n.cache=this),i.status=n,j(this,Z,zm).call(this,e,i)}fetch(e,i={}){let{status:n=void 0}=i;return i.status=n,n&&i.context&&(n.context=i.context),j(this,Z,Su).call(this,e,i)}forceFetch(e,i={}){let{status:n=void 0}=i;return i.status=n,n&&i.context&&(n.context=i.context),j(this,Z,jm).call(this,e,i)}memo(e,i={}){let{status:n=void 0}=i;i.status=n,n&&(n.op="memo",n.key=e,i.context&&(n.context=i.context),n.cache=this);let r=j(this,Z,Fm).call(this,e,i);return n&&(n.value=r),r}get(e,i={}){let{status:n=void 0}=i;i.status=n,n&&(n.op="get",n.key=e,n.cache=this);let r=j(this,Z,Hr).call(this,e,i);return n&&(r!==void 0&&(n.value=r),U2.hasSubscribers),r}delete(e){return j(this,Z,Wi).call(this,e,"delete")}clear(){return j(this,Z,$u).call(this,"delete")}},Xt=new WeakMap,wt=new WeakMap,Ut=new WeakMap,Sn=new WeakMap,Ht=new WeakMap,ur=new WeakMap,cr=new WeakMap,Kt=new WeakMap,je=new WeakMap,Jt=new WeakMap,Ie=new WeakMap,_e=new WeakMap,ne=new WeakMap,ot=new WeakMap,$t=new WeakMap,it=new WeakMap,Ve=new WeakMap,ei=new WeakMap,qe=new WeakMap,ti=new WeakMap,ii=new WeakMap,Qt=new WeakMap,_t=new WeakMap,ni=new WeakMap,hr=new WeakMap,lt=new WeakMap,wn=new WeakMap,Z=new WeakSet,xu=function(){let e=new Ho(S(this,Xt)),i=new Ho(S(this,Xt));U(this,Qt,e),U(this,ii,i);let n=this.ttlAutopurge?Array.from({length:S(this,Xt)}):void 0;U(this,_t,n),U(this,Ys,(a,u,c=S(this,Kt).now())=>{i[a]=u!==0?c:0,e[a]=u,r(a,u)}),U(this,$n,a=>{i[a]=e[a]!==0?S(this,Kt).now():0,r(a,e[a])});let r=this.ttlAutopurge?(a,u)=>{if(n!=null&&n[a]&&(clearTimeout(n[a]),n[a]=void 0),u&&u!==0&&n){let c=setTimeout(()=>{S(this,Pt).call(this,a)?(j(this,Z,Wi).call(this,S(this,_e)[a],"expire"),n[a]=void 0):r(a,l(a))},u+1);c.unref&&c.unref(),n[a]=c}}:()=>{};U(this,Ai,(a,u)=>{if(e[u]){let c=e[u],h=i[u];if(!c||!h)return;a.ttl=c,a.start=h,a.now=s||o();let f=a.now-h;a.remainingTTL=c-f}});let s=0,o=()=>{let a=S(this,Kt).now();if(this.ttlResolution>0){s=a;let u=setTimeout(()=>s=0,this.ttlResolution);u.unref&&u.unref()}return a};this.getRemainingTTL=a=>{let u=S(this,Ie).get(a);return u===void 0?0:l(u)};let l=a=>{let u=e[a],c=i[a];if(!u||!c)return 1/0;let h=(s||o())-c;return u-h};U(this,Pt,a=>{let u=i[a],c=e[a];return!!c&&!!u&&(s||o())-u>c})},$n=new WeakMap,Ai=new WeakMap,Ys=new WeakMap,Pt=new WeakMap,Im=function(){let e=new Ho(S(this,Xt));U(this,Jt,0),U(this,ti,e),U(this,Qn,i=>{U(this,Jt,S(this,Jt)-e[i]),e[i]=0}),U(this,Ns,(i,n,r,s)=>{if(!Bi(r)){if(j(this,Z,we).call(this,n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(n,i),!Bi(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return r}),U(this,fr,(i,n,r)=>{if(e[i]=n,S(this,wt)){let s=S(this,wt)-e[i];for(;S(this,Jt)>s;)j(this,Z,Ko).call(this,!0)}U(this,Jt,S(this,Jt)+e[i]),r&&(r.entrySize=n,r.totalCalculatedSize=S(this,Jt))})},Qn=new WeakMap,fr=new WeakMap,Ns=new WeakMap,Vi=function*({allowStale:e=this.allowStale}={}){if(S(this,je))for(let i=S(this,Ve);j(this,Z,ku).call(this,i)&&((e||!S(this,Pt).call(this,i))&&(yield i),i!==S(this,it));)i=S(this,$t)[i]},qi=function*({allowStale:e=this.allowStale}={}){if(S(this,je))for(let i=S(this,it);j(this,Z,ku).call(this,i)&&((e||!S(this,Pt).call(this,i))&&(yield i),i!==S(this,Ve));)i=S(this,ot)[i]},ku=function(e){return e!==void 0&&S(this,Ie).get(S(this,_e)[e])===e},Vn=function(e,i,n,r){var p,m,O,g,b,y,w,v;let{ttl:s=this.ttl,start:o,noDisposeOnSet:l=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:u}=n,c=j(this,Z,we).call(this,i);if(i===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:h=this.noUpdateTTL}=n;u&&!c&&(u.value=i);let f=S(this,Ns).call(this,e,i,n.size||0,a,u);if(this.maxEntrySize&&f>this.maxEntrySize)return j(this,Z,Wi).call(this,e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let d=S(this,je)===0?void 0:S(this,Ie).get(e);if(d===void 0)d=S(this,je)===0?S(this,Ve):S(this,ei).length!==0?S(this,ei).pop():S(this,je)===S(this,Xt)?j(this,Z,Ko).call(this,!1):S(this,je),S(this,_e)[d]=e,S(this,ne)[d]=i,S(this,Ie).set(e,d),S(this,ot)[S(this,Ve)]=d,S(this,$t)[d]=S(this,Ve),U(this,Ve,d),mo(this,je)._++,S(this,fr).call(this,d,f,u),u&&(u.set="add"),h=!1,S(this,wn)&&!c&&((p=S(this,Sn))==null||p.call(this,i,e,"add"));else{j(this,Z,Kr).call(this,d);let Q=S(this,ne)[d];if(i!==Q){if(!l)if(j(this,Z,we).call(this,Q)){Q!==r&&Q.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:P}=Q;P!==void 0&&P!==i&&(S(this,ni)&&((m=S(this,Ut))==null||m.call(this,P,e,"set")),S(this,lt)&&((O=S(this,qe))==null||O.push([P,e,"set"])))}else S(this,ni)&&((g=S(this,Ut))==null||g.call(this,Q,e,"set")),S(this,lt)&&((b=S(this,qe))==null||b.push([Q,e,"set"]));if(S(this,Qn).call(this,d),S(this,fr).call(this,d,f,u),S(this,ne)[d]=i,!c){let P=Q&&j(this,Z,we).call(this,Q)?Q.__staleWhileFetching:Q,_=P===void 0?"add":i!==P?"replace":"update";u&&(u.set=_,P!==void 0&&(u.oldValue=P)),S(this,wn)&&((y=this.onInsert)==null||y.call(this,i,e,_))}}else c||(u&&(u.set="update"),S(this,wn)&&((w=this.onInsert)==null||w.call(this,i,e,"update")))}if(s!==0&&!S(this,Qt)&&j(this,Z,xu).call(this),S(this,Qt)&&(h||S(this,Ys).call(this,d,s,o),u&&S(this,Ai).call(this,u,d)),!l&&S(this,lt)&&S(this,qe)){let Q=S(this,qe),P;for(;P=Q==null?void 0:Q.shift();)(v=S(this,Ht))==null||v.call(this,...P)}return this},Ko=function(e){var l,a,u;let i=S(this,it),n=S(this,_e)[i],r=S(this,ne)[i],s=j(this,Z,we).call(this,r);s&&r.__abortController.abort(new Error("evicted"));let o=s?r.__staleWhileFetching:r;return(S(this,ni)||S(this,lt))&&o!==void 0&&(S(this,ni)&&((l=S(this,Ut))==null||l.call(this,o,n,"evict")),S(this,lt)&&((a=S(this,qe))==null||a.push([o,n,"evict"]))),S(this,Qn).call(this,i),(u=S(this,_t))!=null&&u[i]&&(clearTimeout(S(this,_t)[i]),S(this,_t)[i]=void 0),e&&(S(this,_e)[i]=void 0,S(this,ne)[i]=void 0,S(this,ei).push(i)),S(this,je)===1?(U(this,it,U(this,Ve,0)),S(this,ei).length=0):U(this,it,S(this,ot)[i]),S(this,Ie).delete(n),mo(this,je)._--,i},Xm=function(e,i={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=i,s=S(this,Ie).get(e);if(s!==void 0){let o=S(this,ne)[s];if(j(this,Z,we).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(S(this,Pt).call(this,s))r&&(r.has="stale",S(this,Ai).call(this,r,s));else return n&&S(this,$n).call(this,s),r&&(r.has="hit",S(this,Ai).call(this,r,s)),!0}else r&&(r.has="miss");return!1},zm=function(e,i){let{status:n,allowStale:r=this.allowStale}=i,s=S(this,Ie).get(e);if(s===void 0||!r&&S(this,Pt).call(this,s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=S(this,ne)[s],l=j(this,Z,we).call(this,o)?o.__staleWhileFetching:o;return n&&(l!==void 0?(n.peek="hit",n.value=l):n.peek="miss"),l},Jo=function(e,i,n,r){let s=i===void 0?void 0:S(this,ne)[i];if(j(this,Z,we).call(this,s))return s;let o=new AbortController,{signal:l}=n;l==null||l.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let a={signal:o.signal,options:n,context:r},u=(m,O=!1)=>{let{aborted:g}=o.signal,b=n.ignoreFetchAbort&&m!==void 0,y=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(g&&!O?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,b&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),g&&!b&&!O)return h(o.signal.reason,y);let w=d,v=S(this,ne)[i];return(v===d||v===void 0&&b&&O)&&(m===void 0?w.__staleWhileFetching!==void 0?S(this,ne)[i]=w.__staleWhileFetching:j(this,Z,Wi).call(this,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),j(this,Z,Vn).call(this,e,m,a.options,w))),m},c=m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),h(m,!1)),h=(m,O)=>{let{aborted:g}=o.signal,b=g&&n.allowStaleOnFetchAbort,y=b||n.allowStaleOnFetchRejection,w=y||n.noDeleteOnFetchRejection,v=d;if(S(this,ne)[i]===d&&(!w||!O&&v.__staleWhileFetching===void 0?j(this,Z,Wi).call(this,e,"fetch"):b||(S(this,ne)[i]=v.__staleWhileFetching)),y)return n.status&&v.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),v.__staleWhileFetching;if(v.__returned===v)throw m},f=(m,O)=>{var b;let g=(b=S(this,ur))==null?void 0:b.call(this,e,s,a);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=y=>u(y,!0)))}),g&&g instanceof Promise?g.then(y=>m(y===void 0?void 0:y),O):g!==void 0&&m(g)};n.status&&(n.status.fetchDispatched=!0);let d=new Promise(f).then(u,c),p=Object.assign(d,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return i===void 0?(j(this,Z,Vn).call(this,e,p,{...a.options,status:void 0}),i=S(this,Ie).get(e)):S(this,ne)[i]=p,p},we=function(e){if(!S(this,hr))return!1;let i=e;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof AbortController},Su=async function(e,i={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:a=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:O=!1,status:g,signal:b}=i;if(g&&(g.op="fetch",g.key=e,O&&(g.forceRefresh=!0),g.cache=this),!S(this,hr))return g&&(g.fetch="get"),j(this,Z,Hr).call(this,e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:g});let y={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:l,size:a,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:p,ignoreFetchAbort:d,status:g,signal:b},w=S(this,Ie).get(e);if(w===void 0){g&&(g.fetch="miss");let v=j(this,Z,Jo).call(this,e,w,y,m);return v.__returned=v}else{let v=S(this,ne)[w];if(j(this,Z,we).call(this,v)){let R=n&&v.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",R&&(g.returnedStale=!0)),R?v.__staleWhileFetching:v.__returned=v}let Q=S(this,Pt).call(this,w);if(!O&&!Q)return g&&(g.fetch="hit"),j(this,Z,Kr).call(this,w),r&&S(this,$n).call(this,w),g&&S(this,Ai).call(this,g,w),v;let P=j(this,Z,Jo).call(this,e,w,y,m),_=P.__staleWhileFetching!==void 0&&n;return g&&(g.fetch=Q?"stale":"refresh",_&&Q&&(g.returnedStale=!0)),_?P.__staleWhileFetching:P.__returned=P}},jm=async function(e,i={}){let n=await j(this,Z,Su).call(this,e,i);if(n===void 0)throw new Error("fetch() returned undefined");return n},Fm=function(e,i={}){let n=S(this,cr);if(!n)throw new Error("no memoMethod provided to constructor");let{context:r,status:s,forceRefresh:o,...l}=i;s&&o&&(s.forceRefresh=!0);let a=j(this,Z,Hr).call(this,e,l),u=o||a===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=a)),!u)return a;let c=n(e,a,{options:l,context:r});return s&&(s.value=c),j(this,Z,Vn).call(this,e,c,l),c},Hr=function(e,i={}){let{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=i,l=S(this,Ie).get(e);if(l===void 0){o&&(o.get="miss");return}let a=S(this,ne)[l],u=j(this,Z,we).call(this,a);return o&&S(this,Ai).call(this,o,l),S(this,Pt).call(this,l)?u?(o&&(o.get="stale-fetching"),n&&a.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),a.__staleWhileFetching):void 0):(s||j(this,Z,Wi).call(this,e,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),a):void 0):(o&&(o.get=u?"fetching":"hit"),j(this,Z,Kr).call(this,l),r&&S(this,$n).call(this,l),u?a.__staleWhileFetching:a)},wu=function(e,i){S(this,$t)[i]=e,S(this,ot)[e]=i},Kr=function(e){e!==S(this,Ve)&&(e===S(this,it)?U(this,it,S(this,ot)[e]):j(this,Z,wu).call(this,S(this,$t)[e],S(this,ot)[e]),j(this,Z,wu).call(this,S(this,Ve),e),U(this,Ve,e))},Wi=function(e,i){var r,s,o,l,a;let n=!1;if(S(this,je)!==0){let u=S(this,Ie).get(e);if(u!==void 0)if((r=S(this,_t))!=null&&r[u]&&(clearTimeout(S(this,_t)[u]),S(this,_t)[u]=void 0),n=!0,S(this,je)===1)j(this,Z,$u).call(this,i);else{S(this,Qn).call(this,u);let c=S(this,ne)[u];if(j(this,Z,we).call(this,c)?c.__abortController.abort(new Error("deleted")):(S(this,ni)||S(this,lt))&&(S(this,ni)&&((s=S(this,Ut))==null||s.call(this,c,e,i)),S(this,lt)&&((o=S(this,qe))==null||o.push([c,e,i]))),S(this,Ie).delete(e),S(this,_e)[u]=void 0,S(this,ne)[u]=void 0,u===S(this,Ve))U(this,Ve,S(this,$t)[u]);else if(u===S(this,it))U(this,it,S(this,ot)[u]);else{let h=S(this,$t)[u];S(this,ot)[h]=S(this,ot)[u];let f=S(this,ot)[u];S(this,$t)[f]=S(this,$t)[u]}mo(this,je)._--,S(this,ei).push(u)}}if(S(this,lt)&&((l=S(this,qe))!=null&&l.length)){let u=S(this,qe),c;for(;c=u==null?void 0:u.shift();)(a=S(this,Ht))==null||a.call(this,...c)}return n},$u=function(e){var i,n,r,s;for(let o of j(this,Z,qi).call(this,{allowStale:!0})){let l=S(this,ne)[o];if(j(this,Z,we).call(this,l))l.__abortController.abort(new Error("deleted"));else{let a=S(this,_e)[o];S(this,ni)&&((i=S(this,Ut))==null||i.call(this,l,a,e)),S(this,lt)&&((n=S(this,qe))==null||n.push([l,a,e]))}}if(S(this,Ie).clear(),S(this,ne).fill(void 0),S(this,_e).fill(void 0),S(this,Qt)&&S(this,ii)){S(this,Qt).fill(0),S(this,ii).fill(0);for(let o of S(this,_t)??[])o!==void 0&&clearTimeout(o);(r=S(this,_t))==null||r.fill(void 0)}if(S(this,ti)&&S(this,ti).fill(0),U(this,it,0),U(this,Ve,0),S(this,ei).length=0,U(this,Jt,0),U(this,je,0),S(this,lt)&&S(this,qe)){let o=S(this,qe),l;for(;l=o==null?void 0:o.shift();)(s=S(this,Ht))==null||s.call(this,...l)}},dr);const bt={hljs:`${x}-hljs`,hlcss:`${x}-hlCss`,prettier:`${x}-prettier`,prettierMD:`${x}-prettierMD`,cropperjs:`${x}-cropper`,croppercss:`${x}-cropperCss`,screenfull:`${x}-screenfull`,mermaidM:`${x}-mermaid-m`,mermaid:`${x}-mermaid`,katexjs:`${x}-katex`,katexcss:`${x}-katexCss`},ik=(t,e)=>{const i=H("editorId"),{noImgZoomIn:n}=t,r=Kp(()=>{const s=document.querySelectorAll(`#${i}-preview img:not(.not-zoom):not(.medium-zoom-image)`);s.length!==0&&Gv(s,{background:"#00000073"})});Ae(()=>{!n&&t.setting.preview&&r()}),te([e,si(t.setting,"preview")],()=>{!n&&t.setting.preview&&r()})},nk=(t,e,i)=>{const n=H("editorId"),r=H("rootRef"),s=H("usedLanguageText"),o=()=>{r.value.querySelectorAll(`#${n} .${x}-preview .${x}-code`).forEach(u=>{let c=-1;const h=u.querySelector(`.${x}-copy-button`);h&&(h.onclick=f=>{f.preventDefault(),clearTimeout(c);const p=(u.querySelector("input:checked + pre code")||u.querySelector("pre code")).textContent,{text:m,successTips:O,failTips:g}=s.value.copyCode;let b=O;Kv(t.formatCopiedText(p)).catch(()=>{b=g}).finally(()=>{h.dataset.isIcon?h.dataset.tips=b:h.innerHTML=b,c=window.setTimeout(()=>{h.dataset.isIcon?h.dataset.tips=m:h.innerHTML=m},1500)})})})},l=()=>{li(o)},a=u=>{u&&li(o)};te([e,i],l),te(()=>t.setting.preview,a),te(()=>t.setting.htmlPreview,a),Ae(o)},rk=t=>{const e=H("highlight"),i=Tn(Me.editorExtensions.highlight.instance);return Ae(()=>{t.noHighlight||i.value||(zt("link",{...e.value.css,rel:"stylesheet",id:bt.hlcss}),zt("script",{...e.value.js,id:bt.hljs,onload(){i.value=window.hljs}},"hljs"))}),te(()=>e.value.css,()=>{t.noHighlight||Me.editorExtensions.highlight.instance||Vv("link",{...e.value.css,rel:"stylesheet",id:bt.hlcss})}),i},el=new tk({max:1e3,ttl:6e5}),sk=t=>{const e=H("editorId"),i=H("theme"),n=H("rootRef"),{editorExtensions:r,editorExtensionsAttrs:s,mermaidConfig:o}=Me;let l=r.mermaid.instance;const a=Tn(-1),u=()=>{!t.noMermaid&&l&&(l.initialize(o({startOnLoad:!1,theme:i.value==="dark"?"dark":"default"})),a.value=a.value+1)};return te(()=>i.value,()=>{el.clear(),u()}),Ae(()=>{var h,f;if(t.noMermaid||l)return;const d=r.mermaid.js;/\.mjs/.test(d)?(zt("link",{...(h=s.mermaid)==null?void 0:h.js,rel:"modulepreload",href:d,id:bt.mermaidM}),import(d).then(p=>{l=p.default,u()})):zt("script",{...(f=s.mermaid)==null?void 0:f.js,src:d,id:bt.mermaid,onload(){l=window.mermaid,u()}},"mermaid")}),{reRenderRef:a,replaceMermaid:async()=>{if(!t.noMermaid&&l){const h=n.value.querySelectorAll(`div.${x}-mermaid`),f=document.createElement("div"),d=document.body.offsetWidth>1366?document.body.offsetWidth:1366,p=document.body.offsetHeight>768?document.body.offsetHeight:768;f.style.width=d+"px",f.style.height=p+"px",f.style.position="fixed",f.style.zIndex="-10000",f.style.top="-10000";let m=h.length;m>0&&document.body.appendChild(f),await Promise.allSettled(Array.from(h).map(O=>(async b=>{var y;if(b.dataset.closed==="false")return!1;const w=b.innerText;let v=el.get(w);if(!v){const Q=mu();let P={svg:""};try{P=await l.render(Q,w,f),v=await t.sanitizeMermaid(P.svg);const _=document.createElement("p");_.className=`${x}-mermaid`,_.setAttribute("data-processed",""),_.innerHTML=v,(y=_.children[0])==null||y.removeAttribute("height"),el.set(w,_.innerHTML),b.dataset.line!==void 0&&(_.dataset.line=b.dataset.line),b.replaceWith(_)}catch(_){X.emit(e,hn,{name:"mermaid",message:_.message,error:_})}--m===0&&f.remove()}})(O)))}}}},ok=t=>{const e=Tn(Me.editorExtensions.katex.instance);return Ae(()=>{var i,n;if(t.noKatex||e.value)return;const{editorExtensions:r,editorExtensionsAttrs:s}=Me;zt("script",{...(i=s.katex)==null?void 0:i.js,src:r.katex.js,id:bt.katexjs,onload(){e.value=window.katex}},"katex"),zt("link",{...(n=s.katex)==null?void 0:n.css,rel:"stylesheet",href:r.katex.css,id:bt.katexcss})}),e},lk=(t,e)=>{const i=t.renderer.rules.fence.bind(t.renderer.rules);t.renderer.rules.fence=(n,r,s,o,l)=>{var a;const u=n[r],c=u.content.trim();if(u.info==="mermaid"){if(u.attrSet("class",`${x}-mermaid`),u.attrSet("data-mermaid-theme",e.themeRef.value),u.map&&u.level===0){const f=u.map[1]-1,d=(a=o.srcLines[f])==null?void 0:a.trim(),p=d==null?void 0:d.startsWith("```");u.attrSet("data-closed",p),u.attrSet("data-line",String(u.map[0]))}const h=el.get(c);return h?(u.attrSet("data-processed",""),`

${h}

`):`
${t.utils.escapeHtml(c)}
`}return i(n,r,s,o,l)}},gl=(t,e)=>{const i=t.attrs?t.attrs.slice():[];return e.forEach(n=>{const r=t.attrIndex(n[0]);r<0?i.push(n):(i[r]=i[r].slice(),i[r][1]+=` ${n[1]}`)}),i},fd={block:[{open:"$$",close:"$$"},{open:"\\[",close:"\\]"}],inline:[{open:"$$",close:"$$"},{open:"$",close:"$"},{open:"\\[",close:"\\]"},{open:"\\(",close:"\\)"}]},ak=t=>(e,i)=>{const n=t.delimiters;let r,s,o;for(const l of n)if(e.src.startsWith(l.open,e.pos)){const a=e.pos+l.open.length;for(r=a;(r=e.src.indexOf(l.close,r))!==-1;){for(o=r-1;e.src[o]==="\\";)o-=1;if((r-o)%2===1)break;r+=l.close.length}if(r===-1)return i||(e.pending+=l.open),e.pos=a,!0;if(r-a===0)return i||(e.pending+=l.open+l.close),e.pos=a+l.close.length,!0;if(!i){const u=e.src.slice(a,r);s=e.push("math_inline","math",0),s.markup=l.open,s.content=u}return e.pos=r+l.close.length,!0}return!1},uk=t=>(e,i,n,r)=>{const s=t.delimiters;let o,l,a,u,c=!1,h=e.bMarks[i]+e.tShift[i],f=e.eMarks[i];for(const d of s)if(e.src.slice(h,h+d.open.length)===d.open&&e.src.slice(f-d.close.length,f)===d.close){if(h+=d.open.length,o=e.src.slice(h,f),r)return!0;for(o.trim().slice(-d.close.length)===d.close&&(o=o.trim().slice(0,-d.close.length),c=!0),a=i;!c&&(a++,!(a>=n||(h=e.bMarks[a]+e.tShift[a],f=e.eMarks[a],h{const r=(o,l,a,u,c)=>{const h=o[l],f={attrs:gl(h,[["class",`${x}-katex-inline`]])};if(e.value){const d=e.value.renderToString(h.content,Me.katexConfig({throwOnError:!1}));return`${d}`}else return`${h.content}`},s=(o,l,a,u,c)=>{const h=o[l],f={attrs:gl(h,[["class",`${x}-katex-block`]])};if(e.value){const d=e.value.renderToString(h.content,Me.katexConfig({throwOnError:!1,displayMode:!0}));return`

${d}

`}else return`

${h.content}

`};t.inline.ruler.before("escape","math_inline",ak({delimiters:i||fd.inline})),t.block.ruler.after("blockquote","math_block",uk({delimiters:n||fd.block}),{alt:["paragraph","reference","blockquote","list"]}),t.renderer.rules.math_inline=r,t.renderer.rules.math_block=s},hk=(t,e)=>{e=e||{};const i=3,n=e.marker||"!",r=n.charCodeAt(0),s=n.length;let o="",l="";const a=(c,h,f,d,p)=>{const m=c[h];return m.type==="admonition_open"?c[h].attrPush(["class",`${x}-admonition ${x}-admonition-${m.info}`]):m.type==="admonition_title_open"&&c[h].attrPush(["class",`${x}-admonition-title`]),p.renderToken(c,h,f)},u=c=>{const h=c.trim().split(" ",2);l="",o=h[0],h.length>1&&(l=c.substring(o.length+2))};t.block.ruler.before("code","admonition",(c,h,f,d)=>{let p,m,O,g=!1,b=c.bMarks[h]+c.tShift[h],y=c.eMarks[h];if(r!==c.src.charCodeAt(b))return!1;for(p=b+1;p<=y&&n[(p-b)%s]===c.src[p];p++);const w=Math.floor((p-b)/s);if(w!==i)return!1;p-=(p-b)%s;const v=c.src.slice(b,p),Q=c.src.slice(p,y);if(u(Q),d)return!0;for(m=h;m++,!(m>=f||(b=c.bMarks[m]+c.tShift[m],y=c.eMarks[m],b=4)){for(p=b+1;p<=y&&n[(p-b)%s]===c.src[p];p++);if(!(Math.floor((p-b)/s){t.renderer.rules.heading_open=(i,n)=>{var r;const s=i[n],o=((r=i[n+1].children)==null?void 0:r.reduce((a,u)=>a+(["text","code_inline","math_inline"].includes(u.type)&&u.content||""),""))||"",l=s.markup.length;return e.headsRef.value.push({text:o,level:l,line:s.map[0]}),s.map&&s.level===0&&s.attrSet("id",e.mdHeadingId(o,l,e.headsRef.value.length)),t.renderer.renderToken(i,n,e)},t.renderer.rules.heading_close=(i,n,r,s,o)=>o.renderToken(i,n,r)},dk=(t,e)=>{const i=t.renderer.rules.fence,n=t.utils.unescapeAll,r=/\[(\w*)(?::([\w ]*))?\]/,s=/::(open|close)/,o=h=>h.info?n(h.info).trim():"",l=h=>{const f=o(h),[d=null,p=""]=(r.exec(f)||[]).slice(1);return[d,p]},a=h=>{const f=o(h);return f?f.split(/(\s+)/g)[0]:""},u=h=>{const f=h.info.match(s)||[],d=f[1]==="open"||f[1]!=="close"&&e.codeFoldable&&h.content.trim().split(` `).length{var O;if(h[f].hidden)return"";const g=(O=e.usedLanguageTextRef.value)==null?void 0:O.copyCode.text,b=e.customIconRef.value.copy||g,y=!!e.customIconRef.value.copy,w=`${os("collapse-tips",e.customIconRef.value)}`,[v]=l(h[f]);if(v===null){const{open:ee,tagContainer:re,tagHeader:ue}=u(h[f]),ye=[["class",`${x}-code`]];ee&&ye.push(["open",""]);const Oe={attrs:gl(h[f],ye)};h[f].info=h[f].info.replace(s,"");const le=i(h,f,d,p,m);return` <${re} ${m.renderAttrs(Oe)}> <${ue} class="${x}-code-head">
${t.utils.escapeHtml(h[f].info.trim())} ${b} ${e.extraTools instanceof Function?e.extraTools({lang:h[f].info.trim()}):e.extraTools||""} ${re==="details"?w:""}
${le} `}let Q,P,_,R,L="",I="",T="";const{open:M,tagContainer:F,tagHeader:B}=u(h[f]),Y=[["class",`${x}-code`]];M&&Y.push(["open",""]);const J={attrs:gl(h[f],Y)};for(let ee=f;ee0?"":"checked",L+=`
  • `,I+=`
    ${i(h,ee,d,p,m)}
    `,T+=` ${t.utils.escapeHtml(a(Q))}`}return` <${F} ${m.renderAttrs(J)}> <${B} class="${x}-code-head">
      ${L}
    ${T} ${b} ${e.extraTools instanceof Function?e.extraTools({lang:h[f].info.trim()}):e.extraTools||""} ${F==="details"?w:""}
    ${I} `};t.renderer.rules.fence=c,t.renderer.rules.code_block=c},dd=(t,e,i)=>{const n=t.attrIndex(e),r=[e,i];n<0?t.attrPush(r):(t.attrs=t.attrs||[],t.attrs[n]=r)},pk=t=>t.type==="inline",mk=t=>t.type==="paragraph_open",Ok=t=>t.type==="list_item_open",gk=t=>t.content.indexOf("[ ] ")===0||t.content.indexOf("[x] ")===0||t.content.indexOf("[X] ")===0,bk=(t,e)=>pk(t[e])&&mk(t[e-1])&&Ok(t[e-2])&&gk(t[e]),vk=(t,e)=>{const i=t[e].level-1;for(let n=e-1;n>=0;n--)if(t[n].level===i)return n;return-1},yk=t=>{const e=new t("html_inline","",0);return e.content="",e},kk=(t,e,i)=>{const n=new i("html_inline","",0);return n.content='",n.attrs=[{for:e}],n},Sk=(t,e,i)=>{const n=new e("html_inline","",0),r=i.enabled?" ":' disabled="" ';return t.content.indexOf("[ ] ")===0?n.content='':(t.content.indexOf("[x] ")===0||t.content.indexOf("[X] ")===0)&&(n.content=''),n},wk=(t,e,i)=>{if(t.children=t.children||[],t.children.unshift(Sk(t,e,i)),t.children[1].content=t.children[1].content.slice(3),t.content=t.content.slice(3),i.label)if(i.labelAfter){t.children.pop();const n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);t.children[0].content=t.children[0].content.slice(0,-1)+' id="'+n+'">',t.children.push(kk(t.content,n,e))}else t.children.unshift(yk(e)),t.children.push(xk(e))},$k=(t,e={})=>{t.core.ruler.after("inline","github-task-lists",i=>{const n=i.tokens;for(let r=2;r{t.core.ruler.push("init-line-number",e=>(e.tokens.forEach(i=>{i.map&&(i.attrs||(i.attrs=[]),i.attrs.push(["data-line",i.map[0].toString()]))}),!0))},_k=(t,e)=>{const{editorConfig:i,markdownItConfig:n,markdownItPlugins:r,editorExtensions:s}=Me,o=H("editorId"),l=H("language"),a=H("usedLanguageText"),u=H("showCodeRowNumber"),c=H("theme"),h=H("customIcon"),f=H("rootRef"),d=pe([]);let p=()=>{};const m=rk(t),O=ok(t),{reRenderRef:g,replaceMermaid:b}=sk(t),y=Wt({html:!0,breaks:!0,linkify:!0});n(y,{editorId:o});const w=[{type:"image",plugin:X2,options:{figcaption:!0,classes:"md-zoom"}},{type:"admonition",plugin:hk,options:{}},{type:"taskList",plugin:$k,options:{}},{type:"heading",plugin:fk,options:{mdHeadingId:t.mdHeadingId,headsRef:d}},{type:"code",plugin:dk,options:{editorId:o,usedLanguageTextRef:a,codeFoldable:t.codeFoldable,autoFoldThreshold:t.autoFoldThreshold,customIconRef:h}},{type:"sub",plugin:F2,options:{}},{type:"sup",plugin:q2,options:{}}];t.noKatex||w.push({type:"katex",plugin:ck,options:{katexRef:O}}),t.noMermaid||w.push({type:"mermaid",plugin:lk,options:{themeRef:c}}),r(w,{editorId:o}).forEach(T=>{y.use(T.plugin,T.options)});const v=y.options.highlight;y.set({highlight:(T,M,F)=>{if(v){const J=v(T,M,F);if(J)return J}let B;!t.noHighlight&&m.value?m.value.getLanguage(M)?B=m.value.highlight(T,{language:M,ignoreIllegals:!0}).value:B=m.value.highlightAuto(T).value:B=y.utils.escapeHtml(T);const Y=u?Y2(B.replace(/^\n+|\n+$/g,""),T.replace(/^\n+|\n+$/g,"")):`${B.replace(/^\n+|\n+$/g,"")}`;return`
    ${Y}
    `}}),Qk(y);const Q=pe(`_article-key_${mu()}`),P=pe(t.sanitize(y.render(t.modelValue,{srcLines:t.modelValue.split(` `)}))),_=()=>{X.emit(o,Go,P.value),t.onHtmlChanged(P.value),t.onGetCatalog(d.value),X.emit(o,ss,d.value),li(()=>{b().then(()=>{var T,M;(T=s.mermaid)!=null&&T.enableZoom&&(p(),p=jf((M=f.value)==null?void 0:M.querySelectorAll(`#${o} p.${x}-mermaid:not([data-closed=false])`),{customIcon:h.value}))})})},R=()=>{d.value=[],P.value=t.sanitize(y.render(t.modelValue,{srcLines:t.modelValue.split(` `)})),_()},L=He(()=>(t.noKatex||O.value)&&(t.noHighlight||m.value));let I=-1;return te([si(t,"modelValue"),L,g,l],()=>{I=window.setTimeout(()=>{R()},e?0:i.renderDelay)}),te(()=>t.setting.preview,()=>{t.setting.preview&&li(()=>{b().then(()=>{var T,M;(T=s.mermaid)!=null&&T.enableZoom&&(p(),p=jf((M=f.value)==null?void 0:M.querySelectorAll(`#${o} p.${x}-mermaid:not([data-closed=false])`),{customIcon:h.value}))}),X.emit(o,ss,d.value)})}),Ae(_),Ae(()=>{X.on(o,{name:nm,callback(){X.emit(o,ss,d.value)}}),X.on(o,{name:_c,callback:()=>{Q.value=`_article-key_${mu()}`,R()}})}),Mn(()=>{p(),clearTimeout(I)}),{html:P,key:Q}},pd={checked:{regexp:/- \[x\]/,value:"- [ ]"},unChecked:{regexp:/- \[\s\]/,value:"- [x]"}},Pk=(t,e)=>{const i=H("editorId"),n=H("rootRef");let r=()=>{};const s=()=>{if(!n.value)return!1;const o=n.value.querySelectorAll(".task-list-item.enabled"),l=a=>{var u;a.preventDefault();const c=a.target.checked?"unChecked":"checked",h=(u=a.target.parentElement)==null?void 0:u.dataset.line;if(!h)return;const f=Number(h),d=t.modelValue.split(` `),p=d[Number(f)].replace(pd[c].regexp,pd[c].value);t.previewOnly?(d[Number(f)]=p,t.onChange(d.join(` `))):X.emit(i,sm,f+1,p)};o.forEach(a=>{a.addEventListener("click",l)}),r=()=>{o.forEach(a=>{a.removeEventListener("click",l)})}};Mn(()=>{r()}),te([e],()=>{r(),li(s)},{immediate:!0})},Ck=(t,e,i)=>{const n=()=>{li(()=>{var s;(s=t.onRemount)==null||s.call(t)})},r=s=>{s&&n()};te([e,i],n),te(()=>t.setting.preview,r),te(()=>t.setting.htmlPreview,r),Ae(n)},Bm={modelValue:{type:String,default:""},onChange:{type:Function,default:()=>{}},setting:{type:Object,default:()=>({preview:!0})},onHtmlChanged:{type:Function,default:()=>{}},onGetCatalog:{type:Function,default:()=>{}},mdHeadingId:{type:Function,default:()=>""},noMermaid:{type:Boolean,default:!1},sanitize:{type:Function,default:t=>t},noKatex:{type:Boolean,default:!1},formatCopiedText:{type:Function,default:t=>t},noHighlight:{type:Boolean,default:!1},previewOnly:{type:Boolean,default:!1},noImgZoomIn:{type:Boolean},sanitizeMermaid:{type:Function},codeFoldable:{type:Boolean},autoFoldThreshold:{type:Number},onRemount:{type:Function}},Tk={...Bm,updateModelValue:{type:Function,default:()=>{}},placeholder:{type:String,default:""},scrollAuto:{type:Boolean},autofocus:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},maxlength:{type:Number},autoDetectCode:{type:Boolean},onBlur:{type:Function,default:()=>{}},onFocus:{type:Function,default:()=>{}},noPrettier:{type:Boolean},completions:{type:Array},catalogVisible:{type:Boolean},theme:{type:String,default:"light"},onInput:{type:Function},onDrop:{type:Function,default:()=>{}},inputBoxWidth:{type:String},oninputBoxWidthChange:{type:Function},transformImgUrl:{type:Function,default:t=>t},catalogLayout:{type:String},catalogMaxDepth:{type:Number}},Ak=t=>{const i=new DOMParser().parseFromString(t,"text/html");return Array.from(i.body.childNodes)},Ek=(t,e)=>{const i=[],n=[];if(t.forEach((r,s)=>{const o=e[s];if(!o){i.push({index:s,newNode:r});return}(r.nodeType!==o.nodeType||r.textContent!==o.textContent||r.nodeType===1&&r.outerHTML!==o.outerHTML)&&i.push({index:s,newNode:r})}),e.length>t.length)for(let r=t.length;r{r.value&&(a.forEach(u=>{u.remove()}),l.forEach(({index:u,newNode:c})=>{var h,f,d;const p=(h=r.value)==null?void 0:h.childNodes[u];p?(d=r.value)==null||d.replaceChild(c.cloneNode(!0),p):(f=r.value)==null||f.appendChild(c.cloneNode(!0))}))};return te(()=>t.html,l=>{var a;const u=Ak(l),c=Array.from(((a=r.value)==null?void 0:a.childNodes)||[]),{updates:h,deletes:f}=Ek(u,c);o(h,f)}),()=>$("div",{id:`${e}-preview`,class:[`${x}-preview`,`${i==null?void 0:i.value}-theme`,n&&`${x}-scrn`],innerHTML:s,ref:r},null)}}),Vm=Te({name:"ContentPreview",props:Bm,setup(t){const e=H("editorId"),{html:i,key:n}=_k(t,t.previewOnly);return nk(t,i,n),ik(t,i),Pk(t,i),Ck(t,i,n),()=>$(Gs,null,[t.setting.preview&&$("div",{id:`${e}-preview-wrapper`,class:`${x}-preview-wrapper`,key:"content-preview-wrapper"},[$(Rk,{key:n.value,html:i.value},null)]),!t.previewOnly&&t.setting.htmlPreview&&$("div",{id:`${e}-html-wrapper`,class:`${x}-preview-wrapper`,key:"html-preview-wrapper"},[$("div",{class:`${x}-html`},[i.value])])])}}),Dk=(t,e,i)=>{const{editorId:n}=i,r=ct({buildFinished:!1,html:""});te(()=>t.modelValue,()=>{r.buildFinished=!1}),Ae(()=>{X.on(n,{name:Go,callback(s){r.buildFinished=!0,r.html=s}}),X.on(n,{name:Ul,callback(){const s=new Promise(o=>{if(r.buildFinished)o(r.html);else{const l=a=>{o(a),X.remove(n,Go,l)};X.on(n,{name:Go,callback:l})}});t.onSave?t.onSave(t.modelValue,s):e.emit("onSave",t.modelValue,s)}})})},qm=(t,e)=>{const i=Me.editorExtensions.highlight,n=Me.editorExtensionsAttrs.highlight,r=jk(t);Ct("editorId",r),Ct("rootRef",e),Ct("theme",He(()=>t.theme)),Ct("language",He(()=>t.language)),Ct("highlight",He(()=>{const{js:o}=i,l={...gu,...i.css},{js:a,css:u={}}=n||{},c=t.codeStyleReverse&&t.codeStyleReverseList.includes(t.previewTheme)?"dark":t.theme,h=l[t.codeTheme]?l[t.codeTheme][c]:gu.atom[c],f=l[t.codeTheme]&&u[t.codeTheme]?u[t.codeTheme][c]:u.atom?u.atom[c]:{};return{js:{src:o,...a},css:{href:h,...f}}})),Ct("showCodeRowNumber",t.showCodeRowNumber);const s=He(()=>{const o={...dl,...Me.editorConfig.languageUserDefined};return Gl(Ur(dl["en-US"]),o[t.language]||{})});return Ct("usedLanguageText",s),Ct("previewTheme",He(()=>t.previewTheme)),Ct("customIcon",He(()=>t.customIcon)),{editorId:r}},Lk=(t,e)=>(Ct("tabWidth",t.tabWidth),Ct("disabled",He(()=>t.disabled)),qm(t,e)),Mk=t=>{const{noPrettier:e,noUploadImg:i}=t,{editorExtensions:n,editorExtensionsAttrs:r}=Me,s=e||n.prettier.prettierInstance,o=e||n.prettier.parserMarkdownInstance,l=i||n.cropper.instance;Ae(()=>{if(!l){const{js:a={},css:u={}}=r.cropper||{};zt("link",{...u,rel:"stylesheet",href:n.cropper.css,id:bt.croppercss}),zt("script",{...a,src:n.cropper.js,id:bt.cropperjs})}if(!s){const{standaloneJs:a={}}=r.prettier||{};zt("script",{...a,src:n.prettier.standaloneJs,id:bt.prettier})}if(!o){const{parserMarkdownJs:a={}}=r.prettier||{};zt("script",{...a,src:n.prettier.parserMarkdownJs,id:bt.prettierMD})}})},Zk=(t,e,i)=>{const{editorId:n}=i;Ae(()=>{X.on(n,{name:hn,callback:r=>{var s;(s=t.onError)==null||s.call(t,r),e.emit("onError",r)}})})},Ik=(t,e,i)=>{const{editorId:n}=i,r=ct({pageFullscreen:t.pageFullscreen,fullscreen:!1,preview:t.preview,htmlPreview:t.preview?!1:t.htmlPreview,previewOnly:!1}),s=ct({...r}),o=(u,c)=>{const h=c===void 0?!r[u]:c;switch(u){case"preview":{r.htmlPreview=!1,r.previewOnly=!1;break}case"htmlPreview":{r.preview=!1,r.previewOnly=!1;break}case"previewOnly":{h?!r.preview&&!r.htmlPreview&&(r.preview=!0):(s.preview||(r.preview=!1),s.htmlPreview||(r.htmlPreview=!1));break}}s[u]=h,r[u]=h};let l="";const a=()=>{r.pageFullscreen||r.fullscreen?document.body.style.overflow="hidden":document.body.style.overflow=l};return te(()=>[r.pageFullscreen,r.fullscreen],a),Ae(()=>{X.on(n,{name:Hl,callback(u,c){const h=f=>{X.emit(n,xe,"image",{desc:"",urls:f}),c==null||c()};t.onUploadImg?t.onUploadImg(u,h):e.emit("onUploadImg",u,h)}}),l=document.body.style.overflow,a()}),[r,o]},Xk=(t,e)=>{const{editorId:i}=e,n=pe(!1);return Ae(()=>{X.on(i,{name:Qc,callback:r=>{r===void 0?n.value=!n.value:n.value=r}})}),n},zk=(t,e,i)=>{const{editorId:n,catalogVisible:r,setting:s,updateSetting:o,codeRef:l}=i;te(()=>s.pageFullscreen,u=>{X.emit(n,Df,u)}),te(()=>s.fullscreen,u=>{X.emit(n,Lf,u)}),te(()=>s.preview,u=>{X.emit(n,Mf,u)}),te(()=>s.previewOnly,u=>{X.emit(n,Zf,u)}),te(()=>s.htmlPreview,u=>{X.emit(n,If,u)}),te(r,u=>{X.emit(n,Xf,u)});const a={on(u,c){switch(u){case"pageFullscreen":{X.on(n,{name:Df,callback(h){c(h)}});break}case"fullscreen":{X.on(n,{name:Lf,callback(h){c(h)}});break}case"preview":{X.on(n,{name:Mf,callback(h){c(h)}});break}case"previewOnly":{X.on(n,{name:Zf,callback(h){c(h)}});break}case"htmlPreview":{X.on(n,{name:If,callback(h){c(h)}});break}case"catalog":{X.on(n,{name:Xf,callback(h){c(h)}});break}}},togglePageFullscreen(u){o("pageFullscreen",u)},toggleFullscreen(u){X.emit(n,em,u)},togglePreview(u){o("preview",u)},togglePreviewOnly(u){o("previewOnly",u)},toggleHtmlPreview(u){o("htmlPreview",u)},toggleCatalog(u){X.emit(n,Qc,u)},triggerSave(){X.emit(n,Ul)},insert(u){X.emit(n,xe,"universal",{generate:u})},focus(u){var c;(c=l.value)==null||c.focus(u)},rerender(){X.emit(n,_c)},getSelectedText(){var u;return(u=l.value)==null?void 0:u.getSelectedText()},resetHistory(){var u;(u=l.value)==null||u.resetHistory()},domEventHandlers(u){X.emit(n,rm,u)},execCommand(u){X.emit(n,xe,u)},getEditorView(){var u;return(u=l.value)==null?void 0:u.getEditorView()}};e.expose(a)},jk=t=>{const e=yv();return t.id||t.editorId||`${x}-${e}`},Fk=t=>t,Wm={modelValue:{type:String,default:""},onChange:{type:Function,default:void 0},theme:{type:String,default:"light"},class:{type:String,default:""},language:{type:String,default:"zh-CN"},onHtmlChanged:{type:Function,default:void 0},onGetCatalog:{type:Function,default:void 0},editorId:{type:String,default:void 0},id:{type:String,default:void 0},showCodeRowNumber:{type:Boolean,default:!0},previewTheme:{type:String,default:"default"},style:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:Fk},sanitize:{type:Function,default:t=>t},noMermaid:{type:Boolean,default:!1},noKatex:{type:Boolean,default:!1},codeTheme:{type:String,default:"atom"},formatCopiedText:{type:Function,default:t=>t},codeStyleReverse:{type:Boolean,default:!0},codeStyleReverseList:{type:Array,default:["default","mk-cute"]},noHighlight:{type:Boolean,default:!1},noImgZoomIn:{type:Boolean,default:!1},customIcon:{type:Object,default:{}},sanitizeMermaid:{type:Function,default:t=>Promise.resolve(t)},codeFoldable:{type:Boolean,default:!0},autoFoldThreshold:{type:Number,default:30},onRemount:{type:Function,default:void 0}},Bk={...Wm,onSave:{type:Function,default:void 0},onUploadImg:{type:Function,default:void 0},pageFullscreen:{type:Boolean,default:!1},preview:{type:Boolean,default:!0},htmlPreview:{type:Boolean,default:!1},toolbars:{type:Array,default:wc},toolbarsExclude:{type:Array,default:[]},noPrettier:{type:Boolean,default:!1},tabWidth:{type:Number,default:2},tableShape:{type:Array,default:[6,4]},placeholder:{type:String,default:""},defToolbars:{type:[String,Object],default:void 0},onError:{type:Function,default:void 0},footers:{type:Array,default:$c},scrollAuto:{type:Boolean,default:!0},defFooters:{type:[String,Object],default:void 0},noUploadImg:{type:Boolean,default:!1},autoFocus:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},maxLength:{type:Number,default:void 0},autoDetectCode:{type:Boolean,default:!1},onBlur:{type:Function,default:void 0},onFocus:{type:Function,default:void 0},completions:{type:Array,default:void 0},showToolbarName:{type:Boolean,default:!1},onInput:{type:Function,default:void 0},onDrop:{type:Function,default:void 0},inputBoxWidth:{type:String,default:"50%"},oninputBoxWidthChange:{type:Function,default:void 0},transformImgUrl:{type:Function,default:t=>t},catalogLayout:{type:String,default:"fixed"},catalogMaxDepth:{type:Number,default:void 0},insertLinkDirect:{type:Boolean,default:!1}},Ym=["onHtmlChanged","onGetCatalog","onChange","onRemount","update:modelValue"],Vk=[...Ym,"onSave","onUploadImg","onError","onBlur","onFocus","onInput","onDrop","oninputBoxWidthChange"],qk=(t,e,i)=>{const{editorId:n}=i,r={rerender(){X.emit(n,_c)}};e.expose(r)},ls=Te({name:"MdPreview",props:Wm,emits:Ym,setup(t,e){const{noKatex:i,noMermaid:n,noHighlight:r}=t,s=pe(),{editorId:o}=qm(t,s);return qk(t,e,{editorId:o}),Mn(()=>{X.clear(o)}),()=>$("div",{id:o,class:[x,t.class,t.theme==="dark"&&`${x}-dark`,`${x}-previewOnly`],style:t.style,ref:s},[$(Vm,{modelValue:t.modelValue,onChange:l=>{var a;(a=t.onChange)==null||a.call(t,l),e.emit("onChange",l),e.emit("update:modelValue",l)},onHtmlChanged:l=>{var a;(a=t.onHtmlChanged)==null||a.call(t,l),e.emit("onHtmlChanged",l)},onGetCatalog:l=>{var a;(a=t.onGetCatalog)==null||a.call(t,l),e.emit("onGetCatalog",l)},mdHeadingId:t.mdHeadingId,noMermaid:n,sanitize:t.sanitize,noKatex:i,formatCopiedText:t.formatCopiedText,noHighlight:r,noImgZoomIn:t.noImgZoomIn,previewOnly:!0,sanitizeMermaid:t.sanitizeMermaid,codeFoldable:t.codeFoldable,autoFoldThreshold:t.autoFoldThreshold,onRemount:()=>{var l;(l=t.onRemount)==null||l.call(t),e.emit("onRemount")}},null)])}});ls.install=t=>(t.component(ls.name,ls),t);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wk=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var yo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yk=({size:t,strokeWidth:e=2,absoluteStrokeWidth:i,color:n,iconNode:r,name:s,class:o,...l},{slots:a})=>xs("svg",{...yo,width:t||yo.width,height:t||yo.height,stroke:n||yo.stroke,"stroke-width":i?Number(e)*24/Number(t):e,class:["lucide",`lucide-${Wk(s??"icon")}`],...l},[...r.map(u=>xs(...u)),...a.default?[a.default()]:[]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const me=(t,e)=>(i,{slots:n})=>xs(Yk,{...i,iconNode:e,name:t},n);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nk=me("BoldIcon",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gk=me("ChartAreaIcon",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z",key:"q0gr47"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Uk=me("CodeXmlIcon",[["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"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hk=me("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kk=me("ExpandIcon",[["path",{d:"m21 21-6-6m6 6v-4.8m0 4.8h-4.8",key:"1c15vz"}],["path",{d:"M3 16.2V21m0 0h4.8M3 21l6-6",key:"1fsnz2"}],["path",{d:"M21 7.8V3m0 0h-4.8M21 3l-6 6",key:"hawz9i"}],["path",{d:"M3 7.8V3m0 0h4.8M3 3l6 6",key:"u9ee12"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jk=me("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eS=me("ForwardIcon",[["polyline",{points:"15 17 20 12 15 7",key:"1w3sku"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tS=me("HeadingIcon",[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const iS=me("ImageIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nS=me("ItalicIcon",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rS=me("LinkIcon",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sS=me("ListOrderedIcon",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oS=me("ListTodoIcon",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lS=me("ListTreeIcon",[["path",{d:"M21 12h-8",key:"1bmf0i"}],["path",{d:"M21 6H8",key:"1pqkrb"}],["path",{d:"M21 18h-8",key:"1tm79t"}],["path",{d:"M3 6v4c0 1.1.9 2 2 2h3",key:"1ywdgy"}],["path",{d:"M3 10v6c0 1.1.9 2 2 2h3",key:"2wc746"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aS=me("ListIcon",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uS=me("Maximize2Icon",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cS=me("Minimize2Icon",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hS=me("QuoteIcon",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fS=me("ReplyIcon",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dS=me("SaveIcon",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pS=me("ShrinkIcon",[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const md=me("SquareCodeIcon",[["path",{d:"M10 9.5 8 12l2 2.5",key:"3mjy60"}],["path",{d:"m14 9.5 2 2.5-2 2.5",key:"1bir2l"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mS=me("SquareSigmaIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M16 8.9V7H8l4 5-4 5h8v-1.9",key:"9nih0i"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OS=me("StrikethroughIcon",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gS=me("SubscriptIcon",[["path",{d:"m4 5 8 8",key:"1eunvl"}],["path",{d:"m12 5-8 8",key:"1ah0jp"}],["path",{d:"M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07",key:"e8ta8j"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bS=me("SuperscriptIcon",[["path",{d:"m4 19 8-8",key:"hr47gm"}],["path",{d:"m12 19-8-8",key:"1dhhmo"}],["path",{d:"M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06",key:"1dfcux"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vS=me("TableIcon",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yS=me("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xS=me("UnderlineIcon",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kS=me("UploadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SS=me("ViewIcon",[["path",{d:"M21 17v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2",key:"mrq65r"}],["path",{d:"M21 7V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2",key:"be3xqs"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M18.944 12.33a1 1 0 0 0 0-.66 7.5 7.5 0 0 0-13.888 0 1 1 0 0 0 0 .66 7.5 7.5 0 0 0 13.888 0",key:"11ak4c"}]]);/** * @license lucide-vue-next v0.453.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wS=me("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$S=()=>$("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-github-icon"},[$("path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"},null),$("path",{d:"M9 18c-4.51 2-5-2-7-2"},null)]),QS={bold:Nk,underline:xS,italic:nS,"strike-through":OS,title:tS,sub:gS,sup:bS,quote:hS,"unordered-list":aS,"ordered-list":sS,task:oS,"code-row":Hk,code:md,link:rS,image:iS,table:vS,revoke:fS,next:eS,save:dS,prettier:md,minimize:cS,maximize:uS,"fullscreen-exit":pS,fullscreen:Kk,"preview-only":SS,preview:Jk,"preview-html":Uk,catalog:lS,github:$S,mermaid:Gk,formula:mS,close:wS,delete:yS,upload:kS},_S=Te({name:`${x}-icon-set`,props:{name:{type:String,default:""}},setup(t){return()=>xs(QS[t.name],{class:`${x}-icon`})}}),ce=Te({name:`${x}-icon`,props:{name:{type:String,default:""}},setup(t){const e=H("customIcon");return()=>{const i=e.value[t.name];return typeof i=="object"?typeof i.component=="object"?xs(i.component,i.props):$("span",{innerHTML:i.component},null):$(_S,{name:t.name},null)}}}),PS={title:{type:[String,Object],default:""},visible:{type:Boolean,default:!1},width:{type:String,default:"auto"},height:{type:String,default:"auto"},onClose:{type:Function},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:()=>{}},class:{type:String,default:void 0},style:{type:[Object,String],default:()=>({})},showMask:{type:Boolean,default:!0}},_n=Te({name:"MdModal",props:PS,emits:["onClose"],setup(t,e){const i=H("theme"),n=H("rootRef"),r=pe(t.visible),s=pe([`${x}-modal`]),o=pe(),l=pe(),a=pe(),u=Tn();let c=()=>{};const h=ct({maskStyle:{zIndex:-1},modalStyle:{zIndex:-1},initPos:{left:"0px",top:"0px"},historyPos:{left:"0px",top:"0px"}}),f=He(()=>t.isFullscreen?{width:"100%",height:"100%"}:{width:t.width,height:t.height});te(()=>t.isFullscreen,m=>{m?c():li(()=>{c=zf(l.value,(O,g)=>{h.initPos.left=O+"px",h.initPos.top=g+"px"})})}),te(()=>t.visible,m=>{m?(h.maskStyle.zIndex=Me.editorConfig.zIndex+cd(),h.modalStyle.zIndex=Me.editorConfig.zIndex+cd(),s.value.push("zoom-in"),r.value=m,li(()=>{const O=o.value.offsetWidth/2,g=o.value.offsetHeight/2,b=document.documentElement.clientWidth/2,y=document.documentElement.clientHeight/2;h.initPos.left=b-O+"px",h.initPos.top=y-g+"px",t.isFullscreen||(c=zf(l.value,(w,v)=>{h.initPos.left=w+"px",h.initPos.top=v+"px"}))}),setTimeout(()=>{s.value=s.value.filter(O=>O!=="zoom-in")},140)):(s.value.push("zoom-out"),c(),setTimeout(()=>{s.value=s.value.filter(O=>O!=="zoom-out"),r.value=m},130))});const d=He(()=>({display:r.value?"block":"none"})),p=He(()=>typeof t.style=="string"?[t.style,d.value].join("; "):t.style instanceof Object?{...d.value,...t.style}:d.value);return Ae(()=>{var m;const O=(m=n.value)==null?void 0:m.getRootNode();a.value=O instanceof Document?document.body:O}),()=>{const m=ht({ctx:e}),O=ht({props:t,ctx:e},"title");return a.value?$(xv,{to:a.value},{default:()=>[$("div",{ref:u,class:`${x}-modal-container`,"data-theme":i.value},[$("div",{class:t.class,style:p.value},[t.showMask&&$("div",{class:`${x}-modal-mask`,style:h.maskStyle,onClick:()=>{var g;(g=t.onClose)==null||g.call(t),e.emit("onClose")}},null),$("div",{class:s.value,style:{...h.modalStyle,...h.initPos,...f.value},ref:o},[$("div",{class:`${x}-modal-header`,ref:l},[O||""]),$("div",{class:`${x}-modal-body`},[m]),$("div",{class:`${x}-modal-func`},[t.showAdjust&&$("div",{class:`${x}-modal-adjust`,onClick:g=>{g.stopPropagation(),t.isFullscreen?h.initPos=h.historyPos:(h.historyPos=h.initPos,h.initPos={left:"0",top:"0"}),t.onAdjust(!t.isFullscreen)}},[$(ce,{name:t.isFullscreen?"minimize":"maximize"},null)]),$("div",{class:`${x}-modal-close`,onClick:g=>{var b;g.stopPropagation(),(b=t.onClose)==null||b.call(t),e.emit("onClose")}},[$(ce,{name:"close"},null)])])])])])]}):""}}});_n.install=t=>(t.component(_n.name,_n),t);const CS=`.${x}-preview > [data-line]`,Nn=(t,e)=>+getComputedStyle(t).getPropertyValue(e).replace("px",""),TS=(t,e)=>{const i=Kp(()=>{t.removeEventListener("scroll",n),t.addEventListener("scroll",n),e.removeEventListener("scroll",n),e.addEventListener("scroll",n)},50),n=r=>{const s=t.clientHeight,o=e.clientHeight,l=t.scrollHeight,a=e.scrollHeight,u=(l-s)/(a-o);r.target===t?(e.removeEventListener("scroll",n),e.scrollTo({top:t.scrollTop/u}),i()):(t.removeEventListener("scroll",n),t.scrollTo({top:e.scrollTop*u}),i())};return[()=>{i().finally(()=>{t.dispatchEvent(new Event("scroll"))})},()=>{t.removeEventListener("scroll",n),e.removeEventListener("scroll",n)}]},AS=(t,e,i)=>{const{view:n}=i,r=Jp(),s=g=>n.lineBlockAt(n.state.doc.line(g+1).from).top,o=g=>n.lineBlockAt(n.state.doc.line(g+1).from).bottom;let l=[],a=[],u=[];const c=()=>{l=[],a=Array.from(e.querySelectorAll(CS)),u=a.map(v=>Number(v.dataset.line));const g=[...u],{lines:b}=n.state.doc;let y=g.shift()||0,w=g.shift()||b;for(let v=0;v{let y=1;for(let w=a.length-1;w-1>=0;w--){const v=a[w],Q=a[w-1];if(v.offsetTop+v.offsetHeight>b&&Q.offsetTop=0;w--){const v=o(l[w].end),Q=s(l[w].start);if(v>g&&Q<=g){y=y{var g,b,y;if(d!==0)return!1;f++;const{scrollDOM:w,contentHeight:v}=n;let Q=Nn(e,"padding-top");const P=n.lineBlockAtHeight(w.scrollTop),{number:_}=n.state.doc.lineAt(P.from),R=l[_-1];if(!R)return!1;let L=1;const I=e.querySelector(`[data-line="${R.start}"]`)||((g=e.firstElementChild)==null?void 0:g.firstElementChild),T=e.querySelector(`[data-line="${R.end+1}"]`)||((b=e.lastElementChild)==null?void 0:b.lastElementChild),M=w.scrollHeight-w.clientHeight,F=e.scrollHeight-e.clientHeight;let B=s(R.start),Y=o(R.end),J=I.offsetTop,ee=T.offsetTop-J;B===0&&(J=0,I===T?(Q=0,Y=v-w.offsetHeight,ee=F):ee=T.offsetTop),L=(w.scrollTop-B)/(Y-B);const re=T==((y=e.lastElementChild)==null?void 0:y.lastElementChild)?T.offsetTop+T.clientHeight:T.offsetTop;if(Y>=M||re>F){const ye=h(M,F);B=s(ye),L=(w.scrollTop-B)/(M-B);const Oe=e.querySelector(`[data-line="${ye}"]`);B>0&&Oe&&(J=Oe.offsetTop),ee=F-J+Nn(e,"padding-top")}const ue=J-Q+ee*L;r(e,ue,()=>{f--})},m=()=>{var g,b,y,w,v,Q;if(f!==0)return;d++;const{scrollDOM:P}=n,_=e.scrollTop,R=e.scrollHeight,L=P.scrollHeight-P.clientHeight,I=e.scrollHeight-e.clientHeight;let T=(g=e.firstElementChild)==null?void 0:g.firstElementChild,M=(b=e.firstElementChild)==null?void 0:b.lastElementChild;if(u.length>0){let Oe=Math.ceil(u[u.length-1]*(_/R)),le=u.findLastIndex(Se=>Se<=Oe);le=le===-1?0:le,Oe=u[le];for(let Se=le;Se>=0&&Se_){if(Se-1>=0){Se--;continue}Oe=-1,le=Se;break}else{if(Se+1L||M.offsetTop+M.offsetHeight>I){const Oe=h(L,I),le=e.querySelector(`[data-line="${Oe}"]`);F=le?le.offsetTop-Nn(le,"margin-top"):F,re=s(Oe),Y=(_-F)/(I-F),ye=L-re}else T===((Q=e.firstElementChild)==null?void 0:Q.firstElementChild)?(T===M&&(B=M.offsetTop+M.offsetHeight+ +getComputedStyle(M).marginBottom.replace("px","")),ye=ue,Y=Math.max(_/B,0)):(Y=Math.max((_-F)/(B-F),0),ye=ue-re);r(t,re+ye*Y,()=>{d--})},O=g=>{var b;const{scrollDOM:y,contentHeight:w}=n,v=y.clientHeight;if(w<=v||e.firstElementChild.clientHeight<=e.clientHeight||n.state.doc.lines<=((b=l[l.length-1])==null?void 0:b.end))return!1;g.target===t?p():m()};return[()=>{c(),t.addEventListener("scroll",O),e.addEventListener("scroll",O),t.dispatchEvent(new Event("scroll"))},()=>{t.removeEventListener("scroll",O),e.removeEventListener("scroll",O)}]},ES={tocItem:{type:Object,default:()=>({})},mdHeadingId:{type:Function,default:()=>{}},onActive:{type:Function,default:()=>{}},onClick:{type:Function,default:()=>{}},scrollElementOffsetTop:{type:Number,default:0}},Nm=Te({props:ES,setup(t){const e=H("scrollElementRef"),i=H("roorNodeRef"),n=pe();return te(()=>t.tocItem.active,r=>{r&&t.onActive(t.tocItem,n.value)}),Ae(()=>{t.tocItem.active&&t.onActive(t.tocItem,n.value)}),()=>{const{tocItem:r,mdHeadingId:s,onClick:o,scrollElementOffsetTop:l}=t;return $("div",{ref:n,class:[`${x}-catalog-link`,r.active&&`${x}-catalog-active`],onClick:a=>{if(a.stopPropagation(),o(a,r),a.defaultPrevented)return;const u=s(r.text,r.level,r.index),c=i.value.getElementById(u),h=e.value;if(c&&h){let f=c.offsetParent,d=c.offsetTop;if(h.contains(f))for(;f&&h!=f;)d+=f==null?void 0:f.offsetTop,f=f==null?void 0:f.offsetParent;const p=c.previousElementSibling;let m=0;p||(m=Nn(c,"margin-top")),h==null||h.scrollTo({top:d-l-m,behavior:"smooth"})}}},[$("span",{title:r.text},[r.text]),r.children&&r.children.length>0&&$("div",{class:`${x}-catalog-wrapper`},[r.children.map(a=>$(Nm,{mdHeadingId:s,key:`${r.text}-link-${a.level}-${a.text}`,tocItem:a,onActive:t.onActive,onClick:o,scrollElementOffsetTop:l},null))])])}}}),RS={editorId:{type:String,default:void 0},class:{type:String,default:""},mdHeadingId:{type:Function,default:t=>t},scrollElement:{type:[String,Object],default:void 0},theme:{type:String,default:"light"},offsetTop:{type:Number,default:20},scrollElementOffsetTop:{type:Number,default:0},onClick:{type:Function,default:void 0},onActive:{type:Function,default:void 0},isScrollElementInShadow:{type:Boolean,default:!1},syncWith:{type:String,default:"preview"},catalogMaxDepth:{type:Number,default:void 0}},Jn=Te({name:"MdCatalog",props:RS,emits:["onClick","onActive"],setup(t,e){const i=t.editorId,n=`#${i}-preview-wrapper`,r=ct({list:[],show:!1,scrollElement:t.scrollElement||n}),s=Tn(),o=pe(),l=pe(),a=pe(),u=pe(),c=Tn(),h=pe({});Ct("scrollElementRef",l),Ct("roorNodeRef",u);const f=He(()=>{const y=[];return r.list.forEach((w,v)=>{if(t.catalogMaxDepth&&w.level>t.catalogMaxDepth)return;const{text:Q,level:P,line:_}=w,R={level:P,text:Q,line:_,index:v+1,active:s.value===w};if(y.length===0)y.push(R);else{let L=y[y.length-1];if(R.level>L.level)for(let I=L.level+1;I<=6;I++){const{children:T}=L;if(!T){L.children=[R];break}if(L=T[T.length-1],R.level<=L.level){T.push(R);break}}else y.push(R)}}),y}),d=()=>{var y;if(r.scrollElement instanceof HTMLElement)return r.scrollElement;let w=document;return(r.scrollElement===n||t.isScrollElementInShadow)&&(w=(y=o.value)==null?void 0:y.getRootNode()),w.querySelector(r.scrollElement)},p=y=>{if(y.length===0)return s.value=void 0,r.list=[],!1;const{activeHead:w}=y.reduce((v,Q,P)=>{var _;let R=0;if(t.syncWith==="preview"){const L=(_=u.value)==null?void 0:_.getElementById(t.mdHeadingId(Q.text,Q.level,P+1));L instanceof HTMLElement&&(R=N2(L,l.value))}else{const L=c.value;if(L){const I=L.lineBlockAt(L.state.doc.line(Q.line+1).from).top,T=L.scrollDOM.scrollTop;R=I-T}}return Rv.minTop?{activeHead:Q,minTop:R}:v},{activeHead:y[0],minTop:Number.MIN_SAFE_INTEGER});s.value=w,r.list=y},m=(y,w)=>{var v;h.value.top=w.offsetTop+Nn(w,"padding-top")+"px",(v=t.onActive)==null||v.call(t,y,w),e.emit("onActive",y,w)},O=()=>{p(r.list)},g=y=>{var w,v,Q;if((w=a.value)==null||w.removeEventListener("scroll",O),t.syncWith==="editor")a.value=(v=c.value)==null?void 0:v.scrollDOM;else{const P=d();l.value=P,a.value=P===document.documentElement?document:P}p(y),(Q=a.value)==null||Q.addEventListener("scroll",O)},b=y=>{c.value=y};return te([()=>t.syncWith,c,()=>t.catalogMaxDepth],()=>{g(r.list)}),Ae(()=>{u.value=o.value.getRootNode(),X.on(i,{name:ss,callback:g}),X.on(i,{name:pl,callback:b}),X.emit(i,nm),X.emit(i,om)}),Mn(()=>{var y;X.remove(i,ss,g),X.remove(i,pl,b),(y=a.value)==null||y.removeEventListener("scroll",O)}),()=>$("div",{class:[`${x}-catalog`,t.theme==="dark"&&`${x}-catalog-dark`,t.class||""],ref:o},[f.value.length>0&&$(Gs,null,[$("div",{class:`${x}-catalog-indicator`,style:h.value},null),$("div",{class:`${x}-catalog-container`},[f.value.map(y=>$(Nm,{mdHeadingId:t.mdHeadingId,tocItem:y,key:`link-${y.level}-${y.text}`,onActive:m,onClick:(w,v)=>{var Q;(Q=t.onClick)==null||Q.call(t,w,v),e.emit("onClick",w,v)},scrollElementOffsetTop:t.scrollElementOffsetTop},null))])])])}});Jn.install=t=>(t.component(Jn.name,Jn),t);let Qu=[],Gm=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,i=0;e>1;if(t=Gm[n])e=n+1;else return!0;if(e==i)return!1}}function Od(t){return t>=127462&&t<=127487}const gd=8205;function LS(t,e,i=!0,n=!0){return(i?Um:MS)(t,e,n)}function Um(t,e,i){if(e==t.length)return e;e&&Hm(t.charCodeAt(e))&&Km(t.charCodeAt(e-1))&&e--;let n=_a(t,e);for(e+=bd(n);e=0&&Od(_a(t,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function MS(t,e,i){for(;e>1;){let n=Um(t,e-2,i);if(n=56320&&t<57344}function Km(t){return t>=55296&&t<56320}function bd(t){return t<65536?1:2}class de{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,i,n){[e,i]=Or(this,e,i);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(i,this.length,r,1),Oi.from(r,this.length-(i-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,i=this.length){[e,i]=Or(this,e,i);let n=[];return this.decompose(e,i,n,0),Oi.from(n,i-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let i=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new as(this),s=new as(e);for(let o=i,l=i;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(l+=r.value.length,r.done||l>=n)return!0}}iter(e=1){return new as(this,e)}iterRange(e,i=this.length){return new Jm(this,e,i)}iterLines(e,i){let n;if(e==null)n=this.iter();else{i==null&&(i=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,i==this.lines+1?this.length:i<=1?0:this.line(i-1).to))}return new eO(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?de.empty:e.length<=32?new Le(e):Oi.from(Le.split(e,[]))}}class Le extends de{constructor(e,i=ZS(e)){super(),this.text=e,this.length=i}get lines(){return this.text.length}get children(){return null}lineInner(e,i,n,r){for(let s=0;;s++){let o=this.text[s],l=r+o.length;if((i?n:l)>=e)return new IS(r,l,n,o);r=l+1,n++}}decompose(e,i,n,r){let s=e<=0&&i>=this.length?this:new Le(vd(this.text,e,i),Math.min(i,this.length)-Math.max(0,e));if(r&1){let o=n.pop(),l=tl(s.text,o.text.slice(),0,s.length);if(l.length<=32)n.push(new Le(l,o.length+s.length));else{let a=l.length>>1;n.push(new Le(l.slice(0,a)),new Le(l.slice(a)))}}else n.push(s)}replace(e,i,n){if(!(n instanceof Le))return super.replace(e,i,n);[e,i]=Or(this,e,i);let r=tl(this.text,tl(n.text,vd(this.text,0,e)),i),s=this.length+n.length-(i-e);return r.length<=32?new Le(r,s):Oi.from(Le.split(r,[]),s)}sliceString(e,i=this.length,n=` `){[e,i]=Or(this,e,i);let r="";for(let s=0,o=0;s<=i&&oe&&o&&(r+=n),es&&(r+=l.slice(Math.max(0,e-s),i-s)),s=a+1}return r}flatten(e){for(let i of this.text)e.push(i)}scanIdentical(){return 0}static split(e,i){let n=[],r=-1;for(let s of e)n.push(s),r+=s.length+1,n.length==32&&(i.push(new Le(n,r)),n=[],r=-1);return r>-1&&i.push(new Le(n,r)),i}}class Oi extends de{constructor(e,i){super(),this.children=e,this.length=i,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,i,n,r){for(let s=0;;s++){let o=this.children[s],l=r+o.length,a=n+o.lines-1;if((i?a:l)>=e)return o.lineInner(e,i,n,r);r=l+1,n=a+1}}decompose(e,i,n,r){for(let s=0,o=0;o<=i&&s=o){let u=r&((o<=e?1:0)|(a>=i?2:0));o>=e&&a<=i&&!u?n.push(l):l.decompose(e-o,i-o,n,u)}o=a+1}}replace(e,i,n){if([e,i]=Or(this,e,i),n.lines=s&&i<=l){let a=o.replace(e-s,i-s,n),u=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>u>>6){let c=this.children.slice();return c[r]=a,new Oi(c,this.length-(i-e)+n.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,i,n)}sliceString(e,i=this.length,n=` `){[e,i]=Or(this,e,i);let r="";for(let s=0,o=0;se&&s&&(r+=n),eo&&(r+=l.sliceString(e-o,i-o,n)),o=a+1}return r}flatten(e){for(let i of this.children)i.flatten(e)}scanIdentical(e,i){if(!(e instanceof Oi))return 0;let n=0,[r,s,o,l]=i>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=i,s+=i){if(r==o||s==l)return n;let a=this.children[r],u=e.children[s];if(a!=u)return n+a.scanIdentical(u,i);n+=a.length+1}}static from(e,i=e.reduce((n,r)=>n+r.length+1,-1)){let n=0;for(let d of e)n+=d.lines;if(n<32){let d=[];for(let p of e)p.flatten(d);return new Le(d,i)}let r=Math.max(32,n>>5),s=r<<1,o=r>>1,l=[],a=0,u=-1,c=[];function h(d){let p;if(d.lines>s&&d instanceof Oi)for(let m of d.children)h(m);else d.lines>o&&(a>o||!a)?(f(),l.push(d)):d instanceof Le&&a&&(p=c[c.length-1])instanceof Le&&d.lines+p.lines<=32?(a+=d.lines,u+=d.length+1,c[c.length-1]=new Le(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>r&&f(),a+=d.lines,u+=d.length+1,c.push(d))}function f(){a!=0&&(l.push(c.length==1?c[0]:Oi.from(c,u)),u=-1,a=c.length=0)}for(let d of e)h(d);return f(),l.length==1?l[0]:new Oi(l,i)}}de.empty=new Le([""],0);function ZS(t){let e=-1;for(let i of t)e+=i.length+1;return e}function tl(t,e,i=0,n=1e9){for(let r=0,s=0,o=!0;s=i&&(a>n&&(l=l.slice(0,n-r)),r0?1:(e instanceof Le?e.text.length:e.children.length)<<1]}nextInner(e,i){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],s=this.offsets[n],o=s>>1,l=r instanceof Le?r.text.length:r.children.length;if(o==(i>0?l:0)){if(n==0)return this.done=!0,this.value="",this;i>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(i>0?0:1)){if(this.offsets[n]+=i,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(r instanceof Le){let a=r.text[o+(i<0?-1:0)];if(this.offsets[n]+=i,a.length>Math.max(0,e))return this.value=e==0?a:i>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[o+(i<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=i):(i<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(i>0?1:(a instanceof Le?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Jm{constructor(e,i,n){this.value="",this.done=!1,this.cursor=new as(e,i>n?-1:1),this.pos=i>n?e.length:0,this.from=Math.min(i,n),this.to=Math.max(i,n)}nextInner(e,i){if(i<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,i<0?this.pos-this.to:this.from-this.pos);let n=i<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*i,this.value=r.length<=n?r:i<0?r.slice(r.length-n):r.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class eO{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:i,lineBreak:n,value:r}=this.inner.next(e);return i&&this.afterBreak?(this.value="",this.afterBreak=!1):i?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(de.prototype[Symbol.iterator]=function(){return this.iter()},as.prototype[Symbol.iterator]=Jm.prototype[Symbol.iterator]=eO.prototype[Symbol.iterator]=function(){return this});let IS=class{constructor(e,i,n,r){this.from=e,this.to=i,this.number=n,this.text=r}get length(){return this.to-this.from}};function Or(t,e,i){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,i))]}function Ge(t,e,i=!0,n=!0){return LS(t,e,i,n)}function XS(t){return t>=56320&&t<57344}function zS(t){return t>=55296&&t<56320}function Ni(t,e){let i=t.charCodeAt(e);if(!zS(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return XS(n)?(i-55296<<10)+(n-56320)+65536:i}function tO(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function vn(t){return t<65536?1:2}const _u=/\r\n?|\n/;var ut=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(ut||(ut={}));class $i{constructor(e){this.sections=e}get length(){let e=0;for(let i=0;ie)return s+(e-r);s+=l}else{if(n!=ut.Simple&&u>=e&&(n==ut.TrackDel&&re||n==ut.TrackBefore&&re))return null;if(u>e||u==e&&i<0&&!l)return e==r||i<0?s:s+a;s+=a}r=u}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,i=e){for(let n=0,r=0;n=0&&r<=i&&l>=e)return ri?"cover":!0;r=l}return!1}toString(){let e="";for(let i=0;i=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(i=>typeof i!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new $i(e)}static create(e){return new $i(e)}}class Fe extends $i{constructor(e,i){super(e),this.inserted=i}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Pu(this,(i,n,r,s,o)=>e=e.replace(r,r+(n-i),o),!1),e}mapDesc(e,i=!1){return Cu(this,e,i,!0)}invert(e){let i=this.sections.slice(),n=[];for(let r=0,s=0;r=0){i[r]=l,i[r+1]=o;let a=r>>1;for(;n.length0&&tn(n,i,s.text),s.forward(c),l+=c}let u=e[o++];for(;l>1].toJSON()))}return e}static of(e,i,n){let r=[],s=[],o=0,l=null;function a(c=!1){if(!c&&!r.length)return;of||h<0||f>i)throw new RangeError(`Invalid change range ${h} to ${f} (in doc of length ${i})`);let p=d?typeof d=="string"?de.of(d.split(n||_u)):d:de.empty,m=p.length;if(h==f&&m==0)return;ho&&nt(r,h-o,-1),nt(r,f-h,m),tn(s,r,p),o=f}}return u(e),a(!l),l}static empty(e){return new Fe(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let i=[],n=[];for(let r=0;rl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)i.push(s[0],0);else{for(;n.length=0&&i<=0&&i==t[r+1]?t[r]+=e:r>=0&&e==0&&t[r]==0?t[r+1]+=i:n?(t[r]+=e,t[r+1]+=i):t.push(e,i)}function tn(t,e,i){if(i.length==0)return;let n=e.length-2>>1;if(n>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],a=t.sections[o++];e(r,u,s,c,h),r=u,s=c}}}function Cu(t,e,i,n=!1){let r=[],s=n?[]:null,o=new _s(t),l=new _s(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);nt(r,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let u=0,c=o.len;for(;c;)if(l.ins==-1){let h=Math.min(c,l.len);u+=h,c-=h,l.forward(h)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||n.length>u),s.forward2(a),o.forward(a)}}}}class _s{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return i>=e.length?de.empty:e[i]}textBit(e){let{inserted:i}=this.set,n=this.i-2>>1;return n>=i.length&&!e?de.empty:i[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Ki{constructor(e,i,n,r){this.from=e,this.to=i,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,i=-1){let n,r;return this.empty?n=r=e.mapPos(this.from,i):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new Ki(n,r,this.flags,this.goalColumn)}extend(e,i=e,n=0){if(e<=this.anchor&&i>=this.anchor)return E.range(e,i,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(i-this.anchor)?e:i;return E.range(this.anchor,r,void 0,void 0,n)}eq(e,i=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!i||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return E.range(e.anchor,e.head)}static create(e,i,n,r){return new Ki(e,i,n,r)}}class E{constructor(e,i){this.ranges=e,this.mainIndex=i}map(e,i=-1){return e.empty?this:E.create(this.ranges.map(n=>n.map(e,i)),this.mainIndex)}eq(e,i=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new E(e.ranges.map(i=>Ki.fromJSON(i)),e.main)}static single(e,i=e){return new E([E.range(e,i)],0)}static create(e,i=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,r=0;rr.from-s.from),i=e.indexOf(n);for(let r=1;rs.head?E.range(a,l):E.range(l,a))}}return new E(e,i)}}function nO(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let Mc=0;class G{constructor(e,i,n,r,s){this.combine=e,this.compareInput=i,this.compare=n,this.isStatic=r,this.id=Mc++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new G(e.combine||(i=>i),e.compareInput||((i,n)=>i===n),e.compare||(e.combine?(i,n)=>i===n:Zc),!!e.static,e.enables)}of(e){return new il([],this,0,e)}compute(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new il(e,this,1,i)}computeN(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new il(e,this,2,i)}from(e,i){return i||(i=n=>n),this.compute([e],n=>i(n.field(e)))}}function Zc(t,e){return t==e||t.length==e.length&&t.every((i,n)=>i===e[n])}class il{constructor(e,i,n,r){this.dependencies=e,this.facet=i,this.type=n,this.value=r,this.id=Mc++}dynamicSlot(e){var i;let n=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,u=!1,c=[];for(let h of this.dependencies)h=="doc"?a=!0:h=="selection"?u=!0:(((i=e[h.id])!==null&&i!==void 0?i:1)&1)==0&&c.push(e[h.id]);return{create(h){return h.values[o]=n(h),1},update(h,f){if(a&&f.docChanged||u&&(f.docChanged||f.selection)||Tu(h,c)){let d=n(h);if(l?!yd(d,h.values[o],r):!r(d,h.values[o]))return h.values[o]=d,1}return 0},reconfigure:(h,f)=>{let d,p=f.config.address[s];if(p!=null){let m=vl(f,p);if(this.dependencies.every(O=>O instanceof G?f.facet(O)===h.facet(O):O instanceof Yt?f.field(O,!1)==h.field(O,!1):!0)||(l?yd(d=n(h),m,r):r(d=n(h),m)))return h.values[o]=m,0}else d=n(h);return h.values[o]=d,1}}}get extension(){return this}}function yd(t,e,i){if(t.length!=e.length)return!1;for(let n=0;nt[a.id]),r=i.map(a=>a.type),s=n.filter(a=>!(a&1)),o=t[e.id]>>1;function l(a){let u=[];for(let c=0;cn===r),e);return e.provide&&(i.provides=e.provide(i)),i}create(e){let i=e.facet(xo).find(n=>n.field==this);return((i==null?void 0:i.create)||this.createF)(e)}slot(e){let i=e[this.id]>>1;return{create:n=>(n.values[i]=this.create(n),1),update:(n,r)=>{let s=n.values[i],o=this.updateF(s,r);return this.compareF(s,o)?0:(n.values[i]=o,1)},reconfigure:(n,r)=>{let s=n.facet(xo),o=r.facet(xo),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[i]=l.create(n),1):r.config.address[this.id]!=null?(n.values[i]=r.field(this),0):(n.values[i]=this.create(n),1)}}}init(e){return[this,xo.of({field:this,create:e})]}get extension(){return this}}const yn={lowest:4,low:3,default:2,high:1,highest:0};function jr(t){return e=>new rO(e,t)}const Ii={highest:jr(yn.highest),high:jr(yn.high),default:jr(yn.default),low:jr(yn.low),lowest:jr(yn.lowest)};class rO{constructor(e,i){this.inner=e,this.prec=i}get extension(){return this}}class gi{of(e){return new Au(this,e)}reconfigure(e){return gi.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Au{constructor(e,i){this.compartment=e,this.inner=i}get extension(){return this}}class bl{constructor(e,i,n,r,s,o){for(this.base=e,this.compartments=i,this.dynamicSlots=n,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,i,n){let r=[],s=Object.create(null),o=new Map;for(let f of FS(e,i,o))f instanceof Yt?r.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],u=[];for(let f of r)l[f.id]=u.length<<1,u.push(d=>f.slot(d));let c=n==null?void 0:n.config.facets;for(let f in s){let d=s[f],p=d[0].facet,m=c&&c[f]||[];if(d.every(O=>O.type==0))if(l[p.id]=a.length<<1|1,Zc(m,d))a.push(n.facet(p));else{let O=p.combine(d.map(g=>g.value));a.push(n&&p.compare(O,n.facet(p))?n.facet(p):O)}else{for(let O of d)O.type==0?(l[O.id]=a.length<<1|1,a.push(O.value)):(l[O.id]=u.length<<1,u.push(g=>O.dynamicSlot(g)));l[p.id]=u.length<<1,u.push(O=>jS(O,p,d))}}let h=u.map(f=>f(l));return new bl(e,o,h,l,a,s)}}function FS(t,e,i){let n=[[],[],[],[],[]],r=new Map;function s(o,l){let a=r.get(o);if(a!=null){if(a<=l)return;let u=n[a].indexOf(o);u>-1&&n[a].splice(u,1),o instanceof Au&&i.delete(o.compartment)}if(r.set(o,l),Array.isArray(o))for(let u of o)s(u,l);else if(o instanceof Au){if(i.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;i.set(o.compartment,u),s(u,l)}else if(o instanceof rO)s(o.inner,o.prec);else if(o instanceof Yt)n[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof il)n[l].push(o),o.facet.extensions&&s(o.facet.extensions,yn.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(u==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(u,l)}}return s(t,yn.default),n.reduce((o,l)=>o.concat(l))}function us(t,e){if(e&1)return 2;let i=e>>1,n=t.status[i];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[i]=4;let r=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|r}function vl(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const sO=G.define(),Eu=G.define({combine:t=>t.some(e=>e),static:!0}),oO=G.define({combine:t=>t.length?t[0]:void 0,static:!0}),lO=G.define(),aO=G.define(),uO=G.define(),cO=G.define({combine:t=>t.length?t[0]:!1});class Xi{constructor(e,i){this.type=e,this.value=i}static define(){return new BS}}class BS{of(e){return new Xi(this,e)}}class VS{constructor(e){this.map=e}of(e){return new ae(this,e)}}class ae{constructor(e,i){this.type=e,this.value=i}map(e){let i=this.type.map(this.value,e);return i===void 0?void 0:i==this.value?this:new ae(this.type,i)}is(e){return this.type==e}static define(e={}){return new VS(e.map||(i=>i))}static mapEffects(e,i){if(!e.length)return e;let n=[];for(let r of e){let s=r.map(i);s&&n.push(s)}return n}}ae.reconfigure=ae.define();ae.appendConfig=ae.define();class Xe{constructor(e,i,n,r,s,o){this.startState=e,this.changes=i,this.selection=n,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,n&&nO(n,i.newLength),s.some(l=>l.type==Xe.time)||(this.annotations=s.concat(Xe.time.of(Date.now())))}static create(e,i,n,r,s,o){return new Xe(e,i,n,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let i of this.annotations)if(i.type==e)return i.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let i=this.annotation(Xe.userEvent);return!!(i&&(i==e||i.length>e.length&&i.slice(0,e.length)==e&&i[e.length]=="."))}}Xe.time=Xi.define();Xe.userEvent=Xi.define();Xe.addToHistory=Xi.define();Xe.remote=Xi.define();function qS(t,e){let i=[];for(let n=0,r=0;;){let s,o;if(n=t[n]))s=t[n++],o=t[n++];else if(r=0;r--){let s=n[r](t);s instanceof Xe?t=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Xe?t=s[0]:t=fO(e,er(s),!1)}return t}function YS(t){let e=t.startState,i=e.facet(uO),n=t;for(let r=i.length-1;r>=0;r--){let s=i[r](t);s&&Object.keys(s).length&&(n=hO(n,Ru(e,s,t.changes.newLength),!0))}return n==t?t:Xe.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const NS=[];function er(t){return t==null?NS:Array.isArray(t)?t:[t]}var Je=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Je||(Je={}));const GS=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Du;try{Du=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function US(t){if(Du)return Du.test(t);for(let e=0;e"€"&&(i.toUpperCase()!=i.toLowerCase()||GS.test(i)))return!0}return!1}function HS(t){return e=>{if(!/\S/.test(e))return Je.Space;if(US(e))return Je.Word;for(let i=0;i-1)return Je.Word;return Je.Other}}class fe{constructor(e,i,n,r,s,o){this.config=e,this.doc=i,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;lr.set(u,a)),i=null),r.set(l.value.compartment,l.value.extension)):l.is(ae.reconfigure)?(i=null,n=l.value):l.is(ae.appendConfig)&&(i=null,n=er(n).concat(l.value));let s;i?s=e.startState.values.slice():(i=bl.resolve(n,r,this),s=new fe(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(a,u)=>u.reconfigure(a,this),null).values);let o=e.startState.facet(Eu)?e.newSelection:e.newSelection.asSingle();new fe(i,e.newDoc,o,s,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:e},range:E.cursor(i.from+e.length)}))}changeByRange(e){let i=this.selection,n=e(i.ranges[0]),r=this.changes(n.changes),s=[n.range],o=er(n.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return fe.create({doc:e.doc,selection:E.fromJSON(e.selection),extensions:i.extensions?r.concat([i.extensions]):r})}static create(e={}){let i=bl.resolve(e.extensions||[],new Map),n=e.doc instanceof de?e.doc:de.of((e.doc||"").split(i.staticFacet(fe.lineSeparator)||_u)),r=e.selection?e.selection instanceof E?e.selection:E.single(e.selection.anchor,e.selection.head):E.single(0);return nO(r,n.length),i.staticFacet(Eu)||(r=r.asSingle()),new fe(i,n,r,i.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(fe.tabSize)}get lineBreak(){return this.facet(fe.lineSeparator)||` `}get readOnly(){return this.facet(cO)}phrase(e,...i){for(let n of this.facet(fe.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return i.length&&(e=e.replace(/\$(\$|\d*)/g,(n,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>i.length?n:i[s-1]})),e}languageDataAt(e,i,n=-1){let r=[];for(let s of this.facet(sO))for(let o of s(this,i,n))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let i=this.languageDataAt("wordChars",e);return HS(i.length?i[0]:"")}wordAt(e){let{text:i,from:n,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=Ge(i,o,!1);if(s(i.slice(a,o))!=Je.Word)break;o=a}for(;lt.length?t[0]:4});fe.lineSeparator=oO;fe.readOnly=cO;fe.phrases=G.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every(r=>t[r]==e[r])}});fe.languageData=sO;fe.changeFilter=lO;fe.transactionFilter=aO;fe.transactionExtender=uO;gi.reconfigure=ae.define();function na(t,e,i={}){let n={};for(let r of t)for(let s of Object.keys(r)){let o=r[s],l=n[s];if(l===void 0)n[s]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(i,s))n[s]=i[s](l,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)n[r]===void 0&&(n[r]=e[r]);return n}class on{eq(e){return this==e}range(e,i=e){return Lu.create(e,i,this)}}on.prototype.startSide=on.prototype.endSide=0;on.prototype.point=!1;on.prototype.mapMode=ut.TrackDel;function Ic(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let Lu=class dO{constructor(e,i,n){this.from=e,this.to=i,this.value=n}static create(e,i,n){return new dO(e,i,n)}};function Mu(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Xc{constructor(e,i,n,r){this.from=e,this.to=i,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,i,n,r=0){let s=n?this.to:this.from;for(let o=r,l=s.length;;){if(o==l)return o;let a=o+l>>1,u=s[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-i;if(a==o)return u>=0?o:l;u>=0?l=a:o=a+1}}between(e,i,n,r){for(let s=this.findIndex(i,-1e9,!0),o=this.findIndex(n,1e9,!1,s);sd||f==d&&u.startSide>0&&u.endSide<=0)continue;(d-f||u.endSide-u.startSide)<0||(o<0&&(o=f),u.point&&(l=Math.max(l,d-f)),n.push(u),r.push(f-o),s.push(d-o))}return{mapped:n.length?new Xc(r,s,n,l):null,pos:o}}}class be{constructor(e,i,n,r){this.chunkPos=e,this.chunk=i,this.nextLayer=n,this.maxPoint=r}static create(e,i,n,r){return new be(e,i,n,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let i of this.chunk)e+=i.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:i=[],sort:n=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(i.length==0&&!o)return this;if(n&&(i=i.slice().sort(Mu)),this.isEmpty)return i.length?be.of(i):this;let l=new pO(this,null,-1).goto(0),a=0,u=[],c=new gr;for(;l.value||a=0){let h=i[a++];c.addInner(h.from,h.to,h.value)||u.push(h)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||sl.to||s=s&&e<=s+o.length&&o.between(s,e-s,i-s,n)===!1)return}this.nextLayer.between(e,i,n)}}iter(e=0){return Ps.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,i=0){return Ps.from(e).goto(i)}static compare(e,i,n,r,s=-1){let o=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),l=i.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=s),a=xd(o,l,n),u=new Fr(o,a,s),c=new Fr(l,a,s);n.iterGaps((h,f,d)=>kd(u,h,c,f,d,r)),n.empty&&n.length==0&&kd(u,0,c,0,0,r)}static eq(e,i,n=0,r){r==null&&(r=999999999);let s=e.filter(c=>!c.isEmpty&&i.indexOf(c)<0),o=i.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let l=xd(s,o),a=new Fr(s,l,0).goto(n),u=new Fr(o,l,0).goto(n);for(;;){if(a.to!=u.to||!Zu(a.active,u.active)||a.point&&(!u.point||!Ic(a.point,u.point)))return!1;if(a.to>r)return!0;a.next(),u.next()}}static spans(e,i,n,r,s=-1){let o=new Fr(e,null,s).goto(i),l=i,a=o.openStart;for(;;){let u=Math.min(o.to,n);if(o.point){let c=o.activeForPoint(o.to),h=o.pointFroml&&(r.span(l,u,o.active,a),a=o.openEnd(u));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,i=!1){let n=new gr;for(let r of e instanceof Lu?[e]:i?KS(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return be.empty;let i=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=be.empty;r=r.nextLayer)i=new be(r.chunkPos,r.chunk,i,Math.max(r.maxPoint,i.maxPoint));return i}}be.empty=new be([],[],null,-1);function KS(t){if(t.length>1)for(let e=t[0],i=1;i0)return t.slice().sort(Mu);e=n}return t}be.empty.nextLayer=be.empty;class gr{finishChunk(e){this.chunks.push(new Xc(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,i,n){this.addInner(e,i,n)||(this.nextLayer||(this.nextLayer=new gr)).add(e,i,n)}addInner(e,i,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(i-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=i,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,i-e)),!0)}addChunk(e,i){if((e-this.lastTo||i.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,i.maxPoint),this.chunks.push(i),this.chunkPos.push(e);let n=i.value.length-1;return this.last=i.value[n],this.lastFrom=i.from[n]+e,this.lastTo=i.to[n]+e,!0}finish(){return this.finishInner(be.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let i=be.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,i}}function xd(t,e,i){let n=new Map;for(let s of t)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&r.push(new pO(o,i,n,s));return r.length==1?r[0]:new Ps(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,i=-1e9){for(let n of this.heap)n.goto(e,i);for(let n=this.heap.length>>1;n>=0;n--)Pa(this.heap,n);return this.next(),this}forward(e,i){for(let n of this.heap)n.forward(e,i);for(let n=this.heap.length>>1;n>=0;n--)Pa(this.heap,n);(this.to-e||this.value.endSide-i)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Pa(this.heap,0)}}}function Pa(t,e){for(let i=t[e];;){let n=(e<<1)+1;if(n>=t.length)break;let r=t[n];if(n+1=0&&(r=t[n+1],n++),i.compare(r)<0)break;t[n]=i,t[e]=r,e=n}}class Fr{constructor(e,i,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ps.from(e,i,n)}goto(e,i=-1e9){return this.cursor.goto(e,i),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=i,this.openStart=-1,this.next(),this}forward(e,i){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-i)<0;)this.removeActive(this.minActive);this.cursor.forward(e,i)}removeActive(e){ko(this.active,e),ko(this.activeTo,e),ko(this.activeRank,e),this.minActive=Sd(this.active,this.activeTo)}addActive(e){let i=0,{value:n,to:r,rank:s}=this.cursor;for(;i0;)i++;So(this.active,i,n),So(this.activeTo,i,r),So(this.activeRank,i,s),e&&So(e,i,this.cursor.from),this.minActive=Sd(this.active,this.activeTo)}next(){let e=this.to,i=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&ko(n,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(i&&this.cursor.to==this.to&&this.cursor.from=0&&n[r]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&i.push(this.active[n]);return i.reverse()}openEnd(e){let i=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)i++;return i}}function kd(t,e,i,n,r,s){t.goto(e),i.goto(n);let o=n+r,l=n,a=n-e,u=!!s.boundChange;for(let c=!1;;){let h=t.to+a-i.to,f=h||t.endSide-i.endSide,d=f<0?t.to+a:i.to,p=Math.min(d,o);if(t.point||i.point?(t.point&&i.point&&Ic(t.point,i.point)&&Zu(t.activeForPoint(t.to),i.activeForPoint(i.to))||s.comparePoint(l,p,t.point,i.point),c=!1):(c&&s.boundChange(l),p>l&&!Zu(t.active,i.active)&&s.compareRange(l,p,t.active,i.active),u&&po)break;l=d,f<=0&&t.next(),f>=0&&i.next()}}function Zu(t,e){if(t.length!=e.length)return!1;for(let i=0;i=e;n--)t[n+1]=t[n];t[e]=i}function Sd(t,e){let i=-1,n=1e9;for(let r=0;r=e)return r;if(r==t.length)break;s+=t.charCodeAt(r)==9?i-s%i:1,r=Ge(t,r)}return t.length}const Iu="ͼ",wd=typeof Symbol>"u"?"__"+Iu:Symbol.for(Iu),Xu=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),$d=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ln{constructor(e,i){this.rules=[];let{finish:n}=i||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,l,a,u){let c=[],h=/^@(\w+)\b/.exec(o[0]),f=h&&h[1]=="keyframes";if(h&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))s(d.split(/,\s*/).map(m=>o.map(O=>m.replace(/&/,O))).reduce((m,O)=>m.concat(O)),p,a);else if(p&&typeof p=="object"){if(!h)throw new RangeError("The value of a property ("+d+") should be a primitive value.");s(r(d),p,c,f)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(c.length||f)&&a.push((n&&!h&&!u?o.map(n):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=$d[wd]||1;return $d[wd]=e+1,Iu+e.toString(36)}static mount(e,i,n){let r=e[Xu],s=n&&n.nonce;r?s&&r.setNonce(s):r=new ew(e,s),r.mount(Array.isArray(i)?i:[i],e)}}let Qd=new Map;class ew{constructor(e,i){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Qd.get(n);if(s)return e[Xu]=s;this.sheet=new r.CSSStyleSheet,Qd.set(n,this)}else this.styleTag=n.createElement("style"),i&&this.styleTag.setAttribute("nonce",i);this.modules=[],e[Xu]=this}mount(e,i){let n=this.sheet,r=0,s=0;for(let o=0;o-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,l),n)for(let u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tw=typeof navigator<"u"&&/Mac/.test(navigator.platform),iw=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ke=0;Ke<10;Ke++)an[48+Ke]=an[96+Ke]=String(Ke);for(var Ke=1;Ke<=24;Ke++)an[Ke+111]="F"+Ke;for(var Ke=65;Ke<=90;Ke++)an[Ke]=String.fromCharCode(Ke+32),Cs[Ke]=String.fromCharCode(Ke);for(var Ca in an)Cs.hasOwnProperty(Ca)||(Cs[Ca]=an[Ca]);function nw(t){var e=tw&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||iw&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",i=!e&&t.key||(t.shiftKey?Cs:an)[t.keyCode]||t.key||"Unidentified";return i=="Esc"&&(i="Escape"),i=="Del"&&(i="Delete"),i=="Left"&&(i="ArrowLeft"),i=="Up"&&(i="ArrowUp"),i=="Right"&&(i="ArrowRight"),i=="Down"&&(i="ArrowDown"),i}function We(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&typeof i=="object"&&i.nodeType==null&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];typeof r=="string"?t.setAttribute(n,r):r!=null&&(t[n]=r)}e++}for(;e2);var q={mac:Cd||/Mac/.test(at.platform),windows:/Win/.test(at.platform),linux:/Linux|X11/.test(at.platform),ie:ra,ie_version:OO?zu.documentMode||6:Fu?+Fu[1]:ju?+ju[1]:0,gecko:_d,gecko_version:_d?+(/Firefox\/(\d+)/.exec(at.userAgent)||[0,0])[1]:0,chrome:!!Ta,chrome_version:Ta?+Ta[1]:0,ios:Cd,android:/Android\b/.test(at.userAgent),webkit:Pd,webkit_version:Pd?+(/\bAppleWebKit\/(\d+)/.exec(at.userAgent)||[0,0])[1]:0,safari:Bu,safari_version:Bu?+(/\bVersion\/(\d+(\.\d+)?)/.exec(at.userAgent)||[0,0])[1]:0,tabSize:zu.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function zc(t,e){for(let i in t)i=="class"&&e.class?e.class+=" "+t.class:i=="style"&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}const yl=Object.create(null);function jc(t,e,i){if(t==e)return!0;t||(t=yl),e||(e=yl);let n=Object.keys(t),r=Object.keys(e);if(n.length-0!=r.length-0)return!1;for(let s of n)if(s!=i&&(r.indexOf(s)==-1||t[s]!==e[s]))return!1;return!0}function rw(t,e){for(let i=t.attributes.length-1;i>=0;i--){let n=t.attributes[i].name;e[n]==null&&t.removeAttribute(n)}for(let i in e){let n=e[i];i=="style"?t.style.cssText=n:t.getAttribute(i)!=n&&t.setAttribute(i,n)}}function Td(t,e,i){let n=!1;if(e)for(let r in e)i&&r in i||(n=!0,r=="style"?t.style.cssText="":t.removeAttribute(r));if(i)for(let r in i)e&&e[r]==i[r]||(n=!0,r=="style"?t.style.cssText=i[r]:t.setAttribute(r,i[r]));return n}function sw(t){let e=Object.create(null);for(let i=0;i0?3e8:-4e8:i>0?1e8:-1e8,new An(e,i,i,n,e.widget||null,!1)}static replace(e){let i=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:s,end:o}=gO(e,i);n=(s?i?-3e8:-1:5e8)-1,r=(o?i?2e8:1:-6e8)+1}return new An(e,n,r,i,e.widget||null,!0)}static line(e){return new eo(e)}static set(e,i=!1){return be.of(e,i)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ve.none=be.empty;class Js extends ve{constructor(e){let{start:i,end:n}=gO(e);super(i?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?zc(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||yl}eq(e){return this==e||e instanceof Js&&this.tagName==e.tagName&&jc(this.attrs,e.attrs)}range(e,i=e){if(e>=i)throw new RangeError("Mark decorations may not be empty");return super.range(e,i)}}Js.prototype.point=!1;class eo extends ve{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof eo&&this.spec.class==e.spec.class&&jc(this.spec.attributes,e.spec.attributes)}range(e,i=e){if(i!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,i)}}eo.prototype.mapMode=ut.TrackBefore;eo.prototype.point=!0;class An extends ve{constructor(e,i,n,r,s,o){super(i,n,s,e),this.block=r,this.isReplace=o,this.mapMode=r?i<=0?ut.TrackBefore:ut.TrackAfter:ut.TrackDel}get type(){return this.startSide!=this.endSide?ft.WidgetRange:this.startSide<=0?ft.WidgetBefore:ft.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof An&&ow(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,i=e){if(this.isReplace&&(e>i||e==i&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&i!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,i)}}An.prototype.point=!0;function gO(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return i==null&&(i=t.inclusive),n==null&&(n=t.inclusive),{start:i??e,end:n??e}}function ow(t,e){return t==e||!!(t&&e&&t.compare(e))}function tr(t,e,i,n=0){let r=i.length-1;r>=0&&i[r]+n>=t?i[r]=Math.max(i[r],e):i.push(t,e)}class Ts extends on{constructor(e,i,n){super(),this.tagName=e,this.attributes=i,this.rank=n}eq(e){return e==this||e instanceof Ts&&this.tagName==e.tagName&&jc(this.attributes,e.attributes)}static create(e){return new Ts(e.tagName,e.attributes||yl,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,i=!1){return be.of(e,i)}}Ts.prototype.startSide=Ts.prototype.endSide=-1;function As(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function Vu(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function cs(t,e){if(!e.anchorNode)return!1;try{return Vu(t,e.anchorNode)}catch{return!1}}function hs(t){return t.nodeType==3?Rs(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function fs(t,e,i,n){return i?Ad(t,e,i,n,-1)||Ad(t,e,i,n,1):!1}function un(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function xl(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function Ad(t,e,i,n,r){for(;;){if(t==i&&e==n)return!0;if(e==(r<0?0:Zi(t))){if(t.nodeName=="DIV")return!1;let s=t.parentNode;if(!s||s.nodeType!=1)return!1;e=un(t)+(r<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(r<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=r<0?Zi(t):0}else return!1}}function Zi(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Es(t,e){let{left:i,right:n}=t;if(i==n)return t;let r=e?i:n;return{left:r,right:r,top:t.top,bottom:t.bottom}}function lw(t){let e=t.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function bO(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function aw(t,e,i,n,r,s,o,l){let a=t.ownerDocument,u=a.defaultView||window;for(let c=t,h=!1;c&&!h;)if(c.nodeType==1){let f,d=c==a.body,p=1,m=1;if(d)f=lw(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let b=c.getBoundingClientRect();({scaleX:p,scaleY:m}=bO(c,b)),f={left:b.left,right:b.left+c.clientWidth*p,top:b.top,bottom:b.top+c.clientHeight*m}}let O=0,g=0;if(r=="nearest")e.top0&&e.bottom>f.bottom+g&&(g=e.bottom-f.bottom+o)):e.bottom>f.bottom-o&&(g=e.bottom-f.bottom+o,i<0&&e.top-g0&&e.right>f.right+O&&(O=e.right-f.right+s)):e.right>f.right-s&&(O=e.right-f.right+s,i<0&&e.leftf.bottom||e.leftf.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function vO(t,e=!0){let i=t.ownerDocument,n=null,r=null;for(let s=t.parentNode;s&&!(s==i.body||(!e||n)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!n&&s.scrollWidth>s.clientWidth&&(n=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:n,y:r}}class uw{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:i,focusNode:n}=e;this.set(i,Math.min(e.anchorOffset,i?Zi(i):0),n,Math.min(e.focusOffset,n?Zi(n):0))}set(e,i,n,r){this.anchorNode=e,this.anchorOffset=i,this.focusNode=n,this.focusOffset=r}}let bn=null;q.safari&&q.safari_version>=26&&(bn=!1);function yO(t){if(t.setActive)return t.setActive();if(bn)return t.focus(bn);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(bn==null?{get preventScroll(){return bn={preventScroll:!0},!0}}:void 0),!bn){bn=!1;for(let i=0;iMath.max(0,t.document.documentElement.scrollHeight-t.innerHeight-4):t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function kO(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n>0)return{node:i,offset:n};if(i.nodeType==1&&n>0){if(i.contentEditable=="false")return null;i=i.childNodes[n-1],n=Zi(i)}else if(i.parentNode&&!xl(i))n=un(i),i=i.parentNode;else return null}}function SO(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n=i){if(l.level==n)return o;(s<0||(r!=0?r<0?l.fromi:e[s].level>l.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function QO(t,e){if(t.length!=e.length)return!1;for(let i=0;i=0;m-=3)if(fi[m+1]==-d){let O=fi[m+2],g=O&2?r:O&4?O&1?s:r:0;g&&(ke[h]=ke[fi[m]]=g),l=m;break}}else{if(fi.length==189)break;fi[l++]=h,fi[l++]=f,fi[l++]=a}else if((p=ke[h])==2||p==1){let m=p==r;a=m?0:1;for(let O=l-3;O>=0;O-=3){let g=fi[O+2];if(g&2)break;if(m)fi[O+2]|=2;else{if(g&4)break;fi[O+2]|=4}}}}}function gw(t,e,i,n){for(let r=0,s=n;r<=i.length;r++){let o=r?i[r-1].to:t,l=ra;)p==O&&(p=i[--m].from,O=m?i[m-1].to:t),ke[--p]=d;a=c}else s=u,a++}}}function Wu(t,e,i,n,r,s,o){let l=n%2?2:1;if(n%2==r%2)for(let a=e,u=0;aa&&o.push(new xi(a,m.from,d));let O=m.direction==En!=!(d%2);Yu(t,O?n+1:n,r,m.inner,m.from,m.to,o),a=m.to}p=m.to}else{if(p==i||(c?ke[p]!=l:ke[p]==l))break;p++}f?Wu(t,a,p,n+1,r,f,o):ae;){let c=!0,h=!1;if(!u||a>s[u-1].to){let m=ke[a-1];m!=l&&(c=!1,h=m==16)}let f=!c&&l==1?[]:null,d=c?n:n+1,p=a;e:for(;;)if(u&&p==s[u-1].to){if(h)break e;let m=s[--u];if(!c)for(let O=m.from,g=u;;){if(O==e)break e;if(g&&s[g-1].to==O)O=s[--g].from;else{if(ke[O-1]==l)break e;break}}if(f)f.push(m);else{m.toke.length;)ke[ke.length]=256;let n=[],r=e==En?0:1;return Yu(t,r,r,i,0,t.length,n),n}function _O(t){return[new xi(0,t,0)]}let PO="";function vw(t,e,i,n,r){var s;let o=n.head-t.from,l=xi.find(e,o,(s=n.bidiLevel)!==null&&s!==void 0?s:-1,n.assoc),a=e[l],u=a.side(r,i);if(o==u){let f=l+=r?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],o=a.side(!r,i),u=a.side(r,i)}let c=Ge(t.text,o,a.forward(r,i));(ca.to)&&(c=u),PO=t.text.slice(Math.min(o,c),Math.max(o,c));let h=l==(r?e.length-1:0)?null:e[l+(r?1:-1)];return h&&c==u&&h.level+(r?0:1)t.some(e=>e)}),MO=G.define({combine:t=>t.some(e=>e)}),ZO=G.define();class nr{constructor(e,i,n,r,s,o=!1){this.range=e,this.y=i,this.x=n,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new nr(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new nr(E.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const wo=ae.define({map:(t,e)=>t.map(e)}),IO=ae.define();function Rt(t,e,i){let n=t.facet(EO);n.length?n[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const Ri=G.define({combine:t=>t.length?t[0]:!0});let xw=0;const Gn=G.define({combine(t){return t.filter((e,i)=>{for(let n=0;n{let a=[];return o&&a.push(sa.of(u=>{let c=u.plugin(l);return c?o(c):ve.none})),s&&a.push(s(l)),a})}static fromClass(e,i){return Mt.define((n,r)=>new e(n,r),i)}}class Aa{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let i=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(i)}catch(n){if(Rt(i.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(i){Rt(e.state,i,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var i;if(!((i=this.value)===null||i===void 0)&&i.destroy)try{this.value.destroy()}catch(n){Rt(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const XO=G.define(),qc=G.define(),sa=G.define(),zO=G.define(),Wc=G.define(),to=G.define(),jO=G.define();function Rd(t,e){let i=t.state.facet(jO);if(!i.length)return i;let n=i.map(s=>s instanceof Function?s(t):s),r=[];return be.spans(n,e.from,e.to,{point(){},span(s,o,l,a){let u=s-e.from,c=o-e.from,h=r;for(let f=l.length-1;f>=0;f--,a--){let d=l[f].spec.bidiIsolate,p;if(d==null&&(d=yw(e.text,u,c)),a>0&&h.length&&(p=h[h.length-1]).to==u&&p.direction==d)p.to=c,h=p.inner;else{let m={from:u,to:c,direction:d,inner:[]};h.push(m),h=m.inner}}}}),r}const FO=G.define();function Yc(t){let e=0,i=0,n=0,r=0;for(let s of t.state.facet(FO)){let o=s(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(i=Math.max(i,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:i,top:n,bottom:r}}const Jr=G.define();class jt{constructor(e,i,n,r){this.fromA=e,this.toA=i,this.fromB=n,this.toB=r}join(e){return new jt(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let i=e.length,n=this;for(;i>0;i--){let r=e[i-1];if(!(r.fromA>n.toA)){if(r.toAr.push(new jt(s,o,l,a))),this.changedRanges=r}static create(e,i,n){return new kl(e,i,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const kw=[];class De{constructor(e,i,n=0){this.dom=e,this.length=i,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return kw}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let i=this.domAttrs;i&&rw(this.dom,i)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,i=this.posAtStart){let n=i;for(let r of this.children){if(r==e)return n;n+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,i,n){return null}domPosFor(e,i){let n=un(this.dom),r=this.length?e>0:i>0;return new oi(this.parent.dom,n+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof la)return e;return null}static get(e){return e.cmTile}}class oa extends De{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let i=this.dom,n=null,r,s=(e==null?void 0:e.node)==i?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,r=n?n.nextSibling:i.firstChild,s&&r!=l.dom&&(s.written=!0),l.dom.parentNode==i)for(;r&&r!=l.dom;)r=Dd(r);else i.insertBefore(l.dom,r);n=l.dom}for(r=n?n.nextSibling:i.firstChild,s&&r&&(s.written=!0);r;)r=Dd(r);this.length=o}}function Dd(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class la extends oa{constructor(e,i){super(i),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let i=De.get(e);if(i&&this.owns(i))return i;e=e.parentNode}}blockTiles(e){for(let i=[],n=this,r=0,s=0;;)if(r==n.children.length){if(!i.length)return;n=n.parent,n.breakAfter&&s++,r=i.pop()}else{let o=n.children[r++];if(o instanceof Di)i.push(r),n=o,r=0;else{let l=s+o.length,a=e(o,s);if(a!==void 0)return a;s=l+o.breakAfter}}}resolveBlock(e,i){let n,r=-1,s,o=-1;if(this.blockTiles((l,a)=>{let u=a+l.length;if(e>=a&&e<=u){if(l.isWidget()&&i>=-1&&i<=1){if(l.flags&32)return!0;l.flags&16&&(n=void 0)}(ae||e==a&&(i>1?l.length:l.covers(-1)))&&(!s||!l.isWidget()&&s.isWidget())&&(s=l,o=e-a)}}),!n&&!s)throw new Error("No tile at position "+e);return n&&i<0||!s?{tile:n,offset:r}:{tile:s,offset:o}}}class Di extends oa{constructor(e,i){super(e),this.wrapper=i}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,i){let n=new Di(i||document.createElement(e.tagName),e);return i||(n.flags|=4),n}}class br extends oa{constructor(e,i){super(e),this.attrs=i}isLine(){return!0}static start(e,i,n){let r=new br(i||document.createElement("div"),e);return(!i||!n)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,i,n){let r=null,s=-1,o=null,l=-1;function a(c,h){for(let f=0,d=0;f=h&&(p.isComposite()?a(p,h-d):(!o||o.isHidden&&(i>0&&!(o.flags&32)||n&&ww(o,p)))&&(m>h||p.flags&32)?(o=p,l=h-d):(dr&&(e=r);let s=e,o=e,l=0;e==0&&i<0||e==r&&i>=0?q.chrome||q.gecko||(e?(s--,l=1):o=0)?0:a.length-1];return q.safari&&!l&&u.width==0&&(u=Array.prototype.find.call(a,c=>c.width)||u),n==null?u:Es(u,(l?l>0:i<0)==n)}static of(e,i){let n=new kn(i||document.createTextNode(e),e);return i||(n.flags|=2),n}}class Rn extends De{constructor(e,i,n,r){super(e,i,r),this.widget=n}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,i){return this.coordsInWidget(e,i,!1)}coordsInWidget(e,i,n){let r=this.widget.coordsAt(this.dom,e,i);if(r)return r;if(n)return Es(this.dom.getBoundingClientRect(),this.length?e==0:i<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?s.length-1:0;o=s[a],!(e>0?a==0:a==s.length-1||o.top0==n)}}class $w{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,i,n){let{tile:r,index:s,beforeBreak:o,parents:l}=this;for(;e||i>0;)if(r.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!l.length)break;n&&n.leave(r),o=!!r.breakAfter,{tile:r,index:s}=l.pop(),s++}else{let a=r.children[s],u=a.breakAfter;(i>0?a.length<=e:a.length=0;l--){let a=i.marks[l],u=r.lastChild;if(u instanceof gt&&u.mark.eq(a.mark))u.dom!=a.dom&&u.setDOM(Ea(a.dom)),r=u;else{if(this.cache.reused.get(a)){let h=De.get(a.dom);h&&h.setDOM(Ea(a.dom))}let c=gt.of(a.mark,a.dom);r.append(c),r=c}this.cache.reused.set(a,2)}let s=De.get(e.text);s&&this.cache.reused.set(s,2);let o=new kn(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,r.append(o)}addInlineWidget(e,i,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(i,n);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,i,n){this.flushBuffer(),this.ensureMarks(i,n).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let i=this.afterWidget||this.lastBlock;i.length+=e,this.pos+=e}addLineStart(e,i){var n;e||(e=BO);let r=br.start(e,i||((n=this.cache.find(br))===null||n===void 0?void 0:n.dom),!!i);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,i){var n;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],l;if(i>0&&(l=r.lastChild)&&l instanceof gt&&l.mark.eq(o))r=l,i--;else{let a=gt.of(o,(n=this.cache.find(gt,u=>u.mark.eq(o)))===null||n===void 0?void 0:n.dom);r.append(a),r=a,i=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Ld(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(q.ios&&Ld(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Ra,0,32)||new Rn(Ra.toDOM(),0,Ra,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to=this.pos){let i=e.rank*102+e.value.rank,n=new Qw(e.from,e.to,e.value,i),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-n.rank||this.wrappers[r-1].to-n.to)<0;)r--;this.wrappers.splice(r,0,n)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let i=this.root;for(let n of this.wrappers){let r=i.lastChild;if(n.fromo.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);i.append(s),i=s}}return i}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let i=2|(e<0?16:32),n=this.cache.find(Sl,void 0,1);return n&&(n.flags=i),n||new Sl(i)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Pw{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let l=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,l)}let i=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,i);return this.textOff=i,n}}const wl=[Rn,br,kn,gt,Sl,Di,la];for(let t=0;t[]),this.index=wl.map(()=>0),this.reused=new Map}add(e){let i=e.constructor.bucket,n=this.buckets[i];n.length<6?n.push(e):n[this.index[i]=(this.index[i]+1)%6]=e}find(e,i,n=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let l=0;l{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,i){let n=i&&this.getCompositionContext(i.text);for(let r=0,s=0,o=0;;){let l=or){let u=a-r;this.preserve(u,!o,!l),r=a,s+=u}if(!l)break;i&&l.fromA<=i.range.fromA&&l.toA>=i.range.toA?(this.forward(l.fromA,i.range.fromA,i.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let u=a>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof gt&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof gt&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,i){let n=null,r=this.builder,s=-1,o=be.spans(this.decorations,e,i,{point:(l,a,u,c,h,f)=>{if(u instanceof An){if(this.disallowBlockEffectsFor[f]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=c.length,h>c.length)r.continueWidget(a-l);else{let d=u.widget||(u.block?vr.block:vr.inline),p=Aw(u),m=this.cache.findWidget(d,a-l,p)||Rn.of(d,this.view,a-l,p);u.block?(u.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(m)):(r.ensureLine(n),r.addInlineWidget(m,c,h))}n=null}else n=Ew(n,u);a>l&&this.text.skip(a-l)},span:(l,a,u,c)=>{for(let h=l;h-1&&(this.openWidget=o>s),this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=o}forward(e,i,n=1){i-e<=10?this.old.advance(i-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(i-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let i=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let s=De.get(r);if(r==this.view.contentDOM)break;s instanceof gt?i.push(s):s!=null&&s.isLine()?n=s:s instanceof Di||(r.nodeName=="DIV"&&!n&&r!=this.view.contentDOM?n=new br(r,BO):n||i.push(gt.of(new Js({tagName:r.nodeName.toLowerCase(),attributes:sw(r)}),r)))}return{line:n,marks:i}}}function Ld(t,e){let i=n=>{for(let r of n.children)if((e?r.isText():r.length)||i(r))return!0;return!1};return i(t)}function Aw(t){let e=t.isReplace?(t.startSide<0?64:0)|(t.endSide>0?128:0):t.startSide>0?32:16;return t.block&&(e|=256),e}const BO={class:"cm-line"};function Ew(t,e){let i=e.spec.attributes,n=e.spec.class;return!i&&!n||(t||(t={class:"cm-line"}),i&&zc(i,t),n&&(t.class+=" "+n)),t}function Rw(t){let e=[];for(let i=t.parents.length;i>1;i--){let n=i==t.parents.length?t.tile:t.parents[i].tile;n instanceof gt&&e.push(n.mark)}return e}function Ea(t){let e=De.get(t);return e&&e.setDOM(t.cloneNode()),t}class vr extends Er{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}vr.inline=new vr("span");vr.block=new vr("div");const Ra=new class extends Er{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Md{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ve.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new la(e,e.contentDOM),this.updateInner([new jt(0,0,0,e.state.doc.length)],null)}update(e){var i;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((i=this.domChanged)===null||i===void 0)&&i.newSel?r=this.domChanged.newSel.head:!Fw(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?Lw(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:h}=this.hasComposition;n=new jt(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(q.ie||q.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=Iw(o,this.decorations,e.changes);a.length&&(n=jt.extendWithRanges(n,a));let u=zw(l,this.blockWrappers,e.changes);return u.length&&(n=jt.extendWithRanges(n,u)),s&&!n.some(c=>c.fromA<=s.range.fromA&&c.toA>=s.range.toA)&&(n=s.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,i){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(i||e.length){let o=this.tile,l=new Tw(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);i&&De.get(i.text)&&l.cache.reused.set(De.get(i.text),2),this.tile=l.run(e,i),Gu(o,l.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=q.chrome||q.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||n.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to-1)&&cs(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(s||i||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,u,c;if(a.empty?c=u=this.inlineDOMNearPos(a.anchor,a.assoc||1):(c=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),u=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),q.gecko&&a.empty&&!this.hasComposition&&Dw(u)){let f=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(f,u.node.childNodes[u.offset]||null)),u=c=new oi(f,0),l=!0}let h=this.view.observer.selectionRange;(l||!h.focusNode||(!fs(u.node,u.offset,h.anchorNode,h.anchorOffset)||!fs(c.node,c.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,a))&&(this.view.observer.ignore(()=>{q.android&&q.chrome&&n.contains(h.focusNode)&&jw(h.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let f=As(this.view.root);if(f)if(a.empty){if(q.gecko){let d=Mw(u.node,u.offset);if(d&&d!=3){let p=(d==1?kO:SO)(u.node,u.offset);p&&(u=new oi(p.node,p.offset))}}f.collapse(u.node,u.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(u.node,u.offset);try{f.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([u,c]=[c,u]),d.setEnd(c.node,c.offset),d.setStart(u.node,u.offset),f.removeAllRanges(),f.addRange(d)}o&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,c)),this.impreciseAnchor=u.precise?null:new oi(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new oi(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,i){return this.hasComposition&&i.empty&&fs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==i.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,i=e.state.selection.main,n=As(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!n||!i.empty||!i.assoc||!n.modify)return;let o=this.lineAt(i.head,i.assoc);if(!o)return;let l=o.posAtStart;if(i.head==l||i.head==l+o.length)return;let a=this.coordsAt(i.head,-1),u=this.coordsAt(i.head,1);if(!a||!u||a.bottom>u.top)return;let c=this.domAtPos(i.head+i.assoc,i.assoc);n.collapse(c.node,c.offset),n.modify("move",i.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let h=e.observer.selectionRange;e.docView.posFromDOM(h.anchorNode,h.anchorOffset)!=i.from&&n.collapse(r,s)}posFromDOM(e,i){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=n.posAtStart;if(n.isComposite()){let s;if(e==n.dom)s=n.dom.childNodes[i];else{let o=Zi(e)==0?0:i==0?-1:1;for(;;){let l=e.parentNode;if(l==n.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?s=e:s=e.nextSibling}if(s==n.dom.firstChild)return r;for(;s&&!De.get(s);)s=s.nextSibling;if(!s)return r+n.length;for(let o=0,l=r;;o++){let a=n.children[o];if(a.dom==s)return l;l+=a.length+a.breakAfter}}else return n.isText()?e==n.dom?r+i:r+(i?n.length:0):r}domAtPos(e,i){let{tile:n,offset:r}=this.tile.resolveBlock(e,i);return n.isWidget()?n.domPosFor(r,i):n.domIn(r,i)}inlineDOMNearPos(e,i){let n,r=-1,s=!1,o,l=-1,a=!1;return this.tile.blockTiles((u,c)=>{if(u.isWidget()){if(u.flags&32&&c>=e)return!0;u.flags&16&&(s=!0)}else{let h=c+u.length;if(c<=e&&(n=u,r=e-c,s=h=e&&!o&&(o=u,l=e-c,a=c>e),c>e&&o)return!0}}),!n&&!o?this.domAtPos(e,i):(s&&o?n=null:a&&n&&(o=null),n&&i<0||!o?n.domIn(r,i):o.domIn(l,i))}coordsAt(e,i,n){let{tile:r,offset:s}=this.tile.resolveBlock(e,i);return r.isWidget()?r.widget instanceof Da?null:r.coordsInWidget(s,i,!0):r.coordsIn(s,i,n)}lineAt(e,i){let{tile:n}=this.tile.resolveBlock(e,i);return n.isLine()?n:null}coordsForChar(e){let{tile:i,offset:n}=this.tile.resolveBlock(e,1);if(!i.isLine())return null;function r(s,o){if(s.isComposite())for(let l of s.children){if(l.length>=o){let a=r(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(s.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==Ce.LTR,u=0,c=(h,f,d)=>{for(let p=0;pr);p++){let m=h.children[p],O=f+m.length,g=m.dom.getBoundingClientRect(),{height:b}=g;if(d&&!p&&(u+=g.top-d.top),m instanceof Di)O>n&&c(m,f,g);else if(f>=n&&(u>0&&i.push(-u),i.push(b+u),u=0,o)){let y=m.dom.lastChild,w=y?hs(y):[];if(w.length){let v=w[w.length-1],Q=a?v.right-g.left:g.right-v.left;Q>l&&(l=Q,this.minWidth=s,this.minWidthFrom=f,this.minWidthTo=O)}}d&&p==h.children.length-1&&(u+=d.bottom-g.bottom),f=O+m.breakAfter}};return c(this.tile,0,null),i}textDirectionAt(e){let{tile:i}=this.tile.resolveBlock(e,1);return getComputedStyle(i.dom).direction=="rtl"?Ce.RTL:Ce.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let c=hs(u.dom);if(c.length!=1)return;l+=c[0].width,a=c[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let i=document.createElement("div"),n,r,s;return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(i);let o=hs(i.firstChild)[0];n=i.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:n,i.remove()}),{lineHeight:n,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],i=this.view.viewState;for(let n=0,r=0;;r++){let s=r==i.viewports.length?null:i.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>n){let l=(i.lineBlockAt(o).bottom-i.lineBlockAt(n).top)/this.view.scaleY;e.push(ve.replace({widget:new Da(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!s)break;n=s.to+1}return ve.set(e)}updateDeco(){let e=1,i=this.view.state.facet(sa).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),n=!1,r=this.view.state.facet(Wc).map((s,o)=>{let l=typeof s=="function";return l&&(n=!0),l?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=n,i.push(be.join(r))),this.decorations=[this.editContextFormatting,...i,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(ZO))try{if(u(this.view,e.range,e))return!0}catch(c){Rt(this.view.state,c,"scroll handler")}let{range:i}=e,n=this.coordsAt(i.head,i.assoc||(i.head>i.anchor?-1:1)),r;if(!n)return;!i.empty&&(r=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let s=Yc(this.view),o={left:n.left-s.left,top:n.top-s.top,right:n.right+s.right,bottom:n.bottom+s.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;if(aw(this.view.scrollDOM,o,i.head1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottomn.isWidget()||n.children.some(i);return i(this.tile.resolveBlock(e,1).tile)}destroy(){Gu(this.tile)}}function Gu(t,e){let i=e==null?void 0:e.get(t);if(i!=1){i==null&&t.destroy();for(let n of t.children)Gu(n,e)}}function Dw(t){return t.node.nodeType==1&&t.node.firstChild&&(t.offset==0||t.node.childNodes[t.offset-1].contentEditable=="false")&&(t.offset==t.node.childNodes.length||t.node.childNodes[t.offset].contentEditable=="false")}function VO(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let n=kO(i.focusNode,i.focusOffset),r=SO(i.focusNode,i.focusOffset),s=n||r;if(r&&n&&r.node!=n.node){let l=De.get(r.node);if(!l||l.isText()&&l.text!=r.node.nodeValue)s=r;else if(t.docView.lastCompositionAfterCursor){let a=De.get(n.node);!a||a.isText()&&a.text!=n.node.nodeValue||(s=r)}}if(t.docView.lastCompositionAfterCursor=s!=n,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function Lw(t,e,i){let n=VO(t,i);if(!n)return null;let{node:r,from:s,to:o}=n,l=r.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(n.from,n.to)!=l)return null;let a=e.invertedDesc;return{range:new jt(a.mapPos(s),a.mapPos(o),s,o),text:r}}function Mw(t,e){return t.nodeType!=1?0:(e&&t.childNodes[e-1].contentEditable=="false"?1:0)|(e{ne.from&&(i=!0)}),i}class Da extends Er{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function Bw(t,e,i=1){let n=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(r.length==0)return E.cursor(e);s==0?i=1:s==r.length&&(i=-1);let o=s,l=s;i<0?o=Ge(r.text,s,!1):l=Ge(r.text,s);let a=n(r.text.slice(o,l));for(;o>0;){let u=Ge(r.text,o,!1);if(n(r.text.slice(u,o))!=a)break;o=u}for(;lt.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,a=Math.floor((r-i.top-(t.defaultLineHeight-l)*.5)/l);s+=a*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(i.from,i.to);return i.from+JS(o,s,t.state.tabSize)}function Uu(t,e,i){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let r;for(let s of n.type){if(s.from>e)break;if(!(s.toe)return s;(!r||s.type==ft.Text&&(r.type!=s.type||(i<0?s.frome)))&&(r=s)}}return r||n}return n}function qw(t,e,i,n){let r=Uu(t,e.head,e.assoc||-1),s=!n||r.type!=ft.Text||!(t.lineWrapping||r.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(r.from),a=t.posAtCoords({x:i==(l==Ce.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(a!=null)return E.cursor(a,i?-1:1)}return E.cursor(i?r.to:r.from,i?-1:1)}function Zd(t,e,i,n){let r=t.state.doc.lineAt(e.head),s=t.bidiSpans(r),o=t.textDirectionAt(r.from);for(let l=e,a=null;;){let u=vw(r,s,o,l,i),c=PO;if(!u){if(r.number==(i?t.state.doc.lines:1))return l;c=` `,r=t.state.doc.line(r.number+(i?1:-1)),s=t.bidiSpans(r),u=t.visualLineSide(r,!i)}if(a){if(!a(c))return l}else{if(!n)return u;a=n(c)}l=u}}function Ww(t,e,i){let n=t.state.charCategorizer(e),r=n(i);return s=>{let o=n(s);return r==Je.Space&&(r=o),r==o}}function Yw(t,e,i,n){let r=e.head,s=i?1:-1;if(r==(i?t.state.doc.length:0))return E.cursor(r,e.assoc);let o=e.goalColumn,l,a=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(r,e.assoc||((e.empty?i:e.head==e.from)?1:-1)),c=t.documentTop;if(u)o==null&&(o=u.left-a.left),l=s<0?u.top:u.bottom;else{let p=t.viewState.lineBlockAt(r);o==null&&(o=Math.min(a.right-a.left,t.defaultCharacterWidth*(r-p.from))),l=(s<0?p.top:p.bottom)+c}let h=a.left+o,f=t.viewState.heightOracle.textHeight>>1,d=n??f;for(let p=0;;p+=f){let m=l+(d+p)*s,O=Hu(t,{x:h,y:m},!1,s);if(i?m>a.bottom:ml:b{if(e>s&&er(t)),i.from,e.head>i.from?-1:1);return n==i.from?i:E.cursor(n,nt.viewState.docHeight)return new bi(t.state.doc.length,-1);if(u=t.elementAtHeight(a),n==null)break;if(u.type==ft.Text){if(n<0?u.tot.viewport.to)break;let f=t.docView.coordsAt(n<0?u.from:u.to,n>0?-1:1);if(f&&(n<0?f.top<=a+s:f.bottom>=a+s))break}let h=t.viewState.heightOracle.textHeight/2;a=n>0?u.bottom+h:u.top-h}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(i)return null;if(u.type==ft.Text){let h=Vw(t,r,u,o,l);return new bi(h,h==u.from?1:-1)}}if(u.type!=ft.Text)return a<(u.top+u.bottom)/2?new bi(u.from,1):new bi(u.to,-1);let c=t.docView.lineAt(u.from,2);return(!c||c.length!=u.length)&&(c=t.docView.lineAt(u.from,-2)),new Nw(t,o,l,t.textDirectionAt(u.from)).scanTile(c,u.from)}class Nw{constructor(e,i,n,r){this.view=e,this.x=i,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from>1;t:if(o.has(m)){let g=r+Math.floor(Math.random()*p);for(let b=0;b1)){if(b.bottomthis.y)(!u||u.top>b.top)&&(u=b),y=-1;else{let w=b.left>this.x?this.x-b.left:b.right(p+p+m)/3)return this.y=a.bottom-1,this.scan(e,i,!0);if(u&&u.top<(p+m+m)/3)return this.y=u.top+1,this.scan(e,i,!0)}let d=(l?this.dirAt(e[c],1):this.baseDir)==Ce.LTR;return{i:c,after:this.x>(f.left+f.right)/2==d}}scanText(e,i){let n=[];for(let s=0;s{let o=n[s]-i,l=n[s+1]-i;return Rs(e.dom,o,l).getClientRects()});return r.after?new bi(n[r.i+1],-1):new bi(n[r.i],1)}scanTile(e,i){if(!e.length)return new bi(i,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,i);if(l.isComposite())return this.scanTile(l,i)}let n=[i];for(let l=0,a=i;l{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:Rs(a.dom,0,a.length)).getClientRects()}),s=e.children[r.i],o=n[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new bi(n[r.i+1],-1):new bi(o,1)}}const qn="￿";class Gw{constructor(e,i){this.points=e,this.view=i,this.text="",this.lineSeparator=i.state.facet(fe.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=qn}readRange(e,i){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let s=this.text.length;this.readNode(r);let o=De.get(r),l=r.nextSibling;if(l==i){o!=null&&o.breakAfter&&!l&&n!=this.view.contentDOM&&this.lineBreak();break}let a=De.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:xl(r))||xl(l)&&(r.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>s)&&!Hw(l,i)&&this.lineBreak(),r=l}return this.findPointBefore(n,i),this}readTextNode(e){let i=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,i.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,l;if(this.lineSeparator?(s=i.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=r.exec(i))&&(s=l.index,o=l[0].length),this.append(i.slice(n,s<0?i.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=s+o}}readNode(e){let i=De.get(e),n=i&&i.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let r=n.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,i){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==i&&(n.pos=this.text.length)}findPointInside(e,i){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Uw(e,n.node,n.offset)?i:0))}}function Uw(t,e,i){for(;;){if(!e||i-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&i>-1)this.newSel=null;else if(i>-1&&(this.bounds=WO(e.docView.tile,i,n,0))){let a=s||o?[]:e3(e),u=new Gw(a,e);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=t3(a,this.bounds.from)}else{let a=e.observer.selectionRange,u=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Vu(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Vu(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),h=e.viewport;if((q.ios||q.chrome)&&u!=c&&Math.min(u,c)<=l.main.from&&Math.max(u,c)>=l.main.to&&(h.from>0||h.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(E.range(c,u));else if(e.lineWrapping&&c==u&&!(l.main.empty&&l.main.head==u)&&e.inputState.lastTouchTime>Date.now()-100){let f=e.coordsAtPos(u,-1),d=0;f&&(d=e.inputState.lastTouchY<=f.bottom?-1:1),this.newSel=E.create([E.cursor(u,d)])}else this.newSel=E.single(c,u)}}}function WO(t,e,i,n){if(t.isComposite()){let r=-1,s=-1,o=-1,l=-1;for(let a=0,u=n,c=n;ai)return WO(h,e,i,u);if(f>=e&&r==-1&&(r=a,s=u),u>i&&h.dom.parentNode==t.dom){o=a,l=c;break}c=f,u=f+h.breakAfter}return{from:s,to:l<0?n+t.length:l,startDOM:(r?t.children[r-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o=0?t.children[o].dom:null}}else return t.isText()?{from:n,to:n+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function YO(t,e){let i,{newSel:n}=e,{state:r}=t,s=r.selection.main,o=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,u=s.from,c=null;(o===8||q.android&&e.text.length=l&&s.to<=a&&(e.typeOver||h!=e.text)&&h.slice(0,s.from-l)==e.text.slice(0,s.from-l)&&h.slice(s.to-l)==e.text.slice(f=e.text.length-(h.length-(s.to-l)))?i={from:s.from,to:s.to,insert:de.of(e.text.slice(s.from-l,f).split(qn))}:(d=NO(h,e.text,u-l,c))&&(q.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==qn+qn&&d.toB--,i={from:l+d.from,to:l+d.toA,insert:de.of(e.text.slice(d.from,d.toB).split(qn))})}else n&&(!t.hasFocus&&r.facet(Ri)||$l(n,s))&&(n=null);if(!i&&!n)return!1;if((q.mac||q.android)&&i&&i.from==i.to&&i.from==s.head-1&&/^\. ?$/.test(i.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(n&&i.insert.length==2&&(n=E.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:de.of([i.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).toDate.now()-50?i={from:s.from,to:s.to,insert:r.toText(t.inputState.insertingText)}:q.chrome&&i&&i.from==i.to&&i.from==s.head&&i.insert.toString()==` `&&t.lineWrapping&&(n&&(n=E.single(n.main.anchor-1,n.main.head-1)),i={from:s.from,to:s.to,insert:de.of([" "])}),i)return Nc(t,i,n,o);if(n&&!$l(n,s)){let l=!1,a="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(l=!0),a=t.inputState.lastSelectionOrigin,a=="select.pointer"&&(n=qO(r.facet(to).map(u=>u(t)),n))),t.dispatch({selection:n,scrollIntoView:l,userEvent:a}),!0}else return!1}function Nc(t,e,i,n=-1){if(q.ios&&t.inputState.flushIOSKey(e))return!0;let r=t.state.selection.main;if(q.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&t.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ir(t.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||n==8&&e.insert.lengthr.head)&&ir(t.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ir(t.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=Jw(t,e,i));return t.state.facet(RO).some(a=>a(t,e.from,e.to,s,l))||t.dispatch(l()),!0}function Jw(t,e,i){let n,r=t.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.froms.to){let a=e.fromh(t)),u,a);e.from==c&&(o=c)}if(o>-1)n={changes:e,selection:E.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let a=s.frome.to?r.sliceDoc(e.to,s.to):"";n=r.replaceSelection(t.state.toText(a+e.insert.sliceString(0,void 0,t.state.lineBreak)+u))}else{let a=r.changes(e),u=i&&i.main.to<=a.newLength?i.main:void 0;if(r.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let c=t.state.sliceDoc(e.from,e.to),h,f=i&&VO(t,i.main.head);if(f){let p=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-p}}else h=t.state.doc.lineAt(s.head);let d=s.to-e.to;n=r.changeByRange(p=>{if(p.from==s.from&&p.to==s.to)return{changes:a,range:u||p.map(a)};let m=p.to-d,O=m-c.length;if(t.state.sliceDoc(O,m)!=c||m>=h.from&&O<=h.to)return{range:p};let g=r.changes({from:O,to:m,insert:e.insert}),b=p.to-s.to;return{changes:g,range:u?E.range(Math.max(0,u.anchor+b),Math.max(0,u.head+b)):p.map(g)}})}else n={changes:a,selection:u&&r.selection.replaceRange(u)}}let l="input.type";return(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50)&&(t.inputState.compositionPendingChange=!1,l+=".compose",t.inputState.compositionFirstChange&&(l+=".start",t.inputState.compositionFirstChange=!1)),r.update(n,{userEvent:l,scrollIntoView:!0})}function NO(t,e,i,n){let r=Math.min(t.length,e.length),s=0;for(;s0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,s-Math.min(o,l));i-=o+a-s}if(o=o?s-i:0;s-=a,l=s+(l-o),o=s}else if(l=l?s-i:0;s-=a,o=s+(o-l),l=s}return{from:s,toA:o,toB:l}}function e3(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}=t.observer.selectionRange;return i&&(e.push(new Id(i,n)),(r!=i||s!=n)&&e.push(new Id(r,s))),e}function t3(t,e){if(t.length==0)return null;let i=t[0].pos,n=t.length==2?t[1].pos:i;return i>-1&&n>-1?E.single(i+e,n+e):null}function $l(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class i3{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,q.safari&&e.contentDOM.addEventListener("input",()=>null),q.gecko&&b3(e.contentDOM.ownerDocument)}handleEvent(e){!h3(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,i){let n=this.handlers[e];if(n){for(let r of n.observers)r(this.view,i);for(let r of n.handlers){if(i.defaultPrevented)break;if(r(this.view,i)){i.preventDefault();break}}}}ensureHandlers(e){let i=r3(e),n=this.handlers,r=this.view.contentDOM;for(let s in i)if(s!="scroll"){let o=!i[s].handlers.length,l=n[s];l&&o!=!l.handlers.length&&(r.removeEventListener(s,this.handleEvent),l=null),l||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in n)s!="scroll"&&!i[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=i}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&UO.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),q.android&&q.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(q.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(GO.some(i=>i.keyCode==e.keyCode)&&!e.ctrlKey||s3.indexOf(e.key)>-1&&e.ctrlKey)){let i={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return i.shiftKey&&q.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&n3(this.view.win)&&(i.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:i},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let i=this.pendingIOSKey;return!i||i.key=="Enter"&&e&&e.from0?!0:q.safari&&!q.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function n3(t){return t.visualViewport?t.visualViewport.height*t.visualViewport.scale/t.document.documentElement.clientHeight<.85:!1}function Xd(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(r){Rt(i.state,r)}}}function r3(t){let e=Object.create(null);function i(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of t){let r=n.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let l in s){let a=s[l];a&&i(l).handlers.push(Xd(n.value,a))}if(o)for(let l in o){let a=o[l];a&&i(l).observers.push(Xd(n.value,a))}}for(let n in ai)i(n).handlers.push(ai[n]);for(let n in pt)i(n).observers.push(pt[n]);return e}const GO=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],s3="dthko",UO=[16,17,18,20,91,92,224,225],$o=6;function Qo(t){return Math.max(0,t)*.7+8}function o3(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class l3{constructor(e,i,n,r){this.view=e,this.startEvent=i,this.style=n,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=i,this.scrollParents=vO(e.contentDOM),this.atoms=e.state.facet(to).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=i.shiftKey,this.multiple=e.state.facet(fe.allowMultipleSelections)&&a3(e,i),this.dragging=c3(e,i)&&JO(i)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&o3(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,n=0,r=0,s=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Yc(this.view);e.clientX-a.left<=r+$o?i=-Qo(r-e.clientX):e.clientX+a.right>=o-$o&&(i=Qo(e.clientX-o)),e.clientY-a.top<=s+$o?n=-Qo(s-e.clientY):e.clientY+a.bottom>=l-$o&&(n=Qo(e.clientY-l)),this.setScrollSpeed(i,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,i){this.scrollSpeed={x:e,y:i},e||i?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:i}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),i&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=i,i=0),(e||i)&&this.view.win.scrollBy(e,i),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:i}=this,n=qO(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(i.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(i=>i.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function a3(t,e){let i=t.state.facet(CO);return i.length?i[0](e):q.mac?e.metaKey:e.ctrlKey}function u3(t,e){let i=t.state.facet(TO);return i.length?i[0](e):q.mac?!e.altKey:!e.ctrlKey}function c3(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=As(t.root);if(!n||n.rangeCount==0)return!0;let r=n.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function h3(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i=e.target,n;i!=t.contentDOM;i=i.parentNode)if(!i||i.nodeType==11||(n=De.get(i))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const ai=Object.create(null),pt=Object.create(null),HO=q.ie&&q.ie_version<15||q.ios&&q.webkit_version<604;function f3(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),KO(t,i.value)},50)}function aa(t,e,i){for(let n of t.facet(e))i=n(i,t);return i}function KO(t,e){e=aa(t.state,Bc,e);let{state:i}=t,n,r=1,s=i.toText(e),o=s.lines==i.selection.ranges.length;if(Ku!=null&&i.selection.ranges.every(a=>a.empty)&&Ku==s.toString()){let a=-1;n=i.changeByRange(u=>{let c=i.doc.lineAt(u.from);if(c.from==a)return{range:u};a=c.from;let h=i.toText((o?s.line(r++).text:e)+i.lineBreak);return{changes:{from:c.from,insert:h},range:E.cursor(u.from+h.length)}})}else o?n=i.changeByRange(a=>{let u=s.line(r++);return{changes:{from:a.from,to:a.to,insert:u.text},range:E.cursor(a.from+u.length)}}):n=i.replaceSelection(s);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}pt.scroll=t=>{let e=t.inputState;e.lastScrollTop=t.scrollDOM.scrollTop,e.lastScrollLeft=t.scrollDOM.scrollLeft,q.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};pt.wheel=pt.mousewheel=t=>{t.inputState.lastWheelEvent=Date.now()};ai.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);pt.touchstart=(t,e)=>{let i=t.inputState,n=e.targetTouches[0];i.touchActive=!0,i.lastTouchTime=Date.now(),n&&(i.lastTouchX=n.clientX,i.lastTouchY=n.clientY),i.setSelectionOrigin("select.pointer")};pt.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};pt.touchend=(t,e)=>{t.inputState.touchActive=!1};ai.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet(AO))if(i=n(t,e),i)break;if(!i&&e.button==0&&(i=p3(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new l3(t,e,i,n)),n&&t.observer.ignore(()=>{yO(t.contentDOM);let s=t.root.activeElement;s&&!s.contains(t.contentDOM)&&s.blur()});let r=t.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function zd(t,e,i,n){if(n==1)return E.cursor(e,i);if(n==2)return Bw(t.state,e,i);{let r=t.docView.lineAt(e,i),s=t.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,l=r?r.posAtEnd:s.to;return lDate.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Fd+1)%3:1}function p3(t,e){let i=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=JO(e),r=t.state.selection;return{update(s){s.docChanged&&(i.pos=s.changes.mapPos(i.pos),r=r.map(s.changes))},get(s,o,l){let a=t.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),u,c=zd(t,a.pos,a.assoc,n);if(i.pos!=a.pos&&!o){let h=zd(t,i.pos,i.assoc,n),f=Math.min(h.from,c.from),d=Math.max(h.to,c.to);c=f1&&(u=m3(r,a.pos))?u:l?r.addRange(c):E.create([c])}}}function m3(t,e){for(let i=0;i=e)return E.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}ai.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let r=t.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=i.to||o<=i.from)&&(i=E.undirectionalRange(s,o))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",aa(t.state,Vc,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1};ai.dragend=t=>(t.inputState.draggedContent=null,!1);function Vd(t,e,i,n){if(i=aa(t.state,Bc,i),!i)return;let r=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=t.inputState,o=n&&s&&u3(t,e)?{from:s.from,to:s.to}:null,l={from:r,insert:i},a=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}ai.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),r=0,s=()=>{++r==i.length&&Vd(t,e,n.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),s()},l.readAsText(i[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return Vd(t,e,n,!0),!0}return!1};ai.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=HO?null:e.clipboardData;return i?(KO(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(f3(t),!1)};function O3(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}function g3(t){let e=[],i=[],n=!1;for(let r of t.selection.ranges)r.empty||(e.push(t.sliceDoc(r.from,r.to)),i.push(r));if(!e.length){let r=-1;for(let{from:s}of t.selection.ranges){let o=t.doc.lineAt(s);o.number>r&&(e.push(o.text),i.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),r=o.number}n=!0}return{text:aa(t,Vc,e.join(t.lineBreak)),ranges:i,linewise:n}}let Ku=null;ai.copy=ai.cut=(t,e)=>{if(!cs(t.contentDOM,t.observer.selectionRange))return!1;let{text:i,ranges:n,linewise:r}=g3(t.state);if(!i&&!r)return!1;Ku=r?i:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let s=HO?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",i),!0):(O3(t,i),!1)};const eg=Xi.define();function tg(t,e){let i=[];for(let n of t.facet(DO)){let r=n(t,e);r&&i.push(r)}return i.length?t.update({effects:i,annotations:eg.of(!0)}):null}function ig(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=tg(t.state,e);i?t.dispatch(i):t.update([])}},10)}pt.focus=t=>{t.inputState.lastFocusTime=Date.now(),!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)&&(t.scrollDOM.scrollTop=t.inputState.lastScrollTop,t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft),ig(t)};pt.blur=t=>{t.observer.clearSelectionRange(),ig(t)};pt.compositionstart=pt.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};pt.compositionend=t=>{t.observer.editContext||(t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),t.inputState.compositionPendingKey=!0,t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0,t.inputState.compositionFirstChange=null,q.chrome&&q.android?t.observer.flushSoon():t.inputState.compositionPendingChange?Promise.resolve().then(()=>t.observer.flush()):setTimeout(()=>{t.inputState.composing<0&&t.docView.hasComposition&&t.update([])},50))};pt.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};ai.beforeinput=(t,e)=>{var i,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(i=e.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let l=o[0],a=t.posAtDOM(l.startContainer,l.startOffset),u=t.posAtDOM(l.endContainer,l.endOffset);return Nc(t,{from:a,to:u,insert:t.state.toText(s)},null),!0}}let r;if(q.chrome&&q.android&&(r=GO.find(s=>s.inputType==e.inputType))&&(t.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&t.hasFocus&&(t.contentDOM.blur(),t.focus())},100)}return q.ios&&e.inputType=="deleteContentForward"&&t.observer.flushSoon(),q.safari&&e.inputType=="insertText"&&t.inputState.composing>=0&&setTimeout(()=>pt.compositionend(t,e),20),!1};const qd=new Set;function b3(t){qd.has(t)||(qd.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const Wd=["pre-wrap","normal","pre-line","break-spaces"];let yr=!1;function Yd(){yr=!1}class v3{constructor(e){this.lineWrapping=e,this.doc=de.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,i){let n=this.doc.lineAt(i).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((i-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Wd.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let i=!1;for(let n=0;n-1,a=Math.abs(i-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=i,this.charWidth=n,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let u=0;u0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>nl&&(yr=!0),this.height=e)}replace(e,i,n){return dt.of(n)}decomposeLeft(e,i){i.push(this)}decomposeRight(e,i){i.push(this)}applyChanges(e,i,n,r){let s=this,o=n.doc;for(let l=r.length-1;l>=0;l--){let{fromA:a,toA:u,fromB:c,toB:h}=r[l],f=s.lineAt(a,$e.ByPosNoHeight,n.setDoc(i),0,0),d=f.to>=u?f:s.lineAt(u,$e.ByPosNoHeight,n,0,0);for(h+=d.to-u,u=d.to;l>0&&f.from<=r[l-1].toA;)a=r[l-1].fromA,c=r[l-1].fromB,l--,as*2){let l=e[i-1];l.break?e.splice(--i,1,l.left,null,l.right):e.splice(--i,1,l.left,l.right),n+=1+l.break,r-=l.size}else if(s>r*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,s-=l.size}else break;else if(r=s&&o(this.lineAt(0,$e.ByPos,n,r,s))}setMeasuredHeight(e){let i=e.heights[e.index++];i<0?(this.spaceAbove=-i,i=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(i)}updateHeight(e,i=0,n=!1,r){return r&&r.from<=i&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Tt extends ng{constructor(e,i,n){super(e,i,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,i){return new ri(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,i,n){let r=n[0];return n.length==1&&(r instanceof Tt||r instanceof Ue&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Ue?r=new Tt(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):dt.of(n)}updateHeight(e,i=0,n=!1,r){return r&&r.from<=i&&r.more?this.setMeasuredHeight(r):(n||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ue extends dt{constructor(e){super(e,0)}heightMetrics(e,i){let n=e.doc.lineAt(i).number,r=e.doc.lineAt(i+this.length).number,s=r-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);o=a/s,this.length>s+1&&(l=(this.height-a)/(this.length-s-1))}else o=this.height/s;return{firstLine:n,lastLine:r,perLine:o,perChar:l}}blockAt(e,i,n,r){let{firstLine:s,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r);if(i.lineWrapping){let u=r+(e0){let s=n[n.length-1];s instanceof Ue?n[n.length-1]=new Ue(s.length+r):n.push(null,new Ue(r-1))}if(e>0){let s=n[0];s instanceof Ue?n[0]=new Ue(e+s.length):n.unshift(new Ue(e-1),null)}return dt.of(n)}decomposeLeft(e,i){i.push(new Ue(e-1),null)}decomposeRight(e,i){i.push(null,new Ue(this.length-e-1))}updateHeight(e,i=0,n=!1,r){let s=i+this.length;if(r&&r.from<=i+this.length&&r.more){let o=[],l=Math.max(i,r.from),a=-1;for(r.from>i&&o.push(new Ue(r.from-i-1).updateHeight(e,i));l<=s&&r.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let h=r.heights[r.index++],f=0;h<0&&(f=-h,h=r.heights[r.index++]),a==-1?a=h:Math.abs(h-a)>=nl&&(a=-2);let d=new Tt(c,h,f);d.outdated=!1,o.push(d),l+=c+1}l<=s&&o.push(null,new Ue(s-l).updateHeight(e,l));let u=dt.of(o);return(a<0||Math.abs(u.height-this.height)>=nl||Math.abs(a-this.heightMetrics(e,i).perLine)>=nl)&&(yr=!0),Ql(this,u)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(i,i+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class k3 extends dt{constructor(e,i,n){super(e.length+i+n.length,e.height+n.height,i|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,i,n,r){let s=n+this.left.height;return el))return u;let c=i==$e.ByPosNoHeight?$e.ByPosNoHeight:$e.ByPos;return a?u.join(this.right.lineAt(l,c,n,o,l)):this.left.lineAt(l,c,n,r,s).join(u)}forEachLine(e,i,n,r,s,o){let l=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,i,n,l,a,o);else{let u=this.lineAt(a,$e.ByPos,n,r,s);e=e&&u.from<=i&&o(u),i>u.to&&this.right.forEachLine(u.to+1,i,n,l,a,o)}}replace(e,i,n){let r=this.left.length+this.break;if(ithis.left.length)return this.balanced(this.left,this.right.replace(e-r,i-r,n));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let l of n)s.push(l);if(e>0&&Nd(s,o-1),i=n&&i.push(null)),e>n&&this.right.decomposeLeft(e-n,i)}decomposeRight(e,i){let n=this.left.length,r=n+this.break;if(e>=r)return this.right.decomposeRight(e-r,i);e2*i.size||i.size>2*e.size?dt.of(this.break?[e,null,i]:[e,i]):(this.left=Ql(this.left,e),this.right=Ql(this.right,i),this.setHeight(e.height+i.height),this.outdated=e.outdated||i.outdated,this.size=e.size+i.size,this.length=e.length+this.break+i.length,this)}updateHeight(e,i=0,n=!1,r){let{left:s,right:o}=this,l=i+s.length+this.break,a=null;return r&&r.from<=i+s.length&&r.more?a=s=s.updateHeight(e,i,n,r):s.updateHeight(e,i,n),r&&r.from<=l+o.length&&r.more?a=o=o.updateHeight(e,l,n,r):o.updateHeight(e,l,n),a?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Nd(t,e){let i,n;t[e]==null&&(i=t[e-1])instanceof Ue&&(n=t[e+1])instanceof Ue&&t.splice(e-1,3,new Ue(i.length+1+n.length))}const S3=5;class Gc{constructor(e,i){this.pos=e,this.oracle=i,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,i){if(this.lineStart>-1){let n=Math.min(i,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Tt?r.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Tt(n-this.pos,-1,0)),this.writtenTo=n,i>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=i}point(e,i,n){if(e=S3)&&this.addLineDeco(r,s,o)}else i>e&&this.span(e,i);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:i}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=i,this.writtenToe&&this.nodes.push(new Tt(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,i){let n=new Ue(i-e);return this.oracle.doc.lineAt(e).to==i&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Tt)return e;let i=new Tt(0,-1,0);return this.nodes.push(i),i}addBlock(e){this.enterLine();let i=e.deco;i&&i.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,i&&i.endSide>0&&(this.covering=e)}addLineDeco(e,i,n){let r=this.ensureLine();r.length+=n,r.collapsed+=n,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=i,this.writtenTo=this.pos=this.pos+n}finish(e){let i=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(i instanceof Tt)&&!this.isCovered?this.nodes.push(new Tt(0,-1,0)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&h.overflow!="visible"){let f=c.getBoundingClientRect();s=Math.max(s,f.left),o=Math.min(o,f.right),l=Math.max(l,f.top),a=Math.min(u==t.parentNode?r.innerHeight:a,f.bottom)}u=h.position=="absolute"||h.position=="fixed"?c.offsetParent:c.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:s-i.left,right:Math.max(s,o)-i.left,top:l-(i.top+e),bottom:Math.max(l,a)-(i.top+e)}}function _3(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function P3(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class Ma{constructor(e,i,n,r){this.from=e,this.to=i,this.size=n,this.displaySize=r}static same(e,i){if(e.length!=i.length)return!1;for(let n=0;ntypeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new v3(n),this.stateDeco=Hd(i),this.heightMap=dt.empty().applyChanges(this.stateDeco,de.empty,this.heightOracle.setDoc(i.doc),[new jt(0,0,0,i.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ve.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:i}=this.state.selection;for(let n=0;n<=1;n++){let r=n?i.head:i.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new _o(s,o))}}return this.viewports=e.sort((n,r)=>n.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Ud:new Uc(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(es(e,this.scaler))})}update(e,i=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=Hd(this.state);let r=e.changedRanges,s=jt.extendWithRanges(r,w3(n,this.stateDeco,e?e.changes:Fe.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Yd(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||yr)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(i&&(i.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,i));let u=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(u||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),i&&(this.scrollTarget=i),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(MO)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,i=e.contentDOM,n=window.getComputedStyle(i),r=this.heightOracle,s=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?Ce.RTL:Ce.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",l=i.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,c=0;if(l.width&&l.height){let{scaleX:v,scaleY:Q}=bO(i,l);(v>.005&&Math.abs(this.scaleX-v)>.005||Q>.005&&Math.abs(this.scaleY-Q)>.005)&&(this.scaleX=v,this.scaleY=Q,u|=16,o=a=!0)}let h=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=h||this.paddingBottom!=f)&&(this.paddingTop=h,this.paddingBottom=f,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let d=vO(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=xO(this.scrollParent||e.win);let m=(this.printing?P3:Q3)(i,this.paddingTop),O=m.top-this.pixelViewport.top,g=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let b=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(b!=this.inView&&(this.inView=b,b&&(a=!0)),!this.inView&&!this.scrollTarget&&!_3(e.dom))return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),a){let v=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(v)&&(o=!0),o||r.lineWrapping&&Math.abs(y-this.contentDOMWidth)>r.charWidth){let{lineHeight:Q,charWidth:P,textHeight:_}=e.docView.measureTextSize();o=Q>0&&r.refresh(s,Q,P,_,Math.max(5,y/P),v),o&&(e.docView.minWidth=0,u|=16)}O>0&&g>0?c=Math.max(O,g):O<0&&g<0&&(c=Math.min(O,g)),Yd();for(let Q of this.viewports){let P=Q.from==this.viewport.from?v:e.docView.measureVisibleLineHeights(Q);this.heightMap=(o?dt.empty().applyChanges(this.stateDeco,de.empty,this.heightOracle,[new jt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new y3(Q.from,P))}yr&&(u|=2)}let w=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return w&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),u|=this.updateForViewport()),(u&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,i){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new _o(r.lineAt(o-n*1e3,$e.ByHeight,s,0,0).from,r.lineAt(l+(1-n)*1e3,$e.ByHeight,s,0,0).to);if(i){let{head:u}=i.range;if(ua.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=r.lineAt(u,$e.ByPos,s,0,0),f;i.y=="center"?f=(h.top+h.bottom)/2-c/2:i.y=="start"||i.y=="nearest"&&u=l+Math.max(10,Math.min(n,250)))&&r>o-2*1e3&&s>1,o=r<<1;if(this.defaultTextDirection!=Ce.LTR&&!n)return[];let l=[],a=(c,h,f,d)=>{if(h-cc&&gg.from>=f.from&&g.to<=f.to&&Math.abs(g.from-c)g.fromb));if(!O){if(hy.from<=h&&y.to>=h)){let y=i.moveToLineBoundary(E.cursor(h),!1,!0).head;y>c&&(h=y)}let g=this.gapSize(f,c,h,d),b=n||g<2e6?g:2e6;O=new Ma(c,h,g,b)}l.push(O)},u=c=>{if(c.length2e6)for(let Q of e)Q.from>=c.from&&Q.fromc.from&&a(c.from,d,c,h),pi.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let i=this.stateDeco;this.lineGaps.length&&(i=i.concat(this.lineGapDeco));let n=[];be.spans(i,this.viewport.from,this.viewport.to,{span(s,o){n.push({from:s,to:o})},point(){}},20);let r=0;if(n.length!=this.visibleRanges.length)r=12;else for(let s=0;s=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(i=>i.from<=e&&i.to>=e)||es(this.heightMap.lineAt(e,$e.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(i=>i.top<=e&&i.bottom>=e)||es(this.heightMap.lineAt(this.scaler.fromDOM(e),$e.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let i=this.lineBlockAtHeight(e+8);return i.from>=this.viewport.from||this.viewportLines[0].top-e>200?i:this.viewportLines[0]}elementAtHeight(e){return es(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class _o{constructor(e,i){this.from=e,this.to=i}}function T3(t,e,i){let n=[],r=t,s=0;return be.spans(i,t,e,{span(){},point(o,l){o>r&&(n.push({from:r,to:o}),s+=o-r),r=l}},20),r=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let r=0;;r++){let{from:s,to:o}=e[r],l=o-s;if(n<=l)return s+n;n-=l}}function Co(t,e){let i=0;for(let{from:n,to:r}of t.ranges){if(e<=r){i+=e-n;break}i+=r-n}return i/t.total}function A3(t,e){for(let i of t)if(e(i))return i}const Ud={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function Hd(t){let e=t.facet(sa).filter(n=>typeof n!="function"),i=t.facet(Wc).filter(n=>typeof n!="function");return i.length&&e.push(be.join(i)),e}class Uc{constructor(e,i,n){let r=0,s=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let u=i.lineAt(l,$e.ByPos,e,0,0).top,c=i.lineAt(a,$e.ByPos,e,0,0).bottom;return r+=c-u,{from:l,to:a,top:u,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(i.height-r);for(let l of this.viewports)l.domTop=o+(l.top-s)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),s=l.bottom}toDOM(e){for(let i=0,n=0,r=0;;i++){let s=ii.from==e.viewports[n].from&&i.to==e.viewports[n].to):!1}}function es(t,e){if(e.scale==1)return t;let i=e.toDOM(t.top),n=e.toDOM(t.bottom);return new ri(t.from,t.length,i,n-i,Array.isArray(t._content)?t._content.map(r=>es(r,e)):t._content)}const To=G.define({combine:t=>t.join(" ")}),Ju=G.define({combine:t=>t.indexOf(!0)>-1}),ec=ln.newName(),rg=ln.newName(),sg=ln.newName(),og={"&light":"."+rg,"&dark":"."+sg};function tc(t,e,i){return new ln(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,r=>{if(r=="&")return t;if(!i||!i[r])throw new RangeError(`Unsupported selector: ${r}`);return i[r]}):t+" "+n}})}const E3=tc("."+ec,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},og),R3={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Za=q.ie&&q.ie_version<=11;class D3{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new uw,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(i=>{for(let n of i)this.queue.push(n);(q.ie&&q.ie_version<=11||q.ios&&e.composing)&&i.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&q.android&&e.constructor.EDIT_CONTEXT!==!1&&!(q.chrome&&q.chrome_version<126)&&(this.editContext=new M3(e),e.state.facet(Ri)&&(e.contentDOM.editContext=this.editContext.editContext)),Za&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var i;((i=this.view.docView)===null||i===void 0?void 0:i.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),i.length>0&&i[i.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(i=>{i.length>0&&i[i.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((i,n)=>i!=e[n]))){this.gapIntersection.disconnect();for(let i of e)this.gapIntersection.observe(i);this.gaps=e}}onSelectionChange(e){let i=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,r=this.selectionRange;if(n.state.facet(Ri)?n.root.activeElement!=this.dom:!cs(this.dom,r))return;let s=r.anchorNode&&n.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){i||(this.selectionChanged=!1);return}(q.ie&&q.ie_version<=11||q.android&&q.chrome)&&!n.state.selection.main.empty&&r.focusNode&&fs(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,i=As(e.root);if(!i)return!1;let n=q.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&L3(this.view,i)||i;if(!n||this.selectionRange.eq(n))return!1;let r=cs(this.dom,n);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&ir(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:i,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let i=-1,n=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),i==-1?{from:i,to:n}=o:(i=Math.min(o.from,i),n=Math.max(o.to,n)))}return{from:i,to:n,typeOver:r}}readChange(){let{from:e,to:i,typeOver:n}=this.processRecords(),r=this.selectionChanged&&cs(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Kw(this.view,e,i,n);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let i=this.readChange();if(!i)return this.view.requestMeasure(),!1;let n=this.view.state,r=YO(this.view,i);return this.view.state==n&&(i.domChanged||i.newSel&&!$l(this.view.state.selection,i.newSel.main))&&this.view.update([]),r}readMutation(e){let i=this.view.docView.tile.nearest(e.target);if(!i||i.isWidget())return null;if(i.markDirty(e.type=="attributes"),e.type=="childList"){let n=Kd(i,e.previousSibling||e.target.previousSibling,-1),r=Kd(i,e.nextSibling||e.target.nextSibling,1);return{from:n?i.posAfter(n):i.posAtStart,to:r?i.posBefore(r):i.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:i.posAtStart,to:i.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ri)!=e.state.facet(Ri)&&(e.view.contentDOM.editContext=e.state.facet(Ri)?this.editContext.editContext:null))}destroy(){var e,i,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(i=this.gapIntersection)===null||i===void 0||i.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Kd(t,e,i){for(;e;){let n=De.get(e);if(n&&n.parent==t)return n;let r=e.parentNode;e=r!=t.dom?r:i>0?e.nextSibling:e.previousSibling}return null}function Jd(t,e){let i=e.startContainer,n=e.startOffset,r=e.endContainer,s=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return fs(o.node,o.offset,r,s)&&([i,n,r,s]=[r,s,i,n]),{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}}function L3(t,e){if(e.getComposedRanges){let r=e.getComposedRanges(t.root)[0];if(r)return Jd(t,r)}let i=null;function n(r){r.preventDefault(),r.stopImmediatePropagation(),i=r.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),i?Jd(t,i):null}class M3{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let i=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let r=e.state.selection.main,{anchor:s,head:o}=r,l=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let u=a-l>n.text.length;l==this.from&&sthis.to&&(a=s);let c=NO(e.state.sliceDoc(l,a),n.text,(u?r.from:r.to)-l,u?"end":null);if(!c){let f=E.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));$l(f,r)||e.dispatch({selection:f,userEvent:"select"});return}let h={from:c.from+l,to:c.toA+l,insert:de.of(n.text.slice(c.from,c.toB).split(` `))};if((q.mac||q.android)&&h.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:l,to:a,insert:de.of([n.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);Nc(e,h,E.single(this.toEditorPos(n.selectionStart,f),this.toEditorPos(n.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(i.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(i.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let r=[],s=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o{let r=[];for(let s of n.getTextFormats()){let o=s.underlineStyle,l=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(s.rangeStart),u=this.toEditorPos(s.rangeEnd);if(a{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)i.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{let r=As(n.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let i=0,n=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,l,a,u)=>{if(n)return;let c=u.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(u)){r=this.pendingContextChange=null,i+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(s+=i,o+=i,o<=this.from)this.from+=c,this.to+=c;else if(sthis.to||this.to-this.from+u.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),u.toString()),this.to+=c}i+=c}),r&&!n&&this.revertPending(e.state),!n}update(e){let i=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||i)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:i}=e.selection.main;this.from=Math.max(0,i-1e4),this.to=Math.min(e.doc.length,i+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let i=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(i.from),this.toContextPos(i.from+i.insert.length),e.doc.sliceString(i.from,i.to))}setSelection(e){let{main:i}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,i.anchor))),r=this.toContextPos(i.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(n,r)}rangeIsValid(e){let{head:i}=e.selection.main;return!(this.from>0&&i-this.from<500||this.to1e4*3)}toEditorPos(e,i=this.to-this.from){e=Math.min(e,i);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let i=this.composing;return i&&i.drifted?i.contextBase+(e-i.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class W{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var i;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(r=>r.forEach(s=>n(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||cw(e.parent)||document,this.viewState=new Gd(this,e.state||fe.create(e)),e.scrollTo&&e.scrollTo.is(wo)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Gn).map(r=>new Aa(r));for(let r of this.plugins)r.update(this);this.observer=new D3(this),this.inputState=new i3(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Md(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((i=document.fonts)===null||i===void 0)&&i.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let i=e.length==1&&e[0]instanceof Xe?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(i,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let i=!1,n=!1,r,s=this.state;for(let f of e){if(f.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=f.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(eg))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=tg(s,o),a||(l=1));let u=this.observer.delayedAndroidKey,c=null;if(u?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(fe.phrases)!=this.state.facet(fe.phrases))return this.setState(s);r=kl.create(this,s,e),r.flags|=l;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(h&&(h=h.map(f.changes)),f.scrollIntoView){let{main:d}=f.state.selection,{x:p,y:m}=this.state.facet(W.cursorScrollMargin);h=new nr(d.empty?d:E.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",m,p)}for(let d of f.effects)d.is(wo)&&(h=d.value.clip(this.state))}this.viewState.update(r,h),this.bidiCache=_l.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),i=this.docView.update(r),this.state.facet(Jr)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(To)!=r.state.facet(To)&&(this.viewState.mustMeasureContent=!0),(i||n||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!r.empty)for(let f of this.state.facet(Nu))try{f(r)}catch(d){Rt(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!YO(this,c)&&u.force&&ir(this.contentDOM,u.key,u.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let i=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new Gd(this,e),this.plugins=e.facet(Gn).map(n=>new Aa(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new Md(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}i&&this.focus(),this.requestMeasure()}updatePlugins(e){let i=e.startState.facet(Gn),n=e.state.facet(Gn);if(i!=n){let r=[];for(let s of n){let o=i.indexOf(s);if(o<0)r.push(new Aa(s));else{let l=this.plugins[o];l.mustUpdate=e,r.push(l)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let i=null,n=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(xO(n||this.win))s=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(r);s=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];a&4||([this.measureRequests,u]=[u,this.measureRequests]);let c=u.map(d=>{try{return d.read(this)}catch(p){return Rt(this.state,p),e0}}),h=kl.create(this,this.state,[]),f=!1;h.flags|=a,i?i.flags|=a:i=h,this.updateState=2,h.empty||(this.updatePlugins(h),this.inputState.update(h),this.updateAttrs(),f=this.docView.update(h),f&&this.docViewUpdate());for(let d=0;d1||p<-1)&&!(q.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(n==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+p,n?n.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(i&&!i.empty)for(let l of this.state.facet(Nu))l(i)}get themeClasses(){return ec+" "+(this.state.facet(Ju)?sg:rg)+" "+this.state.facet(To)}updateAttrs(){let e=t0(this,XO,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),i={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ri)?"true":"false",class:"cm-content",style:`${q.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(i["aria-readonly"]="true"),t0(this,qc,i);let n=this.observer.ignore(()=>{let r=Td(this.contentDOM,this.contentAttrs,i),s=Td(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=i,n}showAnnouncements(e){let i=!0;for(let n of e)for(let r of n.effects)if(r.is(W.announce)){i&&(this.announceDOM.textContent=""),i=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Jr);let e=this.state.facet(W.cspNonce);ln.mount(this.root,this.styleModules.concat(E3).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let i=0;in.plugin==e)||null),i&&i.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,i,n){return La(this,e,Zd(this,e,i,n))}moveByGroup(e,i){return La(this,e,Zd(this,e,i,n=>Ww(this,e.head,n)))}visualLineSide(e,i){let n=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=n[i?n.length-1:0];return E.cursor(s.side(i,r)+e.from,s.forward(!i,r)?1:-1)}moveToLineBoundary(e,i,n=!0){return qw(this,e,i,n)}moveVertically(e,i,n){return La(this,e,Yw(this,e,i,n))}domAtPos(e,i=1){return this.docView.domAtPos(e,i)}posAtDOM(e,i=0){return this.docView.posFromDOM(e,i)}posAtCoords(e,i=!0){this.readMeasured();let n=Hu(this,e,i);return n&&n.pos}posAndSideAtCoords(e,i=!0){return this.readMeasured(),Hu(this,e,i)}coordsAtPos(e,i=1){this.readMeasured();let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),s=r[xi.find(r,e-n.from,-1,i)];return this.docView.coordsAt(e,i,s.dir==Ce.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(LO)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Z3)return _O(e.length);let i=this.textDirectionAt(e.from),n;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==i&&(s.fresh||QO(s.isolates,n=Rd(this,e))))return s.order;n||(n=Rd(this,e));let r=bw(e.text,i,n);return this.bidiCache.push(new _l(e.from,e.to,i,n,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||q.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{yO(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,i={}){var n,r,s,o;return wo.of(new nr(typeof e=="number"?E.cursor(e):e,(n=i.y)!==null&&n!==void 0?n:"nearest",(r=i.x)!==null&&r!==void 0?r:"nearest",(s=i.yMargin)!==null&&s!==void 0?s:5,(o=i.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:i}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return wo.of(new nr(E.cursor(n.from),"start","start",n.top-e,i,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return Mt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Mt.define(()=>({}),{eventObservers:e})}static theme(e,i){let n=ln.newName(),r=[To.of(n),Jr.of(tc(`.${n}`,e))];return i&&i.dark&&r.push(Ju.of(!0)),r}static baseTheme(e){return Ii.lowest(Jr.of(tc("."+ec,e,og)))}static findFromDOM(e){var i;let n=e.querySelector(".cm-content"),r=n&&De.get(n)||De.get(e);return((i=r==null?void 0:r.root)===null||i===void 0?void 0:i.view)||null}}W.styleModule=Jr;W.inputHandler=RO;W.clipboardInputFilter=Bc;W.clipboardOutputFilter=Vc;W.scrollHandler=ZO;W.focusChangeEffect=DO;W.perLineTextDirection=LO;W.exceptionSink=EO;W.updateListener=Nu;W.editable=Ri;W.mouseSelectionStyle=AO;W.dragMovesSelection=TO;W.clickAddsSelectionRange=CO;W.decorations=sa;W.blockWrappers=zO;W.outerDecorations=Wc;W.atomicRanges=to;W.bidiIsolatedRanges=jO;W.cursorScrollMargin=G.define({combine:t=>{let e=5,i=5;for(let n of t)typeof n=="number"?e=i=n:{x:e,y:i}=n;return{x:e,y:i}}});W.scrollMargins=FO;W.darkTheme=Ju;W.cspNonce=G.define({combine:t=>t.length?t[0]:""});W.contentAttributes=qc;W.editorAttributes=XO;W.lineWrapping=W.contentAttributes.of({class:"cm-lineWrapping"});W.announce=ae.define();const Z3=4096,e0={};class _l{constructor(e,i,n,r,s,o){this.from=e,this.to=i,this.dir=n,this.isolates=r,this.fresh=s,this.order=o}static update(e,i){if(i.empty&&!e.some(s=>s.fresh))return e;let n=[],r=e.length?e[e.length-1].dir:Ce.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=n[r],o=typeof s=="function"?s(t):s;o&&zc(o,i)}return i}const I3=q.mac?"mac":q.windows?"win":q.linux?"linux":"key";function X3(t,e){const i=t.split(/-(?!$)/);let n=i[i.length-1];n=="Space"&&(n=" ");let r,s,o,l;for(let a=0;an.concat(r),[]))),i}function j3(t,e,i){return ag(lg(t.state),e,t,i)}let Ji=null;const F3=4e3;function B3(t,e=I3){let i=Object.create(null),n=Object.create(null),r=(o,l)=>{let a=n[o];if(a==null)n[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,l,a,u,c)=>{var h,f;let d=i[o]||(i[o]=Object.create(null)),p=l.split(/ (?!$)/).map(g=>X3(g,e));for(let g=1;g{let w=Ji={view:y,prefix:b,scope:o};return setTimeout(()=>{Ji==w&&(Ji=null)},F3),!0}]})}let m=p.join(" ");r(m,!1);let O=d[m]||(d[m]={preventDefault:!1,stopPropagation:!1,run:((f=(h=d._any)===null||h===void 0?void 0:h.run)===null||f===void 0?void 0:f.slice())||[]});a&&O.run.push(a),u&&(O.preventDefault=!0),c&&(O.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let c=i[u]||(i[u]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let f in c)c[f].run.push(d=>h(d,ic))}let a=o[e]||o.key;if(a)for(let u of l)s(u,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(u,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return i}let ic=null;function ag(t,e,i,n){ic=e;let r=nw(e),s=Ni(r,0),o=vn(s)==r.length&&r!=" ",l="",a=!1,u=!1,c=!1;Ji&&Ji.view==i&&Ji.scope==n&&(l=Ji.prefix+" ",UO.indexOf(e.keyCode)<0&&(u=!0,Ji=null));let h=new Set,f=O=>{if(O){for(let g of O.run)if(!h.has(g)&&(h.add(g),g(i)))return O.stopPropagation&&(c=!0),!0;O.preventDefault&&(O.stopPropagation&&(c=!0),u=!0)}return!1},d=t[n],p,m;return d&&(f(d[l+Ao(r,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(q.windows&&e.ctrlKey&&e.altKey)&&!(q.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=an[e.keyCode])&&p!=r?(f(d[l+Ao(p,e,!0)])||e.shiftKey&&(m=Cs[e.keyCode])!=r&&m!=p&&f(d[l+Ao(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&f(d[l+Ao(r,e,!0)])&&(a=!0),!a&&f(d._any)&&(a=!0)),u&&(a=!0),a&&c&&e.stopPropagation(),ic=null,a}class Pn{constructor(e,i,n,r,s){this.className=e,this.left=i,this.top=n,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,i){return i.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,i,n){if(n.empty){let r=e.coordsAtPos(n.head,n.assoc||1);if(!r)return[];let s=ug(e);return[new Pn(i,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return V3(e,i,n)}}function ug(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==Ce.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function n0(t,e,i,n){let r=t.coordsAtPos(e,i*2);if(!r)return n;let s=t.dom.getBoundingClientRect(),o=(r.top+r.bottom)/2,l=t.posAtCoords({x:s.left+1,y:o}),a=t.posAtCoords({x:s.right-1,y:o});return l==null||a==null?n:{from:Math.max(n.from,Math.min(l,a)),to:Math.min(n.to,Math.max(l,a))}}function V3(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let n=Math.max(i.from,t.viewport.from),r=Math.min(i.to,t.viewport.to),s=t.textDirection==Ce.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),a=ug(t),u=o.querySelector(".cm-line"),c=u&&window.getComputedStyle(u),h=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),f=l.right-(c?parseInt(c.paddingRight):0),d=Uu(t,n,1),p=Uu(t,r,-1),m=d.type==ft.Text?d:null,O=p.type==ft.Text?p:null;if(m&&(t.lineWrapping||d.widgetLineBreaks)&&(m=n0(t,n,1,m)),O&&(t.lineWrapping||p.widgetLineBreaks)&&(O=n0(t,r,-1,O)),m&&O&&m.from==O.from&&m.to==O.to)return b(y(i.from,i.to,m));{let v=m?y(i.from,null,m):w(d,!1),Q=O?y(null,i.to,O):w(p,!0),P=[];return(m||d).to<(O||p).from-(m&&O?1:0)||d.widgetLineBreaks>1&&v.bottom+t.defaultLineHeight/2T&&F.from=Y)break;ue>B&&I(Math.max(re,B),v==null&&re<=T,Math.min(ue,Y),Q==null&&ue>=M,ee.dir)}if(B=J.to+1,B>=Y)break}return L.length==0&&I(T,v==null,M,Q==null,t.textDirection),{top:_,bottom:R,horizontal:L}}function w(v,Q){let P=l.top+(Q?v.top:v.bottom);return{top:P,bottom:P,horizontal:[]}}}function q3(t,e){return t.constructor==e.constructor&&t.eq(e)}class W3{constructor(e,i){this.view=e,this.layer=i,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),i.above&&this.dom.classList.add("cm-layer-above"),i.class&&this.dom.classList.add(i.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),i.mount&&i.mount(this.dom,e)}update(e){e.startState.facet(rl)!=e.state.facet(rl)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let i=0,n=e.facet(rl);for(;i!q3(i,this.drawn[n]))){let i=this.dom.firstChild,n=0;for(let r of e)r.update&&i&&r.constructor&&this.drawn[n].constructor&&r.update(i,this.drawn[n])?(i=i.nextSibling,n++):this.dom.insertBefore(r.draw(),i);for(;i;){let r=i.nextSibling;i.remove(),i=r}this.drawn=e,q.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const rl=G.define();function cg(t){return[Mt.define(e=>new W3(e,t)),rl.of(t)]}const xr=G.define({combine(t){return na(t,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,i)=>Math.min(e,i),drawRangeCursor:(e,i)=>e||i})}});function Y3(t={}){return[xr.of(t),N3,G3,U3,MO.of(!0)]}function hg(t){return t.startState.facet(xr)!=t.state.facet(xr)}const N3=cg({above:!0,markers(t){let{state:e}=t,i=e.facet(xr),n=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty||i.drawRangeCursor&&!(s&&q.ios&&i.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=r.empty?r:E.cursor(r.head,r.assoc);for(let a of Pn.forRange(t,o,l))n.push(a)}}return n},update(t,e){t.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let i=hg(t);return i&&r0(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){r0(e.state,t)},class:"cm-cursorLayer"});function r0(t,e){e.style.animationDuration=t.facet(xr).cursorBlinkRate+"ms"}const G3=cg({above:!1,markers(t){let e=[],{main:i,ranges:n}=t.state.selection;for(let r of n)if(!r.empty)for(let s of Pn.forRange(t,"cm-selectionBackground",r))e.push(s);if(q.ios&&!i.empty&&t.state.facet(xr).iosSelectionHandles){for(let r of Pn.forRange(t,"cm-selectionHandle cm-selectionHandle-start",E.cursor(i.from,1)))e.push(r);for(let r of Pn.forRange(t,"cm-selectionHandle cm-selectionHandle-end",E.cursor(i.to,1)))e.push(r)}return e},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||hg(t)},class:"cm-selectionLayer"}),U3=Ii.highest(W.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));class H3 extends Er{constructor(e){super(),this.content=e}toDOM(e){let i=document.createElement("span");return i.className="cm-placeholder",i.style.pointerEvents="none",i.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),i.setAttribute("aria-hidden","true"),i}coordsAt(e){let i=e.firstChild?hs(e.firstChild):[];if(!i.length)return null;let n=window.getComputedStyle(e.parentNode),r=Es(i[0],n.direction!="rtl"),s=parseInt(n.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function K3(t){let e=Mt.fromClass(class{constructor(i){this.view=i,this.placeholder=t?ve.set([ve.widget({widget:new H3(t),side:1}).range(0)]):ve.none}get decorations(){return this.view.state.doc.length?ve.none:this.placeholder}},{decorations:i=>i.decorations});return typeof t=="string"?[e,W.contentAttributes.of({"aria-placeholder":t})]:e}const Eo="-10000px";class J3{constructor(e,i,n,r){this.facet=i,this.createTooltipView=n,this.removeTooltipView=r,this.input=e.state.facet(i),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=n(o,s))}update(e,i){var n;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=i?[]:null;for(let a=0;ai[u]=a),i.length=l.length),this.input=r,this.tooltips=s,this.tooltipViews=o,!0}}function e$(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Ia=G.define({combine:t=>{var e,i,n;return{position:q.ios?"absolute":((e=t.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((i=t.find(r=>r.parent))===null||i===void 0?void 0:i.parent)||null,tooltipSpace:((n=t.find(r=>r.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||e$}}}),s0=new WeakMap,fg=Mt.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(Ia);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new J3(t,dg,(i,n)=>this.createTooltip(i,n),i=>{this.resizeObserver&&this.resizeObserver.unobserve(i.dom),i.dom.remove()}),this.above=this.manager.tooltips.map(i=>!!i.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(i=>{Date.now()>this.lastTransaction-50&&i.length>0&&i[i.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet(Ia);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),n=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let r=document.createElement("div");r.className="cm-tooltip-arrow",i.dom.appendChild(r)}return i.dom.style.position=this.position,i.dom.style.top=Eo,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(t=n.destroy)===null||t===void 0||t.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(i=this.intersectionObserver)===null||i===void 0||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(q.safari){let o=s.getBoundingClientRect();i=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else i=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(i||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(t=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),r=Yc(this.view);return{visible:{left:n.left+r.left,top:n.top+r.top,right:n.right-r.right,bottom:n.bottom-r.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Ia).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:i,space:n,scaleX:r,scaleY:s}=t,o=[];for(let l=0;l=Math.min(i.bottom,n.bottom)||h.rightMath.min(i.right,n.right)+.1)){c.style.top=Eo;continue}let d=a.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,m=f.right-f.left,O=(e=s0.get(u))!==null&&e!==void 0?e:f.bottom-f.top,g=u.offset||i$,b=this.view.textDirection==Ce.LTR,y=f.width>n.right-n.left?b?n.left:n.right-f.width:b?Math.max(n.left,Math.min(h.left-(d?14:0)+g.x,n.right-m)):Math.min(Math.max(n.left,h.left-m+(d?14:0)-g.x),n.right-m),w=this.above[l];!a.strictSide&&(w?h.top-O-p-g.yn.bottom)&&w==n.bottom-h.bottom>h.top-n.top&&(w=this.above[l]=!w);let v=(w?h.top-n.top:n.bottom-h.bottom)-p;if(vy&&_.topQ&&(Q=w?_.top-O-2-p:_.bottom+p+2);if(this.position=="absolute"?(c.style.top=(Q-t.parent.top)/s+"px",o0(c,(y-t.parent.left)/r)):(c.style.top=Q/s+"px",o0(c,y/r)),d){let _=h.left+(b?g.x:-g.x)-(y+14-7);d.style.left=_/r+"px"}u.overlap!==!0&&o.push({left:y,top:Q,right:P,bottom:Q+O}),c.classList.toggle("cm-tooltip-above",w),c.classList.toggle("cm-tooltip-below",!w),u.positioned&&u.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=Eo}},{eventObservers:{scroll(){this.maybeMeasure()}}});function o0(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const t$=W.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),i$={x:0,y:0},dg=G.define({enables:[fg,t$]});function pg(t,e){let i=t.plugin(fg);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}const l0=G.define({combine(t){let e,i;for(let n of t)e=e||n.topContainer,i=i||n.bottomContainer;return{topContainer:e,bottomContainer:i}}});function mg(t,e){let i=t.plugin(Og),n=i?i.specs.indexOf(e):-1;return n>-1?i.panels[n]:null}const Og=Mt.fromClass(class{constructor(t){this.input=t.state.facet(Pl),this.specs=this.input.filter(i=>i),this.panels=this.specs.map(i=>i(t));let e=t.state.facet(l0);this.top=new Ro(t,!0,e.topContainer),this.bottom=new Ro(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(i=>i.top)),this.bottom.sync(this.panels.filter(i=>!i.top));for(let i of this.panels)i.dom.classList.add("cm-panel"),i.mount&&i.mount()}update(t){let e=t.state.facet(l0);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Ro(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ro(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(Pl);if(i!=this.input){let n=i.filter(a=>a),r=[],s=[],o=[],l=[];for(let a of n){let u=this.specs.indexOf(a),c;u<0?(c=a(t.view),l.push(c)):(c=this.panels[u],c.update&&c.update(t)),r.push(c),(c.top?s:o).push(c)}this.specs=n,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>W.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class Ro{constructor(e,i,n){this.view=e,this.top=i,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let i of this.panels)i.destroy&&e.indexOf(i)<0&&i.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let i=this.container||this.view.dom;i.insertBefore(this.dom,this.top?i.firstChild:null)}let e=this.dom.firstChild;for(let i of this.panels)if(i.dom.parentNode==this.dom){for(;e!=i.dom;)e=a0(e);e=e.nextSibling}else this.dom.insertBefore(i.dom,e);for(;e;)e=a0(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function a0(t){let e=t.nextSibling;return t.remove(),e}const Pl=G.define({enables:Og});function n$(t,e){let i,n=new Promise(o=>i=o),r=o=>r$(o,e,i);t.state.field(Xa,!1)?t.dispatch({effects:gg.of(r)}):t.dispatch({effects:ae.appendConfig.of(Xa.init(()=>[r]))});let s=bg.of(r);return{close:s,result:n.then(o=>((t.win.queueMicrotask||(a=>t.win.setTimeout(a,10)))(()=>{t.state.field(Xa).indexOf(r)>-1&&t.dispatch({effects:s})}),o))}}const Xa=Yt.define({create(){return[]},update(t,e){for(let i of e.effects)i.is(gg)?t=[i.value].concat(t):i.is(bg)&&(t=t.filter(n=>n!=i.value));return t},provide:t=>Pl.computeN([t],e=>e.field(t))}),gg=ae.define(),bg=ae.define();function r$(t,e,i){let n=e.content?e.content(t,()=>o(null)):null;if(!n){if(n=We("form"),e.input){let l=We("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),n.appendChild(We("label",(e.label||"")+": ",l))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(We("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let r=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let l=0;l{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(a))}),a.addEventListener("submit",u=>{u.preventDefault(),o(a)})}let s=We("div",n,We("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(l){s.contains(s.ownerDocument.activeElement)&&t.focus(),i(l)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=n.querySelector(e.focus):l=n.querySelector("input")||n.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class kr extends on{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}kr.prototype.elementClass="";kr.prototype.toDOM=void 0;kr.prototype.mapMode=ut.TrackBefore;kr.prototype.startSide=kr.prototype.endSide=-1;kr.prototype.point=!0;const vg=1024;let s$=0;class Ft{constructor(e,i){this.from=e,this.to=i}}class K{constructor(e={}){this.id=s$++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=ze.match(e)),i=>{let n=e(i);return n===void 0?null:[this,n]}}}K.closedBy=new K({deserialize:t=>t.split(" ")});K.openedBy=new K({deserialize:t=>t.split(" ")});K.group=new K({deserialize:t=>t.split(" ")});K.isolate=new K({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});K.contextHash=new K({perNode:!0});K.lookAhead=new K({perNode:!0});K.mounted=new K({perNode:!0});class rr{constructor(e,i,n,r=!1){this.tree=e,this.overlay=i,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[K.mounted.id]}}const o$=Object.create(null);class ze{constructor(e,i,n,r=0){this.name=e,this.props=i,this.id=n,this.flags=r}static define(e){let i=e.props&&e.props.length?Object.create(null):o$,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new ze(e.name||"",i,e.id,n);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let i=this.prop(K.group);return i?i.indexOf(e)>-1:!1}return this.id==e}static match(e){let i=Object.create(null);for(let n in e)for(let r of n.split(" "))i[r]=e[n];return n=>{for(let r=n.prop(K.group),s=-1;s<(r?r.length:0);s++){let o=i[s<0?n.name:r[s]];if(o)return o}}}}ze.none=new ze("",Object.create(null),0,8);class Rr{constructor(e){this.types=e;for(let i=0;i0;for(let a=this.cursor(o|ge.IncludeAnonymous);;){let u=!1;if(a.from<=s&&a.to>=r&&(!l&&a.type.isAnonymous||i(a)!==!1)){if(a.firstChild())continue;u=!0}for(;u&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;u=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let i in this.props)e.push([+i,this.props[i]]);return e}balance(e={}){return this.children.length<=8?this:Jc(ze.none,this.children,this.positions,0,this.children.length,0,this.length,(i,n,r)=>new se(this.type,i,n,r,this.propValues),e.makeTree||((i,n,r)=>new se(ze.none,i,n,r)))}static build(e){return c$(e)}}se.empty=new se(ze.none,[],[],0);class Hc{constructor(e,i){this.buffer=e,this.index=i}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Hc(this.buffer,this.index)}}class cn{constructor(e,i,n){this.buffer=e,this.length=i,this.set=n}get type(){return ze.none}toString(){let e=[];for(let i=0;i0));a=o[a+3]);return l}slice(e,i,n){let r=this.buffer,s=new Uint16Array(i-e),o=0;for(let l=e,a=0;l=e&&ie;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function Ds(t,e,i,n){for(var r;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to0?l.length:-1;e!=u;e+=i){let c=l[e],h=a[e]+o.from,f;if(!(!(s&ge.EnterBracketed&&c instanceof se&&(f=rr.get(c))&&!f.overlay&&f.bracketed&&n>=h&&n<=h+c.length)&&!yg(r,n,h,h+c.length))){if(c instanceof cn){if(s&ge.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,i,n-h,r);if(d>-1)return new ki(new l$(o,c,e,h),null,d)}else if(s&ge.IncludeAnonymous||!c.type.isAnonymous||Kc(c)){let d;if(!(s&ge.IgnoreMounts)&&(d=rr.get(c))&&!d.overlay)return new rt(d.tree,h,e,o);let p=new rt(c,h,e,o);return s&ge.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(i<0?c.children.length-1:0,i,n,r,s)}}}if(s&ge.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+i:e=i<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,i,n=0){let r;if(!(n&ge.IgnoreOverlays)&&(r=rr.get(this._tree))&&r.overlay){let s=e-this.from,o=n&ge.EnterBracketed&&r.bracketed;for(let{from:l,to:a}of r.overlay)if((i>0||o?l<=s:l=s:a>s))return new rt(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,i,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function c0(t,e,i,n){let r=t.cursor(),s=[];if(!r.firstChild())return s;if(i!=null){for(let o=!1;!o;)if(o=r.type.is(i),!r.nextSibling())return s}for(;;){if(n!=null&&r.type.is(n))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return n==null?s:[]}}function nc(t,e,i=e.length-1){for(let n=t;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class l${constructor(e,i,n,r){this.parent=e,this.buffer=i,this.index=n,this.start=r}}class ki extends xg{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,i,n){super(),this.context=e,this._parent=i,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,i,n){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,i-this.context.start,n);return s<0?null:new ki(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,i,n=0){if(n&ge.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],i>0?1:-1,e-this.context.start,i);return s<0?null:new ki(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,i=e.buffer[this.index+3];return i<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ki(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new ki(this.context,this._parent,e.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],i=[],{buffer:n}=this.context,r=this.index+4,s=n.buffer[this.index+3];if(s>r){let o=n.buffer[this.index+1];e.push(n.slice(r,s,o)),i.push(0)}return new se(this.type,e,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function kg(t){if(!t.length)return null;let e=0,i=t[0];for(let s=1;si.from||o.to=e){let l=new rt(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[n])).push(Ds(l,e,i,!1))}}return r?kg(r):n}class Cl{get name(){return this.type.name}constructor(e,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~ge.EnterBracketed,e instanceof rt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,i){this.index=e;let{start:n,buffer:r}=this.buffer;return this.type=i||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof rt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,i,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,i,n,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,i-this.buffer.start,n);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,i,n=this.mode){return this.buffer?n&ge.ExcludeBuffers?!1:this.enterChild(1,e,i):this.yield(this._tree.enter(e,i,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ge.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ge.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:i}=this.buffer,n=this.stack.length-1;if(e<0){let r=n<0?0:this.stack[n]+4;if(this.index!=r)return this.yieldBuf(i.findChild(r,this.index,-1,0,4))}else{let r=i.buffer[this.index+3];if(r<(n<0?i.buffer.length:i.buffer[this.stack[n]+3]))return this.yieldBuf(r)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let i,n,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=i+e,o=e<0?-1:n._tree.children.length;s!=o;s+=e){let l=n._tree.children[s];if(this.mode&ge.IncludeAnonymous||l instanceof cn||!l.type.isAnonymous||Kc(l))return!1}return!0}move(e,i){if(i&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,i=0){for(;(this.from==this.to||(i<1?this.from>=e:this.from>e)||(i>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;i=o,n=s+1;break e}r=this.stack[--s]}for(let r=n;r=0;s--){if(s<0)return nc(this._tree,e,r);let o=n[i.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function Kc(t){return t.children.some(e=>e instanceof cn||!e.type.isAnonymous||Kc(e))}function c$(t){var e;let{buffer:i,nodeSet:n,maxBufferLength:r=vg,reused:s=[],minRepeatType:o=n.types.length}=t,l=Array.isArray(i)?new Hc(i,i.length):i,a=n.types,u=0,c=0;function h(v,Q,P,_,R,L){let{id:I,start:T,end:M,size:F}=l,B=c,Y=u;if(F<0)if(l.next(),F==-1){let ye=s[I];P.push(ye),_.push(T-v);return}else if(F==-3){u=I;return}else if(F==-4){c=I;return}else throw new RangeError(`Unrecognized record size: ${F}`);let J=a[I],ee,re,ue=T-v;if(M-T<=r&&(re=O(l.pos-Q,R))){let ye=new Uint16Array(re.size-re.skip),Oe=l.pos-re.size,le=ye.length;for(;l.pos>Oe;)le=g(re.start,ye,le);ee=new cn(ye,M-re.start,n),ue=re.start-v}else{let ye=l.pos-F;l.next();let Oe=[],le=[],Se=I>=o?I:-1,et=0,Pi=M;for(;l.pos>ye;)Se>=0&&l.id==Se&&l.size>=0?(l.end<=Pi-r&&(p(Oe,le,T,et,l.end,Pi,Se,B,Y),et=Oe.length,Pi=l.end),l.next()):L>2500?f(T,ye,Oe,le):h(T,ye,Oe,le,Se,L+1);if(Se>=0&&et>0&&et-1&&et>0){let dn=d(J,Y);ee=Jc(J,Oe,le,0,Oe.length,0,M-T,dn,dn)}else ee=m(J,Oe,le,M-T,B-M,Y)}P.push(ee),_.push(ue)}function f(v,Q,P,_){let R=[],L=0,I=-1;for(;l.pos>Q;){let{id:T,start:M,end:F,size:B}=l;if(B>4)l.next();else{if(I>-1&&M=0;F-=3)T[B++]=R[F],T[B++]=R[F+1]-M,T[B++]=R[F+2]-M,T[B++]=B;P.push(new cn(T,R[2]-M,n)),_.push(M-v)}}function d(v,Q){return(P,_,R)=>{let L=0,I=P.length-1,T,M;if(I>=0&&(T=P[I])instanceof se){if(!I&&T.type==v&&T.length==R)return T;(M=T.prop(K.lookAhead))&&(L=_[I]+T.length+M)}return m(v,P,_,R,L,Q)}}function p(v,Q,P,_,R,L,I,T,M){let F=[],B=[];for(;v.length>_;)F.push(v.pop()),B.push(Q.pop()+P-R);v.push(m(n.types[I],F,B,L-R,T-L,M)),Q.push(R-P)}function m(v,Q,P,_,R,L,I){if(L){let T=[K.contextHash,L];I=I?[T].concat(I):[T]}if(R>25){let T=[K.lookAhead,R];I=I?[T].concat(I):[T]}return new se(v,Q,P,_,I)}function O(v,Q){let P=l.fork(),_=0,R=0,L=0,I=P.end-r,T={size:0,start:0,skip:0};e:for(let M=P.pos-v;P.pos>M;){let F=P.size;if(P.id==Q&&F>=0){T.size=_,T.start=R,T.skip=L,L+=4,_+=4,P.next();continue}let B=P.pos-F;if(F<0||B=o?4:0,J=P.start;for(P.next();P.pos>B;){if(P.size<0)if(P.size==-3||P.size==-4)Y+=4;else break e;else P.id>=o&&(Y+=4);P.next()}R=J,_+=F,L+=Y}return(Q<0||_==v)&&(T.size=_,T.start=R,T.skip=L),T.size>4?T:void 0}function g(v,Q,P){let{id:_,start:R,end:L,size:I}=l;if(l.next(),I>=0&&_4){let M=l.pos-(I-4);for(;l.pos>M;)P=g(v,Q,P)}Q[--P]=T,Q[--P]=L-v,Q[--P]=R-v,Q[--P]=_}else I==-3?u=_:I==-4&&(c=_);return P}let b=[],y=[];for(;l.pos>0;)h(t.start||0,t.bufferStart||0,b,y,-1,0);let w=(e=t.length)!==null&&e!==void 0?e:b.length?y[0]+b[0].length:0;return new se(a[t.topID],b.reverse(),y.reverse(),w)}const h0=new WeakMap;function sl(t,e){if(!t.isAnonymous||e instanceof cn||e.type!=t)return 1;let i=h0.get(e);if(i==null){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof se)){i=1;break}i+=sl(t,n)}h0.set(e,i)}return i}function Jc(t,e,i,n,r,s,o,l,a){let u=0;for(let p=n;p=c)break;Q+=P}if(y==w+1){if(Q>c){let P=p[w];d(P.children,P.positions,0,P.children.length,m[w]+b);continue}h.push(p[w])}else{let P=m[y-1]+p[y-1].length-v;h.push(Jc(t,p,m,w,y,v,P,null,a))}f.push(v+b-s)}}return d(e,i,n,r,0),(l||a)(h,f,o)}class Sg{constructor(){this.map=new WeakMap}setBuffer(e,i,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(i,n)}getBuffer(e,i){let n=this.map.get(e);return n&&n.get(i)}set(e,i){e instanceof ki?this.setBuffer(e.context.buffer,e.index,i):e instanceof rt&&this.map.set(e.tree,i)}get(e){return e instanceof ki?this.getBuffer(e.context.buffer,e.index):e instanceof rt?this.map.get(e.tree):void 0}cursorSet(e,i){e.buffer?this.setBuffer(e.buffer.buffer,e.index,i):this.map.set(e.tree,i)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Li{constructor(e,i,n,r,s=!1,o=!1){this.from=e,this.to=i,this.tree=n,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,i=[],n=!1){let r=[new Li(0,e.length,e,0,!1,n)];for(let s of i)s.to>e.length&&r.push(s);return r}static applyChanges(e,i,n=128){if(!i.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let l=0,a=0,u=0;;l++){let c=l=n)for(;o&&o.from=f.from||h<=f.to||u){let d=Math.max(f.from,a)-u,p=Math.min(f.to,h)-u;f=d>=p?null:new Li(d,p,f.tree,f.offset+u,l>0,!!c)}if(f&&r.push(f),o.to>h)break;o=snew Ft(r.from,r.to)):[new Ft(0,0)]:[new Ft(0,e.length)],this.createParse(e,i||[],n)}parse(e,i,n){let r=this.startParse(e,i,n);for(;;){let s=r.advance();if(s)return s}}}class h${constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,i){return this.string.slice(e,i)}}function wg(t){return(e,i,n,r)=>new d$(e,t,i,n,r)}class f0{constructor(e,i,n,r,s,o){this.parser=e,this.parse=i,this.overlay=n,this.bracketed=r,this.target=s,this.from=o}}function d0(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class f${constructor(e,i,n,r,s,o,l,a){this.parser=e,this.predicate=i,this.mounts=n,this.index=r,this.start=s,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const rc=new K({perNode:!0});class d${constructor(e,i,n,r,s){this.nest=i,this.input=n,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new se(n.type,n.children,n.positions,n.length,n.propValues.concat([[rc,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],i=e.parse.advance();if(i){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[K.mounted.id]=new rr(i,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let i=this.innerDone;i=this.stoppedAt)l=!1;else if(e.hasNode(r)){if(i){let u=i.mounts.find(c=>c.frag.from<=r.from&&c.frag.to>=r.to&&c.mount.overlay);if(u)for(let c of u.mount.overlay){let h=c.from+u.pos,f=c.to+u.pos;h>=r.from&&f<=r.to&&!i.ranges.some(d=>d.fromh)&&i.ranges.push({from:h,to:f})}}l=!1}else if(n&&(o=p$(n.ranges,r.from,r.to)))l=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Ft(h.from-r.from,h.to-r.from)):null,!!s.bracketed,r.tree,c.length?c[0].from:r.from)),s.overlay?c.length&&(n={ranges:c,depth:0,prev:n}):l=!1}}else if(i&&(a=i.predicate(r))&&(a===!0&&(a=new Ft(r.from,r.to)),a.from=0&&i.ranges[u].to==a.from?i.ranges[u]={from:i.ranges[u].from,to:a.to}:i.ranges.push(a)}if(l&&r.firstChild())i&&i.depth++,n&&n.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(i&&!--i.depth){let u=O0(this.ranges,i.ranges);u.length&&(d0(u),this.inner.splice(i.index,0,new f0(i.parser,i.parser.startParse(this.input,g0(i.mounts,u),u),i.ranges.map(c=>new Ft(c.from-i.start,c.to-i.start)),i.bracketed,i.target,u[0].from))),i=i.prev}n&&!--n.depth&&(n=n.prev)}}}}function p$(t,e,i){for(let n of t){if(n.from>=i)break;if(n.to>e)return n.from<=e&&n.to>=i?2:1}return 0}function p0(t,e,i,n,r,s){if(e=e&&i.enter(n,1,ge.IgnoreOverlays|ge.ExcludeBuffers)))if(i.to<=e)i.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let i=this.cursor.tree;;){if(i==e.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof se)i=i.children[0];else break}return!1}}let O$=class{constructor(e){var i;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(i=n.tree.prop(rc))!==null&&i!==void 0?i:n.to,this.inner=new m0(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let i=this.curFrag=this.fragments[this.fragI];this.curTo=(e=i.tree.prop(rc))!==null&&e!==void 0?e:i.to,this.inner=new m0(i.tree,-i.offset)}}findMounts(e,i){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(n=s.tree)===null||n===void 0?void 0:n.prop(K.mounted);if(o&&o.parser==i)for(let l=this.fragI;l=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:o})}}}return r}};function O0(t,e){let i=null,n=e;for(let r=1,s=0;r=l)break;a.to<=o||(i||(n=i=e.slice()),a.froml&&i.splice(s+1,0,new Ft(l,a.to))):a.to>l?i[s--]=new Ft(l,a.to):i.splice(s--,1))}}return n}function g$(t,e,i,n){let r=0,s=0,o=!1,l=!1,a=-1e9,u=[];for(;;){let c=r==t.length?1e9:o?t[r].to:t[r].from,h=s==e.length?1e9:l?e[s].to:e[s].from;if(o!=l){let f=Math.max(a,i),d=Math.min(c,h,n);fnew Ft(f.from+n,f.to+n)),h=g$(e,c,a,u);for(let f=0,d=a;;f++){let p=f==h.length,m=p?u:h[f].from;if(m>d&&i.push(new Li(d,m,r.tree,-o,s.from>=d||s.openStart,s.to<=m||s.openEnd)),p)break;d=h[f].to}}else i.push(new Li(a,u,r.tree,-o,s.from>=o||s.openStart,s.to<=l||s.openEnd))}return i}let b$=0;class Et{constructor(e,i,n,r){this.name=e,this.set=i,this.base=n,this.modified=r,this.id=b$++}toString(){let{name:e}=this;for(let i of this.modified)i.name&&(e=`${i.name}(${e})`);return e}static define(e,i){let n=typeof e=="string"?e:"?";if(e instanceof Et&&(i=e),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let r=new Et(n,[],null,[]);if(r.set.push(r),i)for(let s of i.set)r.set.push(s);return r}static defineModifier(e){let i=new Tl(e);return n=>n.modified.indexOf(i)>-1?n:Tl.get(n.base||n,n.modified.concat(i).sort((r,s)=>r.id-s.id))}}let v$=0;class Tl{constructor(e){this.name=e,this.instances=[],this.id=v$++}static get(e,i){if(!i.length)return e;let n=i[0].instances.find(l=>l.base==e&&y$(i,l.modified));if(n)return n;let r=[],s=new Et(e.name,r,e,i);for(let l of i)l.instances.push(s);let o=x$(i);for(let l of e.set)if(!l.modified.length)for(let a of o)r.push(Tl.get(l,a));return s}}function y$(t,e){return t.length==e.length&&t.every((i,n)=>i==e[n])}function x$(t){let e=[[]];for(let i=0;in.length-i.length)}function Dr(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let r of i.split(" "))if(r){let s=[],o=2,l=r;for(let h=0;;){if(l=="..."&&h>0&&h+3==r.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+r);if(s.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),h+=f[0].length,h==r.length)break;let d=r[h++];if(h==r.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+r);l=r.slice(h)}let a=s.length-1,u=s[a];if(!u)throw new RangeError("Invalid path: "+r);let c=new Ls(n,o,a>0?s.slice(0,a):null);e[u]=c.sort(e[u])}}return $g.add(e)}const $g=new K({combine(t,e){let i,n,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),i&&i.mode==r.mode&&!r.context&&!i.context)continue;let s=new Ls(r.tags,r.mode,r.context);i?i.next=s:n=s,i=s}return n}});class Ls{constructor(e,i,n,r){this.tags=e,this.mode=i,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=r;for(let l of s)for(let a of l.set){let u=i[a.id];if(u){o=o?o+" "+u:u;break}}return o},scope:n}}function k$(t,e){let i=null;for(let n of t){let r=n.style(e);r&&(i=i?i+" "+r:r)}return i}function S$(t,e,i,n=0,r=t.length){let s=new w$(n,Array.isArray(e)?e:[e],i);s.highlightRange(t.cursor(),n,r,"",s.highlighters),s.flush(r)}class w${constructor(e,i,n){this.at=e,this.highlighters=i,this.span=n,this.class=""}startSpan(e,i){i!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=i)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,i,n,r,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=i)return;o.isTop&&(s=this.highlighters.filter(d=>!d.scope||d.scope(o)));let u=r,c=$$(e)||Ls.empty,h=k$(s,c.tags);if(h&&(u&&(u+=" "),u+=h,c.mode==1&&(r+=(r?" ":"")+h)),this.startSpan(Math.max(i,l),u),c.opaque)return;let f=e.tree&&e.tree.prop(K.mounted);if(f&&f.overlay){let d=e.node.enter(f.overlay[0].from+l,1),p=this.highlighters.filter(O=>!O.scope||O.scope(f.tree.type)),m=e.firstChild();for(let O=0,g=l;;O++){let b=O=y||!e.nextSibling())););if(!b||y>n)break;g=b.to+l,g>i&&(this.highlightRange(d.cursor(),Math.max(i,b.from+l),Math.min(n,g),"",p),this.startSpan(Math.min(n,g),u))}m&&e.parent()}else if(e.firstChild()){f&&(r="");do if(!(e.to<=i)){if(e.from>=n)break;this.highlightRange(e,i,n,r,s),this.startSpan(Math.min(n,e.to),u)}while(e.nextSibling());e.parent()}}}function $$(t){let e=t.type.prop($g);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const V=Et.define,Lo=V(),Gi=V(),b0=V(Gi),v0=V(Gi),Ui=V(),Mo=V(Ui),za=V(Ui),mi=V(),On=V(mi),di=V(),pi=V(),sc=V(),Br=V(sc),Zo=V(),k={comment:Lo,lineComment:V(Lo),blockComment:V(Lo),docComment:V(Lo),name:Gi,variableName:V(Gi),typeName:b0,tagName:V(b0),propertyName:v0,attributeName:V(v0),className:V(Gi),labelName:V(Gi),namespace:V(Gi),macroName:V(Gi),literal:Ui,string:Mo,docString:V(Mo),character:V(Mo),attributeValue:V(Mo),number:za,integer:V(za),float:V(za),bool:V(Ui),regexp:V(Ui),escape:V(Ui),color:V(Ui),url:V(Ui),keyword:di,self:V(di),null:V(di),atom:V(di),unit:V(di),modifier:V(di),operatorKeyword:V(di),controlKeyword:V(di),definitionKeyword:V(di),moduleKeyword:V(di),operator:pi,derefOperator:V(pi),arithmeticOperator:V(pi),logicOperator:V(pi),bitwiseOperator:V(pi),compareOperator:V(pi),updateOperator:V(pi),definitionOperator:V(pi),typeOperator:V(pi),controlOperator:V(pi),punctuation:sc,separator:V(sc),bracket:Br,angleBracket:V(Br),squareBracket:V(Br),paren:V(Br),brace:V(Br),content:mi,heading:On,heading1:V(On),heading2:V(On),heading3:V(On),heading4:V(On),heading5:V(On),heading6:V(On),contentSeparator:V(mi),list:V(mi),quote:V(mi),emphasis:V(mi),strong:V(mi),link:V(mi),monospace:V(mi),strikethrough:V(mi),inserted:V(),deleted:V(),changed:V(),invalid:V(),meta:Zo,documentMeta:V(Zo),annotation:V(Zo),processingInstruction:V(Zo),definition:Et.defineModifier("definition"),constant:Et.defineModifier("constant"),function:Et.defineModifier("function"),standard:Et.defineModifier("standard"),local:Et.defineModifier("local"),special:Et.defineModifier("special")};for(let t in k){let e=k[t];e instanceof Et&&(e.name=t)}Qg([{tag:k.link,class:"tok-link"},{tag:k.heading,class:"tok-heading"},{tag:k.emphasis,class:"tok-emphasis"},{tag:k.strong,class:"tok-strong"},{tag:k.keyword,class:"tok-keyword"},{tag:k.atom,class:"tok-atom"},{tag:k.bool,class:"tok-bool"},{tag:k.url,class:"tok-url"},{tag:k.labelName,class:"tok-labelName"},{tag:k.inserted,class:"tok-inserted"},{tag:k.deleted,class:"tok-deleted"},{tag:k.literal,class:"tok-literal"},{tag:k.string,class:"tok-string"},{tag:k.number,class:"tok-number"},{tag:[k.regexp,k.escape,k.special(k.string)],class:"tok-string2"},{tag:k.variableName,class:"tok-variableName"},{tag:k.local(k.variableName),class:"tok-variableName tok-local"},{tag:k.definition(k.variableName),class:"tok-variableName tok-definition"},{tag:k.special(k.variableName),class:"tok-variableName2"},{tag:k.definition(k.propertyName),class:"tok-propertyName tok-definition"},{tag:k.typeName,class:"tok-typeName"},{tag:k.namespace,class:"tok-namespace"},{tag:k.className,class:"tok-className"},{tag:k.macroName,class:"tok-macroName"},{tag:k.propertyName,class:"tok-propertyName"},{tag:k.operator,class:"tok-operator"},{tag:k.comment,class:"tok-comment"},{tag:k.meta,class:"tok-meta"},{tag:k.invalid,class:"tok-invalid"},{tag:k.punctuation,class:"tok-punctuation"}]);var ja;const nn=new K;function ca(t){return G.define({combine:t?e=>e.concat(t):void 0})}const eh=new K;class Dt{constructor(e,i,n=[],r=""){this.data=e,this.name=r,fe.prototype.hasOwnProperty("tree")||Object.defineProperty(fe.prototype,"tree",{get(){return Re(this)}}),this.parser=i,this.extension=[$r.of(this),fe.languageData.of((s,o,l)=>{let a=y0(s,o,l),u=a.type.prop(nn);if(!u)return[];let c=s.facet(u),h=a.type.prop(eh);if(h){let f=a.resolve(o-a.from,l);for(let d of h)if(d.test(f,s)){let p=s.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(n)}isActiveAt(e,i,n=-1){return y0(e,i,n).type.prop(nn)==this.data}findRegions(e){let i=e.facet($r);if((i==null?void 0:i.data)==this.data)return[{from:0,to:e.doc.length}];if(!i||!i.allowsNesting)return[];let n=[],r=(s,o)=>{if(s.prop(nn)==this.data){n.push({from:o,to:o+s.length});return}let l=s.prop(K.mounted);if(l){if(l.tree.prop(nn)==this.data){if(l.overlay)for(let a of l.overlay)n.push({from:a.from+o,to:a.to+o});else n.push({from:o,to:o+s.length});return}else if(l.overlay){let a=n.length;if(r(l.tree,l.overlay[0].from+o),n.length>a)return}}for(let a=0;an.isTop?i:void 0)]}),e.name)}configure(e,i){return new Sr(this.data,this.parser.configure(e),i||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Re(t){let e=t.field(Dt.state,!1);return e?e.tree:se.empty}class Q${constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,i){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,i):this.string.slice(e-n,i-n)}}let Vr=null;class Dn{constructor(e,i,n=[],r,s,o,l,a){this.parser=e,this.state=i,this.fragments=n,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,i,n){return new Dn(e,i,[],se.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Q$(this.state.doc),this.fragments)}work(e,i){return i!=null&&i>=this.state.doc.length&&(i=void 0),this.tree!=se.empty&&this.isDone(i??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),i!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>i)&&i=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(i=this.parse.advance()););}),this.treeLen=e,this.tree=i,this.fragments=this.withoutTempSkipped(Li.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let i=Vr;Vr=this;try{return e()}finally{Vr=i}}withoutTempSkipped(e){for(let i;i=this.tempSkipped.pop();)e=x0(e,i.from,i.to);return e}changes(e,i){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((u,c,h,f)=>a.push({fromA:u,toA:c,fromB:h,toB:f})),n=Li.applyChanges(n,a),r=se.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let c=e.mapPos(u.from,1),h=e.mapPos(u.to,-1);ce.from&&(this.fragments=x0(this.fragments,r,s),this.skipped.splice(n--,1))}return this.skipped.length>=i?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,i){this.skipped.push({from:e,to:i})}static getSkippingParser(e){return new class extends ua{createParse(i,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let a=Vr;if(a){for(let u of r)a.tempSkipped.push(u);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new se(ze.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let i=this.fragments;return this.treeLen>=e&&i.length&&i[0].from==0&&i[0].to>=e}static get(){return Vr}}function x0(t,e,i){return Li.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class wr{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let i=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),i.viewport.to);return i.work(20,n)||i.takeTree(),new wr(i)}static init(e){let i=Math.min(3e3,e.doc.length),n=Dn.create(e.facet($r).parser,e,{from:0,to:i});return n.work(20,i)||n.takeTree(),new wr(n)}}Dt.state=Yt.define({create:wr.init,update(t,e){for(let i of e.effects)if(i.is(Dt.setState))return i.value;return e.startState.facet($r)!=e.state.facet($r)?wr.init(e.state):t.apply(e)}});let _g=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(_g=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const Fa=typeof navigator<"u"&&(!((ja=navigator.scheduling)===null||ja===void 0)&&ja.isInputPending)?()=>navigator.scheduling.isInputPending():null,_$=Mt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let i=this.view.state.field(Dt.state).context;(i.updateViewport(e.view.viewport)||this.view.viewport.to>i.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(i)}scheduleWork(){if(this.working)return;let{state:e}=this.view,i=e.field(Dt.state);(i.tree!=i.context.tree||!i.context.isDone(e.doc.length))&&(this.working=_g(this.work))}work(e){this.working=null;let i=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>Fa&&Fa()||Date.now()>o,r+(l?0:1e5));this.chunkBudget-=Date.now()-i,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Dt.setState.of(new wr(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(i=>Rt(this.view.state,i)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),$r=G.define({combine(t){return t.length?t[0]:null},enables:t=>[Dt.state,_$,W.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class Qr{constructor(e,i=[]){this.language=e,this.support=i,this.extension=[e,i]}}class C{constructor(e,i,n,r,s,o=void 0){this.name=e,this.alias=i,this.extensions=n,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:i,support:n}=e;if(!i){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");i=()=>Promise.resolve(n)}return new C(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,i,n)}static matchFilename(e,i){for(let r of e)if(r.filename&&r.filename.test(i))return r;let n=/\.([^.]+)$/.exec(i);if(n){for(let r of e)if(r.extensions.indexOf(n[1])>-1)return r}return null}static matchLanguageName(e,i,n=!0){i=i.toLowerCase();for(let r of e)if(r.alias.some(s=>s==i))return r;if(n)for(let r of e)for(let s of r.alias){let o=i.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(i[o-1])&&!/\w/.test(i[o+s.length])))return r}return null}}const P$=G.define(),Lr=G.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(i=>i!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Ln(t){let e=t.facet(Lr);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Al(t,e){let i="",n=t.tabSize,r=t.facet(Lr)[0];if(r==" "){for(;e>=n;)i+=" ",e-=n;r=" "}for(let s=0;s=e?C$(t,i,e):null}class ha{constructor(e,i={}){this.state=e,this.options=i,this.unit=Ln(e)}lineAt(e,i=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=n.from&&r<=n.to?s&&r==e?{text:"",from:e}:(i<0?r-1&&(s+=o-this.countColumn(n,n.search(/\S|$/))),s}countColumn(e,i=e.length){return Mi(e,this.state.tabSize,i)}lineIndent(e,i=1){let{text:n,from:r}=this.lineAt(e,i),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Mr=new K;function C$(t,e,i){let n=e.resolveStack(i),r=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(r!=n.node){let s=[];for(let o=r;o&&!(o.fromn.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)n={node:s[o],next:n}}return Cg(n,t,i)}function Cg(t,e,i){for(let n=t;n;n=n.next){let r=A$(n.node);if(r)return r(th.create(e,i,n))}return 0}function T$(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function A$(t){let e=t.type.prop(Mr);if(e)return e;let i=t.firstChild,n;if(i&&(n=i.type.prop(K.closedBy))){let r=t.lastChild,s=r&&n.indexOf(r.name)>-1;return o=>Tg(o,!0,1,void 0,s&&!T$(o)?r.from:void 0)}return t.parent==null?E$:null}function E$(){return 0}class th extends ha{constructor(e,i,n){super(e.state,e.options),this.base=e,this.pos=i,this.context=n}get node(){return this.context.node}static create(e,i,n){return new th(e,i,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let i=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(i.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(R$(n,e))break;i=this.state.doc.lineAt(n.from)}return this.lineIndent(i.from)}continue(){return Cg(this.context.next,this.base,this.pos)}}function R$(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function D$(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let r=t.options.simulateBreak,s=t.state.doc.lineAt(i.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let l=i.to;;){let a=e.childAfter(l);if(!a||a==n)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let u=/^ */.exec(s.text.slice(i.to-s.from))[0].length;return{from:i.from,to:i.to+u}}l=a.to}}function L$({closing:t,align:e=!0,units:i=1}){return n=>Tg(n,e,i,t)}function Tg(t,e,i,n,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length,l=n&&s.slice(o,o+n.length)==n||r==t.pos+o,a=e?D$(t):null;return a?l?t.column(a.from):t.column(a.to):t.baseIndent+(l?0:t.unit*i)}const M$=t=>t.baseIndent;function ol({except:t,units:e=1}={}){return i=>{let n=t&&t.test(i.textAfter);return i.baseIndent+(n?0:e*i.unit)}}const Z$=G.define(),no=new K;function Ag(t){let e=t.firstChild,i=t.lastChild;return e&&e.tol.prop(nn)==o.data:o?l=>l==o:void 0,this.style=Qg(e.map(l=>({tag:l.tag,class:l.class||r(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=n?new ln(n):null,this.themeType=i.themeType}static define(e,i){return new ro(e,i||{})}}const oc=G.define(),I$=G.define({combine(t){return t.length?[t[0]]:null}});function Ba(t){let e=t.facet(oc);return e.length?e:t.facet(I$)}function Eg(t,e){let i=[z$],n;return t instanceof ro&&(t.module&&i.push(W.styleModule.of(t.module)),n=t.themeType),n?i.push(oc.computeN([W.darkTheme],r=>r.facet(W.darkTheme)==(n=="dark")?[t]:[])):i.push(oc.of(t)),i}class X${constructor(e){this.markCache=Object.create(null),this.tree=Re(e.state),this.decorations=this.buildDeco(e,Ba(e.state)),this.decoratedTo=e.viewport.to}update(e){let i=Re(e.state),n=Ba(e.state),r=n!=Ba(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);i.length=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(i!=this.tree||e.viewportChanged||r)&&(this.tree=i,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=s.to)}buildDeco(e,i){if(!i||!this.tree.length)return ve.none;let n=new gr;for(let{from:r,to:s}of e.visibleRanges)S$(this.tree,i,(o,l,a)=>{n.add(o,l,this.markCache[a]||(this.markCache[a]=ve.mark({class:a})))},r,s);return n.finish()}}const z$=Ii.high(Mt.fromClass(X$,{decorations:t=>t.decorations})),j$=1e4,F$="()[]{}",Rg=new K;function lc(t,e,i){let n=t.prop(e<0?K.openedBy:K.closedBy);if(n)return n;if(t.name.length==1){let r=i.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[i[r+e]]}return null}function ac(t){let e=t.type.prop(Rg);return e?e(t.node):t}function Un(t,e,i,n={}){let r=n.maxScanDistance||j$,s=n.brackets||F$,o=Re(t),l=o.resolveInner(e,i);for(let a=l;a;a=a.parent){let u=lc(a.type,i,s);if(u&&a.from0?e>=c.from&&ec.from&&e<=c.to))return B$(t,e,i,a,c,u,s)}}return V$(t,e,i,o,l.type,r,s)}function B$(t,e,i,n,r,s,o){let l=n.parent,a={from:r.from,to:r.to},u=0,c=l==null?void 0:l.cursor();if(c&&(i<0?c.childBefore(n.from):c.childAfter(n.to)))do if(i<0?c.to<=n.from:c.from>=n.to){if(u==0&&s.indexOf(c.type.name)>-1&&c.from0)return null;let u={from:i<0?e-1:e,to:i>0?e+1:e},c=t.doc.iterRange(e,i>0?t.doc.length:0),h=0;for(let f=0;!c.next().done&&f<=s;){let d=c.value;i<0&&(f+=d.length);let p=e+f*i;for(let m=i>0?0:d.length-1,O=i>0?d.length:-1;m!=O;m+=i){let g=o.indexOf(d[m]);if(!(g<0||n.resolveInner(p+m,1).type!=r))if(g%2==0==i>0)h++;else{if(h==1)return{start:u,end:{from:p+m,to:p+m+1},matched:g>>1==a>>1};h--}}i>0&&(f+=d.length)}return c.done?{start:u,matched:!1}:null}function k0(t,e,i,n=0,r=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let s=r;for(let o=n;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.posi}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let i=this.string.indexOf(e,this.pos);if(i>-1)return this.pos=i,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosn?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return r(s)==r(e)?(i!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&i!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function q$(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||W$,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||rh,mergeTokens:t.mergeTokens!==!1}}function W$(t){if(typeof t!="object")return t;let e={};for(let i in t){let n=t[i];e[i]=n instanceof Array?n.slice():n}return e}const S0=new WeakMap;class ih extends Dt{constructor(e){let i=ca(e.languageData),n=q$(e),r,s=new class extends ua{createParse(o,l,a){return new N$(r,o,l,a)}};super(i,s,[],e.name),this.topNode=H$(i,this),r=this,this.streamParser=n,this.stateAfter=new K({perNode:!0}),this.tokenTable=e.tokenTable?new Ig(n.tokenTable):U$}static define(e){return new ih(e)}getIndent(e){let i,{overrideIndentation:n}=e.options;n&&(i=S0.get(e.state),i!=null&&i1e4)return null;for(;s=n&&i+e.length<=r&&e.prop(t.stateAfter);if(s)return{state:t.streamParser.copyState(s),pos:i+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=i+e.positions[o],u=l instanceof se&&a=e.length)return e;!r&&i==0&&e.type==t.topNode&&(r=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],l=e.children[s],a;if(oi&&nh(t,s.tree,0-s.offset,i,l),u;if(a&&a.pos<=n&&(u=Lg(t,s.tree,i+s.offset,a.pos+s.offset,!1)))return{state:a.state,tree:u}}return{state:t.streamParser.startState(r?Ln(r):4),tree:se.empty}}let N$=class{constructor(e,i,n,r){this.lang=e,this.input=i,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=Dn.get(),o=r[0].from,{state:l,tree:a}=Y$(e,n,o,this.to,s==null?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let u=0;uu.from<=s.viewport.from&&u.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(Ln(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=Dn.get(),i=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(i,this.chunkStart+512);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos=i?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,i),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let i=this.input.chunk(e);if(this.input.lineChunks)i==` `&&(i="");else{let n=i.indexOf(` `);n>-1&&(i=i.slice(0,n))}return e+i.length<=this.to?i:i.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,i=this.lineAfter(e),n=e+i.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=n||(i=i.slice(0,s-(n-i.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,l=this.lineAfter(o);i+=l,n=o+l.length}return{line:i,end:n}}skipGapsTo(e,i,n){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+i;if(n>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;i+=o-r}return i}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(i,r,1),i+=r;let l=this.chunk.length;r=this.skipGapsTo(n,r,-1),n+=r,s+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==i?this.chunk[o+2]=n:this.chunk.push(e,i,n,s),r}parseLine(e){let{line:i,end:n}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new Dg(i,e?e.state.tabSize:4,e?Ln(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Mg(s.token,o,this.state);if(l&&(r=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPose.start)return r}throw new Error("Stream parser failed to advance stream.")}const rh=Object.create(null),Ms=[ze.none],G$=new Rr(Ms),w0=[],$0=Object.create(null),Zg=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Zg[t]=Xg(rh,e);class Ig{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Zg)}resolve(e){return e?this.table[e]||(this.table[e]=Xg(this.extra,e)):0}}const U$=new Ig(rh);function Va(t,e){w0.indexOf(t)>-1||(w0.push(t),console.warn(e))}function Xg(t,e){let i=[];for(let l of e.split(" ")){let a=[];for(let u of l.split(".")){let c=t[u]||k[u];c?typeof c=="function"?a.length?a=a.map(c):Va(u,`Modifier ${u} used at start of tag`):a.length?Va(u,`Tag ${u} used as modifier`):a=Array.isArray(c)?c:[c]:Va(u,`Unknown highlighting tag ${u}`)}for(let u of a)i.push(u)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),r=n+" "+i.map(l=>l.id),s=$0[r];if(s)return s.id;let o=$0[r]=ze.define({id:Ms.length,name:n,props:[Dr({[n]:i})]});return Ms.push(o),o.id}function H$(t,e){let i=ze.define({id:Ms.length,name:"Document",props:[nn.add(()=>t),Mr.add(()=>n=>e.getIndent(n))],top:!0});return Ms.push(i),i}Ce.RTL,Ce.LTR;const K$=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=oh(t.state,i.from);return n.line?J$(t):n.block?tQ(t):!1};function sh(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=t(e,i);return r?(n(i.update(r)),!0):!1}}const J$=sh(rQ,0),eQ=sh(zg,0),tQ=sh((t,e)=>zg(t,e,nQ(e)),0);function oh(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const qr=50;function iQ(t,{open:e,close:i},n,r){let s=t.sliceDoc(n-qr,n),o=t.sliceDoc(r,r+qr),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,u=s.length-l;if(s.slice(u-e.length,u)==e&&o.slice(a,a+i.length)==i)return{open:{pos:n-l,margin:l&&1},close:{pos:r+a,margin:a&&1}};let c,h;r-n<=2*qr?c=h=t.sliceDoc(n,r):(c=t.sliceDoc(n,n+qr),h=t.sliceDoc(r-qr,r));let f=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(h)[0].length,p=h.length-d-i.length;return c.slice(f,f+e.length)==e&&h.slice(p,p+i.length)==i?{open:{pos:n+f+e.length,margin:/\s/.test(c.charAt(f+e.length))?1:0},close:{pos:r-d-i.length,margin:/\s/.test(h.charAt(p-1))?1:0}}:null}function nQ(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),r=i.to<=n.to?n:t.doc.lineAt(i.to);r.from>n.from&&r.from==i.to&&(r=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let s=e.length-1;s>=0&&e[s].to>n.from?e[s].to=r.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:r.to})}return e}function zg(t,e,i=e.selection.ranges){let n=i.map(s=>oh(e,s.from).block);if(!n.every(s=>s))return null;let r=i.map((s,o)=>iQ(e,n[o],s.from,s.to));if(t!=2&&!r.every(s=>s))return{changes:e.changes(i.map((s,o)=>r[o]?[]:[{from:s.from,insert:n[o].open+" "},{from:s.to,insert:" "+n[o].close}]))};if(t!=1&&r.some(s=>s)){let s=[];for(let o=0,l;or&&(s==o||o>h.from)){r=h.from;let f=/^\s*/.exec(h.text)[0].length,d=f==h.length,p=h.text.slice(f,f+u.length)==u?f:-1;fs.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:u,empty:c,single:h}of n)(h||!c)&&s.push({from:l.from+u,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&n.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of n)if(l>=0){let u=o.from+l,c=u+a.length;o.text[c-o.from]==" "&&c++,s.push({from:u,to:c})}return{changes:s}}return null}const uc=Xi.define(),sQ=Xi.define(),oQ=G.define(),jg=G.define({combine(t){return na(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,i)=>i},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,i)=>(n,r)=>e(n,r)||i(n,r)})}}),Fg=Yt.define({create(){return Si.empty},update(t,e){let i=e.state.facet(jg),n=e.annotation(uc);if(n){let a=vt.fromTransaction(e,n.selection),u=n.side,c=u==0?t.undone:t.done;return a?c=Rl(c,c.length,i.minDepth,a):c=Vg(c,e.startState.selection),new Si(u==0?n.rest:c,u==0?c:n.rest)}let r=e.annotation(sQ);if((r=="full"||r=="before")&&(t=t.isolate()),e.annotation(Xe.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let s=vt.fromTransaction(e),o=e.annotation(Xe.time),l=e.annotation(Xe.userEvent);return s?t=t.addChanges(s,o,l,i,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,i.newGroupDelay)),(r=="full"||r=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Si(t.done.map(vt.fromJSON),t.undone.map(vt.fromJSON))}});function Q0(t={}){return[Fg,jg.of(t),W.domEventHandlers({beforeinput(e,i){let n=e.inputType=="historyUndo"?lh:e.inputType=="historyRedo"?El:null;return n?(e.preventDefault(),n(i)):!1}})]}function fa(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let r=i.field(Fg,!1);if(!r)return!1;let s=r.pop(t,i,e);return s?(n(s),!0):!1}}const lh=fa(0,!1),El=fa(1,!1),lQ=fa(0,!0),aQ=fa(1,!0);class vt{constructor(e,i,n,r,s){this.changes=e,this.effects=i,this.mapped=n,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new vt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,i,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(i=this.mapped)===null||i===void 0?void 0:i.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new vt(e.changes&&Fe.fromJSON(e.changes),[],e.mapped&&$i.fromJSON(e.mapped),e.startSelection&&E.fromJSON(e.startSelection),e.selectionsAfter.map(E.fromJSON))}static fromTransaction(e,i){let n=Bt;for(let r of e.startState.facet(oQ)){let s=r(e);s.length&&(n=n.concat(s))}return!n.length&&e.changes.empty?null:new vt(e.changes.invert(e.startState.doc),n,void 0,i||e.startState.selection,Bt)}static selection(e){return new vt(void 0,Bt,void 0,void 0,e)}}function Rl(t,e,i,n){let r=e+1>i+20?e-i-1:0,s=t.slice(r,e);return s.push(n),s}function uQ(t,e){let i=[],n=!1;return t.iterChangedRanges((r,s)=>i.push(r,s)),e.iterChangedRanges((r,s,o,l)=>{for(let a=0;a=u&&o<=c&&(n=!0)}}),n}function cQ(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((i,n)=>i.empty!=e.ranges[n].empty).length===0}function Bg(t,e){return t.length?e.length?t.concat(e):t:e}const Bt=[],hQ=200;function Vg(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-hQ));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),Rl(t,t.length-1,1e9,i.setSelAfter(n)))}else return[vt.selection([e])]}function fQ(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function qa(t,e){if(!t.length)return t;let i=t.length,n=Bt;for(;i;){let r=dQ(t[i-1],e,n);if(r.changes&&!r.changes.empty||r.effects.length){let s=t.slice(0,i);return s[i-1]=r,s}else e=r.mapped,i--,n=r.selectionsAfter}return n.length?[vt.selection(n)]:Bt}function dQ(t,e,i){let n=Bg(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Bt,i);if(!t.changes)return vt.selection(n);let r=t.changes.map(e),s=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(s):s;return new vt(r,ae.mapEffects(t.effects,e),o,t.startSelection.map(s),n)}const pQ=/^(input\.type|delete)($|\.)/;class Si{constructor(e,i,n=0,r=void 0){this.done=e,this.undone=i,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new Si(this.done,this.undone):this}addChanges(e,i,n,r,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||pQ.test(n))&&(!l.selectionsAfter.length&&i-this.prevTime0&&i-this.prevTimei.empty?t.moveByChar(i,e):da(i,e))}function st(t){return t.textDirectionAt(t.state.selection.main.head)==Ce.LTR}const Wg=t=>qg(t,!st(t)),Yg=t=>qg(t,st(t));function Ng(t,e){return hi(t,i=>i.empty?t.moveByGroup(i,e):da(i,e))}const OQ=t=>Ng(t,!st(t)),gQ=t=>Ng(t,st(t));function bQ(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function pa(t,e,i){let n=Re(t).resolveInner(e.head),r=i?K.closedBy:K.openedBy;for(let a=e.head;;){let u=i?n.childAfter(a):n.childBefore(a);if(!u)break;bQ(t,u,r)?n=u:a=i?u.to:u.from}let s=n.type.prop(r),o,l;return s&&(o=i?Un(t,n.from,1):Un(t,n.to,-1))&&o.matched?l=i?o.end.to:o.end.from:l=i?n.to:n.from,E.cursor(l,i?-1:1)}const vQ=t=>hi(t,e=>pa(t.state,e,!st(t))),yQ=t=>hi(t,e=>pa(t.state,e,st(t)));function Gg(t,e){return hi(t,i=>{if(!i.empty)return da(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)})}const Ug=t=>Gg(t,!1),Hg=t=>Gg(t,!0);function Kg(t){let e=t.scrollDOM.clientHeighto.empty?t.moveVertically(o,e,i.height):da(o,e));if(r.eq(n.selection))return!1;let s;if(i.selfScroll){let o=t.coordsAtPos(n.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),a=l.top+i.marginTop,u=l.bottom-i.marginBottom;o&&o.top>a&&o.bottomJg(t,!1),cc=t=>Jg(t,!0);function fn(t,e,i){let n=t.lineBlockAt(e.head),r=t.moveToLineBoundary(e,i);if(r.head==e.head&&r.head!=(i?n.to:n.from)&&(r=t.moveToLineBoundary(e,i,!1)),!i&&r.head==n.from&&n.length){let s=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;s&&e.head!=n.from+s&&(r=E.cursor(n.from+s))}return r}const xQ=t=>hi(t,e=>fn(t,e,!0)),kQ=t=>hi(t,e=>fn(t,e,!1)),SQ=t=>hi(t,e=>fn(t,e,!st(t))),wQ=t=>hi(t,e=>fn(t,e,st(t))),$Q=t=>hi(t,e=>E.cursor(t.lineBlockAt(e.head).from,1)),QQ=t=>hi(t,e=>E.cursor(t.lineBlockAt(e.head).to,-1));function _Q(t,e,i){let n=!1,r=Zr(t.selection,s=>{let o=Un(t,s.head,-1)||Un(t,s.head,1)||s.head>0&&Un(t,s.head-1,1)||s.head_Q(t,e);function Nt(t,e,i){let n=Zr(t.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=E.range(r.head,r.anchor));let s=i(r);return E.range(r.anchor,s.head,s.goalColumn,s.bidiLevel||void 0,s.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(ci(t.state,n)),!0)}function e1(t,e){return Nt(t,e,i=>t.moveByChar(i,e))}const t1=t=>e1(t,!st(t)),i1=t=>e1(t,st(t));function n1(t,e){return Nt(t,e,i=>t.moveByGroup(i,e))}const CQ=t=>n1(t,!st(t)),TQ=t=>n1(t,st(t)),AQ=t=>{let e=!st(t);return Nt(t,e,i=>pa(t.state,i,e))},EQ=t=>{let e=st(t);return Nt(t,e,i=>pa(t.state,i,e))};function r1(t,e){return Nt(t,e,i=>t.moveVertically(i,e))}const s1=t=>r1(t,!1),o1=t=>r1(t,!0);function l1(t,e){return Nt(t,e,i=>t.moveVertically(i,e,Kg(t).height))}const P0=t=>l1(t,!1),C0=t=>l1(t,!0),RQ=t=>Nt(t,!0,e=>fn(t,e,!0)),DQ=t=>Nt(t,!1,e=>fn(t,e,!1)),LQ=t=>{let e=!st(t);return Nt(t,e,i=>fn(t,i,e))},MQ=t=>{let e=st(t);return Nt(t,e,i=>fn(t,i,e))},ZQ=t=>Nt(t,!1,e=>E.cursor(t.lineBlockAt(e.head).from)),IQ=t=>Nt(t,!0,e=>E.cursor(t.lineBlockAt(e.head).to)),T0=({state:t,dispatch:e})=>(e(ci(t,{anchor:0})),!0),A0=({state:t,dispatch:e})=>(e(ci(t,{anchor:t.doc.length})),!0),E0=({state:t,dispatch:e})=>(e(ci(t,{anchor:t.selection.main.anchor,head:0})),!0),R0=({state:t,dispatch:e})=>(e(ci(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),XQ=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),zQ=({state:t,dispatch:e})=>{let i=ma(t).map(({from:n,to:r})=>E.range(n,Math.min(r+1,t.doc.length)));return e(t.update({selection:E.create(i),userEvent:"select"})),!0},jQ=({state:t,dispatch:e})=>{let i=Zr(t.selection,n=>{let r=Re(t),s=r.resolveStack(n.from,1);if(n.empty){let o=r.resolveStack(n.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=n.to||l.to>n.to&&l.from<=n.from)&&o.next)return E.range(l.to,l.from)}return n});return i.eq(t.selection)?!1:(e(ci(t,i)),!0)};function a1(t,e){let{state:i}=t,n=i.selection,r=i.selection.ranges.slice();for(let s of i.selection.ranges){let o=i.doc.lineAt(s.head);if(e?o.to0)for(let l=s;;){let a=t.moveVertically(l,e);if(a.heado.to){r.some(u=>u.head==a.head)||r.push(a);break}else{if(a.head==l.head)break;l=a}}}return r.length==n.ranges.length?!1:(t.dispatch(ci(i,E.create(r,r.length-1))),!0)}const FQ=t=>a1(t,!1),BQ=t=>a1(t,!0),VQ=({state:t,dispatch:e})=>{let i=t.selection,n=null;return i.ranges.length>1?n=E.create([i.main]):i.main.empty||(n=E.create([E.cursor(i.main.head)])),n?(e(ci(t,n)),!0):!1};function so(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,r=n.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);ao&&(i="delete.forward",a=Io(t,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Io(t,o,!1),l=Io(t,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:E.cursor(o,or(t)))n.between(e,e,(r,s)=>{re&&(e=i?s:r)});return e}const u1=(t,e,i)=>so(t,n=>{let r=n.from,{state:s}=t,o=s.doc.lineAt(r),l,a;if(i&&!e&&r>o.from&&ru1(t,!1,!0),c1=t=>u1(t,!0,!1),h1=(t,e)=>so(t,i=>{let n=i.head,{state:r}=t,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let l=null;;){if(n==(e?s.to:s.from)){n==i.head&&s.number!=(e?r.doc.lines:1)&&(n+=e?1:-1);break}let a=Ge(s.text,n-s.from,e)+s.from,u=s.text.slice(Math.min(n,a)-s.from,Math.max(n,a)-s.from),c=o(u);if(l!=null&&c!=l)break;(u!=" "||n!=i.head)&&(l=c),n=a}return n}),f1=t=>h1(t,!1),qQ=t=>h1(t,!0),WQ=t=>so(t,e=>{let i=t.lineBlockAt(e.head).to;return e.headso(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),NQ=t=>so(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.head{if(t.readOnly)return!1;let i=t.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:de.of(["",""])},range:E.cursor(n.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0},UQ=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{if(!n.empty||n.from==0||n.from==t.doc.length)return{range:n};let r=n.from,s=t.doc.lineAt(r),o=r==s.from?r-1:Ge(s.text,r-s.from,!1)+s.from,l=r==s.to?r+1:Ge(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:t.doc.slice(r,l).append(t.doc.slice(o,r))},range:E.cursor(l)}});return i.changes.empty?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ma(t){let e=[],i=-1;for(let n of t.selection.ranges){let r=t.doc.lineAt(n.from),s=t.doc.lineAt(n.to);if(!n.empty&&n.to==s.from&&(s=t.doc.lineAt(n.to-1)),i>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(n)}else e.push({from:r.from,to:s.to,ranges:[n]});i=s.number+1}return e}function d1(t,e,i){if(t.readOnly)return!1;let n=[],r=[];for(let s of ma(t)){if(i?s.to==t.doc.length:s.from==0)continue;let o=t.doc.lineAt(i?s.to+1:s.from-1),l=o.length+1;if(i){n.push({from:s.to,to:o.to},{from:s.from,insert:o.text+t.lineBreak});for(let a of s.ranges)r.push(E.range(Math.min(t.doc.length,a.anchor+l),Math.min(t.doc.length,a.head+l)))}else{n.push({from:o.from,to:s.from},{from:s.to,insert:t.lineBreak+o.text});for(let a of s.ranges)r.push(E.range(a.anchor-l,a.head-l))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:E.create(r,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const HQ=({state:t,dispatch:e})=>d1(t,e,!1),KQ=({state:t,dispatch:e})=>d1(t,e,!0);function p1(t,e,i){if(t.readOnly)return!1;let n=[];for(let s of ma(t))i?n.push({from:s.from,insert:t.doc.slice(s.from,s.to)+t.lineBreak}):n.push({from:s.to,insert:t.lineBreak+t.doc.slice(s.from,s.to)});let r=t.changes(n);return e(t.update({changes:r,selection:t.selection.map(r,i?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const JQ=({state:t,dispatch:e})=>p1(t,e,!1),e_=({state:t,dispatch:e})=>p1(t,e,!0),m1=t=>{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(ma(e).map(({from:r,to:s})=>(r>0?r--:s{let s;if(t.lineWrapping){let o=t.lineBlockAt(r.head),l=t.coordsAtPos(r.head,r.assoc||1);l&&(s=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(r,!0,s)}).map(i);return t.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function t_(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i=Re(t).resolveInner(e),n=i.childBefore(e),r=i.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(K.closedBy))&&s.indexOf(r.name)>-1&&t.doc.lineAt(n.to).from==t.doc.lineAt(r.from).from&&!/\S/.test(t.sliceDoc(n.to,r.from))?{from:n.to,to:r.from}:null}const D0=O1(!1),i_=O1(!0);function O1(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange(r=>{let{from:s,to:o}=r,l=e.doc.lineAt(s),a=!t&&s==o&&t_(e,s);t&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let u=new ha(e,{simulateBreak:s,simulateDoubleBreak:!!a}),c=Pg(u,s);for(c==null&&(c=Mi(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));ol.from&&s{let r=[];for(let o=n.from;o<=n.to;){let l=t.doc.lineAt(o);l.number>i&&(n.empty||n.to>l.from)&&(e(l,r,n),i=l.number),o=l.to+1}let s=t.changes(r);return{changes:r,range:E.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}})}const n_=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),n=new ha(t,{overrideIndentation:s=>{let o=i[s];return o??-1}}),r=ah(t,(s,o,l)=>{let a=Pg(n,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let u=/^\s*/.exec(s.text)[0],c=Al(t,a);(u!=c||l.fromt.readOnly?!1:(e(t.update(ah(t,(i,n)=>{n.push({from:i.from,insert:t.facet(Lr)})}),{userEvent:"input.indent"})),!0),b1=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(ah(t,(i,n)=>{let r=/^\s*/.exec(i.text)[0];if(!r)return;let s=Mi(r,t.tabSize),o=0,l=Al(t,Math.max(0,s-Ln(t)));for(;o(t.setTabFocusMode(),!0),s_=[{key:"Ctrl-b",run:Wg,shift:t1,preventDefault:!0},{key:"Ctrl-f",run:Yg,shift:i1},{key:"Ctrl-p",run:Ug,shift:s1},{key:"Ctrl-n",run:Hg,shift:o1},{key:"Ctrl-a",run:$Q,shift:ZQ},{key:"Ctrl-e",run:QQ,shift:IQ},{key:"Ctrl-d",run:c1},{key:"Ctrl-h",run:hc},{key:"Ctrl-k",run:WQ},{key:"Ctrl-Alt-h",run:f1},{key:"Ctrl-o",run:GQ},{key:"Ctrl-t",run:UQ},{key:"Ctrl-v",run:cc}],o_=[{key:"ArrowLeft",run:Wg,shift:t1,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:OQ,shift:CQ,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:SQ,shift:LQ,preventDefault:!0},{key:"ArrowRight",run:Yg,shift:i1,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:gQ,shift:TQ,preventDefault:!0},{mac:"Cmd-ArrowRight",run:wQ,shift:MQ,preventDefault:!0},{key:"ArrowUp",run:Ug,shift:s1,preventDefault:!0},{mac:"Cmd-ArrowUp",run:T0,shift:E0},{mac:"Ctrl-ArrowUp",run:_0,shift:P0},{key:"ArrowDown",run:Hg,shift:o1,preventDefault:!0},{mac:"Cmd-ArrowDown",run:A0,shift:R0},{mac:"Ctrl-ArrowDown",run:cc,shift:C0},{key:"PageUp",run:_0,shift:P0},{key:"PageDown",run:cc,shift:C0},{key:"Home",run:kQ,shift:DQ,preventDefault:!0},{key:"Mod-Home",run:T0,shift:E0},{key:"End",run:xQ,shift:RQ,preventDefault:!0},{key:"Mod-End",run:A0,shift:R0},{key:"Enter",run:D0,shift:D0},{key:"Mod-a",run:XQ},{key:"Backspace",run:hc,shift:hc,preventDefault:!0},{key:"Delete",run:c1,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:f1,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:qQ,preventDefault:!0},{mac:"Mod-Backspace",run:YQ,preventDefault:!0},{mac:"Mod-Delete",run:NQ,preventDefault:!0}].concat(s_.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),l_=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:vQ,shift:AQ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:yQ,shift:EQ},{key:"Alt-ArrowUp",run:HQ},{key:"Shift-Alt-ArrowUp",run:JQ},{key:"Alt-ArrowDown",run:KQ},{key:"Shift-Alt-ArrowDown",run:e_},{key:"Mod-Alt-ArrowUp",run:FQ},{key:"Mod-Alt-ArrowDown",run:BQ},{key:"Escape",run:VQ},{key:"Mod-Enter",run:i_},{key:"Alt-l",mac:"Ctrl-l",run:zQ},{key:"Mod-i",run:jQ,preventDefault:!0},{key:"Mod-[",run:b1},{key:"Mod-]",run:g1},{key:"Mod-Alt-\\",run:n_},{key:"Shift-Mod-k",run:m1},{key:"Shift-Mod-\\",run:PQ},{key:"Mod-/",run:K$},{key:"Alt-A",run:eQ},{key:"Ctrl-m",mac:"Shift-Alt-m",run:r_}].concat(o_),a_={key:"Tab",run:g1,shift:b1},L0=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class Zs{constructor(e,i,n=0,r=e.length,s,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=s?l=>s(L0(l)):L0,this.query=this.normalize(i)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ni(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let i=tO(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=vn(e);let r=this.normalize(i);if(r.length)for(let s=0,o=n,l=!0;;s++){let a=r.charCodeAt(s),u=this.match(a,o,l,this.bufferPos+this.bufferStart,s==r.length-1);if(u)return this.value=u,this;if(s==r.length-1)break;l&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let i=this.matchPos<=this.to&&this.re.exec(this.curLine);if(i){let n=this.curLineStart+i.index,r=n+i[0].length;if(this.matchPos=Dl(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,r,i)))return this.value={from:n,to:r,precise:!0,match:i},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||r.to<=i){let l=new sr(i,e.sliceString(i,n));return Wa.set(e,l),l}if(r.from==i&&r.to==n)return r;let{text:s,from:o}=r;return o>i&&(s=e.sliceString(i,o)+s,o=i),r.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,i=this.re.exec(this.flat.text);if(i&&!i[0]&&i.index==e&&(this.re.lastIndex=e+1,i=this.re.exec(this.flat.text)),i){let n=this.flat.from+i.index,r=n+i[0].length;if((this.flat.to>=this.to||i.index+i[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,r,i)))return this.value={from:n,to:r,precise:!0,match:i},this.matchPos=Dl(this.text,r+(n==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=sr.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(y1.prototype[Symbol.iterator]=x1.prototype[Symbol.iterator]=function(){return this});function u_(t){try{return new RegExp(t,uh),!0}catch{return!1}}function Dl(t,e){if(e>=t.length)return e;let i=t.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}const c_=t=>{let{state:e}=t,i=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:r}=n$(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:i},focus:!0,submitLabel:e.phrase("go")});return r.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){t.dispatch({effects:n});return}let l=e.doc.lineAt(e.selection.main.head),[,a,u,c,h]=o,f=c?+c.slice(1):0,d=u?+u:l.number;if(u&&h){let O=d/100;a&&(O=O*(a=="-"?-1:1)+l.number/e.doc.lines),d=Math.round(e.doc.lines*O)}else u&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,d))),m=E.cursor(p.from+Math.max(0,Math.min(f,p.length)));t.dispatch({effects:[n,W.scrollIntoView(m.from,{y:"center"})],selection:m})}),!0},h_=({state:t,dispatch:e})=>{let{selection:i}=t,n=E.create(i.ranges.map(r=>t.wordAt(r.head)||E.cursor(r.head)),i.mainIndex);return n.eq(i)?!1:(e(t.update({selection:n})),!0)};function f_(t,e){let{main:i,ranges:n}=t.selection,r=t.wordAt(i.head),s=r&&r.from==i.from&&r.to==i.to;for(let o=!1,l=new Zs(t.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Zs(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(a=>a.from==l.value.from))continue;if(s){let a=t.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const d_=({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(s=>s.from===s.to))return h_({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(s=>t.sliceDoc(s.from,s.to)!=n))return!1;let r=f_(t,n);return r?(e(t.update({selection:t.selection.addRange(E.range(r.from,r.to),!1),effects:W.scrollIntoView(r.to)})),!0):!1},Ir=G.define({combine(t){return na(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new __(e),scrollToMatch:e=>W.scrollIntoView(e)})}});class k1{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||u_(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(i,n)=>n=="n"?` `:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new v_(this):new O_(this)}getCursor(e,i=0,n){let r=e.doc?e:fe.create({doc:e});return n==null&&(n=r.doc.length),this.regexp?Yn(this,r,i,n):Wn(this,r,i,n)}}class S1{constructor(e){this.spec=e}}function p_(t,e,i){return(n,r,s,o)=>{if(i&&!i(n,r,s,o))return!1;let l=n>=o&&r<=o+s.length?s.slice(n-o,r-o):e.doc.sliceString(n,r);return t(l,e,n,r)}}function Wn(t,e,i,n){let r;return t.wholeWord&&(r=m_(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(r=p_(t.test,e,r)),new Zs(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:s=>s.toLowerCase(),r)}function m_(t,e){return(i,n,r,s)=>((s>i||s+r.length=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=Wn(this.spec,e,Math.max(0,i-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function g_(t,e,i){return(n,r,s)=>(!i||i(n,r,s))&&t(s[0],e,n,r)}function Yn(t,e,i,n){let r;return t.wholeWord&&(r=b_(e.charCategorizer(e.selection.main.head))),t.test&&(r=g_(t.test,e,r)),new y1(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:r},i,n)}function Ll(t,e){return t.slice(Ge(t,e,!1),e)}function Ml(t,e){return t.slice(e,Ge(t,e))}function b_(t){return(e,i,n)=>!n[0].length||(t(Ll(n.input,n.index))!=Je.Word||t(Ml(n.input,n.index))!=Je.Word)&&(t(Ml(n.input,n.index+n[0].length))!=Je.Word||t(Ll(n.input,n.index+n[0].length))!=Je.Word)}class v_ extends S1{nextMatch(e,i,n){let r=Yn(this.spec,e,n,e.doc.length).next();return r.done&&(r=Yn(this.spec,e,0,i).next()),r.done?null:r.value}prevMatchInRange(e,i,n){for(let r=1;;r++){let s=Math.max(i,n-r*1e4),o=Yn(this.spec,e,s,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==i||l.from>s+10))return l;if(s==i)return null}}prevMatch(e,i,n){return this.prevMatchInRange(e,0,i)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(i,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let r=n.length;r>0;r--){let s=+n.slice(0,r);if(s>0&&s=i)return null;r.push(n.value)}return r}highlight(e,i,n,r){let s=Yn(this.spec,e,Math.max(0,i-250),Math.min(n+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const Is=ae.define(),ch=ae.define(),rn=Yt.define({create(t){return new Ya(fc(t).create(),null)},update(t,e){for(let i of e.effects)i.is(Is)?t=new Ya(i.value.create(),t.panel):i.is(ch)&&(t=new Ya(t.query,i.value?hh:null));return t},provide:t=>Pl.from(t,e=>e.panel)});class Ya{constructor(e,i){this.query=e,this.panel=i}}const y_=ve.mark({class:"cm-searchMatch"}),x_=ve.mark({class:"cm-searchMatch cm-searchMatch-selected"}),k_=Mt.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(rn))}update(t){let e=t.state.field(rn);(e!=t.startState.field(rn)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return ve.none;let{view:i}=this,n=new gr;for(let r=0,s=i.visibleRanges,o=s.length;rs[r+1].from-500;)a=s[++r].to;t.highlight(i.state,l,a,(u,c)=>{let h=i.state.selection.ranges.some(f=>f.from==u&&f.to==c);n.add(u,c,h?x_:y_)})}return n.finish()}},{decorations:t=>t.decorations});function oo(t){return e=>{let i=e.state.field(rn,!1);return i&&i.query.spec.valid?t(e,i):Q1(e)}}const Zl=oo((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let r=E.single(n.from,n.to),s=t.state.facet(Ir);return t.dispatch({selection:r,effects:[fh(t,n),s.scrollToMatch(r.main,t)],userEvent:"select.search"}),$1(t),!0}),Il=oo((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,r=e.prevMatch(i,n,n);if(!r)return!1;let s=E.single(r.from,r.to),o=t.state.facet(Ir);return t.dispatch({selection:s,effects:[fh(t,r),o.scrollToMatch(s.main,t)],userEvent:"select.search"}),$1(t),!0}),S_=oo((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!i||!i.length?!1:(t.dispatch({selection:E.create(i.map(n=>E.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),w_=({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:r}=i.main,s=[],o=0;for(let l=new Zs(t.doc,t.sliceDoc(n,r));!l.next().done;){if(s.length>1e3)return!1;l.value.from==n&&(o=s.length),s.push(E.range(l.value.from,l.value.to))}return e(t.update({selection:E.create(s,o),userEvent:"select.search.matches"})),!0},M0=oo((t,{query:e})=>{let{state:i}=t,{from:n,to:r}=i.selection.main;if(i.readOnly)return!1;let s=e.nextMatch(i,n,n);if(!s)return!1;let o=s,l=[],a,u,c=[];o.precise?o.from==n&&o.to==r&&(u=i.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=e.nextMatch(i,o.from,o.to),c.push(W.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(n).number)+"."))):o=e.nextMatch(i,o.from,o.to);let h=t.state.changes(l);return o&&(a=E.single(o.from,o.to).map(h),c.push(fh(t,o)),c.push(i.facet(Ir).scrollToMatch(a.main,t))),t.dispatch({changes:h,selection:a,effects:c,userEvent:"input.replace"}),!0}),$_=oo((t,{query:e})=>{if(t.state.readOnly)return!1;let i=[];for(let r of e.matchAll(t.state,1e9)){let{from:s,to:o,precise:l}=r;l&&i.push({from:s,to:o,insert:e.getReplacement(r)})}if(!i.length)return!1;let n=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:W.announce.of(n),userEvent:"input.replace.all"}),!0});function hh(t){return t.state.facet(Ir).createPanel(t)}function fc(t,e){var i,n,r,s,o;let l=t.selection.main,a=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!a)return e;let u=t.facet(Ir);return new k1({search:((i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:u.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:u.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function w1(t){let e=mg(t,hh);return e&&e.dom.querySelector("[main-field]")}function $1(t){let e=w1(t);e&&e==t.root.activeElement&&e.select()}const Q1=t=>{let e=t.state.field(rn,!1);if(e&&e.panel){let i=w1(t);if(i&&i!=t.root.activeElement){let n=fc(t.state,e.query.spec);n.valid&&t.dispatch({effects:Is.of(n)}),i.focus(),i.select()}}else t.dispatch({effects:[ch.of(!0),e?Is.of(fc(t.state,e.query.spec)):ae.appendConfig.of(C_)]});return!0},_1=t=>{let e=t.state.field(rn,!1);if(!e||!e.panel)return!1;let i=mg(t,hh);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:ch.of(!1)}),!0},Q_=[{key:"Mod-f",run:Q1,scope:"editor search-panel"},{key:"F3",run:Zl,shift:Il,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Zl,shift:Il,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:_1,scope:"editor search-panel"},{key:"Mod-Shift-l",run:w_},{key:"Mod-Alt-g",run:c_},{key:"Mod-d",run:d_,preventDefault:!0}];class __{constructor(e){this.view=e;let i=this.query=e.state.field(rn).query.spec;this.commit=this.commit.bind(this),this.searchField=We("input",{value:i.search,placeholder:xt(e,"Find"),"aria-label":xt(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=We("input",{value:i.replace,placeholder:xt(e,"Replace"),"aria-label":xt(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=We("input",{type:"checkbox",name:"case",form:"",checked:i.caseSensitive,onchange:this.commit}),this.reField=We("input",{type:"checkbox",name:"re",form:"",checked:i.regexp,onchange:this.commit}),this.wordField=We("input",{type:"checkbox",name:"word",form:"",checked:i.wholeWord,onchange:this.commit});function n(r,s,o){return We("button",{class:"cm-button",name:r,onclick:s,type:"button"},o)}this.dom=We("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,n("next",()=>Zl(e),[xt(e,"next")]),n("prev",()=>Il(e),[xt(e,"previous")]),n("select",()=>S_(e),[xt(e,"all")]),We("label",null,[this.caseField,xt(e,"match case")]),We("label",null,[this.reField,xt(e,"regexp")]),We("label",null,[this.wordField,xt(e,"by word")]),...e.state.readOnly?[]:[We("br"),this.replaceField,n("replace",()=>M0(e),[xt(e,"replace")]),n("replaceAll",()=>$_(e),[xt(e,"replace all")])],We("button",{name:"close",onclick:()=>_1(e),"aria-label":xt(e,"close"),type:"button"},["×"])])}commit(){let e=new k1({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Is.of(e)}))}keydown(e){j3(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Il:Zl)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),M0(this.view))}update(e){for(let i of e.transactions)for(let n of i.effects)n.is(Is)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ir).top}}function xt(t,e){return t.state.phrase(e)}const Xo=30,zo=/[\s\.,:;?!]/;function fh(t,{from:e,to:i}){let n=t.state.doc.lineAt(e),r=t.state.doc.lineAt(i).to,s=Math.max(n.from,e-Xo),o=Math.min(r,i+Xo),l=t.state.sliceDoc(s,o);if(s!=n.from){for(let a=0;al.length-Xo;a--)if(!zo.test(l[a-1])&&zo.test(l[a])){l=l.slice(0,a);break}}return W.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${n.number}.`)}const P_=W.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),C_=[rn,Ii.low(k_),P_];class dh{constructor(e,i,n,r){this.state=e,this.pos=i,this.explicit=n,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let i=Re(this.state).resolveInner(this.pos,-1);for(;i&&e.indexOf(i.name)<0;)i=i.parent;return i?{from:i.from,to:this.pos,text:this.state.sliceDoc(i.from,this.pos),type:i.type}:null}matchBefore(e){let i=this.state.doc.lineAt(this.pos),n=Math.max(i.from,this.pos-250),r=i.text.slice(n-i.from,this.pos-i.from),s=r.search(C1(e,!1));return s<0?null:{from:n+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,i,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(i),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function Z0(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function T_(t){let e=Object.create(null),i=Object.create(null);for(let{label:r}of t){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[i,n]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:T_(e);return r=>{let s=r.matchBefore(n);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:i}:null}}function A_(t,e){return i=>{for(let n=Re(i.state).resolveInner(i.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(i)}}class I0{constructor(e,i,n,r){this.completion=e,this.source=i,this.match=n,this.score=r}}function Cn(t){return t.selection.main.from}function C1(t,e){var i;let{source:n}=t,r=e&&n[0]!="^",s=n[n.length-1]!="$";return!r&&!s?t:new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,(i=t.flags)!==null&&i!==void 0?i:t.ignoreCase?"i":"")}const ph=Xi.define();function E_(t,e,i,n){let{main:r}=t.selection,s=i-r.from,o=n-r.from;return{...t.changeByRange(l=>{if(l!=r&&i!=n&&t.sliceDoc(l.from+s,l.from+o)!=t.sliceDoc(i,n))return{range:l};let a=t.toText(e);return{changes:{from:l.from+s,to:n==r.from?l.to:l.from+o,insert:a},range:E.cursor(l.from+s+a.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const X0=new WeakMap;function R_(t){if(!Array.isArray(t))return t;let e=X0.get(t);return e||X0.set(t,e=P1(t)),e}const Xl=ae.define(),Xs=ae.define();class D_{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let i=0;i=48&&v<=57||v>=97&&v<=122?2:v>=65&&v<=90?1:0:(Q=tO(v))!=Q.toLowerCase()?1:Q!=Q.toUpperCase()?2:0;(!b||P==1&&O||w==0&&P!=0)&&(i[h]==v||n[h]==v&&(f=!0)?o[h++]=b:o.length&&(g=!1)),w=P,b+=vn(v)}return h==a&&o[0]==0&&g?this.result(-100+(f?-200:0),o,e):d==a&&p==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,m]):h==a?this.result(-100+(f?-200:0)+-700+(g?0:-1100),o,e):i.length==2?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,i,n){let r=[],s=0;for(let o of i){let l=o+(this.astral?vn(Ni(n,o)):1);s&&r[s-1]==o?r[s-1]=l:(r[s++]=o,r[s++]=l)}return this.ret(e-n.length,r)}}class L_{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:M_,filterStrict:!1,compareCompletions:(e,i)=>(e.sortText||e.label).localeCompare(i.sortText||i.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,i)=>e&&i,closeOnBlur:(e,i)=>e&&i,icons:(e,i)=>e&&i,tooltipClass:(e,i)=>n=>z0(e(n),i(n)),optionClass:(e,i)=>n=>z0(e(n),i(n)),addToOptions:(e,i)=>e.concat(i),filterStrict:(e,i)=>e||i})}});function z0(t,e){return t?e?t+" "+e:t:e}function M_(t,e,i,n,r,s){let o=t.textDirection==Ce.RTL,l=o,a=!1,u="top",c,h,f=e.left-r.left,d=r.right-e.right,p=n.right-n.left,m=n.bottom-n.top;if(l&&f=m||b>e.top?c=i.bottom-e.top:(u="bottom",c=e.bottom-i.top)}let O=(e.bottom-e.top)/s.offsetHeight,g=(e.right-e.left)/s.offsetWidth;return{style:`${u}: ${c/O}px; max-width: ${h/g}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}const mh=ae.define();function Z_(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(i){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),i.type&&n.classList.add(...i.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(i,n,r,s){let o=document.createElement("span");o.className="cm-completionLabel";let l=i.displayLabel||i.label,a=0;for(let u=0;ua&&o.appendChild(document.createTextNode(l.slice(a,c)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(l.slice(c,h))),f.className="cm-completionMatchedText",a=h}return ai.position-n.position).map(i=>i.render)}function Na(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let r=Math.floor(e/i);return{from:r*i,to:(r+1)*i}}let n=Math.ceil((t-e)/i);return{from:t-n*i,to:t-(n-1)*i}}class I_{constructor(e,i,n){this.view=e,this.stateField=i,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let r=e.state.field(i),{options:s,selected:o}=r.open,l=e.state.facet(Ne);this.optionContent=Z_(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Na(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:u}=e.state.field(i).open;for(let c=a.target,h;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(h=/-(\d+)$/.exec(c.id))&&+h[1]this.list.lastChild.getBoundingClientRect().bottom?this.range.to:null;c!=null&&(e.dispatch({effects:mh.of(c)}),a.preventDefault())}}),this.dom.addEventListener("focusout",a=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Ne).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:Xs.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,i){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,i,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var i;let n=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:s,selected:o,disabled:l}=n.open;(!r.open||r.open.options!=s)&&(this.range=Na(s.length,o,e.state.facet(Ne).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),l!=((i=r.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let i=this.tooltipClass(e);if(i!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of i.split(" "))n&&this.dom.classList.add(n);this.currentClass=i}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),i=e.open;(i.selected>-1&&i.selected=this.range.to)&&(this.range=Na(i.options.length,i.selected,this.view.state.facet(Ne).maxRenderedOptions),this.showOptions(i.options,e.id));let n=this.updateSelectedOption(i.selected);if(n){this.destroyInfo();let{completion:r}=i.options[i.selected],{info:s}=r;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(r);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,r)}).catch(l=>Rt(this.view.state,l,"completion info")):(this.addInfoPane(o,r),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,i){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;n.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let i=null;for(let n=this.list.firstChild,r=this.range.from;n;n=n.nextSibling,r++)n.nodeName!="LI"||!n.id?r--:r==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),i=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return i&&z_(this.list,i),i}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let i=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return r.top>Math.min(s.bottom,i.bottom)-10||r.bottom{o.target==r&&o.preventDefault()});let s=null;for(let o=n.from;on.from||n.from==0))if(s=f,typeof u!="string"&&u.header)r.appendChild(u.header(u));else{let d=r.appendChild(document.createElement("completion-section"));d.textContent=f}}const c=r.appendChild(document.createElement("li"));c.id=i+"-"+o,c.setAttribute("role","option");let h=this.optionClass(l);h&&(c.className=h);for(let f of this.optionContent){let d=f(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.tonew I_(i,t,e)}function z_(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=i.height/t.offsetHeight;n.topi.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/r)}function j0(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function j_(t,e){let i=[],n=null,r=null,s=c=>{i.push(c);let{section:h}=c.completion;if(h){n||(n=[]);let f=typeof h=="string"?h:h.name;n.some(d=>d.name==f)||n.push(typeof h=="string"?{name:f}:h)}},o=e.facet(Ne);for(let c of t)if(c.hasResult()){let h=c.result.getMatch;if(c.result.filter===!1)for(let f of c.result.options)s(new I0(f,c.source,h?h(f):[],1e9-i.length));else{let f=e.sliceDoc(c.from,c.to),d,p=o.filterStrict?new L_(f):new D_(f);for(let m of c.result.options)if(d=p.match(m.label)){let O=m.displayLabel?h?h(m,d.matched):[]:d.matched,g=d.score+(m.boost||0);if(s(new I0(m,c.source,O,g)),typeof m.section=="object"&&m.section.rank==="dynamic"){let{name:b}=m.section;r||(r=Object.create(null)),r[b]=Math.max(g,r[b]||-1e9)}}}}if(n){let c=Object.create(null),h=0,f=(d,p)=>(d.rank==="dynamic"&&p.rank==="dynamic"?r[p.name]-r[d.name]:0)||(typeof d.rank=="number"?d.rank:1e9)-(typeof p.rank=="number"?p.rank:1e9)||(d.namef.score-h.score||u(h.completion,f.completion))){let h=c.completion;!a||a.label!=h.label||a.detail!=h.detail||a.type!=null&&h.type!=null&&a.type!=h.type||a.apply!=h.apply||a.boost!=h.boost?l.push(c):j0(c.completion)>j0(a)&&(l[l.length-1]=c),a=c.completion}return l}class Hn{constructor(e,i,n,r,s,o){this.options=e,this.attrs=i,this.tooltip=n,this.timestamp=r,this.selected=s,this.disabled=o}setSelected(e,i){return e==this.selected||e>=this.options.length?this:new Hn(this.options,F0(i,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,i,n,r,s,o){if(r&&!o&&e.some(u=>u.isPending))return r.setDisabled();let l=j_(e,i);if(!l.length)return r&&e.some(u=>u.isPending)?r.setDisabled():null;let a=i.facet(Ne).selectOnOpen?0:-1;if(r&&r.selected!=a&&r.selected!=-1){let u=r.options[r.selected].completion;for(let c=0;cc.hasResult()?Math.min(u,c.from):u,1e8),create:Y_,above:s.aboveCursor},r?r.timestamp:Date.now(),a,!1)}map(e){return new Hn(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Hn(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class zl{constructor(e,i,n){this.active=e,this.id=i,this.open=n}static start(){return new zl(q_,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:i}=e,n=i.facet(Ne),s=(n.override||i.languageDataAt("autocomplete",Cn(i)).map(R_)).map(a=>(this.active.find(c=>c.source==a)||new Vt(a,this.active.some(c=>c.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((a,u)=>a==this.active[u])&&(s=this.active);let o=this.open,l=e.effects.some(a=>a.is(Oh));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!F_(s,this.active)||l?o=Hn.build(s,i,this.id,o,n,l):o&&o.disabled&&!s.some(a=>a.isPending)&&(o=null),!o&&s.every(a=>!a.isPending)&&s.some(a=>a.hasResult())&&(s=s.map(a=>a.hasResult()?new Vt(a.source,0):a));for(let a of e.effects)a.is(mh)&&(o=o&&o.setSelected(a.value,this.id));return s==this.active&&o==this.open?this:new zl(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?B_:V_}}function F_(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i-1&&(i["aria-activedescendant"]=t+"-"+e),i}const q_=[];function T1(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(ph);if(n&&e.activateOnCompletion(n))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Vt{constructor(e,i,n=!1){this.source=e,this.state=i,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,i){let n=T1(e,i),r=this;(n&8||n&16&&this.touches(e))&&(r=new Vt(r.source,0)),n&4&&r.state==0&&(r=new Vt(this.source,1)),r=r.updateFor(e,n);for(let s of e.effects)if(s.is(Xl))r=new Vt(r.source,1,s.value);else if(s.is(Xs))r=new Vt(r.source,0);else if(s.is(Oh))for(let o of s.value)o.source==r.source&&(r=o);return r}updateFor(e,i){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Cn(e.state))}}class or extends Vt{constructor(e,i,n,r,s,o){super(e,3,i),this.limit=n,this.result=r,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,i){var n;if(!(i&3))return this.map(e.changes);let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=Cn(e.state);if(l>o||!r||i&2&&(Cn(e.startState)==this.from||li.map(e))}}),Ot=Yt.define({create(){return zl.start()},update(t,e){return t.update(e)},provide:t=>[dg.from(t,e=>e.tooltip),W.contentAttributes.from(t,e=>e.attrs)]});function gh(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(Ot).active.find(r=>r.source==e.source);return n instanceof or?(typeof i=="string"?t.dispatch({...E_(t.state,i,n.from,n.to),annotations:ph.of(e.completion)}):i(t,e.completion,n.from,n.to),!0):!1}const Y_=X_(Ot,gh);function jo(t,e="option"){return i=>{let n=i.state.field(Ot,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+r*(t?1:-1):t?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),i.dispatch({effects:mh.of(l)}),!0}}const N_=t=>{let e=t.state.field(Ot,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampt.state.field(Ot,!1)?(t.dispatch({effects:Xl.of(!0)}),!0):!1,G_=t=>{let e=t.state.field(Ot,!1);return!e||!e.active.some(i=>i.state!=0)?!1:(t.dispatch({effects:Xs.of(null)}),!0)};class U_{constructor(e,i){this.active=e,this.context=i,this.time=Date.now(),this.updates=[],this.done=void 0}}const H_=50,K_=1e3,J_=Mt.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Ot).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Ot),i=t.state.facet(Ne);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Ot)==e)return;let n=t.transactions.some(s=>{let o=T1(s,i);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;sH_&&Date.now()-o.time>K_){for(let l of o.context.abortListeners)try{l()}catch(a){Rt(this.view.state,a)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(s=>s.effects.some(o=>o.is(Xl)))&&(this.pendingStart=!0);let r=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),r):-1,this.composing!=0)for(let s of t.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Ot);for(let i of e.active)i.isPending&&!this.running.some(n=>n.active.source==i.source)&&this.startQuery(i);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ne).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=Cn(e),n=new dh(e,i,t.explicit,this.view),r=new U_(t,n);this.running.push(r),Promise.resolve(t.source(n)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Xs.of(null)}),Rt(this.view.state,s)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Ne).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Ne),n=this.view.state.field(Ot);for(let r=0;rl.source==s.active.source);if(o&&o.isPending)if(s.done==null){let l=new Vt(s.active.source,0);for(let a of s.updates)l=l.update(a,i);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:Oh.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Ot,!1);if(e&&e.tooltip&&this.view.state.facet(Ne).closeOnBlur){let i=e.open&&pg(this.view,e.open.tooltip);(!i||!i.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Xs.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Xl.of(!1)}),20),this.composing=0}}}),eP=typeof navigator=="object"&&/Win/.test(navigator.platform),tP=Ii.highest(W.domEventHandlers({keydown(t,e){let i=e.state.field(Ot,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&!(eP&&t.altKey)||t.metaKey)return!1;let n=i.open.options[i.open.selected],r=i.active.find(o=>o.source==n.source),s=n.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(t.key)>-1&&gh(e,n),!1}})),A1=W.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class iP{constructor(e,i,n,r){this.field=e,this.line=i,this.from=n,this.to=r}}class bh{constructor(e,i,n){this.field=e,this.from=i,this.to=n}map(e){let i=e.mapPos(this.from,-1,ut.TrackDel),n=e.mapPos(this.to,1,ut.TrackDel);return i==null||n==null?null:new bh(this.field,i,n)}}class vh{constructor(e,i){this.lines=e,this.fieldPositions=i}instantiate(e,i){let n=[],r=[i],s=e.doc.lineAt(i),o=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(n.length){let u=o,c=/^\t*/.exec(a)[0].length;for(let h=0;hnew bh(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:n,ranges:l}}static parse(e){let i=[],n=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=s[1]?+s[1]:null,a=s[2]||s[3]||"",u=-1;l===0&&(l=1e9);let c=a.replace(/\\[{}]/g,h=>h[1]);for(let h=0;h=u&&f.field++}for(let h of r)if(h.line==n.length&&h.from>s.index){let f=s[2]?3+(s[1]||"").length:2;h.from-=f,h.to-=f}r.push(new iP(u,n.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+a+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(l,a,u)=>{for(let c of r)c.line==n.length&&c.from>u&&(c.from--,c.to--);return a}),n.push(o)}return new vh(n,r)}}let nP=ve.widget({widget:new class extends Er{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),rP=ve.mark({class:"cm-snippetField"});class Xr{constructor(e,i){this.ranges=e,this.active=i,this.deco=ve.set(e.map(n=>(n.from==n.to?nP:rP).range(n.from,n.to)),!0)}map(e){let i=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;i.push(r)}return new Xr(i,this.active)}selectionInsideField(e){return e.ranges.every(i=>this.ranges.some(n=>n.field==this.active&&n.from<=i.from&&n.to>=i.to))}}const lo=ae.define({map(t,e){return t&&t.map(e)}}),sP=ae.define(),zs=Yt.define({create(){return null},update(t,e){for(let i of e.effects){if(i.is(lo))return i.value;if(i.is(sP)&&t)return new Xr(t.ranges,i.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>W.decorations.from(t,e=>e?e.deco:ve.none)});function yh(t,e){return E.create(t.filter(i=>i.field==e).map(i=>E.range(i.from,i.to)))}function oP(t){let e=vh.parse(t);return(i,n,r,s)=>{let{text:o,ranges:l}=e.instantiate(i.state,r),{main:a}=i.state.selection,u={changes:{from:r,to:s==a.from?a.to:s,insert:de.of(o)},scrollIntoView:!0,annotations:n?[ph.of(n),Xe.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=yh(l,0)),l.some(c=>c.field>0)){let c=new Xr(l,0),h=u.effects=[lo.of(c)];i.state.field(zs,!1)===void 0&&h.push(ae.appendConfig.of([zs,hP,fP,A1]))}i.dispatch(i.state.update(u))}}function E1(t){return({state:e,dispatch:i})=>{let n=e.field(zs,!1);if(!n||t<0&&n.active==0)return!1;let r=n.active+t,s=t>0&&!n.ranges.some(o=>o.field==r+t);return i(e.update({selection:yh(n.ranges,r),effects:lo.of(s?null:new Xr(n.ranges,r)),scrollIntoView:!0})),!0}}const lP=({state:t,dispatch:e})=>t.field(zs,!1)?(e(t.update({effects:lo.of(null)})),!0):!1,aP=E1(1),uP=E1(-1),cP=[{key:"Tab",run:aP,shift:uP},{key:"Escape",run:lP}],B0=G.define({combine(t){return t.length?t[0]:cP}}),hP=Ii.highest(io.compute([B0],t=>t.facet(B0)));function mt(t,e){return{...e,apply:oP(t)}}const fP=W.domEventHandlers({mousedown(t,e){let i=e.state.field(zs,!1),n;if(!i||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let r=i.ranges.find(s=>s.from<=n&&s.to>=n);return!r||r.field==i.active?!1:(e.dispatch({selection:yh(i.ranges,r.field),effects:lo.of(i.ranges.some(s=>s.field>r.field)?new Xr(i.ranges,r.field):null),scrollIntoView:!0}),!0)}}),R1=new class extends on{};R1.startSide=1;R1.endSide=-1;function dP(t={}){return[tP,Ot,Ne.of(t),J_,mP,A1]}const pP=[{key:"Ctrl-Space",run:Ga},{mac:"Alt-`",run:Ga},{mac:"Alt-i",run:Ga},{key:"Escape",run:G_},{key:"ArrowDown",run:jo(!0)},{key:"ArrowUp",run:jo(!1)},{key:"PageDown",run:jo(!0,"page")},{key:"PageUp",run:jo(!1,"page")},{key:"Enter",run:N_}],mP=Ii.highest(io.computeN([Ne],t=>t.facet(Ne).defaultKeymap?[pP]:[]));function D(t){return new Qr(ih.define(t))}function zi(t){return A(()=>import("./index-B0ormpAm.js"),__vite__mapDeps([0,1,2])).then(e=>e.sql({dialect:e[t]}))}const OP=[C.of({name:"C",extensions:["c","h","ino"],load(){return A(()=>import("./index-LhKTwHBG.js"),__vite__mapDeps([3,1,2])).then(t=>t.cpp())}}),C.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return A(()=>import("./index-LhKTwHBG.js"),__vite__mapDeps([3,1,2])).then(t=>t.cpp())}}),C.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return zi("Cassandra")}}),C.of({name:"CSS",extensions:["css"],load(){return A(()=>Promise.resolve().then(()=>pT),void 0).then(t=>t.css())}}),C.of({name:"Go",extensions:["go"],load(){return A(()=>import("./index-5pRcGjrK.js"),__vite__mapDeps([4,1,2])).then(t=>t.go())}}),C.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return A(()=>Promise.resolve().then(()=>o5),void 0).then(t=>t.html())}}),C.of({name:"Java",extensions:["java"],load(){return A(()=>import("./index-toAgSog8.js"),__vite__mapDeps([5,1,2])).then(t=>t.java())}}),C.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return A(()=>Promise.resolve().then(()=>Vo),void 0).then(t=>t.javascript())}}),C.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return A(()=>import("./index-DuwFEVsx.js"),__vite__mapDeps([6,1,2])).then(t=>t.jinja())}}),C.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return A(()=>import("./index-B2CPrvxQ.js"),__vite__mapDeps([7,1,2])).then(t=>t.json())}}),C.of({name:"JSX",extensions:["jsx"],load(){return A(()=>Promise.resolve().then(()=>Vo),void 0).then(t=>t.javascript({jsx:!0}))}}),C.of({name:"LESS",extensions:["less"],load(){return A(()=>import("./index-C2zGUHGQ.js"),__vite__mapDeps([8,1,2])).then(t=>t.less())}}),C.of({name:"Liquid",extensions:["liquid"],load(){return A(()=>import("./index-CYSLvMxp.js"),__vite__mapDeps([9,1,2])).then(t=>t.liquid())}}),C.of({name:"MariaDB SQL",load(){return zi("MariaSQL")}}),C.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return A(()=>Promise.resolve().then(()=>g5),void 0).then(t=>t.markdown())}}),C.of({name:"MS SQL",load(){return zi("MSSQL")}}),C.of({name:"MySQL",load(){return zi("MySQL")}}),C.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return A(()=>import("./index-eC7dsKua.js"),__vite__mapDeps([10,1,2])).then(t=>t.php())}}),C.of({name:"PLSQL",extensions:["pls"],load(){return zi("PLSQL")}}),C.of({name:"PostgreSQL",load(){return zi("PostgreSQL")}}),C.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return A(()=>import("./index-KrlGGYSI.js"),__vite__mapDeps([11,1,2])).then(t=>t.python())}}),C.of({name:"Rust",extensions:["rs"],load(){return A(()=>import("./index-7CO1rqmB.js"),__vite__mapDeps([12,1,2])).then(t=>t.rust())}}),C.of({name:"Sass",extensions:["sass"],load(){return A(()=>import("./index-B08WtdHY.js"),__vite__mapDeps([13,1,2])).then(t=>t.sass({indented:!0}))}}),C.of({name:"SCSS",extensions:["scss"],load(){return A(()=>import("./index-B08WtdHY.js"),__vite__mapDeps([13,1,2])).then(t=>t.sass())}}),C.of({name:"SQL",extensions:["sql"],load(){return zi("StandardSQL")}}),C.of({name:"SQLite",load(){return zi("SQLite")}}),C.of({name:"TSX",extensions:["tsx"],load(){return A(()=>Promise.resolve().then(()=>Vo),void 0).then(t=>t.javascript({jsx:!0,typescript:!0}))}}),C.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return A(()=>Promise.resolve().then(()=>Vo),void 0).then(t=>t.javascript({typescript:!0}))}}),C.of({name:"WebAssembly",extensions:["wat","wast"],load(){return A(()=>import("./index-B1uOYh0y.js"),__vite__mapDeps([14,1,2])).then(t=>t.wast())}}),C.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return A(()=>import("./index-N3Iua89b.js"),__vite__mapDeps([15,1,2])).then(t=>t.xml())}}),C.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return A(()=>import("./index-B0kct9eQ.js"),__vite__mapDeps([16,1,2])).then(t=>t.yaml())}}),C.of({name:"APL",extensions:["dyalog","apl"],load(){return A(()=>import("./apl-B4CMkyY2.js"),[]).then(t=>D(t.apl))}}),C.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return A(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(t=>D(t.asciiArmor))}}),C.of({name:"ASN.1",extensions:["asn","asn1"],load(){return A(()=>import("./asn1-EdZsLKOL.js"),[]).then(t=>D(t.asn1({})))}}),C.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return A(()=>import("./asterisk-B-8jnY81.js"),[]).then(t=>D(t.asterisk))}}),C.of({name:"Brainfuck",extensions:["b","bf"],load(){return A(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(t=>D(t.brainfuck))}}),C.of({name:"Cobol",extensions:["cob","cpy"],load(){return A(()=>import("./cobol-CWcv1MsR.js"),[]).then(t=>D(t.cobol))}}),C.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return A(()=>import("./clike-B9uivgTg.js"),[]).then(t=>D(t.csharp))}}),C.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return A(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>D(t.clojure))}}),C.of({name:"ClojureScript",extensions:["cljs"],load(){return A(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>D(t.clojure))}}),C.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return A(()=>import("./css-BnMrqG3P.js"),[]).then(t=>D(t.gss))}}),C.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return A(()=>import("./cmake-BQqOBYOt.js"),[]).then(t=>D(t.cmake))}}),C.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return A(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(t=>D(t.coffeeScript))}}),C.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return A(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(t=>D(t.commonLisp))}}),C.of({name:"Cypher",extensions:["cyp","cypher"],load(){return A(()=>import("./cypher-C_CwsFkJ.js"),[]).then(t=>D(t.cypher))}}),C.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return A(()=>import("./python-BuPzkPfP.js"),[]).then(t=>D(t.cython))}}),C.of({name:"Crystal",extensions:["cr"],load(){return A(()=>import("./crystal-SjHAIU92.js"),[]).then(t=>D(t.crystal))}}),C.of({name:"D",extensions:["d"],load(){return A(()=>import("./d-pRatUO7H.js"),[]).then(t=>D(t.d))}}),C.of({name:"Dart",extensions:["dart"],load(){return A(()=>import("./clike-B9uivgTg.js"),[]).then(t=>D(t.dart))}}),C.of({name:"diff",extensions:["diff","patch"],load(){return A(()=>import("./diff-DbItnlRl.js"),[]).then(t=>D(t.diff))}}),C.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return A(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([17,18])).then(t=>D(t.dockerFile))}}),C.of({name:"DTD",extensions:["dtd"],load(){return A(()=>import("./dtd-DF_7sFjM.js"),[]).then(t=>D(t.dtd))}}),C.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return A(()=>import("./dylan-DwRh75JA.js"),[]).then(t=>D(t.dylan))}}),C.of({name:"EBNF",load(){return A(()=>import("./ebnf-CDyGwa7X.js"),[]).then(t=>D(t.ebnf))}}),C.of({name:"ECL",extensions:["ecl"],load(){return A(()=>import("./ecl-Cabwm37j.js"),[]).then(t=>D(t.ecl))}}),C.of({name:"edn",extensions:["edn"],load(){return A(()=>import("./clojure-BMjYHr_A.js"),[]).then(t=>D(t.clojure))}}),C.of({name:"Eiffel",extensions:["e"],load(){return A(()=>import("./eiffel-CnydiIhH.js"),[]).then(t=>D(t.eiffel))}}),C.of({name:"Elm",extensions:["elm"],load(){return A(()=>import("./elm-vLlmbW-K.js"),[]).then(t=>D(t.elm))}}),C.of({name:"Erlang",extensions:["erl"],load(){return A(()=>import("./erlang-BNw1qcRV.js"),[]).then(t=>D(t.erlang))}}),C.of({name:"Esper",load(){return A(()=>import("./sql-D0XecflT.js"),[]).then(t=>D(t.esper))}}),C.of({name:"Factor",extensions:["factor"],load(){return A(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([19,18])).then(t=>D(t.factor))}}),C.of({name:"FCL",load(){return A(()=>import("./fcl-Kvtd6kyn.js"),[]).then(t=>D(t.fcl))}}),C.of({name:"Forth",extensions:["forth","fth","4th"],load(){return A(()=>import("./forth-Ffai-XNe.js"),[]).then(t=>D(t.forth))}}),C.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return A(()=>import("./fortran-DYz_wnZ1.js"),[]).then(t=>D(t.fortran))}}),C.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return A(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>D(t.fSharp))}}),C.of({name:"Gas",extensions:["s"],load(){return A(()=>import("./gas-Bneqetm1.js"),[]).then(t=>D(t.gas))}}),C.of({name:"Gherkin",extensions:["feature"],load(){return A(()=>import("./gherkin-heZmZLOM.js"),[]).then(t=>D(t.gherkin))}}),C.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return A(()=>import("./groovy-D9Dt4D0W.js"),[]).then(t=>D(t.groovy))}}),C.of({name:"Haskell",extensions:["hs"],load(){return A(()=>import("./haskell-Cw1EW3IL.js"),[]).then(t=>D(t.haskell))}}),C.of({name:"Haxe",extensions:["hx"],load(){return A(()=>import("./haxe-H-WmDvRZ.js"),[]).then(t=>D(t.haxe))}}),C.of({name:"HXML",extensions:["hxml"],load(){return A(()=>import("./haxe-H-WmDvRZ.js"),[]).then(t=>D(t.hxml))}}),C.of({name:"HTTP",load(){return A(()=>import("./http-DBlCnlav.js"),[]).then(t=>D(t.http))}}),C.of({name:"IDL",extensions:["pro"],load(){return A(()=>import("./idl-BEugSyMb.js"),[]).then(t=>D(t.idl))}}),C.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return A(()=>import("./javascript-iXu5QeM3.js"),[]).then(t=>D(t.jsonld))}}),C.of({name:"Julia",extensions:["jl"],load(){return A(()=>import("./julia-DuME0IfC.js"),[]).then(t=>D(t.julia))}}),C.of({name:"Kotlin",extensions:["kt","kts"],load(){return A(()=>import("./clike-B9uivgTg.js"),[]).then(t=>D(t.kotlin))}}),C.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return A(()=>import("./livescript-BwQOo05w.js"),[]).then(t=>D(t.liveScript))}}),C.of({name:"Lua",extensions:["lua"],load(){return A(()=>import("./lua-VAEuO923.js"),[]).then(t=>D(t.lua))}}),C.of({name:"mIRC",extensions:["mrc"],load(){return A(()=>import("./mirc-CjQqDB4T.js"),[]).then(t=>D(t.mirc))}}),C.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return A(()=>import("./mathematica-DTrFuWx2.js"),[]).then(t=>D(t.mathematica))}}),C.of({name:"Modelica",extensions:["mo"],load(){return A(()=>import("./modelica-Dc1JOy9r.js"),[]).then(t=>D(t.modelica))}}),C.of({name:"MUMPS",extensions:["mps"],load(){return A(()=>import("./mumps-BT43cFF4.js"),[]).then(t=>D(t.mumps))}}),C.of({name:"Mbox",extensions:["mbox"],load(){return A(()=>import("./mbox-CNhZ1qSd.js"),[]).then(t=>D(t.mbox))}}),C.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return A(()=>import("./nginx-DdIZxoE0.js"),[]).then(t=>D(t.nginx))}}),C.of({name:"NSIS",extensions:["nsh","nsi"],load(){return A(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([20,18])).then(t=>D(t.nsis))}}),C.of({name:"NTriples",extensions:["nt","nq"],load(){return A(()=>import("./ntriples-BfvgReVJ.js"),[]).then(t=>D(t.ntriples))}}),C.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return A(()=>import("./clike-B9uivgTg.js"),[]).then(t=>D(t.objectiveC))}}),C.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return A(()=>import("./clike-B9uivgTg.js"),[]).then(t=>D(t.objectiveCpp))}}),C.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return A(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>D(t.oCaml))}}),C.of({name:"Octave",extensions:["m"],load(){return A(()=>import("./octave-Ck1zUtKM.js"),[]).then(t=>D(t.octave))}}),C.of({name:"Oz",extensions:["oz"],load(){return A(()=>import("./oz-BzwKVEFT.js"),[]).then(t=>D(t.oz))}}),C.of({name:"Pascal",extensions:["p","pas"],load(){return A(()=>import("./pascal--L3eBynH.js"),[]).then(t=>D(t.pascal))}}),C.of({name:"Perl",extensions:["pl","pm"],load(){return A(()=>import("./perl-CdXCOZ3F.js"),[]).then(t=>D(t.perl))}}),C.of({name:"Pig",extensions:["pig"],load(){return A(()=>import("./pig-CevX1Tat.js"),[]).then(t=>D(t.pig))}}),C.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return A(()=>import("./powershell-CFHJl5sT.js"),[]).then(t=>D(t.powerShell))}}),C.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return A(()=>import("./properties-C78fOPTZ.js"),[]).then(t=>D(t.properties))}}),C.of({name:"ProtoBuf",extensions:["proto"],load(){return A(()=>import("./protobuf-ChK-085T.js"),[]).then(t=>D(t.protobuf))}}),C.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return A(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([21,22])).then(t=>D(t.pug))}}),C.of({name:"Puppet",extensions:["pp"],load(){return A(()=>import("./puppet-DMA9R1ak.js"),[]).then(t=>D(t.puppet))}}),C.of({name:"Q",extensions:["q"],load(){return A(()=>import("./q-pXgVlZs6.js"),[]).then(t=>D(t.q))}}),C.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return A(()=>import("./r-B6wPVr8A.js"),[]).then(t=>D(t.r))}}),C.of({name:"RPM Changes",load(){return A(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>D(t.rpmChanges))}}),C.of({name:"RPM Spec",extensions:["spec"],load(){return A(()=>import("./rpm-CTu-6PCP.js"),[]).then(t=>D(t.rpmSpec))}}),C.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return A(()=>import("./ruby-B2Rjki9n.js"),[]).then(t=>D(t.ruby))}}),C.of({name:"SAS",extensions:["sas"],load(){return A(()=>import("./sas-B4kiWyti.js"),[]).then(t=>D(t.sas))}}),C.of({name:"Scala",extensions:["scala"],load(){return A(()=>import("./clike-B9uivgTg.js"),[]).then(t=>D(t.scala))}}),C.of({name:"Scheme",extensions:["scm","ss"],load(){return A(()=>import("./scheme-C41bIUwD.js"),[]).then(t=>D(t.scheme))}}),C.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return A(()=>import("./shell-CjFT_Tl9.js"),[]).then(t=>D(t.shell))}}),C.of({name:"Sieve",extensions:["siv","sieve"],load(){return A(()=>import("./sieve-C3Gn_uJK.js"),[]).then(t=>D(t.sieve))}}),C.of({name:"Smalltalk",extensions:["st"],load(){return A(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(t=>D(t.smalltalk))}}),C.of({name:"Solr",load(){return A(()=>import("./solr-DehyRSwq.js"),[]).then(t=>D(t.solr))}}),C.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return A(()=>import("./mllike-CXdrOF99.js"),[]).then(t=>D(t.sml))}}),C.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return A(()=>import("./sparql-DkYu6x3z.js"),[]).then(t=>D(t.sparql))}}),C.of({name:"Spreadsheet",alias:["excel","formula"],load(){return A(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(t=>D(t.spreadsheet))}}),C.of({name:"Squirrel",extensions:["nut"],load(){return A(()=>import("./clike-B9uivgTg.js"),[]).then(t=>D(t.squirrel))}}),C.of({name:"Stylus",extensions:["styl"],load(){return A(()=>import("./stylus-B533Al4x.js"),[]).then(t=>D(t.stylus))}}),C.of({name:"Swift",extensions:["swift"],load(){return A(()=>import("./swift-BzpIVaGY.js"),[]).then(t=>D(t.swift))}}),C.of({name:"sTeX",load(){return A(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>D(t.stex))}}),C.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return A(()=>import("./stex-C3f8Ysf7.js"),[]).then(t=>D(t.stex))}}),C.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return A(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>D(t.verilog))}}),C.of({name:"Tcl",extensions:["tcl"],load(){return A(()=>import("./tcl-DVfN8rqt.js"),[]).then(t=>D(t.tcl))}}),C.of({name:"Textile",extensions:["textile"],load(){return A(()=>import("./textile-CnDTJFAw.js"),[]).then(t=>D(t.textile))}}),C.of({name:"TiddlyWiki",load(){return A(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(t=>D(t.tiddlyWiki))}}),C.of({name:"Tiki wiki",load(){return A(()=>import("./tiki-DGYXhP31.js"),[]).then(t=>D(t.tiki))}}),C.of({name:"TOML",extensions:["toml"],load(){return A(()=>import("./toml-Bm5Em-hy.js"),[]).then(t=>D(t.toml))}}),C.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return A(()=>import("./troff-wAsdV37c.js"),[]).then(t=>D(t.troff))}}),C.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return A(()=>import("./ttcn-CfJYG6tj.js"),[]).then(t=>D(t.ttcn))}}),C.of({name:"TTCN_CFG",extensions:["cfg"],load(){return A(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(t=>D(t.ttcnCfg))}}),C.of({name:"Turtle",extensions:["ttl"],load(){return A(()=>import("./turtle-B1tBg_DP.js"),[]).then(t=>D(t.turtle))}}),C.of({name:"Web IDL",extensions:["webidl"],load(){return A(()=>import("./webidl-ZXfAyPTL.js"),[]).then(t=>D(t.webIDL))}}),C.of({name:"VB.NET",extensions:["vb"],load(){return A(()=>import("./vb-CmGdzxic.js"),[]).then(t=>D(t.vb))}}),C.of({name:"VBScript",extensions:["vbs"],load(){return A(()=>import("./vbscript-BuJXcnF6.js"),[]).then(t=>D(t.vbScript))}}),C.of({name:"Velocity",extensions:["vtl"],load(){return A(()=>import("./velocity-D8B20fx6.js"),[]).then(t=>D(t.velocity))}}),C.of({name:"Verilog",extensions:["v"],load(){return A(()=>import("./verilog-C6RDOZhf.js"),[]).then(t=>D(t.verilog))}}),C.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return A(()=>import("./vhdl-lSbBsy5d.js"),[]).then(t=>D(t.vhdl))}}),C.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return A(()=>import("./xquery-DzFWVndE.js"),[]).then(t=>D(t.xQuery))}}),C.of({name:"Yacas",extensions:["ys"],load(){return A(()=>import("./yacas-BJ4BC0dw.js"),[]).then(t=>D(t.yacas))}}),C.of({name:"Z80",extensions:["z80"],load(){return A(()=>import("./z80-Hz9HOZM7.js"),[]).then(t=>D(t.z80))}}),C.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return A(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>D(t.mscgen))}}),C.of({name:"Xù",extensions:["xu"],load(){return A(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>D(t.xu))}}),C.of({name:"MsGenny",extensions:["msgenny"],load(){return A(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(t=>D(t.msgenny))}}),C.of({name:"Vue",extensions:["vue"],load(){return A(()=>import("./index-CH-Gehkm.js"),__vite__mapDeps([23,1,2])).then(t=>t.vue())}}),C.of({name:"Angular Template",load(){return A(()=>import("./index-DjcPgQmx.js"),__vite__mapDeps([24,1,2])).then(t=>t.angular())}})];class jl{static create(e,i,n,r,s){let o=r+(r<<8)+e+(i<<4)|0;return new jl(e,i,n,o,s,[],[])}constructor(e,i,n,r,s,o,l){this.type=e,this.value=i,this.from=n,this.hash=r,this.end=s,this.children=o,this.positions=l,this.hashProp=[[K.contextHash,r]]}addChild(e,i){e.prop(K.contextHash)!=this.hash&&(e=new se(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(i)}toTree(e,i=this.end){let n=this.children.length-1;return n>=0&&(i=Math.max(i,this.positions[n]+this.children[n].length+this.from)),new se(e.types[this.type],this.children,this.positions,i-this.from).balance({makeTree:(r,s,o)=>new se(ze.none,r,s,o,this.hashProp)})}}var z;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(z||(z={}));class gP{constructor(e,i){this.start=e,this.content=i,this.marks=[],this.parsers=[]}}class bP{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return ps(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,i=0,n=0){for(let r=i;r=e.stack[i.depth+1].value+i.baseIndent)return!0;if(i.indent>=i.baseIndent+4)return!1;let n=(t.type==z.OrderedList?Sh:kh)(i,e,!1);return n>0&&(t.type!=z.BulletList||xh(i,e,!1)<0)&&i.text.charCodeAt(i.pos+n-1)==t.value}const D1={[z.Blockquote](t,e,i){return i.next!=62?!1:(i.markers.push(he(z.QuoteMark,e.lineStart+i.pos,e.lineStart+i.pos+1)),i.moveBase(i.pos+(Gt(i.text.charCodeAt(i.pos+1))?2:1)),t.end=e.lineStart+i.text.length,!0)},[z.ListItem](t,e,i){return i.indent-1?!1:(i.moveBaseColumn(i.baseIndent+t.value),!0)},[z.OrderedList]:V0,[z.BulletList]:V0,[z.Document](){return!0}};function Gt(t){return t==32||t==9||t==10||t==13}function ps(t,e=0){for(;ei&&Gt(t.charCodeAt(e-1));)e--;return e}function L1(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(B1.SetextHeading)>-1||n<3?-1:1}function Z1(t,e){for(let i=t.stack.length-1;i>=0;i--)if(t.stack[i].type==e)return!0;return!1}function kh(t,e,i){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||Gt(t.text.charCodeAt(t.pos+1)))&&(!i||Z1(e,z.BulletList)||t.skipSpace(t.pos+2)=48&&r<=57;){n++;if(n==t.text.length)return-1;r=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||r!=46&&r!=41||nt.pos+1||t.next!=49)?-1:n+1-t.pos}function I1(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e6?-1:i}function X1(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,j1=/\?>/,pc=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(s)return t.append(he(z.Comment,i,i+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(he(z.ProcessingInstruction,i,i+1+o[0].length));let l=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return l?t.append(he(z.HTMLTag,i,i+1+l[0].length)):-1},Emphasis(t,e,i){if(e!=95&&e!=42)return-1;let n=i+1;for(;t.char(n)==e;)n++;let r=t.slice(i-1,i),s=t.slice(n,n+1),o=Fs.test(r),l=Fs.test(s),a=/\s|^$/.test(r),u=/\s|^$/.test(s),c=!u&&(!l||a||o),h=!a&&(!o||u||l),f=c&&(e==42||!h||o),d=h&&(e==42||!c||l);return t.append(new At(e==95?N1:G1,i,n,(f?1:0)|(d?2:0)))},HardBreak(t,e,i){if(e==92&&t.char(i+1)==10)return t.append(he(z.HardBreak,i,i+2));if(e==32){let n=i+1;for(;t.char(n)==32;)n++;if(t.char(n)==10&&n>=i+2)return t.append(he(z.HardBreak,i,n+1))}return-1},Link(t,e,i){return e==91?t.append(new At(xn,i,i+1,1)):-1},Image(t,e,i){return e==33&&t.char(i+1)==91?t.append(new At(Fl,i,i+2,1)):-1},LinkEnd(t,e,i){if(e!=93)return-1;for(let n=t.parts.length-1;n>=0;n--){let r=t.parts[n];if(r instanceof At&&(r.type==xn||r.type==Fl)){if(!r.side||t.skipSpace(r.to)==i&&!/[(\[]/.test(t.slice(i+1,i+2)))return t.parts[n]=null,-1;let s=t.takeContent(n),o=t.parts[n]=wP(t,s,r.type==xn?z.Link:z.Image,r.from,i+1);if(r.type==xn)for(let l=0;le?he(z.URL,e+i,s+i):s==t.length?null:!1}}function H1(t,e,i){let n=t.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let r=n==40?41:n;for(let s=e+1,o=!1;s=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,i){return this.text.slice(e-this.offset,i-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,i,n,r,s){return this.append(new At(e,i,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let i=this.parts[e];if(i instanceof At&&(i.type==xn||i.type==Fl))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n=e;a--){let m=this.parts[a];if(m instanceof At&&m.side&1&&m.type==r.type&&!(s&&(r.side&1||m.side&2)&&(m.to-m.from+o)%3==0&&((m.to-m.from)%3||o%3))){l=m;break}}if(!l)continue;let u=r.type.resolve,c=[],h=l.from,f=r.to;if(s){let m=Math.min(2,l.to-l.from,o);h=l.to-m,f=r.from+m,u=m==1?"Emphasis":"StrongEmphasis"}l.type.mark&&c.push(this.elt(l.type.mark,h,l.to));for(let m=a+1;m=0;i--){let n=this.parts[i];if(n instanceof At&&n.type==e&&n.side&1)return i}return null}takeContent(e){let i=this.resolveMarkers(e);return this.parts.length=e,i}getDelimiterAt(e){let i=this.parts[e];return i instanceof At?i:null}skipSpace(e){return ps(this.text,e-this.offset)+this.offset}elt(e,i,n,r){return typeof e=="string"?he(this.parser.getNodeType(e),i,n,r):new Y1(e,i)}}wh.linkStart=xn;wh.imageStart=Fl;function Oc(t,e){if(!e.length)return t;if(!t.length)return e;let i=t.slice(),n=0;for(let r of e){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=` `;)s--;this.fragmentEnd=s?s-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=i;if(!n.childAfter(r))return!1}}matches(e){let i=this.cursor.tree;return i&&i.prop(K.contextHash)==e}takeNodes(e){let i=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,l=e.block.children.length,a=o,u=l;for(;;){if(i.to-n>r){if(i.type.isAnonymous&&i.firstChild())continue;break}let c=J1(i.from-n,e.ranges);if(i.to-n<=e.ranges[e.rangeI].to)e.addNode(i.tree,c);else{let h=new se(e.parser.nodeSet.types[z.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,i.tree),e.addNode(h,c)}if(i.type.is("Block")&&($P.indexOf(i.type.id)<0?(o=i.to-n,l=e.block.children.length):(o=a,l=u),a=i.to-n,u=e.block.children.length),!i.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-s}};function J1(t,e){let i=t;for(let n=1;nFo[t]),Object.keys(Fo).map(t=>B1[t]),Object.keys(Fo),xP,D1,Object.keys(Ha).map(t=>Ha[t]),Object.keys(Ha),[]);function CP(t,e,i){let n=[];for(let r=t.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:i;if(o>s&&n.push({from:s,to:o}),!r)break;s=r.to}return n}function TP(t){let{codeParser:e,htmlParser:i}=t;return{wrap:wg((r,s)=>{let o=r.type.id;if(e&&(o==z.CodeBlock||o==z.FencedCode)){let l="";if(o==z.FencedCode){let u=r.node.getChild(z.CodeInfo);u&&(l=s.read(u.from,u.to))}let a=e(l);if(a)return{parser:a,overlay:u=>u.type.id==z.CodeText,bracketed:o==z.FencedCode}}else if(i&&(o==z.HTMLBlock||o==z.HTMLTag||o==z.CommentBlock))return{parser:i,overlay:CP(r.node,r.from,r.to)};return null})}}const AP={resolve:"Strikethrough",mark:"StrikethroughMark"},EP={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":k.strikethrough}},{name:"StrikethroughMark",style:k.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,i){if(e!=126||t.char(i+1)!=126||t.char(i+2)==126)return-1;let n=t.slice(i-1,i),r=t.slice(i+2,i+3),s=/\s|^$/.test(n),o=/\s|^$/.test(r),l=Fs.test(n),a=Fs.test(r);return t.addDelimiter(AP,i,i+2,!o&&(!a||s||l),!s&&(!l||o||a))},after:"Emphasis"}]};function ms(t,e,i=0,n,r=0){let s=0,o=!0,l=-1,a=-1,u=!1,c=()=>{n.push(t.elt("TableCell",r+l,r+a,t.parser.parseInline(e.slice(l,a),r+l)))};for(let h=i;h-1)&&s++,o=!1,n&&(l>-1&&c(),n.push(t.elt("TableDelimiter",h+r,h+r+1))),l=a=-1):(u||f!=32&&f!=9)&&(l<0&&(l=h),a=h+1),u=!u&&f==92}return l>-1&&(s++,n&&c()),s}function N0(t,e){for(let i=e;i\s]*\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class G0{constructor(){this.rows=null}nextLine(e,i,n){if(this.rows==null){this.rows=!1;let r;if((i.next==45||i.next==58||i.next==124)&&eb.test(r=i.text.slice(i.pos))){let s=[];ms(e,n.content,0,s,n.start)==ms(e,r,0)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,s),e.elt("TableDelimiter",e.lineStart+i.pos,e.lineStart+i.text.length)])}}else if(this.rows){let r=[];ms(e,i.text,i.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+i.pos,e.lineStart+i.text.length,r))}return!1}finish(e,i){return this.rows?(e.addLeafElement(i,e.elt("Table",i.start,i.start+i.content.length,this.rows)),!0):!1}}const RP={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":k.heading}},"TableRow",{name:"TableCell",style:k.content},{name:"TableDelimiter",style:k.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return N0(e.content,0)?new G0:null},endLeaf(t,e,i){if(i.parsers.some(r=>r instanceof G0)||!N0(e.text,e.basePos))return!1;let n=t.peekLine();return eb.test(n)&&ms(t,e.text,e.basePos)==ms(t,n,e.basePos)},before:"SetextHeading"}]};class DP{nextLine(){return!1}finish(e,i){return e.addLeafElement(i,e.elt("Task",i.start,i.start+i.content.length,[e.elt("TaskMarker",i.start,i.start+3),...e.parser.parseInline(i.content.slice(3),i.start+3)])),!0}}const LP={defineNodes:[{name:"Task",block:!0,style:k.list},{name:"TaskMarker",style:k.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new DP:null},after:"SetextHeading"}]},U0=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,H0=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,MP=/[\w-]+\.[\w-]+($|[/:])/,K0=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,J0=/\/[a-zA-Z\d@.]+/gy;function ep(t,e,i,n){let r=0;for(let s=e;s-1)return-1;let n=e+i[0].length;for(;;){let r=t[n-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&ep(t,e,n,")")>ep(t,e,n,"("))n--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+s.index;else break}return n}function tp(t,e){K0.lastIndex=e;let i=K0.exec(t);if(!i)return-1;let n=i[0][i[0].length-1];return n=="_"||n=="-"?-1:e+i[0].length-(n=="."?1:0)}const IP={parseInline:[{name:"Autolink",parse(t,e,i){let n=i-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;U0.lastIndex=n;let r=U0.exec(t.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=ZP(t.text,n+r[0].length),s>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,s));s=n+o[0].length}}else r[3]?s=tp(t.text,n):(s=tp(t.text,n+r[0].length),s>-1&&r[0]=="xmpp:"&&(J0.lastIndex=s,r=J0.exec(t.text),r&&(s=r.index+r[0].length)));return s<0?-1:(t.addElement(t.elt("URL",i,s+t.offset)),s+t.offset)}}]},XP=[RP,LP,EP,IP];function tb(t,e,i){return(n,r,s)=>{if(r!=t||n.char(s+1)==t)return-1;let o=[n.elt(i,s,s+1)];for(let l=s+1;li%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,i,n=0){let r=e.parser.context;return new Bl(e,[],i,n,n,0,[],0,r?new np(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,i){this.stack.push(this.state,i,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var i;let n=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos=2e3&&!(!((i=this.p.parser.nodeSet.types[r])===null||i===void 0)&&i.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,u)}storeNode(e,i,n,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&this.buffer[o-4]==0&&this.buffer[o-1]>-1){if(i==n)return;if(this.buffer[o-2]>=i){this.buffer[o-2]=n;return}}}if(!s||this.pos==n)this.buffer.push(e,i,n,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=i,this.buffer[o+2]=n,this.buffer[o+3]=r}}shift(e,i,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let l=o.stateFlag(s,1);!l&&(r>n||i<=o.maxNode)&&(this.reducePos=r),this.pushState(s,l?n:Math.min(n,this.reducePos)),this.shiftContext(i,n),i<=o.maxNode&&this.buffer.push(i,n,r,4)}else this.pos=r,this.shiftContext(i,n),i<=this.p.parser.maxNode&&this.buffer.push(i,n,r,4)}apply(e,i,n,r){e&65536?this.reduce(e):this.shift(e,i,n,r)}useNode(e,i){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(i,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,i=e.buffer.length;for(i&&e.buffer[i-4]==0&&(i-=4);i>0&&e.buffer[i-2]>e.reducePos;)i-=4;let n=e.buffer.slice(i),r=e.bufferBase+i;for(;e&&r==e.bufferBase;)e=e.parent;return new Bl(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,i){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,i,4),this.storeNode(0,this.pos,i,n?8:4),this.pos=this.reducePos=i,this.score-=190}canShift(e){for(let i=new BP(this);;){let n=this.p.parser.stateSlot(i.state,4)||this.p.parser.hasAction(i.state,e);if(n==0)return!1;if((n&65536)==0)return!0;i.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let i=this.p.parser.nextStates(this.state);if(i.length>8||this.stack.length>=120){let r=[];for(let s=0,o;sa&1&&l==o)||r.push(i[s],o)}i=r}let n=[];for(let r=0;r>19,r=i&65535,s=this.stack.length-n*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;i=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(i),!0}findForcedReduction(){let{parser:e}=this.p,i=[],n=(r,s)=>{if(!i.includes(r))return i.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-s;if(l>1){let a=o&65535,u=this.stack.length-l*3;if(u>=0&&e.getGoto(this.stack[u],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,s+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let i=0;i0&&this.emitLookAhead()}}class np{constructor(e,i){this.tracker=e,this.context=i,this.hash=e.strict?e.hash(i):0}}class BP{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let i=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],i,!0);this.state=r}}class Vl{constructor(e,i,n){this.stack=e,this.pos=i,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,i=e.bufferBase+e.buffer.length){return new Vl(e,i,i-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Vl(this.stack,this.pos,this.index)}}function ts(t,e=Uint16Array){if(typeof t!="string")return t;let i=null;for(let n=0,r=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),s+=a,l)break;s*=46}i?i[r++]=s:i=new e(s)}return i}class ll{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const rp=new ll;class VP{constructor(e,i){this.input=e,this.ranges=i,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=rp,this.rangeIndex=0,this.pos=this.chunkPos=i[0].from,this.range=i[0],this.end=i[i.length-1].to,this.readNext()}resolveOffset(e,i){let n=this.range,r=this.rangeIndex,s=this.pos+e;for(;sn.to:s>=n.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-n.to,n=o}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,i.from);return this.end}peek(e){let i=this.chunkOff+e,n,r;if(i>=0&&i=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,i=0){let n=i?this.resolveOffset(i,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,i){if(i?(this.token=i,i.start=e,i.lookAhead=e+1,i.value=i.extended=-1):this.token=rp,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&i<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,i-this.chunkPos);if(e>=this.chunk2Pos&&i<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,i-this.chunk2Pos);if(e>=this.range.from&&i<=this.range.to)return this.input.read(e,i);let n="";for(let r of this.ranges){if(r.from>=i)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,i)))}return n}}class lr{constructor(e,i){this.data=e,this.id=i}token(e,i){let{parser:n}=i.p;ib(this.data,e,i,this.id,n.data,n.tokenPrecTable)}}lr.prototype.contextual=lr.prototype.fallback=lr.prototype.extend=!1;class ql{constructor(e,i,n){this.precTable=i,this.elseToken=n,this.data=typeof e=="string"?ts(e):e}token(e,i){let n=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(ib(this.data,e,i,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}}ql.prototype.contextual=lr.prototype.fallback=lr.prototype.extend=!1;class Zt{constructor(e,i={}){this.token=e,this.contextual=!!i.contextual,this.fallback=!!i.fallback,this.extend=!!i.extend}}function ib(t,e,i,n,r,s){let o=0,l=1<0){let p=t[d];if(a.allows(p)&&(e.token.value==-1||e.token.value==p||qP(p,e.token.value,r,s))){e.acceptToken(p);break}}let c=e.next,h=0,f=t[o+2];if(e.next<0&&f>h&&t[u+f*3-3]==65535){o=t[u+f*3-1];continue e}for(;h>1,p=u+d+(d<<1),m=t[p],O=t[p+1]||65536;if(c=O)h=d+1;else{o=t[p+2],e.advance();continue e}}break}}function sp(t,e,i){for(let n=e,r;(r=t[n])!=65535;n++)if(r==i)return n-e;return-1}function qP(t,e,i,n){let r=sp(i,n,e);return r<0||sp(i,n,t)e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class WP{constructor(e,i){this.fragments=e,this.nodeSet=i,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?op(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?op(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(s instanceof se){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[i]++,this.nextStart=o+s.length}}}class YP{constructor(e,i){this.stream=i,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new ll)}getActions(e){let i=0,n=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let u=0;uh.end+25&&(a=Math.max(h.lookAhead,a)),h.value!=0)){let f=i;if(h.extended>-1&&(i=this.addActions(e,h.extended,h.end,i)),i=this.addActions(e,h.value,h.end,i),!c.extend&&(n=h,i>f))break}}for(;this.actions.length>i;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new ll,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,i=this.addActions(e,n.value,n.end,i)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let i=new ll,{pos:n,p:r}=e;return i.start=n,i.end=Math.min(n+1,r.stream.end),i.value=n==r.stream.end?r.parser.eofTerm:0,i}updateCachedToken(e,i,n){let r=this.stream.clipPos(n.pos);if(i.token(this.stream.reset(r,e),n),e.value>-1){let{parser:s}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,i,n,r){for(let s=0;se.bufferLength*4?new WP(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,i=this.minStackPos,n=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;oi)n.push(l);else{if(this.advanceStack(l,n,e))continue;{r||(r=[],s=[]),r.push(l);let a=this.tokens.getMainToken(l);s.push(a.value,a.end)}}break}}if(!n.length){let o=r&&UP(r);if(o)return kt&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw kt&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,n);if(o)return kt&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>i)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,c=u?e.curContext.hash:0;for(let h=this.fragments.nodeAt(r);h;){let f=this.parser.nodeSet.types[h.type.id]==h.type?s.getGoto(e.state,h.type.id):-1;if(f>-1&&h.length&&(!u||(h.prop(K.contextHash)||0)==c))return e.useNode(h,f),kt&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(h.type.id)})`),!0;if(!(h instanceof se)||h.children.length==0||h.positions[0]>0)break;let d=h.children[0];if(d instanceof se&&h.positions[0]==0)h=d;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),kt&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let u=0;ur?i.push(p):n.push(p)}return!1}advanceFully(e,i){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return lp(e,i),!0}}runRecovery(e,i,n){let r=null,s=!1;for(let o=0;o ":"";if(l.deadEnd&&(s||(s=!0,l.restart(),kt&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let h=l.split(),f=c;for(let d=0;d<10&&h.forceReduce()&&(kt&&console.log(f+this.stackID(h)+" (via force-reduce)"),!this.advanceFully(h,n));d++)kt&&(f=this.stackID(h)+" -> ");for(let d of l.recoverByInsert(a))kt&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,n);this.stream.end>l.pos?(u==l.pos&&(u++,a=0),l.recoverByDelete(a,u),kt&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),lp(l,n)):(!r||r.scoret;class nb{constructor(e){this.start=e.start,this.shift=e.shift||Ja,this.reduce=e.reduce||Ja,this.reuse=e.reuse||Ja,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Pr extends ua{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let i=e.nodeNames.split(" ");this.minRepeatTerm=i.length;for(let l=0;le.topRules[l][1]),r=[];for(let l=0;l=0)s(c,a,l[u++]);else{let h=l[u+-c];for(let f=-c;f>0;f--)s(l[u++],a,h);u++}}}this.nodeSet=new Rr(i.map((l,a)=>ze.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:r[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=vg;let o=ts(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new lr(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,i,n){let r=new NP(this,e,i,n);for(let s of this.wrappers)r=s(r,e,i,n);return r}getGoto(e,i,n=!1){let r=this.goto;if(i>=r[0])return-1;for(let s=r[i+1];;){let o=r[s++],l=o&1,a=r[s++];if(l&&n)return a;for(let u=s+(o>>1);s0}validAction(e,i){return!!this.allActions(e,n=>n==i?!0:null)}allActions(e,i){let n=this.stateSlot(e,4),r=n?i(n):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Ti(this.data,s+2);else break;r=i(Ti(this.data,s+1))}return r}nextStates(e){let i=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=Ti(this.data,n+2);else break;if((this.data[n+2]&1)==0){let r=this.data[n+1];i.some((s,o)=>o&1&&s==r)||i.push(this.data[n],r)}}return i}configure(e){let i=Object.assign(Object.create(Pr.prototype),this);if(e.props&&(i.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);i.top=n}return e.tokenizers&&(i.tokenizers=this.tokenizers.map(n=>{let r=e.tokenizers.find(s=>s.from==n);return r?r.to:n})),e.specializers&&(i.specializers=this.specializers.slice(),i.specializerSpecs=this.specializerSpecs.map((n,r)=>{let s=e.specializers.find(l=>l.from==n.external);if(!s)return n;let o=Object.assign(Object.assign({},n),{external:s.to});return i.specializers[r]=ap(o),o})),e.contextTracker&&(i.context=e.contextTracker),e.dialect&&(i.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(i.strict=e.strict),e.wrap&&(i.wrappers=i.wrappers.concat(e.wrap)),e.bufferLength!=null&&(i.bufferLength=e.bufferLength),i}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let i=this.dynamicPrecedences;return i==null?0:i[e]||0}parseDialect(e){let i=Object.keys(this.dialects),n=i.map(()=>!1);if(e)for(let s of e.split(" ")){let o=i.indexOf(s);o>=0&&(n[o]=!0)}let r=null;for(let s=0;sn)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.scoret.external(i,n)<<1|e}return t.get}const HP=55,KP=1,JP=56,eC=2,tC=57,iC=3,up=4,nC=5,$h=6,rb=7,sb=8,ob=9,lb=10,rC=11,sC=12,oC=13,eu=58,lC=14,aC=15,cp=59,ab=21,uC=23,ub=24,cC=25,gc=27,cb=28,hC=29,fC=32,dC=35,pC=37,mC=38,OC=0,gC=1,bC={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},vC={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},hp={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function yC(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let fp=null,dp=null,pp=0;function bc(t,e){let i=t.pos+e;if(pp==i&&dp==t)return fp;let n=t.peek(e),r="";for(;yC(n);)r+=String.fromCharCode(n),n=t.peek(++e);return dp=t,pp=i,fp=r?r.toLowerCase():n==xC||n==kC?void 0:null}const hb=60,Wl=62,Qh=47,xC=63,kC=33,SC=45;function mp(t,e){this.name=t,this.parent=e}const wC=[$h,lb,rb,sb,ob],$C=new nb({start:null,shift(t,e,i,n){return wC.indexOf(e)>-1?new mp(bc(n,1)||"",t):t},reduce(t,e){return e==ab&&t?t.parent:t},reuse(t,e,i,n){let r=e.type.id;return r==$h||r==pC?new mp(bc(n,1)||"",t):t},strict:!1}),QC=new Zt((t,e)=>{if(t.next!=hb){t.next<0&&e.context&&t.acceptToken(eu);return}t.advance();let i=t.next==Qh;i&&t.advance();let n=bc(t,0);if(n===void 0)return;if(!n)return t.acceptToken(i?aC:lC);let r=e.context?e.context.name:null;if(i){if(n==r)return t.acceptToken(rC);if(r&&vC[r])return t.acceptToken(eu,-2);if(e.dialectEnabled(OC))return t.acceptToken(sC);for(let s=e.context;s;s=s.parent)if(s.name==n)return;t.acceptToken(oC)}else{if(n=="script")return t.acceptToken(rb);if(n=="style")return t.acceptToken(sb);if(n=="textarea")return t.acceptToken(ob);if(bC.hasOwnProperty(n))return t.acceptToken(lb);r&&hp[r]&&hp[r][n]?t.acceptToken(eu,-1):t.acceptToken($h)}},{contextual:!0}),_C=new Zt(t=>{for(let e=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(cp);break}if(t.next==SC)e++;else if(t.next==Wl&&e>=2){i>=3&&t.acceptToken(cp,-2);break}else e=0;t.advance()}});function PC(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const CC=new Zt((t,e)=>{if(t.next==Qh&&t.peek(1)==Wl){let i=e.dialectEnabled(gC)||PC(e.context);t.acceptToken(i?nC:up,2)}else t.next==Wl&&t.acceptToken(up,1)});function _h(t,e,i){let n=2+t.length;return new Zt(r=>{for(let s=0,o=0,l=0;;l++){if(r.next<0){l&&r.acceptToken(e);break}if(s==0&&r.next==hb||s==1&&r.next==Qh||s>=2&&so?r.acceptToken(e,-o):r.acceptToken(i,-(o-2));break}else if((r.next==10||r.next==13)&&l){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}const TC=_h("script",HP,KP),AC=_h("style",JP,eC),EC=_h("textarea",tC,iC),RC=Dr({"Text RawText IncompleteTag IncompleteCloseTag":k.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":k.angleBracket,TagName:k.tagName,"MismatchedCloseTag/TagName":[k.tagName,k.invalid],AttributeName:k.attributeName,"AttributeValue UnquotedAttributeValue":k.attributeValue,Is:k.definitionOperator,"EntityReference CharacterReference":k.character,Comment:k.blockComment,ProcessingInst:k.processingInstruction,DoctypeDecl:k.documentMeta}),DC=Pr.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:$C,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[RC],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let u=l.type.id;if(u==hC)return tu(l,a,i);if(u==fC)return tu(l,a,n);if(u==dC)return tu(l,a,r);if(u==ab&&s.length){let c=l.node,h=c.firstChild,f=h&&Op(h,a),d;if(f){for(let p of s)if(p.tag==f&&(!p.attrs||p.attrs(d||(d=fb(h,a))))){let m=c.lastChild,O=m.type.id==mC?m.from:c.to;if(O>h.to)return{parser:p.parser,overlay:[{from:h.to,to:O}]}}}}if(o&&u==ub){let c=l.node,h;if(h=c.firstChild){let f=o[a.read(h.from,h.to)];if(f)for(let d of f){if(d.tagName&&d.tagName!=Op(c.parent,a))continue;let p=c.lastChild;if(p.type.id==gc){let m=p.from+1,O=p.lastChild,g=p.to-(O&&O.isError?0:1);if(g>m)return{parser:d.parser,overlay:[{from:m,to:g}],bracketed:!0}}else if(p.type.id==cb)return{parser:d.parser,overlay:[{from:p.from,to:p.to}]}}}}return null})}const LC=145,gp=1,MC=146,ZC=147,pb=2,IC=148,XC=3,zC=4,mb=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],jC=58,FC=40,Ob=95,BC=91,al=45,VC=46,qC=35,WC=37,YC=38,NC=92,GC=10,UC=42;function Bs(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function Ph(t){return t>=48&&t<=57}function bp(t){return Ph(t)||t>=97&&t<=102||t>=65&&t<=70}const gb=(t,e,i)=>(n,r)=>{for(let s=!1,o=0,l=0;;l++){let{next:a}=n;if(Bs(a)||a==al||a==Ob||s&&Ph(a))!s&&(a!=al||l>0)&&(s=!0),o===l&&a==al&&o++,n.advance();else if(a==NC&&n.peek(1)!=GC){if(n.advance(),bp(n.next)){do n.advance();while(bp(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();s=!0}else{s&&n.acceptToken(o==2&&r.canShift(pb)?e:a==FC?i:t);break}}},HC=new Zt(gb(MC,pb,ZC),{contextual:!0}),KC=new Zt(gb(IC,XC,zC),{contextual:!0}),JC=new Zt(t=>{if(mb.includes(t.peek(-1))){let{next:e}=t;(Bs(e)||e==Ob||e==qC||e==VC||e==UC||e==BC||e==jC&&Bs(t.peek(1))||e==al||e==YC)&&t.acceptToken(LC)}}),eT=new Zt(t=>{if(!mb.includes(t.peek(-1))){let{next:e}=t;if(e==WC&&(t.advance(),t.acceptToken(gp)),Bs(e)){do t.advance();while(Bs(t.next)||Ph(t.next));t.acceptToken(gp)}}}),tT=Dr({"AtKeyword import charset namespace keyframes media supports font-feature-values":k.definitionKeyword,"from to selector scope MatchFlag":k.keyword,NamespaceName:k.namespace,KeyframeName:k.labelName,KeyframeRangeName:k.operatorKeyword,TagName:k.tagName,ClassName:k.className,PseudoClassName:k.constant(k.className),IdName:k.labelName,"FeatureName PropertyName":k.propertyName,AttributeName:k.attributeName,NumberLiteral:k.number,KeywordQuery:k.keyword,UnaryQueryOp:k.operatorKeyword,"CallTag ValueName FontName":k.atom,VariableName:k.variableName,Callee:k.operatorKeyword,Unit:k.unit,"UniversalSelector NestingSelector":k.definitionOperator,"MatchOp CompareOp":k.compareOperator,"ChildOp SiblingOp, LogicOp":k.logicOperator,BinOp:k.arithmeticOperator,Important:k.modifier,Comment:k.blockComment,ColorLiteral:k.color,"ParenthesizedContent StringLiteral":k.string,":":k.punctuation,"PseudoOp #":k.derefOperator,"; , |":k.separator,"( )":k.paren,"[ ]":k.squareBracket,"{ }":k.brace}),iT={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:152,"url-prefix":152,domain:152,regexp:152},nT={__proto__:null,or:104,and:104,not:112,only:112,layer:206},rT={__proto__:null,selector:118,style:124,layer:202},sT={__proto__:null,"@import":198,"@media":210,"@charset":214,"@namespace":218,"@keyframes":224,"@supports":236,"@scope":240,"@font-feature-values":246},oT={__proto__:null,to:243},lT=Pr.deserialize({version:14,states:"MlQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FnO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#EOO'dQdO'#EQO'oQdO'#EXO'oQdO'#E[OOQP'#Fn'#FnO)RQhO'#E}OOQS'#Fm'#FmOOQS'#FQ'#FQQYQdOOO)YQdO'#EbO*iQhO'#EhO)YQdO'#EjO*pQdO'#ElO*{QdO'#EoO)}QhO'#EuO+TQdO'#EwO+`QdO'#EzO+eQaO'#CfO+lQ`O'#E_O+qQ`O'#F{O+|QdO'#F{QOQ`OOP,WO&jO'#CaPOOO)CA])CA]OOQP'#Ci'#CiOOQP,59R,59RO%VQdO,59ROOQP'#Cm'#CmOOQP,59V,59VO&XQdO,59VO,cQdO,59YO'_QdO,5:jO'dQdO,5:lO'oQdO,5:sO'oQdO,5:uO'oQdO,5:vO'oQdO'#FXO,nQ`O,58}O,vQdO'#E^OOQS,58},58}OOQP'#Cq'#CqOOQO'#D|'#D|OOQP,59Y,59YO,}Q`O,59YO-SQ`O,59YOOQP'#EP'#EPOOQP,5:j,5:jO-XQpO'#ERO-dQdO'#ESO-iQ`O'#ESO-nQpO,5:lO.XQaO,5:sO.oQaO,5:vOOQW'#D^'#D^O/nQhO'#DgO0RQhO,5;iO)}QhO'#DeO0`Q`O'#DnO0eQhO'#DxOOQW'#Ft'#FtOOQS,5;i,5;iO0jQ`O'#DhO0oQ`O'#DkOOQS-E9O-E9OOOQ['#Cv'#CvO0tQdO'#CwO1[QdO'#C}O1rQdO'#DQO2YQ!pO'#DSO4fQ!jO,5:|OOQO'#DX'#DXO-SQ`O'#DWO4vQ!nO'#FqO6|Q`O'#DYO7RQ`O'#DyOOQ['#Fq'#FqO7WQhO'#GOO7fQ`O,5;SO7kQ!bO,5;UOOQS'#En'#EnO7sQ`O,5;WO7xQdO,5;WOOQO'#Eq'#EqO8QQ`O,5;ZO8VQhO,5;aO'oQdO'#DjOOQS,5;c,5;cO0jQ`O,5;cO8_QdO,5;cOOQS'#F`'#F`O8gQdO'#E|O7fQ`O,5;fO8oQdO,5:yO9PQdO'#FZO9^Q`O,5lQhO'#DoOOQW,5:Y,5:YOOQW,5:d,5:dOOQW,5:S,5:SO>vQhO,5:VO?bQ!fO'#FrOOQS'#Fr'#FrOOQS'#FS'#FSO@rQdO,59cOOQ[,59c,59cOAYQdO,59iOOQ[,59i,59iOApQdO,59lOOQ[,59l,59lOOQ[,59n,59nO)YQdO,59pOBWQhO'#EdOOQW'#Ed'#EdOBuQ`O1G0hO4oQhO1G0hOOQ[,59r,59rO)}QhO'#D[OOQ[,59t,59tOBzQ#tO,5:eOCVQhO'#F]OCdQ`O,5vQhO'#DmOI_QhO'#DqOIgQhO'#DsOIlQhO'#FwOOQO'#Fw'#FwOItQ!bO'#DwOOQO'#Fy'#FyOOQO'#Fv'#FvOIyQ`O1G/qOOQS-E9Q-E9QOOQ[1G.}1G.}OOQ[1G/T1G/TOOQ[1G/W1G/WOOQ[1G/[1G/[OJOQdO,5;OOOQS7+&S7+&SOJTQ`O7+&SOJYQhO'#D]OJbQ`O,59vO)}QhO,59vOOQ[1G0P1G0POJjQ`O1G0POJoQhO,5;wOOQO-E9Z-E9ZOOQS7+&^7+&^OJ}QbO'#DSOOQO'#Et'#EtOK]Q`O'#EsOOQO'#Es'#EsOKhQ`O'#F^OKpQdO,5;^OOQS,5;^,5;^OOQ[1G/p1G/pOOQS7+&i7+&iO7fQ`O7+&iOK{Q!fO'#FYO)YQdO'#FYOMSQdO7+&POOQO7+&P7+&POOQO,5:{,5:{OOQO1G1a1G1aOMgQ!bO<vQhO'#DrOOQO,5:],5:]O! hQhO,5:_OGUQhO,5:cOOQW7+%]7+%]OOQO'#Ef'#EfO! pQ`O1G0jOOQS<xAN>xO!#zQ`OAN>xO!$PQaO,5;rOOQO-E9U-E9UO!$ZQdO,5;qOOQO-E9T-E9TOOQW<vQhO'#DuOOQO1G/y1G/yO!%vQ!bO1G/}OJOQdO'#F[O!&OQ`O7+&UOOQW7+&U7+&UO!&WQ!bO1G/cOOQ[7+$|7+$|O!&cQhO7+$|P!&jQ`O'#FTOOQO,5;y,5;yOOQO-E9]-E9]OOQS1G1d1G1dOOQPG24dG24dO!&oQ`OAN>ZO)YQdO1G1[O!&tQ`O7+'jOOQO1G/x1G/xO!&|Q`O,5:aO!$eQhO7+%iOOQO,5;v,5;vOOQO-E9Y-E9YOOQW<Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!o`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$[~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$[~!o`OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%jj)jS$qYOy%jz;'S%j;'S;=`%{<%lO%j~)yWOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d<%lO)v~*hOw~~*kRO;'S)v;'S;=`*t;=`O)v~*wXOY)vZr)vrs*cs#O)v#O#P*h#P;'S)v;'S;=`+d;=`<%l)v<%lO)v~+gP;=`<%l)vj+oYmYOy%jz!Q%j!Q![,_![!c%j!c!i,_!i#T%j#T#Z,_#Z;'S%j;'S;=`%{<%lO%jj,dY!o`Oy%jz!Q%j!Q![-S![!c%j!c!i-S!i#T%j#T#Z-S#Z;'S%j;'S;=`%{<%lO%jj-XY!o`Oy%jz!Q%j!Q![-w![!c%j!c!i-w!i#T%j#T#Z-w#Z;'S%j;'S;=`%{<%lO%jj.OYuY!o`Oy%jz!Q%j!Q![.n![!c%j!c!i.n!i#T%j#T#Z.n#Z;'S%j;'S;=`%{<%lO%jj.uYuY!o`Oy%jz!Q%j!Q![/e![!c%j!c!i/e!i#T%j#T#Z/e#Z;'S%j;'S;=`%{<%lO%jj/jY!o`Oy%jz!Q%j!Q![0Y![!c%j!c!i0Y!i#T%j#T#Z0Y#Z;'S%j;'S;=`%{<%lO%jj0aYuY!o`Oy%jz!Q%j!Q![1P![!c%j!c!i1P!i#T%j#T#Z1P#Z;'S%j;'S;=`%{<%lO%jj1UY!o`Oy%jz!Q%j!Q![1t![!c%j!c!i1t!i#T%j#T#Z1t#Z;'S%j;'S;=`%{<%lO%jj1{SuY!o`Oy%jz;'S%j;'S;=`%{<%lO%jd2[UOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jd2uS!yS!o`Oy%jz;'S%j;'S;=`%{<%lO%jb3WS^QOy%jz;'S%j;'S;=`%{<%lO%j~3gWOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{<%lO3d~4SRO;'S3d;'S;=`4];=`O3d~4`XOY3dZw3dwx*cx#O3d#O#P4P#P;'S3d;'S;=`4{;=`<%l3d<%lO3d~5OP;=`<%l3dj5WShYOy%jz;'S%j;'S;=`%{<%lO%j~5iOg~n5pUWQyWOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jj6ZWyW#PQOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj6xU!o`Oy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%jj7cY!o`$gYOy%jz!Q%j!Q![7[![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj8WY!o`Oy%jz{%j{|8v|}%j}!O8v!O!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj8{U!o`Oy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj9fU!o`$gYOy%jz!Q%j!Q![9_![;'S%j;'S;=`%{<%lO%jj:P[!o`$gYOy%jz!O%j!O!P7[!P!Q%j!Q![9x![!g%j!g!h8R!h#X%j#X#Y8R#Y;'S%j;'S;=`%{<%lO%jj:zS!dYOy%jz;'S%j;'S;=`%{<%lO%jj;]WyWOy%jz!O%j!O!P6s!P!Q%j!Q![9x![;'S%j;'S;=`%{<%lO%jj;zU`YOy%jz!Q%j!Q![7[![;'S%j;'S;=`%{<%lO%j~VUcYOy%jz![%j![!]>i!];'S%j;'S;=`%{<%lO%jj>pSdY!o`Oy%jz;'S%j;'S;=`%{<%lO%jj?RSnYOy%jz;'S%j;'S;=`%{<%lO%jh?dU!WWOy%jz!_%j!_!`?v!`;'S%j;'S;=`%{<%lO%jh?}S!WW!o`Oy%jz;'S%j;'S;=`%{<%lO%jl@bS!WW!ySOy%jz;'S%j;'S;=`%{<%lO%jj@uV!|Q!WWOy%jz!_%j!_!`?v!`!aA[!a;'S%j;'S;=`%{<%lO%jbAcS!|Q!o`Oy%jz;'S%j;'S;=`%{<%lO%jjArYOy%jz}%j}!OBb!O!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjBgW!o`Oy%jz!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jjCW[lY!o`Oy%jz}%j}!OCP!O!Q%j!Q![CP![!c%j!c!}CP!}#T%j#T#oCP#o;'S%j;'S;=`%{<%lO%jhDRS!zWOy%jz;'S%j;'S;=`%{<%lO%jjDdSpYOy%jz;'S%j;'S;=`%{<%lO%jnDuSo^Oy%jz;'S%j;'S;=`%{<%lO%jjEWU!zWOy%jz#a%j#a#bEj#b;'S%j;'S;=`%{<%lO%jbEoU!o`Oy%jz#d%j#d#eFR#e;'S%j;'S;=`%{<%lO%jbFWU!o`Oy%jz#c%j#c#dFj#d;'S%j;'S;=`%{<%lO%jbFoU!o`Oy%jz#f%j#f#gGR#g;'S%j;'S;=`%{<%lO%jbGWU!o`Oy%jz#h%j#h#iGj#i;'S%j;'S;=`%{<%lO%jbGoU!o`Oy%jz#T%j#T#UHR#U;'S%j;'S;=`%{<%lO%jbHWU!o`Oy%jz#b%j#b#cHj#c;'S%j;'S;=`%{<%lO%jbHoU!o`Oy%jz#h%j#h#iIR#i;'S%j;'S;=`%{<%lO%jbIYS$pQ!o`Oy%jz;'S%j;'S;=`%{<%lO%jjIkSsYOy%jz;'S%j;'S;=`%{<%lO%jfI|U$cUOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%jjJeSrYOy%jz;'S%j;'S;=`%{<%lO%jfJvU#PQOy%jz!_%j!_!`2n!`;'S%j;'S;=`%{<%lO%j`K]P;=`<%l%Z",tokenizers:[JC,eT,HC,KC,1,2,3,4,new ql("m~RRYZ[z{a~~g~aO$_~~dP!P!Qg~lO$`~~",28,152)],topRules:{StyleSheet:[0,6],Styles:[1,126]},dynamicPrecedences:{94:1},specialized:[{term:147,get:t=>iT[t]||-1},{term:148,get:t=>nT[t]||-1},{term:4,get:t=>rT[t]||-1},{term:28,get:t=>sT[t]||-1},{term:146,get:t=>oT[t]||-1}],tokenPrec:2405});let iu=null;function nu(){if(!iu&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],i=new Set;for(let n in t)n!="cssText"&&n!="cssFloat"&&typeof t[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),i.has(n)||(e.push(n),i.add(n)));iu=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return iu||[]}const vp=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(t=>({type:"class",label:t})),yp=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),aT=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),uT=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(t=>({type:"keyword",label:t})),Ci=/^(\w[\w-]*|-\w[\w-]*|)$/,cT=/^-(-[\w-]*)?$/;function hT(t,e){var i;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let n=(i=t.parent)===null||i===void 0?void 0:i.firstChild;return(n==null?void 0:n.name)!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}const xp=new Sg,fT=["Declaration"];function dT(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function bb(t,e,i){if(e.to-e.from>4096){let n=xp.get(e);if(n)return n;let r=[],s=new Set,o=e.cursor(ge.IncludeAnonymous);if(o.firstChild())do for(let l of bb(t,o.node,i))s.has(l.label)||(s.add(l.label),r.push(l));while(o.nextSibling());return xp.set(e,r),r}else{let n=[],r=new Set;return e.cursor().iterate(s=>{var o;if(i(s)&&s.matchContext(fT)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=t.sliceString(s.from,s.to);r.has(l)||(r.add(l),n.push({label:l,type:"variable"}))}}),n}}const vb=t=>e=>{let{state:i,pos:n}=e,r=Re(i).resolveInner(n,-1),s=r.type.isError&&r.from==r.to-1&&i.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:nu(),validFor:Ci};if(r.name=="ValueName")return{from:r.from,options:yp,validFor:Ci};if(r.name=="PseudoClassName")return{from:r.from,options:vp,validFor:Ci};if(t(r)||(e.explicit||s)&&hT(r,i.doc))return{from:t(r)||s?r.from:n,options:bb(i.doc,dT(r),t),validFor:cT};if(r.name=="TagName"){for(let{parent:a}=r;a;a=a.parent)if(a.name=="Block")return{from:r.from,options:nu(),validFor:Ci};return{from:r.from,options:aT,validFor:Ci}}if(r.name=="AtKeyword")return{from:r.from,options:uT,validFor:Ci};if(!e.explicit)return null;let o=r.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:vp,validFor:Ci}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:yp,validFor:Ci}:o.name=="Block"||o.name=="Styles"?{from:n,options:nu(),validFor:Ci}:null},yb=vb(t=>t.name=="VariableName"),Vs=Sr.define({name:"css",parser:lT.configure({props:[Mr.add({Declaration:ol()}),no.add({"Block KeyframeList":Ag})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function xb(){return new Qr(Vs,Vs.data.of({autocomplete:yb}))}const pT=Object.freeze(Object.defineProperty({__proto__:null,css:xb,cssCompletionSource:yb,cssLanguage:Vs,defineCSSCompletionSource:vb},Symbol.toStringTag,{value:"Module"})),mT=316,OT=317,kp=1,gT=2,bT=3,vT=4,yT=318,xT=320,kT=321,ST=5,wT=6,$T=0,vc=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],kb=125,QT=59,yc=47,_T=42,PT=43,CT=45,TT=60,AT=44,ET=63,RT=46,DT=91,LT=new nb({start:!1,shift(t,e){return e==ST||e==wT||e==xT?t:e==kT},strict:!1}),MT=new Zt((t,e)=>{let{next:i}=t;(i==kb||i==-1||e.context)&&t.acceptToken(yT)},{contextual:!0,fallback:!0}),ZT=new Zt((t,e)=>{let{next:i}=t,n;vc.indexOf(i)>-1||i==yc&&((n=t.peek(1))==yc||n==_T)||i!=kb&&i!=QT&&i!=-1&&!e.context&&t.acceptToken(mT)},{contextual:!0}),IT=new Zt((t,e)=>{t.next==DT&&!e.context&&t.acceptToken(OT)},{contextual:!0}),XT=new Zt((t,e)=>{let{next:i}=t;if(i==PT||i==CT){if(t.advance(),i==t.next){t.advance();let n=!e.context&&e.canShift(kp);t.acceptToken(n?kp:gT)}}else i==ET&&t.peek(1)==RT&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken(bT))},{contextual:!0});function ru(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const zT=new Zt((t,e)=>{if(t.next!=TT||!e.dialectEnabled($T)||(t.advance(),t.next==yc))return;let i=0;for(;vc.indexOf(t.next)>-1;)t.advance(),i++;if(ru(t.next,!0)){for(t.advance(),i++;ru(t.next,!1);)t.advance(),i++;for(;vc.indexOf(t.next)>-1;)t.advance(),i++;if(t.next==AT)return;for(let n=0;;n++){if(n==7){if(!ru(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),i++}}t.acceptToken(vT,-i)}),jT=Dr({"get set async static":k.modifier,"for while do if else switch try catch finally return throw break continue default case defer":k.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":k.operatorKeyword,"let var const using function class extends":k.definitionKeyword,"import export from":k.moduleKeyword,"with debugger new":k.keyword,TemplateString:k.special(k.string),super:k.atom,BooleanLiteral:k.bool,this:k.self,null:k.null,Star:k.modifier,VariableName:k.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":k.function(k.variableName),VariableDefinition:k.definition(k.variableName),Label:k.labelName,PropertyName:k.propertyName,PrivatePropertyName:k.special(k.propertyName),"CallExpression/MemberExpression/PropertyName":k.function(k.propertyName),"FunctionDeclaration/VariableDefinition":k.function(k.definition(k.variableName)),"ClassDeclaration/VariableDefinition":k.definition(k.className),"NewExpression/VariableName":k.className,PropertyDefinition:k.definition(k.propertyName),PrivatePropertyDefinition:k.definition(k.special(k.propertyName)),UpdateOp:k.updateOperator,"LineComment Hashbang":k.lineComment,BlockComment:k.blockComment,Number:k.number,String:k.string,Escape:k.escape,ArithOp:k.arithmeticOperator,LogicOp:k.logicOperator,BitOp:k.bitwiseOperator,CompareOp:k.compareOperator,RegExp:k.regexp,Equals:k.definitionOperator,Arrow:k.function(k.punctuation),": Spread":k.punctuation,"( )":k.paren,"[ ]":k.squareBracket,"{ }":k.brace,"InterpolationStart InterpolationEnd":k.special(k.brace),".":k.derefOperator,", ;":k.separator,"@":k.meta,TypeName:k.typeName,TypeDefinition:k.definition(k.typeName),"type enum interface implements namespace module declare":k.definitionKeyword,"abstract global Privacy readonly override":k.modifier,"is keyof unique infer asserts":k.operatorKeyword,JSXAttributeValue:k.attributeValue,JSXText:k.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":k.angleBracket,"JSXIdentifier JSXNameSpacedName":k.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":k.attributeName,"JSXBuiltin/JSXIdentifier":k.standard(k.tagName)}),FT={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},BT={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},VT={__proto__:null,"<":193},qT=Pr.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-EtOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-EPO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-ERQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<VO!l$xO#jROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!OVO!l$xO#jVO!l$xO#jROe!iOpkOrPO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]VO!l$xO#j^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOrROe!iOpkOrPO(T)]O(VTO(YUO(aVO(o[O~O!]WO!l$xO#jgPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{SU+P%]S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mR>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o>UPS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;kP>X>Y>]>^T)z$u){V+P%]S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`SS#q]SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uSSR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:mSR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:mSQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:oS)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mSS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:mST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:mS#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^Q+T%aQ/c*Oo4OP>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^n=rTQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k]>^o4OP>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f]>^nZ>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f]>^nZ>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.lPQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.nSR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:LT,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[jT],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l^!Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!^!LYP;=`<%l!KS>^!L`P;=`<%l!_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#Jv_al$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z04f#LS^h#)`#R-v$?V_!^(CdvBr$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z?O$@a_!q7`$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ZT,IT,XT,zT,2,3,4,5,6,7,8,9,10,11,12,13,14,MT,new ql("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new ql("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:t=>FT[t]||-1},{term:343,get:t=>BT[t]||-1},{term:95,get:t=>VT[t]||-1}],tokenPrec:15201}),Ch=[mt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),mt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),mt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),mt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),mt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),mt(`try { \${} } catch (\${error}) { \${} }`,{label:"try",detail:"/ catch block",type:"keyword"}),mt("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),mt(`if (\${}) { \${} } else { \${} }`,{label:"if",detail:"/ else block",type:"keyword"}),mt(`class \${name} { constructor(\${params}) { \${} } }`,{label:"class",detail:"definition",type:"keyword"}),mt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),mt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Sb=Ch.concat([mt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),mt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),mt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Sp=new Sg,wb=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Yr(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}const WT=["FunctionDeclaration"],YT={FunctionDeclaration:Yr("function"),ClassDeclaration:Yr("class"),ClassExpression:()=>!0,EnumDeclaration:Yr("constant"),TypeAliasDeclaration:Yr("type"),NamespaceDeclaration:Yr("namespace"),VariableDefinition(t,e){t.matchContext(WT)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function $b(t,e){let i=Sp.get(e);if(i)return i;let n=[],r=!0;function s(o,l){let a=t.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(ge.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let l=YT[o.name];if(l&&l(o,s)||wb.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of $b(t,o.node))n.push(l);return!1}}),Sp.set(e,n),n}const Yl=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Th=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Qb(t){let e=Re(t.state).resolveInner(t.pos,-1);if(Th.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&Yl.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let r=e;r;r=r.parent)wb.has(r.name)&&(n=n.concat($b(t.state.doc,r)));return{options:n,from:i?e.from:t.pos,validFor:Yl}}function su(t,e,i){var n;let r=[];for(;;){let s=e.firstChild,o;if((s==null?void 0:s.name)=="VariableName")return r.push(t(s)),{path:r.reverse(),name:i};if((s==null?void 0:s.name)=="MemberExpression"&&((n=o=s.lastChild)===null||n===void 0?void 0:n.name)=="PropertyName")r.push(t(o)),e=s;else return null}}function _b(t){let e=n=>t.state.doc.sliceString(n.from,n.to),i=Re(t.state).resolveInner(t.pos,-1);return i.name=="PropertyName"?su(e,i.parent,e(i)):(i.name=="."||i.name=="?.")&&i.parent.name=="MemberExpression"?su(e,i.parent,""):Th.indexOf(i.name)>-1?null:i.name=="VariableName"||i.to-i.from<20&&Yl.test(e(i))?{path:[],name:e(i)}:i.name=="MemberExpression"?su(e,i,""):t.explicit?{path:[],name:""}:null}function NT(t,e){let i=t,n=[],r=new Set;for(let s=0;;s++){for(let l of(Object.getOwnPropertyNames||Object.keys)(t)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(l)||r.has(l))continue;r.add(l);let a;try{a=i[l]}catch{continue}n.push({label:l,type:typeof a=="function"?/^[A-Z]/.test(l)?"class":e?"function":"method":e?"variable":"property",boost:-s})}let o=Object.getPrototypeOf(t);if(!o)return n;t=o}}function GT(t){let e=new Map;return i=>{let n=_b(i);if(!n)return null;let r=t;for(let o of n.path)if(r=r[o],!r)return null;let s=e.get(r);return s||e.set(r,s=NT(r,!n.path.length)),{from:i.pos-n.name.length,options:s,validFor:Yl}}}const qt=Sr.define({name:"javascript",parser:qT.configure({props:[Mr.add({IfStatement:ol({except:/^\s*({|else\b)/}),TryStatement:ol({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:M$,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:L$({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":ol({except:/^\s*{/}),JSXElement(t){let e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},JSXEscape(t){let e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.node.from)+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),no.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ag,BlockComment(t){return{from:t.from+2,to:t.to-2}},JSXElement(t){let e=t.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let i=t.lastChild;return{from:e.to,to:i.type.isError?t.to:i.from}},"JSXSelfClosingTag JSXOpenTag"(t){var e;let i=(e=t.firstChild)===null||e===void 0?void 0:e.nextSibling,n=t.lastChild;return!i||i.type.isError?null:{from:i.to,to:n.type.isError?t.to:n.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Pb={test:t=>/^JSX/.test(t.name),facet:ca({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Ah=qt.configure({dialect:"ts"},"typescript"),Eh=qt.configure({dialect:"jsx",props:[eh.add(t=>t.isTop?[Pb]:void 0)]}),Rh=qt.configure({dialect:"jsx ts",props:[eh.add(t=>t.isTop?[Pb]:void 0)]},"typescript");let Cb=t=>({label:t,type:"keyword"});const Tb="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Cb),UT=Tb.concat(["declare","implements","private","protected","public"].map(Cb));function Ab(t={}){let e=t.jsx?t.typescript?Rh:Eh:t.typescript?Ah:qt,i=t.typescript?Sb.concat(UT):Ch.concat(Tb);return new Qr(e,[qt.data.of({autocomplete:A_(Th,P1(i))}),qt.data.of({autocomplete:Qb}),t.jsx?Eb:[]])}function HT(t){for(;;){if(t.name=="JSXOpenTag"||t.name=="JSXSelfClosingTag"||t.name=="JSXFragmentTag")return t;if(t.name=="JSXEscape"||!t.parent)return null;t=t.parent}}function wp(t,e,i=t.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return t.sliceString(n.from,Math.min(n.to,i));return""}const KT=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Eb=W.inputHandler.of((t,e,i,n,r)=>{if((KT?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||n!=">"&&n!="/"||!qt.isActiveAt(t.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var u;let{head:c}=a,h=Re(o).resolveInner(c-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(c-1,c)!=n||h.name=="JSXAttributeValue"&&h.to>c)){if(n==">"&&h.name=="JSXFragmentTag")return{range:a,changes:{from:c,insert:""}};if(n=="/"&&h.name=="JSXStartCloseTag"){let d=h.parent,p=d.parent;if(p&&d.from==c-2&&((f=wp(o.doc,p.firstChild,c))||((u=p.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let m=`${f}>`;return{range:E.cursor(c+m.length,-1),changes:{from:c,insert:m}}}}else if(n==">"){let d=HT(h);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(c,c+2))&&(f=wp(o.doc,d,c)))return{range:a,changes:{from:c,insert:``}}}}return{range:a}});return l.changes.empty?!1:(t.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function JT(t,e){return e||(e={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},t.getRules().forEach((i,n)=>{var r;!((r=i.meta.docs)===null||r===void 0)&&r.recommended&&(e.rules[n]=2)})),i=>{let{state:n}=i,r=[];for(let{from:s,to:o}of qt.findRegions(n)){let l=n.doc.lineAt(s),a={line:l.number-1,col:s-l.from,pos:s};for(let u of t.verify(n.sliceDoc(s,o),e))r.push(e5(u,n.doc,a))}return r}}function $p(t,e,i,n){return i.line(t+n.line).from+e+(t==1?n.col-1:-1)}function e5(t,e,i){let n=$p(t.line,t.column,e,i),r={from:n,to:t.endLine!=null&&t.endColumn!=1?$p(t.endLine,t.endColumn,e,i):n,message:t.message,source:t.ruleId?"eslint:"+t.ruleId:"eslint",severity:t.severity==1?"warning":"error"};if(t.fix){let{range:s,text:o}=t.fix,l=s[0]+i.pos-n,a=s[1]+i.pos-n;r.actions=[{name:"fix",apply(u,c){u.dispatch({changes:{from:c+l,to:c+a,insert:o},scrollIntoView:!0})}}]}return r}const Vo=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Eb,completionPath:_b,esLint:JT,javascript:Ab,javascriptLanguage:qt,jsxLanguage:Eh,localCompletionSource:Qb,scopeCompletionSource:GT,snippets:Ch,tsxLanguage:Rh,typescriptLanguage:Ah,typescriptSnippets:Sb},Symbol.toStringTag,{value:"Module"})),Nr=["_blank","_self","_top","_parent"],ou=["ascii","utf-8","utf-16","latin1","latin1"],lu=["get","post","put","delete"],au=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],St=["true","false"],N={},t5={a:{attrs:{href:null,ping:null,type:null,media:null,target:Nr,hreflang:null}},abbr:N,address:N,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:N,aside:N,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:N,base:{attrs:{href:null,target:Nr}},bdi:N,bdo:N,blockquote:{attrs:{cite:null}},body:N,br:N,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:au,formmethod:lu,formnovalidate:["novalidate"],formtarget:Nr,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:N,center:N,cite:N,code:N,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:N,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:N,div:N,dl:N,dt:N,em:N,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:N,figure:N,footer:N,form:{attrs:{action:null,name:null,"accept-charset":ou,autocomplete:["on","off"],enctype:au,method:lu,novalidate:["novalidate"],target:Nr}},h1:N,h2:N,h3:N,h4:N,h5:N,h6:N,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:N,hgroup:N,hr:N,html:{attrs:{manifest:null}},i:N,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:au,formmethod:lu,formnovalidate:["novalidate"],formtarget:Nr,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:N,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:N,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:N,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ou,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:N,noscript:N,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:N,param:{attrs:{name:null,value:null}},pre:N,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:N,rt:N,ruby:N,samp:N,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ou}},section:N,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:N,source:{attrs:{src:null,type:null,media:null}},span:N,strong:N,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:N,summary:N,sup:N,table:N,tbody:N,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:N,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:N,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:N,time:{attrs:{datetime:null}},title:N,tr:N,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:N,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:N},Rb={accesskey:null,class:null,contenteditable:St,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:St,autocorrect:St,autocapitalize:St,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":St,"aria-autocomplete":["inline","list","both","none"],"aria-busy":St,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":St,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":St,"aria-hidden":St,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":St,"aria-multiselectable":St,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":St,"aria-relevant":null,"aria-required":St,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Db="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(t=>"on"+t);for(let t of Db)Rb[t]=null;class qs{constructor(e,i){this.tags={...t5,...e},this.globalAttrs={...Rb,...i},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}qs.default=new qs;function Cr(t,e,i=t.length){if(!e)return"";let n=e.firstChild,r=n&&n.getChild("TagName");return r?t.sliceString(r.from,Math.min(r.to,i)):""}function Tr(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function Lb(t,e,i){let n=i.tags[Cr(t,Tr(e))];return(n==null?void 0:n.children)||i.allTags}function Dh(t,e){let i=[];for(let n=Tr(e);n&&!n.type.isTop;n=Tr(n.parent)){let r=Cr(t,n);if(r&&n.lastChild.name=="CloseTag")break;r&&i.indexOf(r)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&i.push(r)}return i}const Mb=/^[:\-\.\w\u00b7-\uffff]*$/;function Qp(t,e,i,n,r){let s=/\s*>/.test(t.sliceDoc(r,r+5))?"":">",o=Tr(i,i.name=="StartTag"||i.name=="TagName");return{from:n,to:r,options:Lb(t.doc,o,e).map(l=>({label:l,type:"type"})).concat(Dh(t.doc,i).map((l,a)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function _p(t,e,i,n){let r=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:Dh(t.doc,e).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:Mb}}function i5(t,e,i,n){let r=[],s=0;for(let o of Lb(t.doc,i,e))r.push({label:"<"+o,type:"type"});for(let o of Dh(t.doc,i))r.push({label:"",type:"type",boost:99-s++});return{from:n,to:n,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function n5(t,e,i,n,r){let s=Tr(i),o=s?e.tags[Cr(t.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:r,options:a.map(u=>({label:u,type:"property"})),validFor:Mb}}function r5(t,e,i,n,r){var s;let o=(s=i.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],a;if(o){let u=t.sliceDoc(o.from,o.to),c=e.globalAttrs[u];if(!c){let h=Tr(i),f=h?e.tags[Cr(t.doc,h)]:null;c=(f==null?void 0:f.attrs)&&f.attrs[u]}if(c){let h=t.sliceDoc(n,r).toLowerCase(),f='"',d='"';/^['"]/.test(h)?(a=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",d=t.sliceDoc(r,r+1)==h[0]?"":h[0],h=h.slice(1),n++):a=/^[^\s<>='"]*$/;for(let p of c)l.push({label:p,apply:f+p+d,type:"constant"})}}return{from:n,to:r,options:l,validFor:a}}function Zb(t,e){let{state:i,pos:n}=e,r=Re(i).resolveInner(n,-1),s=r.resolve(n);for(let o=n,l;s==r&&(l=r.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.fromZb(n,r)}const s5=qt.parser.configure({top:"SingleExpression"}),zb=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:Ah.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:Eh.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:Rh.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:s5},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:qt.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:Vs.parser}],jb=[{name:"style",parser:Vs.parser.configure({top:"Styles"})}].concat(Db.map(t=>({name:t,parser:qt.parser}))),Fb=Sr.define({name:"html",parser:DC.configure({props:[Mr.add({Element(t){let e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.node.from)+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(t){if(t.pos+/\s*/.exec(t.textAfter)[0].lengtht.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Os=Fb.configure({wrap:db(zb,jb)});function Bb(t={}){let e="",i;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(i=db((t.nestedLanguages||[]).concat(zb),(t.nestedAttributes||[]).concat(jb)));let n=i?Fb.configure({wrap:i,dialect:e}):e?Os.configure({dialect:e}):Os;return new Qr(n,[Os.data.of({autocomplete:Xb(t)}),t.autoCloseTags!==!1?Vb:[],Ab().support,xb().support])}const Pp=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Vb=W.inputHandler.of((t,e,i,n,r)=>{if(t.composing||t.state.readOnly||e!=i||n!=">"&&n!="/"||!Os.isActiveAt(t.state,e,-1))return!1;let s=r(),{state:o}=s,l=o.changeByRange(a=>{var u,c,h;let f=o.doc.sliceString(a.from-1,a.to)==n,{head:d}=a,p=Re(o).resolveInner(d,-1),m;if(f&&n==">"&&p.name=="EndTag"){let O=p.parent;if(((c=(u=O.parent)===null||u===void 0?void 0:u.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(m=Cr(o.doc,O.parent,d))&&!Pp.has(m)){let g=d+(o.doc.sliceString(d,d+1)===">"?1:0),b=``;return{range:a,changes:{from:d,to:g,insert:b}}}}else if(f&&n=="/"&&p.name=="IncompleteCloseTag"){let O=p.parent;if(p.from==d-2&&((h=O.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=Cr(o.doc,O,d))&&!Pp.has(m)){let g=d+(o.doc.sliceString(d,d+1)===">"?1:0),b=`${m}>`;return{range:E.cursor(d+b.length,-1),changes:{from:d,to:g,insert:b}}}}return{range:a}});return l.changes.empty?!1:(t.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),o5=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:Vb,html:Bb,htmlCompletionSource:Ib,htmlCompletionSourceWith:Xb,htmlLanguage:Os},Symbol.toStringTag,{value:"Module"})),qb=ca({commentTokens:{block:{open:""}}}),Wb=new K,Yb=PP.configure({props:[no.add(t=>!t.is("Block")||t.is("Document")||xc(t)!=null||l5(t)?void 0:(e,i)=>({from:i.doc.lineAt(e.from).to,to:e.to})),Wb.add(xc),Mr.add({Document:()=>null}),nn.add({Document:qb})]});function xc(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function l5(t){return t.name=="OrderedList"||t.name=="BulletList"}function a5(t,e){let i=t;for(;;){let n=i.nextSibling,r;if(!n||(r=xc(n.type))!=null&&r<=e)break;i=n}return i.to}const u5=Z$.of((t,e,i)=>{for(let n=Re(t).resolveInner(i,-1);n&&!(n.fromi)return{from:i,to:s}}return null});function Lh(t){return new Dt(qb,t,[],"markdown")}const Nb=Lh(Yb),c5=Yb.configure([XP,jP,zP,FP,{props:[no.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),Ws=Lh(c5);function h5(t,e){return i=>{if(i&&t){let n=null;if(i=/\S*/.exec(i)[0],typeof t=="function"?n=t(i):n=C.matchLanguageName(t,i,!0),n instanceof C)return n.support?n.support.language.parser:Dn.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class uu{constructor(e,i,n,r,s,o,l){this.node=e,this.from=i,this.to=n,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=l}blank(e,i=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length0;r--)n+=" ";return n+(i?this.spaceAfter:"")}}marker(e,i){let n=this.node.name=="OrderedList"?String(+Ub(this.item,e)[2]+i):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function Gb(t,e){let i=[],n=[];for(let r=t;r;r=r.parent){if(r.name=="FencedCode")return n;(r.name=="ListItem"||r.name=="Blockquote")&&i.push(r)}for(let r=i.length-1;r>=0;r--){let s=i[r],o,l=e.lineAt(s.from),a=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(a))))n.push(new uu(s,a,a+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(a)))){let u=o[3],c=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),c-=4),n.push(new uu(s.parent,a,a+c,o[1],u,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(a)))){let u=o[4],c=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),c-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),n.push(new uu(s.parent,a,a+c,o[1],u,h,s))}}return n}function Ub(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function cu(t,e,i,n=0){for(let r=-1,s=t;;){if(s.name=="ListItem"){let l=Ub(s,e),a=+l[2];if(r>=0){if(a!=r+1)return;i.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(r+2+n)})}r=a}let o=s.nextSibling;if(!o)break;s=o}}function Mh(t,e){let i=/^[ \t]*/.exec(t)[0].length;if(!i||e.facet(Lr)!=" ")return t;let n=Mi(t,4,i),r="";for(let s=n;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+t.slice(i)}const Hb=(t={})=>({state:e,dispatch:i})=>{let n=Re(e),{doc:r}=e,s=null,o=e.changeByRange(l=>{if(!l.empty||!Ws.isActiveAt(e,l.from,-1)&&!Ws.isActiveAt(e,l.from,1))return s={range:l};let a=l.from,u=r.lineAt(a),c=Gb(n.resolveInner(a,-1),r);for(;c.length&&c[c.length-1].from>a-u.from;)c.pop();if(!c.length)return s={range:l};let h=c[c.length-1];if(h.to-h.spaceAfter.length>a-u.from)return s={range:l};let f=a>=h.to-h.spaceAfter.length&&!/\S/.test(u.text.slice(h.to));if(h.item&&f){let g=h.node.firstChild,b=h.node.getChild("ListItem","ListItem");if(g.to>=a||b&&b.to0&&!/[^\s>]/.test(r.lineAt(u.from-1).text)||t.nonTightLists===!1){let y=c.length>1?c[c.length-2]:null,w,v="";y&&y.item?(w=u.from+y.from,v=y.marker(r,1)):w=u.from+(y?y.to:0);let Q=[{from:w,to:a,insert:v}];return h.node.name=="OrderedList"&&cu(h.item,r,Q,-2),y&&y.node.name=="OrderedList"&&cu(y.item,r,Q),{range:E.cursor(w+v.length),changes:Q}}else{let y=Tp(c,e,u);return{range:E.cursor(a+y.length+1),changes:{from:u.from,insert:y+e.lineBreak}}}}if(h.node.name=="Blockquote"&&f&&u.from){let g=r.lineAt(u.from-1),b=/>\s*$/.exec(g.text);if(b&&b.index==h.from){let y=e.changes([{from:g.from+b.index,to:g.to},{from:u.from+h.from,to:u.to}]);return{range:l.map(y),changes:y}}}let d=[];h.node.name=="OrderedList"&&cu(h.item,r,d);let p=h.item&&h.item.from]*/.exec(u.text)[0].length>=h.to)for(let g=0,b=c.length-1;g<=b;g++)m+=g==b&&!p?c[g].marker(r,1):c[g].blank(gu.from&&/\s/.test(u.text.charAt(O-u.from-1));)O--;return m=Mh(m,e),f5(h.node,e.doc)&&(m=Tp(c,e,u)+e.lineBreak+m),d.push({from:O,to:a,insert:e.lineBreak+m}),{range:E.cursor(O+m.length+1),changes:d}});return s?!1:(i(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},Kb=Hb();function Cp(t){return t.name=="QuoteMark"||t.name=="ListMark"}function f5(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let i=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let r=e.lineAt(i.to),s=e.lineAt(n.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1){let i=Re(t),n=null,r=t.changeByRange(s=>{let o=s.from,{doc:l}=t;if(s.empty&&Ws.isActiveAt(t,s.from)){let a=l.lineAt(o),u=Gb(d5(i,o),l);if(u.length){let c=u[u.length-1],h=c.to-c.spaceAfter.length+(c.spaceAfter?1:0);if(o-a.from>h&&!/\S/.test(a.text.slice(h,o-a.from)))return{range:E.cursor(a.from+h),changes:{from:a.from+h,to:o}};if(o-a.from==h&&(!c.item||a.from<=c.item.from||!/\S/.test(a.text.slice(0,c.to)))){let f=a.from+c.from;if(c.item&&c.node.from{var i;let{main:n}=e.state.selection;if(n.empty)return!1;let r=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!Ws.isActiveAt(e.state,n.from,1)))return!1;let s=Re(e.state),o=!1;return s.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||O5.test(l.name))&&(o=!0)},leave:l=>{l.to{const i=ht({props:t,ctx:e},"trigger"),n=ht({props:t,ctx:e});return $("div",{class:[`${x}-toolbar-item`,t.disabled&&`${x}-disabled`],title:t.title,onClick:r=>{var s;t.disabled||((s=t.onClick)==null||s.call(t,r),e.emit("onClick",r))}},[n||i])}}});gs.install=t=>(t.component(gs.name,gs),t);function v5(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!kv(t)}const y5={title:{type:String,default:""},modalTitle:{type:[String,Object],default:""},visible:{type:Boolean,default:void 0},width:{type:String,default:"auto"},height:{type:String,default:"auto"},trigger:{type:[String,Object],default:void 0},onClick:{type:Function,default:void 0},onClose:{type:Function,default:void 0},showAdjust:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},onAdjust:{type:Function,default:void 0},class:{type:String,default:void 0},style:{type:[Object,String],default:void 0},showMask:{type:Boolean,default:!0},insert:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},previewTheme:{type:String,default:void 0},codeTheme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},showToolbarName:{type:Boolean,default:void 0}},bs=Te({name:"ModalToolbar",props:y5,emits:["onClick","onClose","onAdjust"],setup(t,e){return()=>{const i=ht({props:t,ctx:e},"trigger"),n=ht({props:t,ctx:e},"modalTitle"),r=ht({props:t,ctx:e});return $(Gs,null,[$("div",{class:[`${x}-toolbar-item`,t.disabled&&`${x}-disabled`],title:t.title,onClick:()=>{var s;t.disabled||((s=t.onClick)==null||s.call(t),e.emit("onClick"))}},[i]),$(_n,{style:t.style,class:t.class,width:t.width,height:t.height,title:n,visible:t.visible,showMask:t.showMask,onClose:()=>{var s;(s=t.onClose)==null||s.call(t),e.emit("onClose")},showAdjust:t.showAdjust,isFullscreen:t.isFullscreen,onAdjust:s=>{var o;(o=t.onAdjust)==null||o.call(t,s),e.emit("onAdjust",s)}},v5(r)?r:{default:()=>[r]})])}}});bs.install=t=>(t.component(bs.name,bs),t);var x5=Object.defineProperty,k5=(t,e,i)=>e in t?x5(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Fi=(t,e,i)=>k5(t,typeof e!="symbol"?e+"":e,i);const S5=Te({name:`${x}-divider`,setup(){return()=>$("div",{class:`${x}-divider`},null)}}),w5={noPrettier:{type:Boolean},toolbars:{type:Array,default:()=>[]},toolbarsExclude:{type:Array,default:()=>[]},setting:{type:Object,default:()=>({})},screenfull:{type:Object,default:null},screenfullJs:{type:String,default:""},updateSetting:{type:Function,default:()=>{}},tableShape:{type:Array,default:()=>[6,4]},defToolbars:{type:Object},noUploadImg:{type:Boolean},showToolbarName:{type:Boolean},catalogVisible:{type:Boolean},codeTheme:{type:String},insertLinkDirect:{type:Boolean}},$5=t=>{const e=H("editorId"),{editorExtensions:i,editorExtensionsAttrs:n}=Me;let r=i.screenfull.instance;const s=pe(!1),o=u=>{if(!r){X.emit(e,hn,{name:"fullscreen",message:"fullscreen is undefined"});return}r.isEnabled?(s.value=!0,(u===void 0?!r.isFullscreen:u)?r.request():r.exit()):console.error("browser does not support screenfull!")},l=()=>{r&&r.isEnabled&&r.on("change",()=>{(s.value||t.setting.fullscreen)&&(s.value=!1,t.updateSetting("fullscreen"))})},a=()=>{r=window.screenfull,l()};return Ae(()=>{var u;l(),r||zt("script",{...(u=n.screenfull)==null?void 0:u.js,src:i.screenfull.js,id:bt.screenfull,onload:a},"screenfull")}),Ae(()=>{X.on(e,{name:em,callback:o})}),{fullscreenHandler:o}},Q5={tableShape:{type:Array,default:()=>[6,4]},onSelected:{type:Function,default:()=>{}}},_5=Te({name:"TableShape",props:Q5,setup(t){const e=ct({x:-1,y:-1}),i=He(()=>JSON.stringify(t.tableShape)),n=()=>{const s=[...JSON.parse(i.value)];return(!s[2]||s[2]{r.value=n()}),()=>$("div",{class:`${x}-table-shape`,onMouseleave:()=>{r.value=n(),e.x=-1,e.y=-1}},[new Array(r.value[1]).fill("").map((s,o)=>$("div",{class:`${x}-table-shape-row`,key:`table-shape-row-${o}`},[new Array(r.value[0]).fill("").map((l,a)=>$("div",{class:`${x}-table-shape-col`,key:`table-shape-col-${a}`,onMouseenter:()=>{e.x=o,e.y=a,a+1===r.value[0]&&a+1t.tableShape[0]&&r.value[0]--,o+1===r.value[1]&&o+1t.tableShape[1]&&r.value[1]--},onClick:()=>{t.onSelected(e)}},[$("div",{class:[`${x}-table-shape-col-default`,o<=e.x&&a<=e.y&&`${x}-table-shape-col-include`]},null)]))]))])}}),P5={type:{type:String,default:"link"},visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},C5=Te({name:`${x}-modal-link`,props:P5,setup(t){const e=H("usedLanguageText"),i=H("editorId"),n=He(()=>{var s,o;switch(t.type){case"link":return(s=e.value.linkModalTips)==null?void 0:s.linkTitle;case"image":return(o=e.value.linkModalTips)==null?void 0:o.imageTitle;default:return""}}),r=ct({desc:"",url:""});return te(()=>t.visible,s=>{s||setTimeout(()=>{r.desc="",r.url=""},200)}),()=>$(_n,{title:n.value,visible:t.visible,onClose:t.onCancel},{default:()=>{var s,o,l,a,u;return[$("div",{class:`${x}-form-item`},[$("label",{class:`${x}-label`,for:`link-desc-${i}`},[(s=e.value.linkModalTips)==null?void 0:s.descLabel]),$("input",{placeholder:(o=e.value.linkModalTips)==null?void 0:o.descLabelPlaceHolder,class:`${x}-input`,id:`link-desc-${i}`,type:"text",value:r.desc,onChange:c=>{r.desc=c.target.value},autocomplete:"off"},null)]),$("div",{class:`${x}-form-item`},[$("label",{class:`${x}-label`,for:`link-url-${i}`},[(l=e.value.linkModalTips)==null?void 0:l.urlLabel]),$("input",{placeholder:(a=e.value.linkModalTips)==null?void 0:a.urlLabelPlaceHolder,class:`${x}-input`,id:`link-url-${i}`,type:"text",value:r.url,onChange:c=>{r.url=c.target.value},autocomplete:"off"},null)]),$("div",{class:`${x}-form-item`},[$("button",{class:[`${x}-btn`,`${x}-btn-row`],type:"button",onClick:()=>{t.onOk(r),r.desc="",r.url=""}},[(u=e.value.linkModalTips)==null?void 0:u.buttonOK])])]}})}}),T5={visible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},A5=Te({name:`${x}-modal-clip`,props:T5,setup(t){const e=H("usedLanguageText"),i=H("editorId"),n=H("rootRef");let r=Me.editorExtensions.cropper.instance;const s=pe(),o=pe(),l=pe(),a=ct({cropperInited:!1,imgSelected:!1,imgSrc:"",isFullscreen:!1});let u=null;te(()=>t.visible,()=>{t.visible&&!a.cropperInited&&(r=r||window.Cropper,s.value.onchange=()=>{if(!r){X.emit(i,hn,{name:"Cropper",message:"Cropper is undefined"});return}const h=s.value.files||[];if(a.imgSelected=!0,(h==null?void 0:h.length)>0){const f=new FileReader;f.onload=d=>{a.imgSrc=d.target.result},f.readAsDataURL(h[0])}})}),te(()=>[a.imgSelected],()=>{l.value.style=""}),te([si(()=>a.isFullscreen),si(()=>a.imgSrc)],()=>{a.imgSrc&&li(()=>{u==null||u.destroy(),l.value.style="",o.value&&(u=new r(o.value,{viewMode:2,preview:n.value.getRootNode().querySelector(`.${x}-clip-preview-target`)}))})});const c=()=>{u.clear(),u.destroy(),u=null,s.value.value="",a.imgSelected=!1,a.imgSrc=""};return()=>{var h;return $(_n,{class:`${x}-modal-clip`,title:(h=e.value.clipModalTips)==null?void 0:h.title,visible:t.visible,onClose:t.onCancel,showAdjust:!0,isFullscreen:a.isFullscreen,onAdjust:f=>{a.isFullscreen=f},width:"668px",height:"421px"},{default:()=>{var f,d,p;return[$("div",{class:`${x}-form-item ${x}-clip`},[$("div",{class:`${x}-clip-main`},[a.imgSelected?$("div",{class:`${x}-clip-cropper`},[$("img",{src:a.imgSrc,ref:o,style:{display:"none"},alt:""},null),$("div",{class:`${x}-clip-delete`,onClick:c},[$(ce,{name:"delete"},null)])]):$("div",{class:`${x}-clip-upload`,onClick:()=>{s.value.click()},role:"button",tabindex:"0","aria-label":(f=e.value.imgTitleItem)==null?void 0:f.upload},[$(ce,{name:"upload"},null)])]),$("div",{class:`${x}-clip-preview`},[$("div",{class:`${x}-clip-preview-target`,ref:l},null)])]),$("div",{class:`${x}-form-item`},[$("button",{class:`${x}-btn`,type:"button",onClick:()=>{if(u){const m=u.getCroppedCanvas();X.emit(i,Hl,[W2(m.toDataURL("image/png"))],t.onOk),c()}}},[((d=e.value.clipModalTips)==null?void 0:d.buttonUpload)||((p=e.value.linkModalTips)==null?void 0:p.buttonOK)])]),$("input",{ref:s,accept:"image/*",type:"file",multiple:!1,style:{display:"none"},"aria-hidden":"true"},null)]}})}}}),E5={type:{type:String,default:"link"},linkVisible:{type:Boolean,default:!1},clipVisible:{type:Boolean,default:!1},onCancel:{type:Function,default:()=>{}},onOk:{type:Function,default:()=>{}}},R5=Te({name:`${x}-modals`,props:E5,setup(t){return()=>$(Gs,null,[$(C5,{type:t.type,visible:t.linkVisible,onOk:t.onOk,onCancel:t.onCancel},null),$(A5,{visible:t.clipVisible,onOk:t.onOk,onCancel:t.onCancel},null)])}}),D5=Te({name:"MDEditorToolbar",props:w5,setup(t){const e=H("editorId"),i=H("usedLanguageText"),n=H("theme"),r=H("previewTheme"),s=H("language"),o=H("disabled"),{fullscreenHandler:l}=$5(t),a=`${e}-toolbar-wrapper`,u=pe(),c=ct({title:!1,catalog:!1,image:!1,table:!1,mermaid:!1,katex:!1}),h=(b,y)=>{if(o!=null&&o.value)return!1;X.emit(e,xe,b,y)},f=ct({type:"link",linkVisible:!1,clipVisible:!1}),d=pe();Ae(()=>{X.on(e,{name:bu,callback(b){f.type=b,f.linkVisible=!0}})});const p=He(()=>{const b=t.toolbars.filter(Q=>!t.toolbarsExclude.includes(Q)),y=b.indexOf("="),w=y===-1?b:b.slice(0,y+1),v=y===-1?[]:b.slice(y,Number.MAX_SAFE_INTEGER);return[w,v]}),m=pe(),O=()=>{X.emit(e,Hl,Array.from(m.value.files||[])),m.value.value=""};Ae(()=>{m.value.addEventListener("change",O)});const g=b=>{var y,w,v,Q,P,_,R,L,I,T,M,F,B,Y,J,ee,re,ue,ye,Oe,le,Se,et,Pi,dn,pn,ao,uo,In,Xn,co,ho,zn,fo,po,zr,zh,jh,Fh,Bh,Vh,qh,Wh,Yh,Nh,Gh,Uh,Hh,Kh,Jh,ef,tf,nf,rf,sf,of,lf,af,uf,cf,hf,ff,df,pf,mf,Of,gf,bf,vf,yf,xf,kf,Sf,wf,$f,Qf,_f,Pf,Cf,Tf,Af;if(wc.includes(b))switch(b){case"-":return $(S5,null,null);case"bold":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(y=i.value.toolbarTips)==null?void 0:y.bold,onClick:()=>{h("bold")}},[$(ce,{name:"bold"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(w=i.value.toolbarTips)==null?void 0:w.bold])]);case"underline":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(v=i.value.toolbarTips)==null?void 0:v.underline,onClick:()=>{h("underline")}},[$(ce,{name:"underline"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Q=i.value.toolbarTips)==null?void 0:Q.underline])]);case"italic":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(P=i.value.toolbarTips)==null?void 0:P.italic,onClick:()=>{h("italic")}},[$(ce,{name:"italic"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(_=i.value.toolbarTips)==null?void 0:_.italic])]);case"strikeThrough":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(R=i.value.toolbarTips)==null?void 0:R.strikeThrough,onClick:()=>{h("strikeThrough")}},[$(ce,{name:"strike-through"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(L=i.value.toolbarTips)==null?void 0:L.strikeThrough])]);case"title":return $(Bn,{relative:`#${a}`,visible:c.title,onChange:ie=>{c.title=ie},disabled:o==null?void 0:o.value,overlay:$("ul",{class:`${x}-menu`,onClick:()=>{c.title=!1},role:"menu"},[$("li",{class:`${x}-menu-item ${x}-menu-item-title`,onClick:()=>{h("h1")},role:"menuitem",tabindex:"0"},[(I=i.value.titleItem)==null?void 0:I.h1]),$("li",{class:`${x}-menu-item ${x}-menu-item-title`,onClick:()=>{h("h2")},role:"menuitem",tabindex:"0"},[(T=i.value.titleItem)==null?void 0:T.h2]),$("li",{class:`${x}-menu-item ${x}-menu-item-title`,onClick:()=>{h("h3")},role:"menuitem",tabindex:"0"},[(M=i.value.titleItem)==null?void 0:M.h3]),$("li",{class:`${x}-menu-item ${x}-menu-item-title`,onClick:()=>{h("h4")},role:"menuitem",tabindex:"0"},[(F=i.value.titleItem)==null?void 0:F.h4]),$("li",{class:`${x}-menu-item ${x}-menu-item-title`,onClick:()=>{h("h5")},role:"menuitem",tabindex:"0"},[(B=i.value.titleItem)==null?void 0:B.h5]),$("li",{class:`${x}-menu-item ${x}-menu-item-title`,onClick:()=>{h("h6")},role:"menuitem",tabindex:"0"},[(Y=i.value.titleItem)==null?void 0:Y.h6])])},{default:()=>{var ie,tt;return[$("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(ie=i.value.toolbarTips)==null?void 0:ie.title},[$(ce,{name:"title"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(tt=i.value.toolbarTips)==null?void 0:tt.title])])]}});case"sub":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(J=i.value.toolbarTips)==null?void 0:J.sub,onClick:()=>{h("sub")}},[$(ce,{name:"sub"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(ee=i.value.toolbarTips)==null?void 0:ee.sub])]);case"sup":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(re=i.value.toolbarTips)==null?void 0:re.sup,onClick:()=>{h("sup")}},[$(ce,{name:"sup"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(ue=i.value.toolbarTips)==null?void 0:ue.sup])]);case"quote":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(ye=i.value.toolbarTips)==null?void 0:ye.quote,onClick:()=>{h("quote")}},[$(ce,{name:"quote"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Oe=i.value.toolbarTips)==null?void 0:Oe.quote])]);case"unorderedList":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(le=i.value.toolbarTips)==null?void 0:le.unorderedList,onClick:()=>{h("unorderedList")}},[$(ce,{name:"unordered-list"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Se=i.value.toolbarTips)==null?void 0:Se.unorderedList])]);case"orderedList":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(et=i.value.toolbarTips)==null?void 0:et.orderedList,onClick:()=>{h("orderedList")}},[$(ce,{name:"ordered-list"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Pi=i.value.toolbarTips)==null?void 0:Pi.orderedList])]);case"task":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(dn=i.value.toolbarTips)==null?void 0:dn.task,onClick:()=>{h("task")}},[$(ce,{name:"task"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(pn=i.value.toolbarTips)==null?void 0:pn.task])]);case"codeRow":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(ao=i.value.toolbarTips)==null?void 0:ao.codeRow,onClick:()=>{h("codeRow")}},[$(ce,{name:"code-row"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(uo=i.value.toolbarTips)==null?void 0:uo.codeRow])]);case"code":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(In=i.value.toolbarTips)==null?void 0:In.code,onClick:()=>{h("code")}},[$(ce,{name:"code"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Xn=i.value.toolbarTips)==null?void 0:Xn.code])]);case"link":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(co=i.value.toolbarTips)==null?void 0:co.link,onClick:()=>{if(o!=null&&o.value)return!1;t.insertLinkDirect?h("link"):(f.type="link",f.linkVisible=!0)}},[$(ce,{name:"link"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(ho=i.value.toolbarTips)==null?void 0:ho.link])]);case"image":return t.noUploadImg?$("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(zn=i.value.toolbarTips)==null?void 0:zn.image,onClick:()=>{if(o!=null&&o.value)return!1;t.insertLinkDirect?h("image"):(f.type="image",f.linkVisible=!0)}},[$(ce,{name:"image"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(fo=i.value.toolbarTips)==null?void 0:fo.image])]):$(Bn,{relative:`#${a}`,visible:c.image,onChange:ie=>{c.image=ie},disabled:o==null?void 0:o.value,overlay:$("ul",{class:`${x}-menu`,onClick:()=>{c.image=!1},role:"menu"},[$("li",{class:`${x}-menu-item ${x}-menu-item-image`,onClick:()=>{t.insertLinkDirect?h("image"):(f.type="image",f.linkVisible=!0)},role:"menuitem",tabindex:"0"},[(po=i.value.imgTitleItem)==null?void 0:po.link]),$("li",{class:`${x}-menu-item ${x}-menu-item-image`,onClick:()=>{m.value.click()},role:"menuitem",tabindex:"0"},[(zr=i.value.imgTitleItem)==null?void 0:zr.upload]),$("li",{class:`${x}-menu-item ${x}-menu-item-image`,onClick:()=>{f.clipVisible=!0},role:"menuitem",tabindex:"0"},[(zh=i.value.imgTitleItem)==null?void 0:zh.clip2upload])])},{default:()=>{var ie,tt;return[$("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(ie=i.value.toolbarTips)==null?void 0:ie.image},[$(ce,{name:"image"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(tt=i.value.toolbarTips)==null?void 0:tt.image])])]}});case"table":return $(Bn,{relative:`#${a}`,visible:c.table,onChange:ie=>{c.table=ie},disabled:o==null?void 0:o.value,key:"bar-table",overlay:$(_5,{tableShape:t.tableShape,onSelected:ie=>{h("table",{selectedShape:ie})}},null)},{default:()=>{var ie,tt;return[$("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(ie=i.value.toolbarTips)==null?void 0:ie.table},[$(ce,{name:"table"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(tt=i.value.toolbarTips)==null?void 0:tt.table])])]}});case"revoke":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(jh=i.value.toolbarTips)==null?void 0:jh.revoke,onClick:()=>{if(o!=null&&o.value)return!1;X.emit(e,tm)}},[$(ce,{name:"revoke"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Fh=i.value.toolbarTips)==null?void 0:Fh.revoke])]);case"next":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(Bh=i.value.toolbarTips)==null?void 0:Bh.next,onClick:()=>{if(o!=null&&o.value)return!1;X.emit(e,im)}},[$(ce,{name:"next"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Vh=i.value.toolbarTips)==null?void 0:Vh.next])]);case"save":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(qh=i.value.toolbarTips)==null?void 0:qh.save,onClick:()=>{if(o!=null&&o.value)return!1;X.emit(e,Ul)}},[$(ce,{name:"save"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Wh=i.value.toolbarTips)==null?void 0:Wh.save])]);case"prettier":return t.noPrettier?"":$("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(Yh=i.value.toolbarTips)==null?void 0:Yh.prettier,onClick:()=>{h("prettier")}},[$(ce,{name:"prettier"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Nh=i.value.toolbarTips)==null?void 0:Nh.prettier])]);case"pageFullscreen":return!t.setting.fullscreen&&$("div",{class:[`${x}-toolbar-item`,t.setting.pageFullscreen&&`${x}-toolbar-active`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(Gh=i.value.toolbarTips)==null?void 0:Gh.pageFullscreen,onClick:()=>{if(o!=null&&o.value)return!1;t.updateSetting("pageFullscreen")}},[$(ce,{name:t.setting.pageFullscreen?"minimize":"maximize"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Uh=i.value.toolbarTips)==null?void 0:Uh.pageFullscreen])]);case"fullscreen":return $("div",{class:[`${x}-toolbar-item`,t.setting.fullscreen&&`${x}-toolbar-active`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(Hh=i.value.toolbarTips)==null?void 0:Hh.fullscreen,onClick:()=>{if(o!=null&&o.value)return!1;l()}},[$(ce,{name:t.setting.fullscreen?"fullscreen-exit":"fullscreen"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(Kh=i.value.toolbarTips)==null?void 0:Kh.fullscreen])]);case"preview":return $("div",{class:[`${x}-toolbar-item`,t.setting.preview&&`${x}-toolbar-active`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(Jh=i.value.toolbarTips)==null?void 0:Jh.preview,onClick:()=>{if(o!=null&&o.value)return!1;t.updateSetting("preview")}},[$(ce,{name:"preview"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(ef=i.value.toolbarTips)==null?void 0:ef.preview])]);case"previewOnly":return $("div",{class:[`${x}-toolbar-item`,t.setting.previewOnly&&`${x}-toolbar-active`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(tf=i.value.toolbarTips)==null?void 0:tf.previewOnly,onClick:()=>{if(o!=null&&o.value)return!1;t.updateSetting("previewOnly")}},[$(ce,{name:"preview-only"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(nf=i.value.toolbarTips)==null?void 0:nf.previewOnly])]);case"htmlPreview":return $("div",{class:[`${x}-toolbar-item`,t.setting.htmlPreview&&`${x}-toolbar-active`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(rf=i.value.toolbarTips)==null?void 0:rf.htmlPreview,onClick:()=>{if(o!=null&&o.value)return!1;t.updateSetting("htmlPreview")}},[$(ce,{name:"preview-html"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(sf=i.value.toolbarTips)==null?void 0:sf.htmlPreview])]);case"catalog":return $("div",{class:[`${x}-toolbar-item`,t.catalogVisible&&`${x}-toolbar-active`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(of=i.value.toolbarTips)==null?void 0:of.catalog,onClick:()=>{if(o!=null&&o.value)return!1;X.emit(e,Qc)},key:"bar-catalog"},[$(ce,{name:"catalog"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(lf=i.value.toolbarTips)==null?void 0:lf.catalog])]);case"github":return $("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(af=i.value.toolbarTips)==null?void 0:af.github,onClick:()=>{if(o!=null&&o.value)return!1;$v("https://github.com/imzbf/md-editor-v3")}},[$(ce,{name:"github"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(uf=i.value.toolbarTips)==null?void 0:uf.github])]);case"mermaid":return $(Bn,{relative:`#${a}`,visible:c.mermaid,onChange:ie=>{c.mermaid=ie},disabled:o==null?void 0:o.value,overlay:$("ul",{class:`${x}-menu`,onClick:()=>{c.mermaid=!1},role:"menu"},[$("li",{class:`${x}-menu-item ${x}-menu-item-mermaid`,onClick:()=>{h("flow")},role:"menuitem",tabindex:"0"},[(cf=i.value.mermaid)==null?void 0:cf.flow]),$("li",{class:`${x}-menu-item ${x}-menu-item-mermaid`,onClick:()=>{h("sequence")},role:"menuitem",tabindex:"0"},[(hf=i.value.mermaid)==null?void 0:hf.sequence]),$("li",{class:`${x}-menu-item ${x}-menu-item-mermaid`,onClick:()=>{h("gantt")},role:"menuitem",tabindex:"0"},[(ff=i.value.mermaid)==null?void 0:ff.gantt]),$("li",{class:`${x}-menu-item ${x}-menu-item-mermaid`,onClick:()=>{h("class")},role:"menuitem",tabindex:"0"},[(df=i.value.mermaid)==null?void 0:df.class]),$("li",{class:`${x}-menu-item ${x}-menu-item-mermaid`,onClick:()=>{h("state")},role:"menuitem",tabindex:"0"},[(pf=i.value.mermaid)==null?void 0:pf.state]),$("li",{class:`${x}-menu-item ${x}-menu-item-mermaid`,onClick:()=>{h("pie")},role:"menuitem",tabindex:"0"},[(mf=i.value.mermaid)==null?void 0:mf.pie]),$("li",{class:`${x}-menu-item ${x}-menu-item-mermaid`,onClick:()=>{h("relationship")},role:"menuitem",tabindex:"0"},[(Of=i.value.mermaid)==null?void 0:Of.relationship]),$("li",{class:`${x}-menu-item ${x}-menu-item-mermaid`,onClick:()=>{h("journey")},role:"menuitem",tabindex:"0"},[(gf=i.value.mermaid)==null?void 0:gf.journey])]),key:"bar-mermaid"},{default:()=>{var ie,tt;return[$("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(ie=i.value.toolbarTips)==null?void 0:ie.mermaid},[$(ce,{name:"mermaid"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(tt=i.value.toolbarTips)==null?void 0:tt.mermaid])])]}});case"katex":return $(Bn,{relative:`#${a}`,visible:c.katex,onChange:ie=>{c.katex=ie},disabled:o==null?void 0:o.value,overlay:$("ul",{class:`${x}-menu`,onClick:()=>{c.katex=!1},role:"menu"},[$("li",{class:`${x}-menu-item ${x}-menu-item-katex`,onClick:()=>{h("katexInline")},role:"menuitem",tabindex:"0"},[(bf=i.value.katex)==null?void 0:bf.inline]),$("li",{class:`${x}-menu-item ${x}-menu-item-katex`,onClick:()=>{h("katexBlock")},role:"menuitem",tabindex:"0"},[(vf=i.value.katex)==null?void 0:vf.block])]),key:"bar-katex"},{default:()=>{var ie,tt;return[$("div",{class:[`${x}-toolbar-item`,(o==null?void 0:o.value)&&`${x}-disabled`],title:(ie=i.value.toolbarTips)==null?void 0:ie.katex},[$(ce,{name:"formula"},null),t.showToolbarName&&$("div",{class:`${x}-toolbar-item-name`},[(tt=i.value.toolbarTips)==null?void 0:tt.katex])])]}})}else if(t.defToolbars instanceof Array){const ie=t.defToolbars[b];return ie?ys(ie,{theme:((yf=ie.props)==null?void 0:yf.theme)||n.value,previewTheme:((xf=ie.props)==null?void 0:xf.theme)||r.value,language:((kf=ie.props)==null?void 0:kf.theme)||s.value,codeTheme:((Sf=ie.props)==null?void 0:Sf.codeTheme)||t.codeTheme,disabled:((wf=ie.props)==null?void 0:wf.disabled)||(o==null?void 0:o.value),showToolbarName:(($f=ie.props)==null?void 0:$f.showToolbarName)||t.showToolbarName,insert(ba){X.emit(e,xe,"universal",{generate:ba})}}):""}else if(t.defToolbars&&t.defToolbars.children instanceof Array){const ie=t.defToolbars.children[b];return ie?ys(ie,{theme:((Qf=ie.props)==null?void 0:Qf.theme)||n.value,previewTheme:((_f=ie.props)==null?void 0:_f.theme)||r.value,language:((Pf=ie.props)==null?void 0:Pf.theme)||s.value,codeTheme:((Cf=ie.props)==null?void 0:Cf.codeTheme)||t.codeTheme,disabled:((Tf=ie.props)==null?void 0:Tf.disabled)||(o==null?void 0:o.value),showToolbarName:((Af=ie.props)==null?void 0:Af.showToolbarName)||t.showToolbarName,insert(ba){X.emit(e,xe,"universal",{generate:ba})}}):""}else return""};return te(()=>t.toolbars,()=>{li(()=>{u.value&&_v(u.value)})},{immediate:!0}),()=>{var b;const y=p.value[0].map(v=>g(v)),w=p.value[1].map(v=>g(v));return $(Gs,null,[t.toolbars.length>0&&$("div",{class:`${x}-toolbar-wrapper`,ref:u,id:a},[$("div",{class:[`${x}-toolbar`,t.showToolbarName&&`${x}-stn`]},[$("div",{class:`${x}-toolbar-left`,ref:d},[y]),$("div",{class:`${x}-toolbar-right`},[w])])]),$("label",{for:`${a}_label`,style:{display:"none"},"aria-label":(b=i.value.imgTitleItem)==null?void 0:b.upload},null),$("input",{id:`${a}_label`,ref:m,accept:"image/*",type:"file",multiple:!0,style:{display:"none"}},null),$(R5,{linkVisible:f.linkVisible,clipVisible:f.clipVisible,type:f.type,onCancel:()=>{f.linkVisible=!1,f.clipVisible=!1},onOk:v=>{v&&h(f.type,{desc:v.desc,url:v.url,transform:f.type==="image"}),f.linkVisible=!1,f.clipVisible=!1}},null)])}}}),L5=(t,e,i)=>{const n=H("editorId");let r=()=>{},s=()=>{};const o=()=>{var l;r();const a=(l=i.value)==null?void 0:l.view.contentDOM.getRootNode(),u=a.querySelector(`#${n} .cm-scroller`),c=a.querySelector(`[id="${n}-preview-wrapper"]`),h=a.querySelector(`[id="${n}-html-wrapper"]`);(c||h)&&([s,r]=(c?AS:TS)(u,c||h,i.value),t.scrollAuto&&s())};te([e,si(t.setting,"preview"),si(t.setting,"htmlPreview"),si(t.setting,"fullscreen"),si(t.setting,"pageFullscreen")],()=>{li(o)}),te(()=>t.scrollAuto,l=>{l?s():r()}),te(()=>t.setting.previewOnly,l=>{l?r():s()}),Ae(o)},fu=async(t,e,i)=>{if(/^h[1-6]$/.test(t))return M5(t,e);if(t==="prettier")return await Z5(e,i);switch(t){case"bold":case"underline":case"italic":case"strikeThrough":case"sub":case"sup":case"codeRow":case"katexInline":case"katexBlock":return X5(t,e);case"quote":case"orderedList":case"unorderedList":case"task":return j5(t,e);case"code":return F5(i,e);case"table":return q5(i);case"link":{const{desc:n="",url:r=""}=i,s=`[${n}](${r})`;return{text:s,options:{select:r==="",deviationStart:s.length-r.length-1,deviationEnd:-1}}}case"image":return V5(i);case"flow":case"sequence":case"gantt":case"class":case"state":case"pie":case"relationship":case"journey":return B5(t);case"universal":return W5(e.getSelectedText(),i);default:return{text:"",options:{}}}},M5=(t,e)=>{const i=t.slice(1),n="#".repeat(Number(i)),[r,s,o]=Zh(e,{wholeLine:!0});return{text:`${n} ${r}`,options:{deviationStart:n.length+1,replaceStart:s,replaceEnd:o}}},Z5=async(t,e)=>{var i,n,r;const s=window.prettier||((i=Me.editorExtensions.prettier)==null?void 0:i.prettierInstance),o=[((n=window.prettierPlugins)==null?void 0:n.markdown)||((r=Me.editorExtensions.prettier)==null?void 0:r.parserMarkdownInstance)];return!s||!o[0]?(X.emit(e.editorId,hn,{name:"prettier",message:"prettier is undefined"}),{text:t.getValue(),options:{select:!1,replaceAll:!0}}):{text:await s.format(t.getValue(),{parser:"markdown",plugins:o}),options:{select:!1,replaceAll:!0}}},I5={bold:["**","**",2,-2],underline:["","",3,-4],italic:["*","*",1,-1],strikeThrough:["~~","~~",2,-2],sub:["~","~",1,-1],sup:["^","^",1,-1],codeRow:["`","`",1,-1],katexInline:["$","$",1,-1],katexBlock:[` $$ `,` $$ `,4,-4]},X5=(t,e)=>{const i=e.getSelectedText(),[n,r,s,o]=I5[t];return{text:`${n}${i}${r}`,options:{deviationStart:s,deviationEnd:o}}},z5={quote:"> ",unorderedList:"- ",orderedList:1,task:"- [ ] "},j5=(t,e)=>{const[i,n,r]=Zh(e,{wholeLine:!0}),s=i.split(` `),o=z5[t],l=t==="orderedList"?s.map((c,h)=>`${o+h}. ${c}`):s.map(c=>`${o}${c}`),a=t==="orderedList"?"1. ":o.toString(),u=s.length===1?a.length:0;return{text:l.join(` `),options:{deviationStart:u,replaceStart:n,replaceEnd:r}}},F5=(t,e)=>{const[i,n,r]=Zh(e),s=t.mode||"language",o=` \`\`\`${s} ${t.text||i||""} \`\`\` `;return{text:o,options:{deviationStart:4,deviationEnd:4+s.length-o.length,replaceStart:n,replaceEnd:r}}},B5=t=>({text:` \`\`\`mermaid ${{flow:`flowchart TD Start --> Stop`,sequence:`sequenceDiagram A->>B: hello! B-->>A: hi!`,gantt:`gantt title Gantt Chart dateFormat YYYY-MM-DD`,class:`classDiagram class Animal`,state:`stateDiagram-v2 s1 --> s2`,pie:`pie "Dogs" : 386 "Cats" : 85 "Rats" : 15`,relationship:`erDiagram CAR ||--o{ NAMED-DRIVER : allows`,journey:`journey title My Journey`,...Me.editorConfig.mermaidTemplate}[t]} \`\`\` `,options:{deviationStart:12,deviationEnd:-5}}),V5=t=>{const{desc:e="",url:i="",urls:n}=t;let r="";const s=i===""&&(!n||n instanceof Array&&n.length===0);return n instanceof Array?r=n.reduce((o,l)=>{const{url:a="",alt:u="",title:c=""}=typeof l=="object"?l:{url:l};return o+`![${u}](${a}${c?" '"+c+"'":""}) `},""):r=`![${e}](${i}) `,{text:r,options:{select:i==="",deviationStart:s?r.length-i.length-2:r.length,deviationEnd:s?-2:0}}},q5=t=>{const{selectedShape:e={x:1,y:1}}=t,{x:i,y:n}=e;let r=` | Column`;for(let s=0;s<=n;s++)r+=" |";r+=` |`;for(let s=0;s<=n;s++)r+=" - |";for(let s=0;s<=i;s++){r+=` |`;for(let o=0;o<=n;o++)r+=" |"}return r+=` `,{text:r,options:{deviationStart:3,deviationEnd:10-r.length}}},W5=(t,e)=>{const{generate:i}=e,n=i(t);return{text:n.targetValue,options:{select:n.select??!0,deviationStart:n.deviationStart||0,deviationEnd:n.deviationEnd||0}}},Zh=(t,e={wholeLine:!1})=>{const i=t.view.state,n=i.selection.main;if(n.empty){const r=i.doc.lineAt(n.from);return[i.doc.lineAt(n.from).text,r.from,r.to]}else if(e.wholeLine){const r=i.doc.lineAt(n.from),s=i.doc.lineAt(n.to);return[i.doc.sliceString(r.from,s.to),r.from,s.to]}return[i.doc.sliceString(n.from,n.to),n.from,n.to]},Y5="#e5c07b",Ap="var(--md-color)",N5="#56b6c2",G5="#ffffff",is="var(--md-color)",Ep="#e5c07b",U5="#e5c07b",H5="var(--md-color)",Rp="#d19a66",K5="#c678dd",J5="#21252b",e6="#2c313a",Dp="var(--md-bk-color)",du="var(--md-bk-color)",t6="#ceedfa33",Lp="#528bff",i6=W.theme({"&":{color:is,backgroundColor:Dp},".cm-content":{caretColor:Lp},".cm-cursor, .cm-dropCursor":{borderLeftColor:Lp},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:t6},".cm-panels":{backgroundColor:J5,color:is},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Dp,color:is,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:e6},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:du},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:du,borderBottomColor:du},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:is}}},{dark:!0}),n6=ro.define([{tag:k.keyword,color:K5},{tag:[k.name,k.deleted,k.character,k.propertyName,k.macroName],color:Ap},{tag:[k.function(k.variableName),k.labelName],color:U5},{tag:[k.color,k.constant(k.name),k.standard(k.name)],color:Rp},{tag:[k.definition(k.name),k.separator],color:is},{tag:[k.typeName,k.className,k.number,k.changed,k.annotation,k.modifier,k.self,k.namespace],color:Y5},{tag:[k.operator,k.operatorKeyword,k.url,k.escape,k.regexp,k.link,k.special(k.string)],color:N5},{tag:[k.meta,k.comment],color:Ep},{tag:k.strong,fontWeight:"bold"},{tag:k.emphasis,fontStyle:"italic"},{tag:k.strikethrough,textDecoration:"line-through"},{tag:k.link,color:Ep,textDecoration:"underline"},{tag:k.heading,fontWeight:"bold",color:Ap},{tag:[k.atom,k.bool,k.special(k.variableName)],color:Rp},{tag:[k.processingInstruction,k.string,k.inserted],color:H5},{tag:k.invalid,color:G5}]),Mp=[i6,Eg(n6)],r6="#e5c07b",Zp="var(--md-color)",s6="#56b6c2",o6="#fff",ns="#3f4a54",Ip="#2d8cf0",l6="#2d8cf0",a6="#3f4a54",Xp="#d19a66",u6="#c678dd",c6="#f6f6f6",h6="#ceedfa33",zp="var(--md-bk-color)",pu="var(--md-bk-color)",f6="#bad5fa",jp="#3f4a54",d6=W.theme({"&":{color:ns,backgroundColor:zp},".cm-content":{caretColor:jp},".cm-cursor, .cm-dropCursor":{borderLeftColor:jp},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:f6},".cm-panels":{backgroundColor:c6,color:ns},".cm-panels.cm-panels-top":{borderBottom:"1px solid var(--md-border-color)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--md-border-color)"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#ceedfa33"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:zp,color:ns,borderRight:"1px solid",borderColor:"var(--md-border-color)"},".cm-activeLineGutter":{backgroundColor:h6},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"1px solid var(--md-border-color)",backgroundColor:pu},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:pu,borderBottomColor:pu},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{color:ns}}}),p6=ro.define([{tag:k.keyword,color:u6},{tag:[k.name,k.deleted,k.character,k.propertyName,k.macroName],color:Zp},{tag:[k.function(k.variableName),k.labelName],color:l6},{tag:[k.color,k.constant(k.name),k.standard(k.name)],color:Xp},{tag:[k.definition(k.name),k.separator],color:ns},{tag:[k.typeName,k.className,k.number,k.changed,k.annotation,k.modifier,k.self,k.namespace],color:r6},{tag:[k.operator,k.operatorKeyword,k.url,k.escape,k.regexp,k.link,k.special(k.string)],color:s6},{tag:[k.meta,k.comment],color:Ip},{tag:k.strong,fontWeight:"bold"},{tag:k.emphasis,fontStyle:"italic"},{tag:k.strikethrough,textDecoration:"line-through"},{tag:k.link,color:Ip,textDecoration:"underline"},{tag:k.heading,fontWeight:"bold",color:Zp},{tag:[k.atom,k.bool,k.special(k.variableName)],color:Xp},{tag:[k.processingInstruction,k.string,k.inserted],color:a6},{tag:k.invalid,color:o6}]),Fp=[d6,Eg(p6)],qo=(t,e,i,n,r)=>(s,o,l,a)=>{const u=`${t}${e}${i}${n}`,c=l+o.label.length+(r==="title"?i.length:0);s.dispatch({changes:{from:l,to:a,insert:u},selection:E.create([E.range(l+o.label.length+(r==="title"?1:-e.length),c),E.cursor(c)],1)}),s.focus()},Bp=t=>(e,i,n,r)=>{const s=t.slice(r-n);e.dispatch(e.state.replaceSelection(`${s} `))},Vp=t=>{const e=i=>{const n=i.matchBefore(/^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|\$\$?|!+\s*\w*/);return n===null||n.from==n.to&&i.explicit?null:{from:n.from,options:[...["h2","h3","h4","h5","h6"].map((r,s)=>{const o=new Array(s+2).fill("#").join("");return{label:o,type:"text",apply:Bp(o)}}),...["unchecked","checked"].map(r=>{const s=r==="checked"?"- [x]":"- [ ]";return{label:s,type:"text",apply:Bp(s)}}),...[["`",""],["```","language"],["```mermaid\n",""]].map(r=>({label:`${r[0]}${r[1]}`,type:"text",apply:qo(r[0],r[1],"",r[0]==="`"?"`":"\n```","type")})),{label:"[]()",type:"text"},{label:"![]()",type:"text"},{label:"| |",type:"text",detail:"table",apply:`| col | col | col | | - | - | - | | content | content | content | | content | content | content |`},{label:"$",type:"text",apply:qo("$","","","$","type")},{label:"$$",type:"text",apply:qo("$$","",` `,` $$`,"title")},...["note","abstract","info","tip","success","question","warning","failure","danger","bug","example","quote","hint","caution","error","attention"].map(r=>({label:`!!! ${r}`,type:"text",apply:qo("!!!",` ${r}`," Title",` !!!`,"title")}))]}};return dP({override:t?[e,...t]:[e]})},Fn=t=>{const e=new gi;return n=>(e.get(t.state)?t.dispatch({effects:e.reconfigure(n)}):t.dispatch({effects:ae.appendConfig.of(e.of(n))}),!0)};class m6{constructor(e){Fi(this,"view"),Fi(this,"maxLength",Number.MAX_SAFE_INTEGER),Fi(this,"toggleTabSize"),Fi(this,"togglePlaceholder"),Fi(this,"setExtensions"),Fi(this,"toggleDisabled"),Fi(this,"toggleReadOnly"),Fi(this,"toggleMaxlength"),this.view=e,this.toggleTabSize=Fn(this.view),this.togglePlaceholder=Fn(this.view),this.setExtensions=Fn(this.view),this.toggleDisabled=Fn(this.view),this.toggleReadOnly=Fn(this.view),this.toggleMaxlength=Fn(this.view)}getValue(){return this.view.state.doc.toString()}setValue(e,i=0,n=this.view.state.doc.length){this.view.dispatch({changes:{from:i,to:n,insert:e}})}getSelectedText(){const{from:e,to:i}=this.view.state.selection.main;return this.view.state.sliceDoc(e,i)}replaceSelectedText(e,i,n){const r={select:!0,deviationStart:0,deviationEnd:0,replaceAll:!1,replaceStart:-1,replaceEnd:-1,...i};try{if(r.replaceAll){if(this.setValue(e),e.length>this.maxLength)throw new Error("The input text is too long");return}if(this.view.state.doc.length-this.getSelectedText().length+e.length>this.maxLength)throw new Error("The input text is too long");const{from:s}=this.view.state.selection.main;r.replaceStart!==-1?this.view.dispatch({changes:{from:r.replaceStart,to:r.replaceEnd,insert:e}}):this.view.dispatch(this.view.state.replaceSelection(e)),r.select&&this.view.dispatch({selection:{anchor:r.replaceStart===-1?s+r.deviationStart:r.replaceStart+r.deviationStart,head:r.replaceStart===-1?s+e.length+r.deviationEnd:r.replaceStart+e.length+r.deviationEnd}}),this.view.focus()}catch(s){if(s.message==="The input text is too long")X.emit(n,hn,{name:"overlength",message:s.message,data:e});else throw s}}setTabSize(e){this.toggleTabSize([fe.tabSize.of(e),Lr.of(" ".repeat(e))])}setPlaceholder(e){this.togglePlaceholder(K3(e))}focus(e){if(this.view.focus(),!e)return;let i=0,n=0,r=0;switch(e){case"start":break;case"end":{i=n=r=this.getValue().length;break}default:i=e.rangeAnchor||e.cursorPos,n=e.rangeHead||e.cursorPos,r=e.cursorPos}this.view.dispatch({scrollIntoView:!0,selection:E.create([E.range(i,n),E.cursor(r)],1)})}setDisabled(e){this.toggleDisabled([W.editable.of(!e)])}setReadOnly(e){this.toggleReadOnly([fe.readOnly.of(e)])}setMaxLength(e){this.maxLength=e,this.toggleMaxlength([fe.changeFilter.of(i=>i.newDoc.length<=e)])}}const O6=(t,e)=>{const i=H("editorId"),n=s=>{s instanceof Promise?s.then(o=>{X.emit(i,xe,"universal",{generate(){return{targetValue:o}}})}).catch(o=>{console.error(o)}):X.emit(i,xe,"universal",{generate(){return{targetValue:s}}})};return s=>{var o,l,a;if(!s.clipboardData)return;if(s.clipboardData.files.length>0){const{files:m}=s.clipboardData;X.emit(i,Hl,Array.from(m).filter(O=>/image\/.*/.test(O.type))),s.preventDefault();return}const u=s.clipboardData.getData("text/plain"),c=((o=e.value)==null?void 0:o.view.state.selection.main.to)||0,h=((l=e.value)==null?void 0:l.view.state.doc.lineAt(c).from)||0,f=((a=e.value)==null?void 0:a.view.state.doc.sliceString(h,c))||"",d=/!\[.*\]\(\s*$/.test(f),p=/!\[.*\]\((.*)\s?.*\)/.test(u);if(d){const m=t.transformImgUrl(u);n(m),s.preventDefault();return}else if(p){const m=u.match(new RegExp(`(?<=!\\[.*\\]\\()([^)\\s]+)(?=\\s?["']?.*["']?\\))`,"g"));m?Promise.all(m.map(O=>t.transformImgUrl(O))).then(O=>{n(O.reduce((g,b,y)=>g.replace(m[y],b),u))}):n(u),s.preventDefault();return}if(t.autoDetectCode&&s.clipboardData.types.includes("vscode-editor-data")){const m=JSON.parse(s.clipboardData.getData("vscode-editor-data"));X.emit(i,xe,"code",{mode:m.mode,text:s.clipboardData.getData("text/plain")}),s.preventDefault();return}t.maxlength&&u.length+t.modelValue.length>t.maxlength&&X.emit(i,hn,{name:"overlength",message:"The input text is too long",data:u})}},g6=(t,e)=>[{key:"Ctrl-b",mac:"Cmd-b",run:()=>(X.emit(t,xe,"bold"),!0)},{key:"Ctrl-d",mac:"Cmd-d",run:m1,preventDefault:!0},{key:"Ctrl-s",mac:"Cmd-s",run:w=>(X.emit(t,Ul,w.state.doc.toString()),!0),shift:()=>(X.emit(t,xe,"strikeThrough"),!0)},{key:"Ctrl-u",mac:"Cmd-u",preventDefault:!0,run:()=>(X.emit(t,xe,"underline"),!0),shift:()=>(X.emit(t,xe,"unorderedList"),!0)},{key:"Ctrl-i",mac:"Cmd-i",preventDefault:!0,run:()=>(X.emit(t,xe,"italic"),!0),shift:()=>(X.emit(t,bu,"image"),!0)},{key:"Ctrl-1",mac:"Cmd-1",run:()=>(X.emit(t,xe,"h1"),!0)},{key:"Ctrl-2",mac:"Cmd-2",run:()=>(X.emit(t,xe,"h2"),!0)},{key:"Ctrl-3",mac:"Cmd-3",run:()=>(X.emit(t,xe,"h3"),!0)},{key:"Ctrl-4",mac:"Cmd-4",run:()=>(X.emit(t,xe,"h4"),!0)},{key:"Ctrl-5",mac:"Cmd-5",run:()=>(X.emit(t,xe,"h5"),!0)},{key:"Ctrl-6",mac:"Cmd-6",run:()=>(X.emit(t,xe,"h6"),!0)},{key:"Ctrl-ArrowUp",mac:"Cmd-ArrowUp",run:()=>(X.emit(t,xe,"sup"),!0)},{key:"Ctrl-ArrowDown",mac:"Cmd-ArrowDown",run:()=>(X.emit(t,xe,"sub"),!0)},{key:"Ctrl-o",mac:"Cmd-o",run:()=>(X.emit(t,xe,"orderedList"),!0)},{key:"Ctrl-c",mac:"Cmd-c",shift:()=>(X.emit(t,xe,"code"),!0),any(w,v){return(v.ctrlKey||v.metaKey)&&v.altKey&&v.code==="KeyC"?(X.emit(t,xe,"codeRow"),!0):!1}},{key:"Ctrl-l",mac:"Cmd-l",run:()=>(X.emit(t,bu,"link"),!0)},{key:"Ctrl-f",mac:"Cmd-f",shift:()=>e.noPrettier?!1:(X.emit(t,xe,"prettier"),!0)},{any:(w,v)=>(v.ctrlKey||v.metaKey)&&v.altKey&&v.shiftKey&&v.code==="KeyT"?(X.emit(t,xe,"table"),!0):!1},...Q_];W.EDIT_CONTEXT=!1;const b6=t=>{const e=H("tabWidth"),i=H("editorId"),n=H("theme"),r=pe(),s=Tn(),o=pe(!1),l=new gi,a=new gi,u=new gi,c=new gi,h=new gi,f=g6(i,t),d=()=>[...f,...l_,...mQ,a_],m={paste:O6(t,s),blur:t.onBlur,focus:t.onFocus,drop:t.onDrop,compositionstart:()=>{o.value=!0},compositionend:(b,y)=>{o.value=!1,t.updateModelValue(y.state.doc.toString())},input:b=>{t.onInput&&t.onInput(b);const{data:y}=b;t.maxlength&&t.modelValue.length+y.length>t.maxlength&&X.emit(i,hn,{name:"overlength",message:"The input text is too long",data:y})}},O=[io.of(d()),c.of(Q0()),l.of(iv({codeLanguages:OP})),W.lineWrapping,W.updateListener.of(b=>{b.docChanged&&(t.onChange(b.state.doc.toString()),o.value||t.updateModelValue(b.state.doc.toString()))}),h.of(W.domEventHandlers(m)),Y3()],g=()=>{const b=[...O,a.of(n.value==="light"?Fp:Mp),u.of(Vp(t.completions))];return Me.codeMirrorExtensions(n.value,b,d(),{editorId:i})};return Ae(()=>{const b=new W({doc:t.modelValue,parent:r.value,extensions:[g()]}),y=new m6(b);s.value=y,setTimeout(()=>{y.setTabSize(e),y.setDisabled(t.disabled),y.setReadOnly(t.readonly),t.placeholder&&y.setPlaceholder(t.placeholder),typeof t.maxlength=="number"&&y.setMaxLength(t.maxlength),t.autofocus&&b.focus()},0),X.on(i,{name:tm,callback(){lh(b)}}),X.on(i,{name:im,callback(){El(b)}}),X.on(i,{name:xe,async callback(w,v={}){var Q,P;if(w==="image"&&v.transform){const _=t.transformImgUrl(v.url);if(_ instanceof Promise)_.then(async R=>{var L;const{text:I,options:T}=await fu(w,s.value,{...v,url:R});(L=s.value)==null||L.replaceSelectedText(I,T,i)}).catch(R=>{console.error(R)});else{const{text:R,options:L}=await fu(w,s.value,{...v,url:_});(Q=s.value)==null||Q.replaceSelectedText(R,L,i)}}else{const{text:_,options:R}=await fu(w,s.value,v);(P=s.value)==null||P.replaceSelectedText(_,R,i)}}}),X.on(i,{name:rm,callback:Qv(w=>{var v;const Q={...m},P=Object.keys(m);for(const _ in w){const R=_;P.includes(R)?Q[R]=(L,I)=>{w[R](L,I),L.defaultPrevented||m[R](L,I)}:Q[R]=w[R]}(v=s.value)==null||v.view.dispatch({effects:h.reconfigure(W.domEventHandlers(Q))})})}),X.on(i,{name:sm,callback:(w,v)=>{const Q=b.state.doc.line(w);b.dispatch(b.state.update({changes:{from:Q.from,to:Q.to,insert:v}}))}}),X.on(i,{name:om,callback(){X.emit(i,pl,b)}}),X.emit(i,pl,b)}),te(n,()=>{var b;(b=s.value)==null||b.view.dispatch({effects:a.reconfigure(n.value==="light"?Fp:Mp)})},{deep:!0}),te(()=>t.completions,()=>{var b;(b=s.value)==null||b.view.dispatch({effects:u.reconfigure(Vp(t.completions))})},{deep:!0}),te(()=>t.modelValue,()=>{var b,y;((b=s.value)==null?void 0:b.getValue())!==t.modelValue&&((y=s.value)==null||y.setValue(t.modelValue))}),te(()=>t.placeholder,()=>{var b;(b=s.value)==null||b.setPlaceholder(t.placeholder)}),te(()=>t.disabled,()=>{var b;(b=s.value)==null||b.setDisabled(t.disabled)}),te(()=>t.readonly,()=>{var b;(b=s.value)==null||b.setDisabled(t.readonly)}),te(()=>t.maxlength,()=>{var b;t.maxlength&&((b=s.value)==null||b.setMaxLength(t.maxlength))}),{inputWrapperRef:r,codeMirrorUt:s,resetHistory(){var b,y;(b=s.value)==null||b.view.dispatch({effects:c.reconfigure([])}),(y=s.value)==null||y.view.dispatch({effects:c.reconfigure(Q0())})}}},v6=(t,e,i)=>{const n=He(()=>/px$/.test(`${t.inputBoxWidth}`)?"50%":t.inputBoxWidth),r=ct({resizedWidth:n.value}),s=ct({width:n.value}),o=ct({left:n.value,display:"initial"}),l=c=>{var h,f,d;const p=((h=e.value)==null?void 0:h.offsetWidth)||0,m=((f=e.value)==null?void 0:f.getBoundingClientRect().x)||0;let O=c.x-m;O/pp-p*Oo&&(O=p-p*Oo);const g=`${O/p*100}%`;s.width=g,o.left=g,r.resizedWidth=g,(d=t.oninputBoxWidthChange)==null||d.call(t,g)},a=c=>{c.target===i.value&&document.addEventListener("mousemove",l)},u=()=>{document.removeEventListener("mousemove",l)};return te([i],()=>{document.removeEventListener("mousedown",a),document.removeEventListener("mouseup",u),document.addEventListener("mousedown",a),document.addEventListener("mouseup",u)}),Ae(()=>{document.addEventListener("mousedown",a),document.addEventListener("mouseup",u)}),Mn(()=>{document.removeEventListener("mousedown",a),document.removeEventListener("mouseup",u)}),te([n],([c])=>{r.resizedWidth=c,s.width=c,o.left=c}),te([si(t.setting,"htmlPreview"),si(t.setting,"preview"),si(t.setting,"previewOnly")],()=>{t.setting.previewOnly?(s.width="0%",o.display="none"):!t.setting.htmlPreview&&!t.setting.preview?(s.width="100%",o.display="none"):(s.width=r.resizedWidth,o.display="initial")},{immediate:!0}),{inputWrapperStyle:s,resizeOperateStyle:o}},y6=Jp(),x6=Te({name:"MDEditorContent",props:Tk,setup(t,e){const i=H("editorId"),n=pe(""),r=pe(),s=pe(),{inputWrapperRef:o,codeMirrorUt:l,resetHistory:a}=b6(t),{inputWrapperStyle:u,resizeOperateStyle:c}=v6(t,r,s);return L5(t,n,l),e.expose({getSelectedText(){var h;return(h=l.value)==null?void 0:h.getSelectedText()},focus(h){var f;(f=l.value)==null||f.focus(h)},resetHistory:a,getEditorView(){var h;return(h=l.value)==null?void 0:h.view}}),()=>$("div",{class:`${x}-content`},[$("div",{class:`${x}-content-wrapper`,ref:r},[$("div",{class:`${x}-input-wrapper`,style:u,ref:o},null),(t.setting.htmlPreview||t.setting.preview)&&$("div",{class:`${x}-resize-operate`,style:c,ref:s},null),$(Vm,{modelValue:t.modelValue,onChange:t.onChange,setting:t.setting,onHtmlChanged:h=>{n.value=h,t.onHtmlChanged(h)},onGetCatalog:t.onGetCatalog,mdHeadingId:t.mdHeadingId,noMermaid:t.noMermaid,sanitize:t.sanitize,noKatex:t.noKatex,formatCopiedText:t.formatCopiedText,noHighlight:t.noHighlight,noImgZoomIn:t.noImgZoomIn,sanitizeMermaid:t.sanitizeMermaid,codeFoldable:t.codeFoldable,autoFoldThreshold:t.autoFoldThreshold,onRemount:t.onRemount},null)]),t.catalogVisible&&$(Jn,{theme:t.theme,class:`${x}-catalog-editor ${x}-catalog-${t.catalogLayout}`,editorId:i,mdHeadingId:t.mdHeadingId,key:"internal-catalog",scrollElementOffsetTop:2,syncWith:t.setting.preview?"preview":"editor",onClick:(h,f)=>{var d,p;if(!t.setting.preview&&f.line!==void 0){h.preventDefault();const m=(d=l.value)==null?void 0:d.view;if(m){const O=m.state.doc.line(f.line+1),g=(p=m.lineBlockAt(O.from))==null?void 0:p.top,b=m.scrollDOM;y6(b,g)}}},catalogMaxDepth:t.catalogMaxDepth},null)])}}),k6=Te({props:{modelValue:{type:String,default:""}},setup(t){const e=H("usedLanguageText");return()=>{var i,n;return $("div",{class:`${x}-footer-item`},[$("label",{class:`${x}-footer-label`},[`${(i=e.value.footer)==null?void 0:i.markdownTotal}:`]),$("span",null,[((n=t.modelValue)==null?void 0:n.length)||0])])}}}),S6={checked:{type:Boolean,default:!1},onChange:{type:Function,default:()=>{}},disabled:{type:Boolean,default:void 0}},w6=Te({name:`${x}-checkbox`,props:S6,setup(t){return()=>$("div",{class:[`${x}-checkbox`,t.checked&&`${x}-checkbox-checked`,t.disabled&&`${x}-disabled`],onClick:()=>{t.disabled||t.onChange(!t.checked)}},null)}}),$6={scrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}}},Q6=Te({props:$6,setup(t){const e=H("usedLanguageText"),i=H("disabled");return()=>{var n;return $("div",{class:[`${x}-footer-item`,(i==null?void 0:i.value)&&`${x}-disabled`]},[$("label",{class:`${x}-footer-label`,onClick:()=>{t.onScrollAutoChange(!t.scrollAuto)}},[(n=e==null?void 0:e.value.footer)==null?void 0:n.scrollAuto]),$(w6,{checked:t.scrollAuto,onChange:t.onScrollAutoChange,disabled:i==null?void 0:i.value},null)])}}}),_6={modelValue:{type:String,default:""},footers:{type:Array,default:[]},scrollAuto:{type:Boolean},noScrollAuto:{type:Boolean},onScrollAutoChange:{type:Function,default:()=>{}},defFooters:{type:Object}},P6=Te({name:"MDEditorFooter",props:_6,setup(t){const e=H("theme"),i=H("language"),n=H("disabled"),r=He(()=>{const o=t.footers.indexOf("="),l=o===-1?t.footers:t.footers.slice(0,o),a=o===-1?[]:t.footers.slice(o,Number.MAX_SAFE_INTEGER);return[l,a]}),s=o=>{var l,a,u,c,h,f;if($c.includes(o))switch(o){case"markdownTotal":return $(k6,{modelValue:t.modelValue},null);case"scrollSwitch":return!t.noScrollAuto&&$(Q6,{scrollAuto:t.scrollAuto,onScrollAutoChange:t.onScrollAutoChange},null)}else if(t.defFooters instanceof Array){const d=t.defFooters[o];return d?ys(d,{theme:((l=d.props)==null?void 0:l.theme)||e.value,language:((a=d.props)==null?void 0:a.language)||i.value,disabled:((u=d.props)==null?void 0:u.disabled)||(n==null?void 0:n.value)}):""}else if(t.defFooters&&t.defFooters.children instanceof Array){const d=t.defFooters.children[o];return d?ys(d,{theme:((c=d.props)==null?void 0:c.theme)||e.value,language:((h=d.props)==null?void 0:h.language)||i.value,disabled:((f=d.props)==null?void 0:f.disabled)||(n==null?void 0:n.value)}):""}else return""};return()=>{const o=r.value[0].map(a=>s(a)),l=r.value[1].map(a=>s(a));return $("div",{class:`${x}-footer`},[$("div",{class:`${x}-footer-left`},[o]),$("div",{class:`${x}-footer-right`},[l])])}}}),ul=Te({name:"MdEditorV3",props:Bk,emits:Vk,setup(t,e){const{noKatex:i,noMermaid:n,noPrettier:r,noUploadImg:s,noHighlight:o}=t,l=ct({scrollAuto:t.scrollAuto}),a=pe(),u=pe(),{editorId:c}=Lk(t,a),[h,f]=Ik(t,e,{editorId:c}),d=Xk(t,{editorId:c});return Dk(t,e,{editorId:c}),Mk(t),Zk(t,e,{editorId:c}),zk(t,e,{editorId:c,catalogVisible:d,setting:h,updateSetting:f,codeRef:u}),Mn(()=>{X.clear(c)}),()=>{const p=ht({props:t,ctx:e},"defToolbars"),m=ht({props:t,ctx:e},"defFooters");return $("div",{id:c,class:[x,t.class,t.theme==="dark"&&`${x}-dark`,h.fullscreen||h.pageFullscreen?`${x}-fullscreen`:""],style:t.style,ref:a},[t.toolbars.length>0&&$(D5,{noPrettier:r,toolbars:t.toolbars,toolbarsExclude:t.toolbarsExclude,setting:h,updateSetting:f,tableShape:t.tableShape,defToolbars:p,noUploadImg:s,showToolbarName:t.showToolbarName,catalogVisible:d.value,codeTheme:t.codeTheme,insertLinkDirect:t.insertLinkDirect},null),$(x6,{ref:u,modelValue:t.modelValue,setting:h,mdHeadingId:t.mdHeadingId,noMermaid:n,noPrettier:r,sanitize:t.sanitize,placeholder:t.placeholder,noKatex:i,scrollAuto:l.scrollAuto,formatCopiedText:t.formatCopiedText,autofocus:t.autoFocus,disabled:t.disabled,readonly:t.readOnly,maxlength:t.maxLength,autoDetectCode:t.autoDetectCode,noHighlight:o,updateModelValue:O=>{e.emit("update:modelValue",O)},onChange:O=>{var g;(g=t.onChange)==null||g.call(t,O),e.emit("onChange",O)},onHtmlChanged:O=>{var g;(g=t.onHtmlChanged)==null||g.call(t,O),e.emit("onHtmlChanged",O)},onGetCatalog:O=>{var g;(g=t.onGetCatalog)==null||g.call(t,O),e.emit("onGetCatalog",O)},onBlur:O=>{var g;(g=t.onBlur)==null||g.call(t,O),e.emit("onBlur",O)},onFocus:O=>{var g;(g=t.onFocus)==null||g.call(t,O),e.emit("onFocus",O)},onInput:O=>{var g;(g=t.onInput)==null||g.call(t,O),e.emit("onInput",O)},completions:t.completions,catalogVisible:d.value,theme:t.theme,noImgZoomIn:t.noImgZoomIn,onDrop:O=>{var g;(g=t.onDrop)==null||g.call(t,O),e.emit("onDrop",O)},inputBoxWidth:t.inputBoxWidth,oninputBoxWidthChange:O=>{var g;(g=t.oninputBoxWidthChange)==null||g.call(t,O),e.emit("oninputBoxWidthChange",O)},sanitizeMermaid:t.sanitizeMermaid,transformImgUrl:t.transformImgUrl,codeFoldable:t.codeFoldable,autoFoldThreshold:t.autoFoldThreshold,onRemount:()=>{var O;(O=t.onRemount)==null||O.call(t),e.emit("onRemount")},catalogLayout:t.catalogLayout,catalogMaxDepth:t.catalogMaxDepth},null),t.footers.length>0&&$(P6,{modelValue:t.modelValue,footers:t.footers,defFooters:m,noScrollAuto:!h.preview&&!h.htmlPreview||h.previewOnly,scrollAuto:l.scrollAuto,onScrollAutoChange:O=>l.scrollAuto=O},null)])}}});ul.install=t=>(t.component(ul.name,ul),t.use(gs).use(rs).use(bs).use(Jn).use(ls),t);const C6=dl["zh-CN"],T6=dl["en-US"];function A6(t,e){for(var i=0;in[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const E6={onClick:{type:Function,default:void 0},language:{type:String,default:void 0},theme:{type:String,default:void 0},disabled:{type:Boolean,default:void 0}},cl=Te({name:"NormalFooterToolbar",props:E6,emits:["onClick"],setup(t,e){return()=>{const i=ht({props:t,ctx:e});return $("div",{class:[`${x}-footer-item`,t.disabled&&`${x}-disabled`],onClick:n=>{var r;t.disabled||((r=t.onClick)==null||r.call(t,n),e.emit("onClick",n))}},[i])}}});cl.install=t=>(t.component(cl.name,cl),t);function R6(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var kc={exports:{}},Ee={},Sc={exports:{}},Zn={};function rv(){var t={};return t["align-content"]=!1,t["align-items"]=!1,t["align-self"]=!1,t["alignment-adjust"]=!1,t["alignment-baseline"]=!1,t.all=!1,t["anchor-point"]=!1,t.animation=!1,t["animation-delay"]=!1,t["animation-direction"]=!1,t["animation-duration"]=!1,t["animation-fill-mode"]=!1,t["animation-iteration-count"]=!1,t["animation-name"]=!1,t["animation-play-state"]=!1,t["animation-timing-function"]=!1,t.azimuth=!1,t["backface-visibility"]=!1,t.background=!0,t["background-attachment"]=!0,t["background-clip"]=!0,t["background-color"]=!0,t["background-image"]=!0,t["background-origin"]=!0,t["background-position"]=!0,t["background-repeat"]=!0,t["background-size"]=!0,t["baseline-shift"]=!1,t.binding=!1,t.bleed=!1,t["bookmark-label"]=!1,t["bookmark-level"]=!1,t["bookmark-state"]=!1,t.border=!0,t["border-bottom"]=!0,t["border-bottom-color"]=!0,t["border-bottom-left-radius"]=!0,t["border-bottom-right-radius"]=!0,t["border-bottom-style"]=!0,t["border-bottom-width"]=!0,t["border-collapse"]=!0,t["border-color"]=!0,t["border-image"]=!0,t["border-image-outset"]=!0,t["border-image-repeat"]=!0,t["border-image-slice"]=!0,t["border-image-source"]=!0,t["border-image-width"]=!0,t["border-left"]=!0,t["border-left-color"]=!0,t["border-left-style"]=!0,t["border-left-width"]=!0,t["border-radius"]=!0,t["border-right"]=!0,t["border-right-color"]=!0,t["border-right-style"]=!0,t["border-right-width"]=!0,t["border-spacing"]=!0,t["border-style"]=!0,t["border-top"]=!0,t["border-top-color"]=!0,t["border-top-left-radius"]=!0,t["border-top-right-radius"]=!0,t["border-top-style"]=!0,t["border-top-width"]=!0,t["border-width"]=!0,t.bottom=!1,t["box-decoration-break"]=!0,t["box-shadow"]=!0,t["box-sizing"]=!0,t["box-snap"]=!0,t["box-suppress"]=!0,t["break-after"]=!0,t["break-before"]=!0,t["break-inside"]=!0,t["caption-side"]=!1,t.chains=!1,t.clear=!0,t.clip=!1,t["clip-path"]=!1,t["clip-rule"]=!1,t.color=!0,t["color-interpolation-filters"]=!0,t["column-count"]=!1,t["column-fill"]=!1,t["column-gap"]=!1,t["column-rule"]=!1,t["column-rule-color"]=!1,t["column-rule-style"]=!1,t["column-rule-width"]=!1,t["column-span"]=!1,t["column-width"]=!1,t.columns=!1,t.contain=!1,t.content=!1,t["counter-increment"]=!1,t["counter-reset"]=!1,t["counter-set"]=!1,t.crop=!1,t.cue=!1,t["cue-after"]=!1,t["cue-before"]=!1,t.cursor=!1,t.direction=!1,t.display=!0,t["display-inside"]=!0,t["display-list"]=!0,t["display-outside"]=!0,t["dominant-baseline"]=!1,t.elevation=!1,t["empty-cells"]=!1,t.filter=!1,t.flex=!1,t["flex-basis"]=!1,t["flex-direction"]=!1,t["flex-flow"]=!1,t["flex-grow"]=!1,t["flex-shrink"]=!1,t["flex-wrap"]=!1,t.float=!1,t["float-offset"]=!1,t["flood-color"]=!1,t["flood-opacity"]=!1,t["flow-from"]=!1,t["flow-into"]=!1,t.font=!0,t["font-family"]=!0,t["font-feature-settings"]=!0,t["font-kerning"]=!0,t["font-language-override"]=!0,t["font-size"]=!0,t["font-size-adjust"]=!0,t["font-stretch"]=!0,t["font-style"]=!0,t["font-synthesis"]=!0,t["font-variant"]=!0,t["font-variant-alternates"]=!0,t["font-variant-caps"]=!0,t["font-variant-east-asian"]=!0,t["font-variant-ligatures"]=!0,t["font-variant-numeric"]=!0,t["font-variant-position"]=!0,t["font-weight"]=!0,t.grid=!1,t["grid-area"]=!1,t["grid-auto-columns"]=!1,t["grid-auto-flow"]=!1,t["grid-auto-rows"]=!1,t["grid-column"]=!1,t["grid-column-end"]=!1,t["grid-column-start"]=!1,t["grid-row"]=!1,t["grid-row-end"]=!1,t["grid-row-start"]=!1,t["grid-template"]=!1,t["grid-template-areas"]=!1,t["grid-template-columns"]=!1,t["grid-template-rows"]=!1,t["hanging-punctuation"]=!1,t.height=!0,t.hyphens=!1,t.icon=!1,t["image-orientation"]=!1,t["image-resolution"]=!1,t["ime-mode"]=!1,t["initial-letters"]=!1,t["inline-box-align"]=!1,t["justify-content"]=!1,t["justify-items"]=!1,t["justify-self"]=!1,t.left=!1,t["letter-spacing"]=!0,t["lighting-color"]=!0,t["line-box-contain"]=!1,t["line-break"]=!1,t["line-grid"]=!1,t["line-height"]=!1,t["line-snap"]=!1,t["line-stacking"]=!1,t["line-stacking-ruby"]=!1,t["line-stacking-shift"]=!1,t["line-stacking-strategy"]=!1,t["list-style"]=!0,t["list-style-image"]=!0,t["list-style-position"]=!0,t["list-style-type"]=!0,t.margin=!0,t["margin-bottom"]=!0,t["margin-left"]=!0,t["margin-right"]=!0,t["margin-top"]=!0,t["marker-offset"]=!1,t["marker-side"]=!1,t.marks=!1,t.mask=!1,t["mask-box"]=!1,t["mask-box-outset"]=!1,t["mask-box-repeat"]=!1,t["mask-box-slice"]=!1,t["mask-box-source"]=!1,t["mask-box-width"]=!1,t["mask-clip"]=!1,t["mask-image"]=!1,t["mask-origin"]=!1,t["mask-position"]=!1,t["mask-repeat"]=!1,t["mask-size"]=!1,t["mask-source-type"]=!1,t["mask-type"]=!1,t["max-height"]=!0,t["max-lines"]=!1,t["max-width"]=!0,t["min-height"]=!0,t["min-width"]=!0,t["move-to"]=!1,t["nav-down"]=!1,t["nav-index"]=!1,t["nav-left"]=!1,t["nav-right"]=!1,t["nav-up"]=!1,t["object-fit"]=!1,t["object-position"]=!1,t.opacity=!1,t.order=!1,t.orphans=!1,t.outline=!1,t["outline-color"]=!1,t["outline-offset"]=!1,t["outline-style"]=!1,t["outline-width"]=!1,t.overflow=!1,t["overflow-wrap"]=!1,t["overflow-x"]=!1,t["overflow-y"]=!1,t.padding=!0,t["padding-bottom"]=!0,t["padding-left"]=!0,t["padding-right"]=!0,t["padding-top"]=!0,t.page=!1,t["page-break-after"]=!1,t["page-break-before"]=!1,t["page-break-inside"]=!1,t["page-policy"]=!1,t.pause=!1,t["pause-after"]=!1,t["pause-before"]=!1,t.perspective=!1,t["perspective-origin"]=!1,t.pitch=!1,t["pitch-range"]=!1,t["play-during"]=!1,t.position=!1,t["presentation-level"]=!1,t.quotes=!1,t["region-fragment"]=!1,t.resize=!1,t.rest=!1,t["rest-after"]=!1,t["rest-before"]=!1,t.richness=!1,t.right=!1,t.rotation=!1,t["rotation-point"]=!1,t["ruby-align"]=!1,t["ruby-merge"]=!1,t["ruby-position"]=!1,t["shape-image-threshold"]=!1,t["shape-outside"]=!1,t["shape-margin"]=!1,t.size=!1,t.speak=!1,t["speak-as"]=!1,t["speak-header"]=!1,t["speak-numeral"]=!1,t["speak-punctuation"]=!1,t["speech-rate"]=!1,t.stress=!1,t["string-set"]=!1,t["tab-size"]=!1,t["table-layout"]=!1,t["text-align"]=!0,t["text-align-last"]=!0,t["text-combine-upright"]=!0,t["text-decoration"]=!0,t["text-decoration-color"]=!0,t["text-decoration-line"]=!0,t["text-decoration-skip"]=!0,t["text-decoration-style"]=!0,t["text-emphasis"]=!0,t["text-emphasis-color"]=!0,t["text-emphasis-position"]=!0,t["text-emphasis-style"]=!0,t["text-height"]=!0,t["text-indent"]=!0,t["text-justify"]=!0,t["text-orientation"]=!0,t["text-overflow"]=!0,t["text-shadow"]=!0,t["text-space-collapse"]=!0,t["text-transform"]=!0,t["text-underline-position"]=!0,t["text-wrap"]=!0,t.top=!1,t.transform=!1,t["transform-origin"]=!1,t["transform-style"]=!1,t.transition=!1,t["transition-delay"]=!1,t["transition-duration"]=!1,t["transition-property"]=!1,t["transition-timing-function"]=!1,t["unicode-bidi"]=!1,t["vertical-align"]=!1,t.visibility=!1,t["voice-balance"]=!1,t["voice-duration"]=!1,t["voice-family"]=!1,t["voice-pitch"]=!1,t["voice-range"]=!1,t["voice-rate"]=!1,t["voice-stress"]=!1,t["voice-volume"]=!1,t.volume=!1,t["white-space"]=!1,t.widows=!1,t.width=!0,t["will-change"]=!1,t["word-break"]=!0,t["word-spacing"]=!0,t["word-wrap"]=!0,t["wrap-flow"]=!1,t["wrap-through"]=!1,t["writing-mode"]=!1,t["z-index"]=!1,t}function D6(t,e,i){}function L6(t,e,i){}var M6=/javascript\s*\:/img;function Z6(t,e){return M6.test(e)?"":e}Zn.whiteList=rv();Zn.getDefaultWhiteList=rv;Zn.onAttr=D6;Zn.onIgnoreAttr=L6;Zn.safeAttrValue=Z6;var I6={indexOf:function(t,e){var i,n;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,n=t.length;i/g,J6=/"/g,e4=/"/g,t4=/&#([a-zA-Z0-9]*);?/gim,i4=/:?/gim,n4=/&newline;?/gim,Yo=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Wp=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Yp=/u\s*r\s*l\s*\(.*/gi;function uv(t){return t.replace(J6,""")}function cv(t){return t.replace(e4,'"')}function hv(t){return t.replace(t4,function(i,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10))})}function fv(t){return t.replace(i4,":").replace(n4," ")}function dv(t){for(var e="",i=0,n=t.length;i",n);if(r===-1)break;i=r+3}return e}function l4(t){var e=t.split("");return e=e.filter(function(i){var n=i.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0}),e.join("")}Ee.whiteList=ov();Ee.getDefaultWhiteList=ov;Ee.onTag=W6;Ee.onIgnoreTag=Y6;Ee.onTagAttr=N6;Ee.onIgnoreTagAttr=G6;Ee.safeAttrValue=U6;Ee.escapeHtml=av;Ee.escapeQuote=uv;Ee.unescapeQuote=cv;Ee.escapeHtmlEntities=hv;Ee.escapeDangerHtml5Entities=fv;Ee.clearNonPrintableCharacter=dv;Ee.friendlyAttrValue=pv;Ee.escapeAttrValue=mv;Ee.onIgnoreTagStripAll=r4;Ee.StripTagBody=s4;Ee.stripCommentTag=o4;Ee.stripBlankChar=l4;Ee.attributeWrapSign='"';Ee.cssFilter=lv;Ee.getDefaultCSSWhiteList=q6;var ga={},Hi=Xh;function a4(t){var e=Hi.spaceIndex(t),i;return e===-1?i=t.slice(1,-1):i=t.slice(1,e+1),i=Hi.trim(i).toLowerCase(),i.slice(0,1)==="/"&&(i=i.slice(1)),i.slice(-1)==="/"&&(i=i.slice(0,-1)),i}function u4(t){return t.slice(0,2)===""||l===a-1){n+=i(t.slice(r,s)),c=t.slice(s,l+1),u=a4(c),n+=e(s,n.length,u,c,u4(c)),r=l+1,s=!1;continue}if(h==='"'||h==="'")for(var f=1,d=t.charAt(l-f);d.trim()===""||d==="=";){if(d==="="){o=h;continue e}d=t.charAt(l-++f)}}else if(h===o){o=!1;continue}}return r0;e--){var i=t[e];if(i!==" ")return i==="="?e:-1}}function O4(t){return t[0]==='"'&&t[t.length-1]==='"'||t[0]==="'"&&t[t.length-1]==="'"}function Np(t){return O4(t)?t.substr(1,t.length-2):t}ga.parseTag=c4;ga.parseAttr=f4;var g4=Ih.FilterCSS,It=Ee,Ov=ga,b4=Ov.parseTag,v4=Ov.parseAttr,hl=Xh;function No(t){return t==null}function y4(t){var e=hl.spaceIndex(t);if(e===-1)return{html:"",closing:t[t.length-2]==="/"};t=hl.trim(t.slice(e+1,-1));var i=t[t.length-1]==="/";return i&&(t=hl.trim(t.slice(0,-1))),{html:t,closing:i}}function x4(t){var e={};for(var i in t)e[i]=t[i];return e}function k4(t){var e={};for(var i in t)Array.isArray(t[i])?e[i.toLowerCase()]=t[i].map(function(n){return n.toLowerCase()}):e[i.toLowerCase()]=t[i];return e}function gv(t){t=x4(t||{}),t.stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=It.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=k4(t.whiteList||t.allowList):t.whiteList=It.whiteList,this.attributeWrapSign=t.singleQuotedAttributeValue===!0?"'":It.attributeWrapSign,t.onTag=t.onTag||It.onTag,t.onTagAttr=t.onTagAttr||It.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||It.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||It.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||It.safeAttrValue,t.escapeHtml=t.escapeHtml||It.escapeHtml,this.options=t,t.css===!1?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new g4(t.css))}gv.prototype.process=function(t){if(t=t||"",t=t.toString(),!t)return"";var e=this,i=e.options,n=i.whiteList,r=i.onTag,s=i.onIgnoreTag,o=i.onTagAttr,l=i.onIgnoreTagAttr,a=i.safeAttrValue,u=i.escapeHtml,c=e.attributeWrapSign,h=e.cssFilter;i.stripBlankChar&&(t=It.stripBlankChar(t)),i.allowCommentTag||(t=It.stripCommentTag(t));var f=!1;i.stripIgnoreTagBody&&(f=It.StripTagBody(i.stripIgnoreTagBody,s),s=f.onIgnoreTag);var d=b4(t,function(p,m,O,g,b){var y={sourcePosition:p,position:m,isClosing:b,isWhite:Object.prototype.hasOwnProperty.call(n,O)},w=r(O,g,y);if(!No(w))return w;if(y.isWhite){if(y.isClosing)return"";var v=y4(g),Q=n[O],P=v4(v.html,function(_,R){var L=hl.indexOf(Q,_)!==-1,I=o(O,_,R,L);return No(I)?L?(R=a(O,_,R,h),R?_+"="+c+R+c:_):(I=l(O,_,R,L),No(I)?void 0:I):I});return g="<"+O,P&&(g+=" "+P),v.closing&&(g+=" /"),g+=">",g}else return w=s(O,g,y),No(w)?u(g):w},u);return f&&(d=f.remove(d)),d};var S4=gv;(function(t,e){var i=Ee,n=ga,r=S4;function s(l,a){var u=new r(a);return u.process(l)}e=t.exports=s,e.filterXSS=s,e.FilterXSS=r,(function(){for(var l in i)e[l]=i[l];for(var a in n)e[a]=n[a]})(),typeof window<"u"&&(window.filterXSS=t.exports);function o(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}o()&&(self.filterXSS=t.exports)})(kc,kc.exports);var vs=kc.exports;const w4=R6(vs),$4=A6({__proto__:null,default:w4},[vs]),Gp={img:["class"],input:["class","disabled","type","checked"],iframe:["class","width","height","src","title","border","frameborder","framespacing","allow","allowfullscreen"]},Q4=(t,e)=>{const{extendedWhiteList:i={},xss:n={}}=e;let r;if(typeof n=="function")r=new vs.FilterXSS(n($4));else{const s=vs.getDefaultWhiteList();[...Object.keys(i),...Object.keys(Gp)].forEach(l=>{const a=s[l]||[],u=Gp[l]||[],c=i[l]||[];s[l]=[...new Set([...a,...u,...c])]}),r=new vs.FilterXSS({whiteList:s,...n})}t.core.ruler.after("linkify","xss",s=>{for(let o=0;o{u.type==="html_inline"&&(u.content=r.process(u.content))});break}}}})},_4=()=>{Object.keys(bt).forEach(t=>{const e=document.getElementById(bt[t]);e&&e.remove()})},Z4=Object.freeze(Object.defineProperty({__proto__:null,DropdownToolbar:rs,MdCatalog:Jn,MdEditor:ul,MdModal:_n,MdPreview:ls,ModalToolbar:bs,NormalFooterToolbar:cl,NormalToolbar:gs,StrIcon:os,XSSPlugin:Q4,allFooter:$c,allToolbar:wc,clearSideEffects:_4,config:Mv,editorExtensionsAttrs:Lv,en_US:T6,prefix:x,zh_CN:C6},Symbol.toStringTag,{value:"Module"}));export{nb as C,Zt as E,ge as I,Sr as L,Sg as N,Qr as a,A_ as b,ol as c,P1 as d,Pr as e,no as f,Re as g,ql as h,Mr as i,M$ as j,L$ as k,Ag as l,mt as m,W as n,E as o,Bb as p,wg as q,vb as r,Dr as s,k as t,Rg as u,qt as v,Z4 as w};