@evandu/super-pi 0.1.113 → 0.1.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/README.md +16 -0
  2. package/bin/super-pi.js +95 -3
  3. package/dist/client/.super-pi-client-sources.json +3 -3
  4. package/dist/client/assets/{CodeMirrorEditor-moFTk5SE.js → CodeMirrorEditor-DNLm2zT6.js} +2 -2
  5. package/dist/client/assets/{dist-DQjJMys5.js → dist-2zLLUXCo.js} +1 -1
  6. package/dist/client/assets/{dist-BsO40qxQ.js → dist-4qEFEbMF.js} +1 -1
  7. package/dist/client/assets/{dist-DuWhzonJ.js → dist-BLldidtK.js} +1 -1
  8. package/dist/client/assets/{dist-DrbUrVWB.js → dist-BO4YrDmO.js} +1 -1
  9. package/dist/client/assets/{dist-DIfmMr8s.js → dist-BTsfS8CA.js} +1 -1
  10. package/dist/client/assets/{dist-Dnr5BxAi.js → dist-BVCGM9Bd.js} +1 -1
  11. package/dist/client/assets/{dist-BR4s0dNg.js → dist-B_N2ELl5.js} +1 -1
  12. package/dist/client/assets/{dist-TgNJUr7p.js → dist-BoV9nE13.js} +1 -1
  13. package/dist/client/assets/{dist-DPDGd2jl.js → dist-CEJcHfEn.js} +1 -1
  14. package/dist/client/assets/{dist-D9m04q-s.js → dist-CW83qn3P.js} +1 -1
  15. package/dist/client/assets/{dist-CCYnr6ul.js → dist-CezTi1ET.js} +1 -1
  16. package/dist/client/assets/{dist-BUuPRG15.js → dist-DszqHTui.js} +1 -1
  17. package/dist/client/assets/{dist-rhPxFuD1.js → dist-DuHJr7vQ.js} +1 -1
  18. package/dist/client/assets/{dist-Bds_PUYK.js → dist-JI_7suRx.js} +1 -1
  19. package/dist/client/assets/{dist-CL65aMXY.js → dist-pJBZJJnA.js} +1 -1
  20. package/dist/client/assets/{dist-DPvy57Ph.js → dist-zwqOqWyp.js} +1 -1
  21. package/dist/client/assets/{index-BixdV7aQ.js → index-CLoO6IHy.js} +2 -2
  22. package/dist/client/index.html +1 -1
  23. package/dist/extension.js +1 -1
  24. package/dist/server/application/conversation-service.js +8 -0
  25. package/dist/server/index.js +14 -4
  26. package/dist/server/logging.d.ts +32 -0
  27. package/dist/server/logging.js +132 -0
  28. package/package.json +2 -1
@@ -1,4 +1,4 @@
1
- import{a as e,b as t,l as n,o as r}from"./dist-Dnr5BxAi.js";import{d as i,r as a}from"./dist-CCYnr6ul.js";import{c as o,d as s,g as c,i as l,l as u,m as d,o as f,p,t as m,u as h}from"./dist-DPDGd2jl.js";import{Language as g,LanguageDescription as ee,LanguageSupport as te,ParseContext as ne,defineLanguageFacet as re,foldNodeProp as ie,foldService as ae,indentNodeProp as oe,indentUnit as se,languageDataProp as ce,syntaxTree as _}from"./dist-DPvy57Ph.js";import{t as le}from"./dist-Bds_PUYK.js";import{html as ue,htmlCompletionSource as de}from"./dist-BR4s0dNg.js";var fe=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.blankFirstLine=!1,this.hashProp=[[u.contextHash,r]]}addChild(e,t){e.prop(u.contextHash)!=this.hash&&(e=new d(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new d(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new d(s.none,e,t,n,this.hashProp)})}},v;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(v||={});var pe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},me=class{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 b(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,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function he(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==v.OrderedList?w:C)(n,t,!1);return r>0&&(e.type!=v.BulletList||S(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var ge={[v.Blockquote](e,t,n){return n.next==62&&(n.markers.push(F(v.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(y(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[v.ListItem](e,t,n){return!(n.next<0?e.blankFirstLine&&e.children.length==1:n.indent<n.baseIndent+e.value)&&(n.moveBaseColumn(n.baseIndent+e.value),!0)},[v.OrderedList]:he,[v.BulletList]:he,[v.Document](){return!0}};function y(e){return e==32||e==9||e==10||e==13}function b(e,t=0){for(;t<e.length&&y(e.charCodeAt(t));)t++;return t}function _e(e,t,n){for(;t>n&&y(e.charCodeAt(t-1));)t--;return t}function ve(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function x(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function S(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!y(n))return-1}return n&&e.next==45&&xe(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Oe.SetextHeading)>-1||r<3?-1:1}function ye(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function C(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||y(e.text.charCodeAt(e.pos+1)))&&(!n||ye(t,v.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function w(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!y(e.text.charCodeAt(r+1))||n&&!ye(t,v.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function be(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&!y(e.text.charCodeAt(t)))return-1;let n=t-e.pos;return n>6?-1:n}function xe(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&y(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var T=/^[ \t]*$/,Se=/-->/,Ce=/\?>/,E=[[/^<(?:script|pre|style|textarea)(?:\s|>|$)/i,/<\/(?:script|pre|style|textarea)>/i],[/^\s*<!--/,Se],[/^\s*<\?/,Ce],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,T],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,T]];function we(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=E.length-+!!n;e<t;e++)if(E[e][0].test(r))return e;return-1}function Te(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.skipSpace(t),i=e.countIndent(r,t,n);return i>=n+5||r==e.text.length?n+1:i}function D(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==v.CodeText?e[r].to=n:e.push(F(v.CodeText,t,n))}var O={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(D(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){D(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==v.CodeText?D(o,e.from,e.to):o.push(e);s=[]}D(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&D(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=v.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(v.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ve(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=_e(t.text,t.text.length,o),c=[F(v.CodeMark,r,r+a)];o<s&&c.push(F(v.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&D(c,e.lineStart-1,e.lineStart),c.push(F(v.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(D(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(D(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(v.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=x(t);return n<0?!1:(e.startContext(v.Blockquote,t.pos),e.addNode(v.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(S(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(v.HorizontalRule,n),!0},BulletList(e,t){let n=C(t,e,!1);if(n<0)return!1;e.block.type!=v.BulletList&&e.startContext(v.BulletList,t.basePos,t.next);let r=Te(t,t.pos+1);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),e.block.blankFirstLine=r>=t.text.length,null},OrderedList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=v.OrderedList&&e.startContext(v.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Te(t,t.pos+n);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),e.block.blankFirstLine=r==t.text.length,null},ATXHeading(e,t){let n=be(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=_e(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!y(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(v.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(v.HeaderMark,o-r,a-r);let c=s.finish(v.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=we(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=E[n][1],a=[],o=i!=T;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==Se?v.CommentBlock:i==Ce?v.ProcessingInstructionBlock:v.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Ee=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
1
+ import{a as e,b as t,l as n,o as r}from"./dist-BVCGM9Bd.js";import{d as i,r as a}from"./dist-CezTi1ET.js";import{c as o,d as s,g as c,i as l,l as u,m as d,o as f,p,t as m,u as h}from"./dist-CEJcHfEn.js";import{Language as g,LanguageDescription as ee,LanguageSupport as te,ParseContext as ne,defineLanguageFacet as re,foldNodeProp as ie,foldService as ae,indentNodeProp as oe,indentUnit as se,languageDataProp as ce,syntaxTree as _}from"./dist-zwqOqWyp.js";import{t as le}from"./dist-JI_7suRx.js";import{html as ue,htmlCompletionSource as de}from"./dist-B_N2ELl5.js";var fe=class e{static create(t,n,r,i,a){let o=i+(i<<8)+t+(n<<4)|0;return new e(t,n,r,o,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.blankFirstLine=!1,this.hashProp=[[u.contextHash,r]]}addChild(e,t){e.prop(u.contextHash)!=this.hash&&(e=new d(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new d(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new d(s.none,e,t,n,this.hashProp)})}},v;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(v||={});var pe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},me=class{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 b(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,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function he(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==v.OrderedList?w:C)(n,t,!1);return r>0&&(e.type!=v.BulletList||S(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var ge={[v.Blockquote](e,t,n){return n.next==62&&(n.markers.push(F(v.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(y(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0)},[v.ListItem](e,t,n){return!(n.next<0?e.blankFirstLine&&e.children.length==1:n.indent<n.baseIndent+e.value)&&(n.moveBaseColumn(n.baseIndent+e.value),!0)},[v.OrderedList]:he,[v.BulletList]:he,[v.Document](){return!0}};function y(e){return e==32||e==9||e==10||e==13}function b(e,t=0){for(;t<e.length&&y(e.charCodeAt(t));)t++;return t}function _e(e,t,n){for(;t>n&&y(e.charCodeAt(t-1));)t--;return t}function ve(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function x(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function S(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!y(n))return-1}return n&&e.next==45&&xe(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Oe.SetextHeading)>-1||r<3?-1:1}function ye(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function C(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||y(e.text.charCodeAt(e.pos+1)))&&(!n||ye(t,v.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function w(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!y(e.text.charCodeAt(r+1))||n&&!ye(t,v.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function be(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&!y(e.text.charCodeAt(t)))return-1;let n=t-e.pos;return n>6?-1:n}function xe(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&y(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var T=/^[ \t]*$/,Se=/-->/,Ce=/\?>/,E=[[/^<(?:script|pre|style|textarea)(?:\s|>|$)/i,/<\/(?:script|pre|style|textarea)>/i],[/^\s*<!--/,Se],[/^\s*<\?/,Ce],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,T],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,T]];function we(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=E.length-+!!n;e<t;e++)if(E[e][0].test(r))return e;return-1}function Te(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.skipSpace(t),i=e.countIndent(r,t,n);return i>=n+5||r==e.text.length?n+1:i}function D(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==v.CodeText?e[r].to=n:e.push(F(v.CodeText,t,n))}var O={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(D(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){D(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==v.CodeText?D(o,e.from,e.to):o.push(e);s=[]}D(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&D(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=v.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(v.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=ve(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=_e(t.text,t.text.length,o),c=[F(v.CodeMark,r,r+a)];o<s&&c.push(F(v.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&D(c,e.lineStart-1,e.lineStart),c.push(F(v.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}{o=!0,n||(D(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(D(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(v.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=x(t);return n<0?!1:(e.startContext(v.Blockquote,t.pos),e.addNode(v.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(S(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(v.HorizontalRule,n),!0},BulletList(e,t){let n=C(t,e,!1);if(n<0)return!1;e.block.type!=v.BulletList&&e.startContext(v.BulletList,t.basePos,t.next);let r=Te(t,t.pos+1);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),e.block.blankFirstLine=r>=t.text.length,null},OrderedList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=v.OrderedList&&e.startContext(v.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Te(t,t.pos+n);return e.startContext(v.ListItem,t.basePos,r-t.baseIndent),e.addNode(v.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),e.block.blankFirstLine=r==t.text.length,null},ATXHeading(e,t){let n=be(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=_e(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!y(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(v.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(v.HeaderMark,o-r,a-r);let c=s.finish(v.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=we(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=E[n][1],a=[],o=i!=T;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==Se?v.CommentBlock:i==Ce?v.ProcessingInstructionBlock:v.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},Ee=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
2
2
  `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length&&this.complete(e,n,i)}finish(e,t){return(this.stage==2||this.stage==3)&&b(t.content,this.pos)==t.content.length&&this.complete(e,t,t.content.length)}complete(e,t,n){return e.addLeafElement(t,F(v.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(Ve(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(F(v.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(ze(e,b(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=b(e,this.pos),n=0;if(t>this.pos){let r=Be(e,t,this.start);if(r){let t=k(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=k(e,this.pos),n>0&&n<e.length?n:-1}else return k(e,this.pos)}};function k(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!y(n))return-1}return t}var De=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:xe(t),i=t.next;if(r<0)return!1;let a=F(v.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,F(i==61?v.SetextHeading1:v.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},Oe={LinkReference(e,t){return t.content.charCodeAt(0)==91?new Ee(t):null},SetextHeading(){return new De}},ke=[(e,t)=>be(t)>=0,(e,t)=>ve(t)>=0,(e,t)=>x(t)>=0,(e,t)=>C(t,e,!0)>=0,(e,t)=>w(t,e,!0)>=0,(e,t)=>S(t,e,!0)>=0,(e,t)=>we(t,e,!0)>=0],Ae={text:``,end:0},je=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new me,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=fe.create(v.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Ue(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let t=new pe(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
3
3
  `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=Ge(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=Ae;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+v[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
4
4
  `?``:t;else{let e=t.indexOf(`
@@ -1,4 +1,4 @@
1
- import{i as e}from"./index-BixdV7aQ.js";import{C as t,S as n,_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b,y as x}from"./dist-Dnr5BxAi.js";for(var ee=`ͼ`,te=typeof Symbol>`u`?`__ͼ`:Symbol.for(ee),ne=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),re=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},ie=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
1
+ import{i as e}from"./index-CLoO6IHy.js";import{C as t,S as n,_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,o as m,p as h,r as g,s as _,t as v,u as y,v as b,y as x}from"./dist-BVCGM9Bd.js";for(var ee=`ͼ`,te=typeof Symbol>`u`?`__ͼ`:Symbol.for(ee),ne=typeof Symbol>`u`?`__styleSet`+Math.floor(Math.random()*1e8):Symbol(`styleSet`),re=typeof globalThis<`u`?globalThis:typeof window<`u`?window:{},ie=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function i(e,t,a,o){let s=[],c=/^@(\w+)\b/.exec(e[0]),l=c&&c[1]==`keyframes`;if(c&&t==null)return a.push(e[0]+`;`);for(let n in t){let o=t[n];if(/&/.test(n))i(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>e.concat(t)),o,a);else if(o&&typeof o==`object`){if(!c)throw RangeError(`The value of a property (`+n+`) should be a primitive value.`);i(r(n),o,s,l)}else o!=null&&s.push(n.replace(/_.*/,``).replace(/[A-Z]/g,e=>`-`+e.toLowerCase())+`: `+o+`;`)}(s.length||l)&&a.push((n&&!c&&!o?e.map(n):e).join(`, `)+` {`+s.join(` `)+`}`)}for(let t in e)i(r(t),e[t],this.rules)}getRules(){return this.rules.join(`
2
2
  `)}static newName(){let e=re[te]||1;return re[te]=e+1,ee+e.toString(36)}static mount(e,t,n){let r=e[ne],i=n&&n.nonce;r?i&&r.setNonce(i):r=new oe(e,i),r.mount(Array.isArray(t)?t:[t],e)}},ae=new Map,oe=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=ae.get(n);if(t)return e[ne]=t;this.sheet=new r.CSSStyleSheet,ae.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[ne]=this}mount(e,t){let n=this.sheet,r=0,i=0,a=!1;for(let t=0;t<e.length;t++){let o=e[t],s=this.modules.indexOf(o);if(s<i&&s>-1&&(this.modules.splice(s,1),a=!0,i--,s=-1),s==-1){if(this.modules.splice(i++,0,o),a=!0,n)for(let e=0;e<o.rules.length;e++)n.insertRule(o.rules[e],r++)}else{for(;i<s;)r+=this.modules[i++].rules.length;r+=o.rules.length,i++}}if(n)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{if(a){let e=``;for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+`
3
3
  `;this.styleTag.textContent=e}let e=t.head||t;this.styleTag.parentNode!=e&&e.insertBefore(this.styleTag,e.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute(`nonce`)!=e&&this.styleTag.setAttribute(`nonce`,e)}},S={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},se={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},ce=typeof navigator<`u`&&/Mac/.test(navigator.platform),le=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),C=0;C<10;C++)S[48+C]=S[96+C]=String(C);for(var C=1;C<=24;C++)S[C+111]=`F`+C;for(var C=65;C<=90;C++)S[C]=String.fromCharCode(C+32),se[C]=String.fromCharCode(C);for(var ue in S)se.hasOwnProperty(ue)||(se[ue]=S[ue]);function de(e){var t=!(ce&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||le&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?se:S)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}function w(){var e=arguments[0];typeof e==`string`&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&typeof n==`object`&&n.nodeType==null&&!Array.isArray(n)){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];typeof i==`string`?e.setAttribute(r,i):i!=null&&(e[r]=i)}t++}for(;t<arguments.length;t++)fe(e,arguments[t]);return e}function fe(e,t){if(typeof t==`string`)e.appendChild(document.createTextNode(t));else if(t!=null){if(t.nodeType!=null)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)fe(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}}var pe=e({BidiSpan:()=>I,BlockInfo:()=>q,BlockType:()=>O,BlockWrapper:()=>Ie,Decoration:()=>k,Direction:()=>P,EditorView:()=>Z,GutterMarker:()=>$,MatchDecorator:()=>ja,RectangleMarker:()=>sa,ViewPlugin:()=>B,ViewUpdate:()=>an,WidgetType:()=>D,__test:()=>Ds,activateHover:()=>ko,closeHoverTooltip:()=>Po,closeHoverTooltips:()=>No,crosshairCursor:()=>oo,drawSelection:()=>_a,dropCursor:()=>Oa,getDialog:()=>Wo,getDrawSelectionConfig:()=>va,getPanel:()=>Ro,getTooltip:()=>Ao,gutter:()=>$o,gutterLineClass:()=>Yo,gutterWidgetClass:()=>Xo,gutters:()=>ts,hasHoverTooltips:()=>jo,highlightActiveLine:()=>qa,highlightActiveLineGutter:()=>ys,highlightSpecialChars:()=>Ra,highlightTrailingWhitespace:()=>Es,highlightWhitespace:()=>ws,hoverTooltip:()=>Oo,keymap:()=>$i,layer:()=>ma,lineNumberMarkers:()=>ls,lineNumberWidgetMarker:()=>us,lineNumbers:()=>hs,logException:()=>R,panels:()=>Lo,placeholder:()=>Za,rectangularSelection:()=>ro,repositionTooltips:()=>Fo,runScopeHandlers:()=>na,scrollPastEnd:()=>Ka,showDialog:()=>Uo,showPanel:()=>Ho,showTooltip:()=>yo,tooltips:()=>lo}),T=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},me=typeof document<`u`?document:{documentElement:{style:{}}},he=/Edge\/(\d+)/.exec(T.userAgent),ge=/MSIE \d/.test(T.userAgent),_e=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(T.userAgent),ve=!!(ge||_e||he),ye=!ve&&/gecko\/(\d+)/i.test(T.userAgent),be=!ve&&/Chrome\/(\d+)/.exec(T.userAgent),xe=`webkitFontSmoothing`in me.documentElement.style,Se=!ve&&/Apple Computer/.test(T.vendor),Ce=Se&&(/Mobile\/\w+/.test(T.userAgent)||T.maxTouchPoints>2),E={mac:Ce||/Mac/.test(T.platform),windows:/Win/.test(T.platform),linux:/Linux|X11/.test(T.platform),ie:ve,ie_version:ge?me.documentMode||6:_e?+_e[1]:he?+he[1]:0,gecko:ye,gecko_version:ye?+(/Firefox\/(\d+)/.exec(T.userAgent)||[0,0])[1]:0,chrome:!!be,chrome_version:be?+be[1]:0,ios:Ce,android:/Android\b/.test(T.userAgent),webkit:xe,webkit_version:xe?+(/\bAppleWebKit\/(\d+)/.exec(T.userAgent)||[0,0])[1]:0,safari:Se,safari_version:Se?+(/\bVersion\/(\d+(\.\d+)?)/.exec(T.userAgent)||[0,0])[1]:0,tabSize:me.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function we(e,t){for(let n in e)n==`class`&&t.class?t.class+=` `+e.class:n==`style`&&t.style?t.style+=`;`+e.style:t[n]=e[n];return t}var Te=Object.create(null);function Ee(e,t,n){if(e==t)return!0;e||=Te,t||=Te;let r=Object.keys(e),i=Object.keys(t);if(r.length-0!=i.length-0)return!1;for(let a of r)if(a!=n&&(i.indexOf(a)==-1||e[a]!==t[a]))return!1;return!0}function De(e,t){for(let n=e.attributes.length-1;n>=0;n--){let r=e.attributes[n].name;t[r]??e.removeAttribute(r)}for(let n in t){let r=t[n];n==`style`?e.style.cssText=r:e.getAttribute(n)!=r&&e.setAttribute(n,r)}}function Oe(e,t,n){let r=!1;if(t)for(let i in t)n&&i in n||(r=!0,i==`style`?e.style.cssText=``:e.removeAttribute(i));if(n)for(let i in n)t&&t[i]==n[i]||(r=!0,i==`style`?e.style.cssText=n[i]:e.setAttribute(i,n[i]));return r}function ke(e){let t=Object.create(null);for(let n=0;n<e.attributes.length;n++){let r=e.attributes[n];t[r.name]=r.value}return t}var D=class{eq(e){return!1}updateDOM(e,t,n){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}},O=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(O||={}),k=class extends c{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static mark(e){return new Ae(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Me(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,r;if(e.isBlockGap)n=-5e8,r=4e8;else{let{start:i,end:a}=Ne(e,t);n=(i?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new Me(e,n,r,t,e.widget||null,!0)}static line(e){return new je(e)}static set(e,t=!1){return y.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};k.none=y.empty;var Ae=class e extends k{constructor(e){let{start:t,end:n}=Ne(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||`span`,this.attrs=e.class&&e.attributes?we(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Te}eq(t){return this==t||t instanceof e&&this.tagName==t.tagName&&Ee(this.attrs,t.attrs)}range(e,t=e){if(e>=t)throw RangeError(`Mark decorations may not be empty`);return super.range(e,t)}};Ae.prototype.point=!1;var je=class e extends k{constructor(e){super(-2e8,-2e8,null,e)}eq(t){return t instanceof e&&this.spec.class==t.spec.class&&Ee(this.spec.attributes,t.spec.attributes)}range(e,t=e){if(t!=e)throw RangeError(`Line decoration ranges must be zero-length`);return super.range(e,t)}};je.prototype.mapMode=o.TrackBefore,je.prototype.point=!0;var Me=class e extends k{constructor(e,t,n,r,i,a){super(t,n,i,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?o.TrackBefore:o.TrackAfter:o.TrackDel}get type(){return this.startSide==this.endSide?this.startSide<=0?O.WidgetBefore:O.WidgetAfter:O.WidgetRange}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof e&&Pe(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw RangeError(`Invalid range for replacement decoration`);if(!this.isReplace&&t!=e)throw RangeError(`Widget decorations can only have zero-length ranges`);return super.range(e,t)}};Me.prototype.point=!0;function Ne(e,t=!1){let{inclusiveStart:n,inclusiveEnd:r}=e;return n??=e.inclusive,r??=e.inclusive,{start:n??t,end:r??t}}function Pe(e,t){return e==t||!!(e&&t&&e.compare(t))}function Fe(e,t,n,r=0){let i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}var Ie=class e extends c{constructor(e,t,n){super(),this.tagName=e,this.attributes=t,this.rank=n}eq(t){return t==this||t instanceof e&&this.tagName==t.tagName&&Ee(this.attributes,t.attributes)}static create(t){return new e(t.tagName,t.attributes||Te,t.rank==null?50:Math.max(0,Math.min(t.rank,100)))}static set(e,t=!1){return y.of(e,t)}};Ie.prototype.startSide=Ie.prototype.endSide=-1;var A=e=>e.nodeType==1,Le=e=>e.nodeType==3;function Re(e){let t;return t=e.nodeType==11?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function ze(e,t){return t?e==t||e.contains(t.nodeType==1?t:t.parentNode):!1}function Be(e,t){if(!t.anchorNode)return!1;try{return ze(e,t.anchorNode)}catch{return!1}}function Ve(e){return Le(e)?nt(e,0,e.nodeValue.length).getClientRects():A(e)?e.getClientRects():[]}function He(e,t,n,r){return n?We(e,t,n,r,-1)||We(e,t,n,r,1):!1}function j(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t}function Ue(e){return A(e)&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function We(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:M(e))){if(e.nodeName==`DIV`)return!1;let n=e.parentNode;if(!n||!A(n))return!1;t=j(e)+(i<0?0:1),e=n}else if(A(e)){if(e=e.childNodes[t+(i<0?-1:0)],A(e)&&(e.nodeName==`IMG`||e.nodeName==`BR`||e.contentEditable==`false`))return!1;t=i<0?M(e):0}else return!1}}function M(e){return Le(e)?e.nodeValue.length:e.childNodes.length}function Ge(e,t){let{left:n,right:r}=e;if(n==r)return e;let i=t?n:r;return{left:i,right:i,top:e.top,bottom:e.bottom}}function Ke(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function qe(e,t){let n=t.width/e.offsetWidth,r=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(t.height-e.offsetHeight)<1)&&(r=1),{scaleX:n,scaleY:r}}function Je(e,t,n,r,i,a,o,s){let c=e.ownerDocument,l=c.defaultView||window;for(let u=e,d=!1;u&&!d;)if(A(u)){let e,f=u==c.body,p=1,m=1,h=!0,g=!0;if(f)e=Ke(l);else{let t=getComputedStyle(u);if(/^(fixed|sticky)$/.test(t.position)&&(d=!0),(u.scrollHeight<=u.clientHeight||!/auto|scroll/.test(t.overflowY))&&(g=!1),(u.scrollWidth<=u.clientWidth||!/auto|scroll/.test(t.overflowX))&&(h=!1),!h&&!g){u=u.assignedSlot||u.parentNode;continue}let n=u.getBoundingClientRect();({scaleX:p,scaleY:m}=qe(u,n)),e={left:n.left,right:n.left+u.clientWidth*p,top:n.top,bottom:n.top+u.clientHeight*m}}let _=0,v=0;if(g){if(i==`nearest`)t.top<e.top+o?(v=t.top-(e.top+o),n>0&&t.bottom>e.bottom+v&&(v=t.bottom-e.bottom+o)):t.bottom>e.bottom-o&&(v=t.bottom-e.bottom+o,n<0&&t.top-v<e.top&&(v=t.top-(e.top+o)));else{let r=t.bottom-t.top,a=e.bottom-e.top;v=(i==`center`&&r<=a?t.top+r/2-a/2:i==`start`||i==`center`&&n<0?t.top-o:t.bottom-a+o)-e.top}}if(h&&(r==`nearest`?t.left<e.left+a?(_=t.left-(e.left+a),n>0&&t.right>e.right+_&&(_=t.right-e.right+a)):t.right>e.right-a&&(_=t.right-e.right+a,n<0&&t.left<e.left+_&&(_=t.left-(e.left+a))):_=(r==`center`?t.left+(t.right-t.left)/2-(e.right-e.left)/2:r==`start`==s?t.left-a:t.right-(e.right-e.left)+a)-e.left),_||v){if(f)l.scrollBy(_,v);else{let e=0,n=0;if(v){let e=u.scrollTop;u.scrollTop+=v/m,n=(u.scrollTop-e)*m}if(_){let t=u.scrollLeft;u.scrollLeft+=_/p,e=(u.scrollLeft-t)*p}t={left:t.left-e,top:t.top-n,right:t.right-e,bottom:t.bottom-n},e&&Math.abs(e-_)<1&&(r=`nearest`),n&&Math.abs(n-v)<1&&(i=`nearest`)}}if(f)break;(t.top<e.top||t.bottom>e.bottom||t.left<e.left||t.right>e.right)&&(t={left:Math.max(t.left,e.left),right:Math.min(t.right,e.right),top:Math.max(t.top,e.top),bottom:Math.min(t.bottom,e.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function Ye(e,t=!0){let n=e.ownerDocument,r=null,i=null;for(let a=e.parentNode;a&&!(a==n.body||(!t||r)&&i);)if(A(a))!i&&a.scrollHeight>a.clientHeight&&/scroll|auto/.test(getComputedStyle(a).overflowY)&&(i=a),t&&!r&&a.scrollWidth>a.clientWidth&&/scroll|auto/.test(getComputedStyle(a).overflowX)&&(r=a),a=a.assignedSlot||a.parentNode;else if(a.nodeType==11)a=a.host;else break;return{x:r,y:i}}var Xe=class{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:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?M(t):0),n,Math.min(e.focusOffset,n?M(n):0))}set(e,t,n,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=r}};function Ze(e){let t=[];for(let n=e;n;n=n.nodeType==11?n.host:n.parentNode)A(n)&&t.push({node:n,left:n.scrollLeft,top:n.scrollTop});return t}function Qe(e,t=!0){for(let{node:n,left:r,top:i}of e)t&&n.scrollTop!=i&&(n.scrollTop=i),n.scrollLeft!=r&&(n.scrollLeft=r)}var $e=null;E.safari&&E.safari_version>=26&&($e=!1);function et(e){if(e.setActive)return e.setActive();if($e)return e.focus($e);let t=Ze(e);e.focus($e==null?{get preventScroll(){return $e={preventScroll:!0},!0}}:void 0),$e||($e=!1,Qe(t))}var tt;function nt(e,t,n=t){let r=tt||=document.createRange();return r.setEnd(e,n),r.setStart(e,t),r}function rt(e,t,n,r){let i={key:t,code:t,keyCode:n,which:n,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let a=new KeyboardEvent(`keydown`,i);a.synthetic=!0,e.dispatchEvent(a);let o=new KeyboardEvent(`keyup`,i);return o.synthetic=!0,e.dispatchEvent(o),a.defaultPrevented||o.defaultPrevented}function it(e){for(;e;){if(e&&(e.nodeType==9||e.nodeType==11&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}function at(e,t){let n=t.focusNode,r=t.focusOffset;if(!n||t.anchorNode!=n||t.anchorOffset!=r)return!1;for(r=Math.min(r,M(n));;)if(r){if(!A(n))return!1;let e=n.childNodes[r-1];e.contentEditable==`false`?r--:(n=e,r=M(n))}else if(n==e)return!0;else r=j(n),n=n.parentNode}function ot(e){return e instanceof Window?e.pageYOffset>Math.max(0,e.document.documentElement.scrollHeight-e.innerHeight-4):e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function st(e,t){for(let n=e,r=t;;)if(Le(n)&&r>0)return{node:n,offset:r};else if(A(n)&&r>0){if(n.contentEditable==`false`)return null;n=n.childNodes[r-1],r=M(n)}else if(n.parentNode&&!Ue(n))r=j(n),n=n.parentNode;else return null}function ct(e,t){for(let n=e,r=t;;)if(Le(n)&&r<n.nodeValue.length)return{node:n,offset:r};else if(A(n)&&r<n.childNodes.length){if(n.contentEditable==`false`)return null;n=n.childNodes[r],r=0}else if(n.parentNode&&!Ue(n))r=j(n)+1,n=n.parentNode;else return null}var N=class e{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(t,n){return new e(t.parentNode,j(t),n)}static after(t,n){return new e(t.parentNode,j(t)+1,n)}},P=(function(e){return e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`,e})(P||={}),lt=P.LTR,ut=P.RTL;function dt(e){let t=[];for(let n=0;n<e.length;n++)t.push(1<<e[n]);return t}var ft=dt(`88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008`),pt=dt(`4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333`),mt=Object.create(null),F=[];for(let e of[`()`,`[]`,`{}`]){let t=e.charCodeAt(0),n=e.charCodeAt(1);mt[t]=n,mt[n]=-t}function ht(e){return e<=247?ft[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?pt[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}var gt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/,I=class{get dir(){return this.level%2?ut:lt}constructor(e,t,n){this.from=e,this.to=t,this.level=n}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,n,r){let i=-1;for(let a=0;a<e.length;a++){let o=e[a];if(o.from<=t&&o.to>=t){if(o.level==n)return a;(i<0||(r==0?e[i].level>o.level:r<0?o.from<t:o.to>t))&&(i=a)}}if(i<0)throw RangeError(`Index out of range`);return i}};function _t(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!_t(r.inner,i.inner))return!1}return!0}var L=[];function vt(e,t,n,r,i){for(let a=0;a<=r.length;a++){let o=a?r[a-1].to:t,s=a<r.length?r[a].from:n,c=a?256:i;for(let t=o,n=c,r=c;t<s;t++){let i=ht(e.charCodeAt(t));i==512?i=n:i==8&&r==4&&(i=16),L[t]=i==4?2:i,i&7&&(r=i),n=i}for(let e=o,t=c,r=c;e<s;e++){let i=L[e];if(i==128)e<s-1&&t==L[e+1]&&t&24?i=L[e]=t:L[e]=256;else if(i==64){let i=e+1;for(;i<s&&L[i]==64;)i++;let a=e&&t==8||i<n&&L[i]==8?r==1?1:8:256;for(let t=e;t<i;t++)L[t]=a;e=i-1}else i==8&&r==1&&(L[e]=1);t=i,i&7&&(r=i)}}}function yt(e,t,n,r,i){let a=i==1?2:1;for(let o=0,s=0,c=0;o<=r.length;o++){let l=o?r[o-1].to:t,u=o<r.length?r[o].from:n;for(let t=l,n,r,o;t<u;t++)if(r=mt[n=e.charCodeAt(t)]){if(r<0){for(let e=s-3;e>=0;e-=3)if(F[e+1]==-r){let n=F[e+2],r=n&2?i:n&4?n&1?a:i:0;r&&(L[t]=L[F[e]]=r),s=e;break}}else if(F.length==189)break;else F[s++]=t,F[s++]=n,F[s++]=c}else if((o=L[t])==2||o==1){let e=o==i;c=+!e;for(let t=s-3;t>=0;t-=3){let n=F[t+2];if(n&2)break;if(e)F[t+2]|=2;else{if(n&4)break;F[t+2]|=4}}}}}function bt(e,t,n,r){for(let i=0,a=r;i<=n.length;i++){let o=i?n[i-1].to:e,s=i<n.length?n[i].from:t;for(let c=o;c<s;){let o=L[c];if(o==256){let o=c+1;for(;;)if(o==s){if(i==n.length)break;o=n[i++].to,s=i<n.length?n[i].from:t}else if(L[o]==256)o++;else break;let l=a==1,u=l==((o<t?L[o]:r)==1)?l?1:2:r;for(let t=o,r=i,a=r?n[r-1].to:e;t>c;)t==a&&(t=n[--r].from,a=r?n[r-1].to:e),L[--t]=u;c=o}else a=o,c++}}}function xt(e,t,n,r,i,a,o){let s=r%2?2:1;if(r%2==i%2)for(let c=t,l=0;c<n;){let t=!0,u=!1;if(l==a.length||c<a[l].from){let e=L[c];e!=s&&(t=!1,u=e==16)}let d=!t&&s==1?[]:null,f=t?r:r+1,p=c;run:for(;;)if(l<a.length&&p==a[l].from){if(u)break run;let m=a[l];if(!t)for(let e=m.to,t=l+1;;){if(e==n)break run;if(t<a.length&&a[t].from==e)e=a[t++].to;else if(L[e]==s)break run;else break}l++,d?d.push(m):(m.from>c&&o.push(new I(c,m.from,f)),St(e,m.direction==lt==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.to),p=m.to}else if(p==n||(t?L[p]!=s:L[p]==s))break;else p++;d?xt(e,c,p,r+1,i,d,o):c<p&&o.push(new I(c,p,f)),c=p}else for(let c=n,l=a.length;c>t;){let n=!0,u=!1;if(!l||c>a[l-1].to){let e=L[c-1];e!=s&&(n=!1,u=e==16)}let d=!n&&s==1?[]:null,f=n?r:r+1,p=c;run:for(;;)if(l&&p==a[l-1].to){if(u)break run;let m=a[--l];if(!n)for(let e=m.from,n=l;;){if(e==t)break run;if(n&&a[n-1].to==e)e=a[--n].from;else if(L[e-1]==s)break run;else break}d?d.push(m):(m.to<c&&o.push(new I(m.to,c,f)),St(e,m.direction==lt==!(f%2)?r:r+1,i,m.inner,m.from,m.to,o),c=m.from),p=m.from}else if(p==t||(n?L[p-1]!=s:L[p-1]==s))break;else p--;d?xt(e,p,c,r+1,i,d,o):p<c&&o.push(new I(p,c,f)),c=p}}function St(e,t,n,r,i,a,o){let s=t%2?2:1;vt(e,i,a,r,s),yt(e,i,a,r,s),bt(i,a,r,s),xt(e,i,a,t,n,r,o)}function Ct(e,t,n){if(!e)return[new I(0,0,+(t==ut))];if(t==lt&&!n.length&&!gt.test(e))return wt(e.length);if(n.length)for(;e.length>L.length;)L[L.length]=256;let r=[],i=t==lt?0:1;return St(e,i,i,n,0,e.length,r),r}function wt(e){return[new I(0,e,0)]}var Tt=``;function Et(e,t,r,a,o){if(!e.length)return null;let s=a.head-e.from,c;if(a.head==e.from&&a.assoc<0){if(!o)return null;s=t[c=0].side(!1,r)}else if(a.head==e.to&&a.assoc>0){if(o)return null;s=t[c=t.length-1].side(!0,r)}else c=I.find(t,s,a.bidiLevel??-1,a.assoc);let l=t[c],u=l.side(o,r);if(s==u){let e=c+=o?1:-1;if(e<0||e>=t.length)return null;l=t[c=e],s=l.side(!o,r),u=l.side(o,r)}let d=n(e.text,s,l.forward(o,r));(d<l.from||d>l.to)&&(d=u),Tt=e.text.slice(Math.min(s,d),Math.max(s,d));let f=c==(o?t.length-1:0)?null:t[c+(o?1:-1)];if(d==u){if(!f)return o?i.cursor(e.to,1):i.cursor(e.from,-1);if(f.level+ +!o<l.level)return i.cursor(f.side(!o,r)+e.from,f.forward(o,r)?1:-1,f.level)}return i.cursor(d+e.from,l.forward(o,r)?-1:1,l.level)}function Dt(e,t,n){for(let r=t;r<n;r++){let t=ht(e.charCodeAt(r));if(t==1)return lt;if(t==2||t==4)return ut}}var Ot=_.define(),kt=_.define(),At=_.define(),jt=_.define(),Mt=_.define(),Nt=_.define(),Pt=_.define(),Ft=_.define(),It=_.define(),Lt=_.define({combine:e=>e.some(e=>e)}),Rt=_.define({combine:e=>e.some(e=>e)}),zt=_.define(),Bt=class e{constructor(e,t,n,r,i,a=!1){this.range=e,this.y=t,this.x=n,this.yMargin=r,this.xMargin=i,this.isSnapshot=a}map(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new e(i.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},Vt=h.define({map:(e,t)=>e.map(t)}),Ht=h.define();function R(e,t,n){let r=e.facet(jt);r.length?r[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)||(n?console.error(n+`:`,t):console.error(t))}var z=_.define({combine:e=>!e.length||e[0]}),Ut=0,Wt=_.define({combine(e){return e.filter((t,n)=>{for(let r=0;r<n;r++)if(e[r].plugin==t.plugin)return!1;return!0})}}),B=class e{constructor(e,t,n,r,i){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=r,this.baseExtensions=i(this),this.extension=this.baseExtensions.concat(Wt.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Wt.of({plugin:this,arg:e}))}static define(t,n){let{eventHandlers:r,eventObservers:i,provide:a,decorations:o}=n||{};return new e(Ut++,t,r,i,e=>{let t=[];return o&&t.push(Jt.of(t=>{let n=t.plugin(e);return n?o(n):k.none})),a&&t.push(a(e)),t})}static fromClass(t,n){return e.define((e,n)=>new t(e,n),n)}},Gt=class{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.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){R(e.state,t,`CodeMirror plugin crashed`),this.deactivate()}}else if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(R(e.state,t,`CodeMirror plugin crashed`),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}return this}destroy(e){if(this.value?.destroy)try{this.value.destroy()}catch(t){R(e.state,t,`CodeMirror plugin crashed`)}}deactivate(){this.spec=this.value=null}},Kt=_.define(),qt=_.define(),Jt=_.define(),Yt=_.define(),Xt=_.define(),Zt=_.define(),Qt=_.define();function $t(e,t){let n=e.state.facet(Qt);if(!n.length)return n;let r=n.map(t=>t instanceof Function?t(e):t),i=[];return y.spans(r,t.from,t.to,{point(){},span(e,n,r,a){let o=e-t.from,s=n-t.from,c=i;for(let e=r.length-1;e>=0;e--,a--){let t=r[e].spec.bidiIsolate,n;if(a>0&&c.length&&(n=c[c.length-1]).to==o&&n.direction==t)n.to=s,c=n.inner;else{let e={from:o,to:s,direction:t,inner:[]};c.push(e),c=e.inner}}}}),en(t.text,i)}function en(e,t){for(let n of t){if(n.direction==null){for(let t=n.from,r=0;t<n.to;r++){let i=r<n.inner.length?n.inner[r]:null,a=Dt(e,t,i?i.from:n.to);if(a){n.direction=a;break}if(!i)break;t=i.to}n.direction??=P.LTR}en(e,n.inner)}return t}var tn=_.define();function nn(e){let t=0,n=0,r=0,i=0;for(let a of e.state.facet(tn)){let o=a(e);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(n=Math.max(n,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:t,right:n,top:r,bottom:i}}var rn=_.define(),V=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}join(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>n.toA)){if(r.toA<n.fromA)break;n=n.join(r),e.splice(t-1,1)}}return e.splice(t,0,n),e}static extendWithRanges(t,n){if(n.length==0)return t;let r=[];for(let i=0,a=0,o=0;;){let s=i<t.length?t[i].fromB:1e9,c=a<n.length?n[a]:1e9,l=Math.min(s,c);if(l==1e9)break;let u=l+o,d=l,f=u;for(;;)if(a<n.length&&n[a]<=d){let e=n[a+1];a+=2,d=Math.max(d,e);for(let e=i;e<t.length&&t[e].fromB<=d;e++)o=t[e].toA-t[e].toB;f=Math.max(f,e+o)}else if(i<t.length&&t[i].fromB<=d){let e=t[i++];d=Math.max(d,e.toB),f=Math.max(f,e.toA),o=e.toA-e.toB}else break;r.push(new e(u,f,l,d))}return r}},an=class e{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=g.empty(this.startState.doc.length);for(let e of n)this.changes=this.changes.compose(e.changes);let r=[];this.changes.iterChangedRanges((e,t,n,i)=>r.push(new V(e,t,n,i))),this.changedRanges=r}static create(t,n,r){return new e(t,n,r)}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}},on=[],H=class{constructor(e,t,n=0){this.dom=e,this.length=t,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return on}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 e=this.domAttrs;e&&De(this.dom,e)}}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,t=this.posAtStart){let n=t;for(let t of this.children){if(t==e)return n;n+=t.length+t.breakAfter}throw RangeError(`Invalid child in posBefore`)}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,n){return null}domPosFor(e,t){let n=j(this.dom),r=this.length?e>0:t>0;return new N(this.parent.dom,n+ +!!r,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 ln)return e;return null}static get(e){return e.cmTile}},sn=class extends H{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 t=this.dom,n=null,r,i=e?.node==t?e:null,a=0;for(let o of this.children){if(o.sync(e),a+=o.length+o.breakAfter,r=n?n.nextSibling:t.firstChild,i&&r!=o.dom&&(i.written=!0),o.dom.parentNode==t)for(;r&&r!=o.dom;)r=cn(r);else t.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:t.firstChild,i&&r&&(i.written=!0);r;)r=cn(r);this.length=a}};function cn(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var ln=class extends sn{constructor(e,t){super(t),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 t=H.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],n=this,r=0,i=0;;)if(r==n.children.length){if(!t.length)return;n=n.parent,n.breakAfter&&i++,r=t.pop()}else{let a=n.children[r++];if(a instanceof un)t.push(r),n=a,r=0;else{let t=i+a.length,n=e(a,i);if(n!==void 0)return n;i=t+a.breakAfter}}}resolveBlock(e,t){let n,r=-1,i,a=-1;if(this.blockTiles((o,s)=>{let c=s+o.length;if(e>=s&&e<=c){if(o.isWidget()&&t>=-1&&t<=1){if(o.flags&32)return!0;o.flags&16&&(n=void 0)}(s<e||e==c&&(t<-1?o.length:o.covers(1)))&&(!n||!o.isWidget()&&n.isWidget())&&(n=o,r=e-s),(c>e||e==s&&(t>1?o.length:o.covers(-1)))&&(!i||!o.isWidget()&&i.isWidget())&&(i=o,a=e-s)}}),!n&&!i)throw Error(`No tile at position `+e);return n&&t<0||!i?{tile:n,offset:r}:{tile:i,offset:a}}},un=class e extends sn{constructor(e,t){super(e),this.wrapper=t}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(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},dn=class e extends sn{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(t,n,r){let i=new e(n||document.createElement(`div`),t);return(!n||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,n=!1){let r=null,i=-1,a=null,o=-1;function s(e,c){for(let l=0,u=0;l<e.children.length&&u<=c;l++){let d=e.children[l],f=u+d.length;f>=c&&(d.isComposite()?s(d,c-u):(!a||n&&a.isHidden&&(t>0&&!(a.flags&32)||n&&pn(a,d)))&&(f>c||d.flags&32&&t<=1)?(a=d,o=c-u):(u<c||d.flags&16&&!(n&&d.isHidden)&&t>=-1)&&(r=d,i=c-u)),u=f}}s(this,e);let c=(t<0?r:a)||r||a;return c?{tile:c,offset:c==r?i:o}:null}coordsIn(e,t,n){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,n):fn(this)}domIn(e,t){let n=this.resolveInline(e,t);if(n){let{tile:e,offset:r}=n;if(this.dom.contains(e.dom))return e.isText()?new N(e.dom,Math.min(e.dom.nodeValue.length,r)):e.domPosFor(r,e.flags&16?1:e.flags&32?-1:t);let i=n.tile.parent,a=!1;for(let e of i.children){if(a)return new N(e.dom,0);e==n.tile&&(a=!0)}}return new N(this.dom,0)}};function fn(e){let t=e.dom.lastChild;if(!t)return e.dom.getBoundingClientRect();let n=Ve(t);return n[n.length-1]||null}function pn(e,t){let n=e.coordsIn(0,1),r=t.coordsIn(0,1);return n&&r&&r.top<n.bottom}var U=class e extends sn{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(t,n){let r=new e(n||document.createElement(t.tagName),t);return n||(r.flags|=4),r}},mn=class e extends H{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,n){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,a=e,o=0;e==0&&t<0||e==r&&t>=0?E.chrome||E.gecko||(e?(i--,o=1):a<r&&(a++,o=-1)):t<0?i--:a<r&&a++;let s=nt(this.dom,i,a).getClientRects();if(!s.length)return null;let c=s[(o?o<0:t>=0)?0:s.length-1];return E.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(s,e=>e.width)||c),n==null?c:Ge(c,(o?o>0:t<0)==n)}static of(t,n){let r=new e(n||document.createTextNode(t),t);return n||(r.flags|=2),r}},hn=class e extends H{constructor(e,t,n,r){super(e,t,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,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,n){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(n)return Ge(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let t=this.dom.getClientRects(),n=null;if(!t.length)return null;let r=this.flags&16?!0:this.flags&32?!1:e>0;for(let i=r?t.length-1:0;n=t[i],!(e>0?i==0:i==t.length-1||n.top<n.bottom);i+=r?-1:1);return Ge(n,!r)}}get overrideDOMText(){if(!this.length)return u.empty;let{root:e}=this;if(!e)return u.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(t,n,r,i,a){return a||(a=t.toDOM(n),t.editable||(a.contentEditable=`false`)),new e(a,r,t,i)}},gn=class extends H{constructor(e){let t=document.createElement(`img`);t.className=`cm-widgetBuffer`,t.setAttribute(`aria-hidden`,`true`),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return u.empty}coordsIn(e,t,n){let r=this.dom.getBoundingClientRect();return n==null?r:Ge(r,t>0==n)}},_n=class{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,n){let{tile:r,index:i,beforeBreak:a,parents:o}=this;for(;e||t>0;)if(!r.isComposite()){let t=r.length;if(i<t&&e){let a=Math.min(e,t-i);n&&n.skip(r,i,i+a),e-=a,i+=a}if(i==t)a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++;else if(!e)break}else if(a){if(!e)break;n&&n.break(),e--,a=!1}else if(i==r.children.length){if(!e&&!o.length)break;n&&n.leave(r),a=!!r.breakAfter,{tile:r,index:i}=o.pop(),i++}else{let s=r.children[i],c=s.breakAfter;(t>0?s.length<=e:s.length<e)&&(!n||n.skip(s,0,s.length)!==!1||!s.isComposite)?(a=!!c,i++,e-=s.length):(o.push({tile:r,index:i}),r=s,i=0,n&&s.isComposite()&&n.enter(s))}return this.tile=r,this.index=i,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}},vn=class{constructor(e,t,n,r){this.from=e,this.to=t,this.wrapper=n,this.rank=r}},yn=class{constructor(e,t,n){this.cache=e,this.root=t,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,n,r){this.flushBuffer();let i=this.ensureMarks(t,n),a=i.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let t=i.children[i.children.length-1]=new mn(a.dom,a.text+e);t.parent=i}else i.append(r||mn.of(e,this.cache.find(mn)?.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let n=this.curLine;n.dom!=t.line.dom&&(n.setDOM(this.cache.reused.has(t.line)?kn(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=n;for(let e=t.marks.length-1;e>=0;e--){let n=t.marks[e],i=r.lastChild;if(i instanceof U&&i.mark.eq(n.mark))i.dom!=n.dom&&i.setDOM(kn(n.dom)),r=i;else{let{dom:e}=n;this.cache.reused.get(n)&&H.get(n.dom)&&(e=kn(n.dom));let t=U.of(n.mark,e);r.append(t),r=t}this.cache.reused.set(n,2)}let i=H.get(e.text);i&&this.cache.reused.set(i,2);let a=new mn(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,n){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let i=this.ensureMarks(t,n);!r&&!(e.flags&16)&&i.append(this.getBuffer(1)),i.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,n){this.flushBuffer(),this.ensureMarks(t,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 t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){e||=En;let n=dn.start(e,t||this.cache.find(dn)?.dom,!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}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,t){let n=this.curLine;for(let r=e.length-1;r>=0;r--){let i=e[r],a;if(t>0&&(a=n.lastChild)&&a instanceof U&&a.mark.eq(i))n=a,t--;else{let e=U.of(i,this.cache.find(U,e=>e.mark.eq(i))?.dom);n.append(e),n=e,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!wn(this.curLine,!1)||e.dom.nodeName!=`BR`&&e.isWidget()&&!(E.ios&&wn(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(jn,0,32)||new hn(jn.toDOM(),0,jn,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&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,n=new vn(e.from,e.to,e.value,t),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(){this.updateBlockWrappers();let e=this.root;for(let t of this.wrappers){let n=e.lastChild;if(t.from<this.pos&&n instanceof un&&n.wrapper.eq(t.wrapper))e=n;else{let n=un.of(t.wrapper,this.cache.find(un,e=>e.wrapper.eq(t.wrapper))?.dom);e.append(n),e=n}}return e}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),n=this.cache.find(gn,void 0,1);return n&&(n.flags=t),n||new gn(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}},bn=class{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:t,lineBreak:n,done:r}=this.cursor.next(this.skipCount);if(this.skipCount=0,r)throw Error(`Ran out of text content when drawing inline views`);this.text=t;let i=this.textOff=Math.min(e,t.length);return n?null:t.slice(0,i)}let t=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,t);return this.textOff=t,n}},xn=[hn,dn,mn,U,gn,un,ln];for(let e=0;e<xn.length;e++)xn[e].bucket=e;var Sn=class{constructor(e){this.view=e,this.buckets=xn.map(()=>[]),this.index=xn.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,n=this.buckets[t];n.length<6?n.push(e):n[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,n=2){let r=e.bucket,i=this.buckets[r],a=this.index[r];for(let e=0;e<i.length;e++){let o=(e+a)%i.length,s=i[o];if((!t||t(s))&&!this.reused.has(s))return i.splice(o,1),o<a&&this.index[r]--,this.reused.set(s,n),s}return null}findWidget(e,t,n){let r=this.buckets[0];if(r.length)for(let i=0,a=0;;i++){if(i==r.length){if(a)return null;a=1,i=0}let o=r[i];if(!this.reused.has(o)&&(a==0?o.widget.compare(e):o.widget.constructor==e.constructor&&e.updateDOM(o.dom,this.view,o.widget)))return r.splice(i,1),i<this.index[0]&&this.index[0]--,o.widget==e&&o.length==t&&(o.flags&497)==n?(this.reused.set(o,1),o):(this.reused.set(o,2),new hn(o.dom,t,e,o.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}},Cn=class{constructor(e,t,n,r,i){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=i,this.openWidget=!1,this.openMarks=0,this.cache=new Sn(e),this.text=new bn(e.state.doc),this.builder=new yn(this.cache,new ln(e,e.contentDOM),y.iter(n)),this.cache.reused.set(t,2),this.old=new _n(t),this.reuseWalker={skip:(e,t,n)=>{if(this.cache.add(e),e.isComposite())return!1},enter:e=>this.cache.add(e),leave:()=>{},break:()=>{}}}run(e,t){let n=t&&this.getCompositionContext(t.text);for(let r=0,i=0,a=0;;){let o=a<e.length?e[a++]:null,s=o?o.fromA:this.old.root.length;if(s>r){let e=s-r;this.preserve(e,!a,!o),r=s,i+=e}if(!o)break;t&&o.fromA<=t.range.fromA&&o.toA>=t.range.toA?(this.forward(o.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(i,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,n),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,o.toA),this.emit(t.range.toB,o.toB)):(this.forward(o.fromA,o.toA),this.emit(i,o.toB)),i=o.toB,r=o.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,n){let r=On(this.old),i=this.openMarks;this.old.advance(e,n?1:-1,{skip:(e,t,n)=>{if(e.isWidget()){if(this.openWidget)this.builder.continueWidget(n-t);else{let a=n>0||t<e.length?hn.of(e.widget,this.view,n-t,e.flags&496,this.cache.maybeReuse(e)):this.cache.reuse(e);a.flags&256?(a.flags&=-2,this.builder.addBlockWidget(a)):(this.builder.ensureLine(null),this.builder.addInlineWidget(a,r,i),i=r.length)}}else if(e.isText())this.builder.ensureLine(null),!t&&n==e.length&&!this.cache.reused.has(e)?this.builder.addText(e.text,r,i,this.cache.reuse(e)):(this.cache.add(e),this.builder.addText(e.text.slice(t,n),r,i)),i=r.length;else if(e.isLine())e.flags&=-2,this.cache.reused.set(e,1),this.builder.addLine(e);else if(e instanceof gn)this.cache.add(e);else if(e instanceof U)this.builder.ensureLine(null),this.builder.addMark(e,r,i),this.cache.reused.set(e,1),i=r.length;else return!1;this.openWidget=!1},enter:e=>{e.isLine()?this.builder.addLineStart(e.attrs,this.cache.maybeReuse(e)):(this.cache.add(e),e instanceof U&&r.unshift(e.mark)),this.openWidget=!1},leave:e=>{e.isLine()?r.length&&=i=0:e instanceof U&&(r.shift(),i=Math.min(i,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let n=null,r=this.builder,i=-1,a=y.spans(this.decorations,e,t,{point:(e,t,a,o,s,c)=>{if(a instanceof Me){if(this.disallowBlockEffectsFor[c]){if(a.block)throw RangeError(`Block decorations may not be specified via plugins`);if(t>this.view.state.doc.lineAt(e).to)throw RangeError(`Decorations that replace line breaks may not be specified via plugins`)}if(i=o.length,s>o.length)r.continueWidget(t-e);else{let i=a.widget||(a.block?An.block:An.inline),c=Tn(a),l=this.cache.findWidget(i,t-e,c)||hn.of(i,this.view,t-e,c);a.block?(a.startSide>0&&r.addLineStartIfNotCovered(n),r.addBlockWidget(l)):(r.ensureLine(n),r.addInlineWidget(l,o,s))}n=null}else n=Dn(n,a);t>e&&this.text.skip(t-e)},span:(e,t,a,o)=>{for(let i=e;i<t;){let s=this.text.next(Math.min(512,t-i));s==null?(r.addLineStartIfNotCovered(n),r.addBreak(),i++):(r.ensureLine(n),r.addText(s,a,i==e?o:a.length),i+=s.length),n=null}i=a.length}});i>-1&&(this.openWidget=a>i),this.openWidget||r.addLineStartIfNotCovered(n),this.openMarks=a}forward(e,t,n=1){t-e<=10?this.old.advance(t-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let t=[],n=null;for(let r=e.parentNode;;r=r.parentNode){let e=H.get(r);if(r==this.view.contentDOM)break;e instanceof U?t.push(e):e?.isLine()?n=e:e instanceof un||(r.nodeName==`DIV`&&!n?n=new dn(r,En):n||t.push(U.of(new Ae({tagName:r.nodeName.toLowerCase(),attributes:ke(r)}),r)))}return n?{line:n,marks:t}:null}};function wn(e,t){let n=e=>{for(let r of e.children)if((t?r.isText():r.length)||n(r))return!0;return!1};return n(e)}function Tn(e){let t=e.isReplace?(e.startSide<0?64:0)|(e.endSide>0?128:0):e.startSide>0?32:16;return e.block&&(t|=256),t}var En={class:`cm-line`};function Dn(e,t){let n=t.spec.attributes,r=t.spec.class;return!n&&!r||(e||={class:`cm-line`},n&&we(n,e),r&&(e.class+=` `+r)),e}function On(e){let t=[];for(let n=e.parents.length;n>1;n--){let r=n==e.parents.length?e.tile:e.parents[n].tile;r instanceof U&&t.push(r.mark)}return t}function kn(e){let t=H.get(e);return t&&t.setDOM(e.cloneNode()),e}var An=class extends D{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}};An.inline=new An(`span`),An.block=new An(`div`);var jn=new class extends D{toDOM(){return document.createElement(`br`)}get isHidden(){return!0}get editable(){return!0}},Mn=class{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=k.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 ln(e,e.contentDOM),this.updateInner([new V(0,0,0,e.state.doc.length)],null)}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:e,toA:t})=>t<this.minWidthFrom||e>this.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 n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(this.domChanged?.newSel?n=this.domChanged.newSel.head:!Un(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?In(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:n,to:r}=this.hasComposition;t=new V(n,r,e.changes.mapPos(n,-1),e.changes.mapPos(r,1)).addToSet(t.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(E.ie||E.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,a=this.blockWrappers;this.updateDeco();let o=zn(i,this.decorations,e.changes);o.length&&(t=V.extendWithRanges(t,o));let s=Vn(a,this.blockWrappers,e.changes);return s.length&&(t=V.extendWithRanges(t,s)),r&&!t.some(e=>e.fromA<=r.range.fromA&&e.toA>=r.range.toA)&&(t=r.range.addToSet(t.slice())),this.tile.flags&2&&t.length==0?!1:(this.updateInner(t,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(t||e.length){let n=this.tile,r=new Cn(this.view,n,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&H.get(t.text)&&r.cache.reused.set(H.get(t.text),2),this.tile=r.run(e,t),Nn(n,r.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 r=E.chrome||E.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=``});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let e of this.tile.children)e.isWidget()&&e.widget instanceof Wn&&r.push(e.dom);n.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let e of t.effects)e.is(Ht)&&(this.editContextFormatting=e.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,r=this.view.root.activeElement,i=r==n,a=!i&&!(this.view.state.facet(z)||n.tabIndex>-1)&&Be(n,this.view.observer.selectionRange)&&!(r&&n.contains(r));if(!(i||t||a))return;let o=this.forceSelection;this.forceSelection=!1;let s=this.view.state.selection.main,c,l;if(s.empty?l=c=this.inlineDOMNearPos(s.anchor,s.assoc||1):(l=this.inlineDOMNearPos(s.head,s.head==s.from?1:-1),c=this.inlineDOMNearPos(s.anchor,s.anchor==s.from?1:-1)),E.gecko&&s.empty&&!this.hasComposition&&Pn(c)){let e=document.createTextNode(``);this.view.observer.ignore(()=>c.node.insertBefore(e,c.node.childNodes[c.offset]||null)),c=l=new N(e,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||(!He(c.node,c.offset,u.anchorNode,u.anchorOffset)||!He(l.node,l.offset,u.focusNode,u.focusOffset))&&!this.suppressWidgetCursorChange(u,s))&&(this.view.observer.ignore(()=>{E.android&&E.chrome&&n.contains(u.focusNode)&&Hn(u.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let e=Re(this.view.root);if(e){if(s.empty){if(E.gecko){let e=Ln(c.node,c.offset);if(e&&e!=3){let t=(e==1?st:ct)(c.node,c.offset);t&&(c=new N(t.node,t.offset))}}e.collapse(c.node,c.offset),s.bidiLevel!=null&&e.caretBidiLevel!==void 0&&(e.caretBidiLevel=s.bidiLevel)}else if(e.extend){e.collapse(c.node,c.offset);try{e.extend(l.node,l.offset)}catch{}}else{let t=document.createRange();s.anchor>s.head&&([c,l]=[l,c]),t.setEnd(l.node,l.offset),t.setStart(c.node,c.offset),e.removeAllRanges(),e.addRange(t)}}a&&this.view.root.activeElement==n&&(n.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(c,l)),this.impreciseAnchor=c.precise?null:new N(u.anchorNode,u.anchorOffset),this.impreciseHead=l.precise?null:new N(u.focusNode,u.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&He(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=Re(e.root),{anchorNode:r,anchorOffset:i}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let o=a.posAtStart;if(t.head==o||t.head==o+a.length)return;let s=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!s||!c||s.bottom>c.top)return;let l=this.domAtPos(t.head+t.assoc,t.assoc);n.collapse(l.node,l.offset),n.modify(`move`,t.assoc<0?`forward`:`backward`,`lineboundary`),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(r,i)}posFromDOM(e,t){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 i;if(e==n.dom)i=n.dom.childNodes[t];else{let r=M(e)==0?0:t==0?-1:1;for(;;){let t=e.parentNode;if(t==n.dom)break;r==0&&t.firstChild!=t.lastChild&&(r=e==t.firstChild?-1:1),e=t}i=r<0?e:e.nextSibling}if(i==n.dom.firstChild)return r;for(;i&&!H.get(i);)i=i.nextSibling;if(!i)return r+n.length;for(let e=0,t=r;;e++){let r=n.children[e];if(r.dom==i)return t;t+=r.length+r.breakAfter}}else if(n.isText())return e==n.dom?r+t:r+(t?n.length:0);else return r}domAtPos(e,t){let{tile:n,offset:r}=this.tile.resolveBlock(e,t);return n.isWidget()?n.domPosFor(r,t):n.domIn(r,t)}inlineDOMNearPos(e,t){let n,r=-1,i=!1,a,o=-1,s=!1;return this.tile.blockTiles((t,c)=>{if(t.isWidget()){if(t.flags&32&&c>=e)return!0;t.flags&16&&(i=!0)}else{let l=c+t.length;if(c<=e&&(n=t,r=e-c,i=l<e),l>=e&&!a&&(a=t,o=e-c,s=c>e),c>e&&a)return!0}}),!n&&!a?this.domAtPos(e,t):(i&&a?n=null:s&&n&&(a=null),n&&t<0||!a?n.domIn(r,t):a.domIn(o,t))}coordsAt(e,t,n){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof Wn?null:r.coordsInWidget(i,t,!0):r.coordsIn(i,t,n)}lineAt(e,t){let{tile:n}=this.tile.resolveBlock(e,t);return n.isLine()?n:null}coordsForChar(e){let{tile:t,offset:r}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function i(e,t){if(e.isComposite())for(let n of e.children){if(n.length>=t){let e=i(n,t);if(e)return e}if(t-=n.length,t<0)break}else if(e.isText()&&t<e.length){let r=n(e.text,t);if(r==t)return null;let i=nt(e.dom,t,r).getClientRects();for(let e=0;e<i.length;e++){let t=i[e];if(e==i.length-1||t.top<t.bottom&&t.left<t.right)return t}}return null}return i(t,r)}measureVisibleLineHeights(e){let t=[],{from:n,to:r}=e,i=this.view.contentDOM.clientWidth,a=i>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,s=this.view.textDirection==P.LTR,c=0,l=(e,u,d)=>{for(let f=0;f<e.children.length&&!(u>r);f++){let r=e.children[f],p=u+r.length,m=r.dom.getBoundingClientRect(),{height:h}=m;if(d&&!f&&(c+=m.top-d.top),r instanceof un)p>n&&l(r,u,m);else if(u>=n&&(c>0&&t.push(-c),t.push(h+c),c=0,a)){let e=r.dom.lastChild,t=e?Ve(e):[];if(t.length){let e=t[t.length-1],n=s?e.right-m.left:m.right-e.left;n>o&&(o=n,this.minWidth=i,this.minWidthFrom=u,this.minWidthTo=p)}}d&&f==e.children.length-1&&(c+=d.bottom-m.bottom),u=p+r.breakAfter}};return l(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction==`rtl`?P.RTL:P.LTR}measureTextSize(){let e=this.tile.blockTiles(e=>{if(e.isLine()&&e.children.length&&e.length<=20){let t=0,n;for(let r of e.children){if(!r.isText()||/[^ -~]/.test(r.text))return;let e=Ve(r.dom);if(e.length!=1)return;t+=e[0].width,n=e[0].height}if(t)return{lineHeight:e.dom.getBoundingClientRect().height,charWidth:t/e.length,textHeight:n}}});if(e)return e;let t=document.createElement(`div`),n,r,i;return t.className=`cm-line`,t.style.width=`99999px`,t.style.position=`absolute`,t.textContent=`abc def ghi jkl mno pqr stu`,this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let e=Ve(t.firstChild)[0];n=t.getBoundingClientRect().height,r=e&&e.width?e.width/27:7,i=e&&e.height?e.height:n,t.remove()}),{lineHeight:n,charWidth:r,textHeight:i}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,r=0;;r++){let i=r==t.viewports.length?null:t.viewports[r],a=i?i.from-1:this.view.state.doc.length;if(a>n){let r=(t.lineBlockAt(a).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(k.replace({widget:new Wn(r),block:!0,inclusive:!0,isBlockGap:!0}).range(n,a))}if(!i)break;n=i.to+1}return k.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Jt).map(t=>(this.dynamicDecorationMap[e++]=typeof t==`function`)?t(this.view):t),n=!1,r=this.view.state.facet(Xt).map((e,t)=>{let r=typeof e==`function`;return r&&(n=!0),r?e(this.view):e});for(r.length&&(this.dynamicDecorationMap[e++]=n,t.push(y.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(Yt).map(e=>typeof e==`function`?e(this.view):e)}scrollIntoView(e){if(e.isSnapshot){let t=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=t.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let t of this.view.state.facet(zt))try{if(t(this.view,e.range,e))return!0}catch(e){R(this.view.state,e,`scroll handler`)}let{range:t}=e,n=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!n)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.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 i=nn(this.view),a={left:n.left-i.left,top:n.top-i.top,right:n.right+i.right,bottom:n.bottom+i.bottom},{offsetWidth:o,offsetHeight:s}=this.view.scrollDOM;if(Je(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,o),-o),Math.max(Math.min(e.yMargin,s),-s),this.view.textDirection==P.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.visualViewport.offsetTop)){let e=this.view.docView.lineAt(t.head,1);if(e){let t=Ze(e.dom);e.dom.scrollIntoView({block:`nearest`}),Qe(t,!1)}}}lineHasWidget(e){let t=e=>e.isWidget()||e.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Nn(this.tile)}};function Nn(e,t){let n=t?.get(e);if(n!=1){n??e.destroy();for(let n of e.children)Nn(n,t)}}function Pn(e){return A(e.node)&&e.node.firstChild&&(e.offset==0||e.node.childNodes[e.offset-1].contentEditable==`false`)&&(e.offset==e.node.childNodes.length||e.node.childNodes[e.offset].contentEditable==`false`)}function Fn(e,t){let n=e.observer.selectionRange;if(!n.focusNode)return null;let r=st(n.focusNode,n.focusOffset),i=ct(n.focusNode,n.focusOffset),a=r||i;if(i&&r&&i.node!=r.node){let t=H.get(i.node);if(!t||t.isText()&&t.text!=i.node.nodeValue)a=i;else if(e.docView.lastCompositionAfterCursor){let e=H.get(r.node);!e||e.isText()&&e.text!=r.node.nodeValue||(a=i)}}if(e.docView.lastCompositionAfterCursor=a!=r,!a)return null;let o=t-a.offset;return{from:o,to:o+a.node.nodeValue.length,node:a.node}}function In(e,t,n){let r=Fn(e,n);if(!r)return null;let{node:i,from:a,to:o}=r,s=i.nodeValue;if(/[\n\r]/.test(s)||e.state.doc.sliceString(r.from,r.to)!=s)return null;let c=t.invertedDesc;return{range:new V(c.mapPos(a),c.mapPos(o),a,o),text:i}}function Ln(e,t){return A(e)?(t&&e.childNodes[t-1].contentEditable==`false`?1:0)|(t<e.childNodes.length&&e.childNodes[t].contentEditable==`false`?2:0):0}var Rn=class{constructor(){this.changes=[]}compareRange(e,t){Fe(e,t,this.changes)}comparePoint(e,t){Fe(e,t,this.changes)}boundChange(e){Fe(e,e,this.changes)}};function zn(e,t,n){let r=new Rn;return y.compare(e,t,n,r),r.changes}var Bn=class{constructor(){this.changes=[]}compareRange(e,t){Fe(e,t,this.changes)}comparePoint(){}boundChange(e){Fe(e,e,this.changes)}};function Vn(e,t,n){let r=new Bn;return y.compare(e,t,n,r),r.changes}function Hn(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(A(n)&&n.contentEditable==`false`)return!0;return!1}function Un(e,t){let n=!1;return t&&e.iterChangedRanges((e,r)=>{e<t.to&&r>t.from&&(n=!0)}),n}var Wn=class extends D{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 Gn(e,t,r=1){let a=e.charCategorizer(t),o=e.doc.lineAt(t),s=t-o.from;if(o.length==0)return i.cursor(t);s==0?r=1:s==o.length&&(r=-1);let c=s,l=s;r<0?c=n(o.text,s,!1):l=n(o.text,s);let u=a(o.text.slice(c,l));for(;c>0;){let e=n(o.text,c,!1);if(a(o.text.slice(e,c))!=u)break;c=e}for(;l<o.length;){let e=n(o.text,l);if(a(o.text.slice(l,e))!=u)break;l=e}return i.undirectionalRange(c+o.from,l+o.from)}function Kn(e,n,r,i,a){let o=Math.round((i-n.left)*e.defaultCharacterWidth);if(e.lineWrapping&&r.height>e.defaultLineHeight*1.5){let t=e.viewState.heightOracle.textHeight,n=Math.floor((a-r.top-(e.defaultLineHeight-t)*.5)/t);o+=n*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(r.from,r.to);return r.from+t(s,o,e.state.tabSize)}function qn(e,t,n){let r=e.lineBlockAt(t);if(Array.isArray(r.type)){let e;for(let i of r.type){if(i.from>t)break;if(!(i.to<t)){if(i.from<t&&i.to>t)return i;(!e||i.type==O.Text&&(e.type!=i.type||(n<0?i.from<t:i.to>t)))&&(e=i)}}return e||r}return r}function Jn(e,t,n,r){let a=qn(e,t.head,t.assoc||-1),o=!r||a.type!=O.Text||!(e.lineWrapping||a.widgetLineBreaks)?null:e.coordsAtPos(t.assoc<0&&t.head>a.from?t.head-1:t.head);if(o){let t=e.dom.getBoundingClientRect(),r=e.textDirectionAt(a.from),s=e.posAndSideAtCoords({x:n==(r==P.LTR)?t.right-1:t.left+1,y:(o.top+o.bottom)/2});if(s)return i.cursor(s.pos,s.assoc)}return i.cursor(n?a.to:a.from,n?1:-1)}function Yn(e,t,n,r){let a=e.state.doc.lineAt(t.head),o=e.bidiSpans(a),s=e.textDirectionAt(a.from);for(let c=t,l=null;;){let t=Et(a,o,s,c,n),u=Tt;if(!t){if(a.number==(n?e.state.doc.lines:1))return c;u=`
4
4
  `,a=e.state.doc.line(a.number+(n?1:-1)),o=e.bidiSpans(a),t=n?i.cursor(a.from,-1):i.cursor(a.to,1)}if(!l){if(!r)return t;l=r(u)}else if(!l(u))return c;c=t}}function Xn(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==d.Space&&(i=t),i==t}}function Zn(e,t,n,r){let a=t.head,o=n?1:-1;if(a==(n?e.state.doc.length:0))return i.cursor(a,t.assoc);let s=t.goalColumn,c,l=e.contentDOM.getBoundingClientRect(),u=e.coordsAtPos(a,t.assoc||((t.empty?n:t.head==t.from)?1:-1)),d=e.documentTop;if(u)s??=u.left-l.left,c=o<0?u.top:u.bottom;else{let t=e.viewState.lineBlockAt(a);s??=Math.min(l.right-l.left,e.defaultCharacterWidth*(a-t.from)),c=(o<0?t.top:t.bottom)+d}let f=l.left+s,p=e.viewState.heightOracle.textHeight>>1,m=r??p;for(let t=0;;t+=p){let r=c+(m+t)*o,a=tr(e,{x:f,y:r},!1,o);if(n?r>l.bottom:r<l.top)return i.cursor(a.pos,a.assoc);let u=e.coordsAtPos(a.pos,a.assoc),d=u?(u.top+u.bottom)/2:0;if(!u||(n?d>c:d<c))return i.cursor(a.pos,a.assoc,void 0,s)}}function Qn(e,t,n){for(;;){let r=0;for(let i of e)i.between(t-1,t+1,(e,i,a)=>{if(t>e&&t<i){let a=r||n||(t-e<i-t?-1:1);t=a<0?e:i,r=a}});if(!r)return t}}function $n(e,t){let n=null;for(let r=0;r<t.ranges.length;r++){let a=t.ranges[r],o=null;if(a.empty){let t=Qn(e,a.from,0);t!=a.from&&(o=i.cursor(t,-1))}else{let t=Qn(e,a.from,-1),n=Qn(e,a.to,1);(t!=a.from||n!=a.to)&&(o=a.undirectional?i.undirectionalRange(a.from,a.to):i.range(a.from==a.anchor?t:n,a.from==a.head?t:n))}o&&(n||=t.ranges.slice(),n[r]=o)}return n?i.create(n,t.mainIndex):t}function er(e,t,n){let r=Qn(e.state.facet(Zt).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:i.cursor(r,r<n.from?1:-1)}var W=class{constructor(e,t){this.pos=e,this.assoc=t}};function tr(e,t,n,r){let i=e.contentDOM.getBoundingClientRect(),a=i.top+e.viewState.paddingTop,{x:o,y:s}=t,c=s-a,l;for(;;){if(c<0)return new W(0,1);if(c>e.viewState.docHeight)return new W(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==O.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);if(t&&(r<0?t.top<=c+a:t.bottom>=c+a))break}let t=e.viewState.heightOracle.textHeight/2;c=r>0?l.bottom+t:l.top-t}if(e.viewport.from>=l.to||e.viewport.to<=l.from){if(n)return null;if(l.type==O.Text){let t=Kn(e,i,l,o,s);return new W(t,t==l.from?1:-1)}}if(l.type!=O.Text)return c<(l.top+l.bottom)/2?new W(l.from,1):new W(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new nr(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var nr=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[I.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[I.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){for(let e=1;e<n;e++){let t=f+e;if(t>=i&&(t-=n),!a.has(t)){f=t;break adjust}}break search}a.add(f);let p=t(f),m=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(t.width==0&&p.length>1)){if(t.bottom<this.y)(!s||s.bottom<t.bottom)&&(s=t),m=1;else if(t.top>this.y)(!c||c.top>t.top)&&(c=t),m=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<u&&(l=f,u=n,d=t),e&&(m=e<0==(this.baseDir==P.LTR)?-1:1)}}}m==-1&&(!o||this.baseDirAt(e[f],1))?i=f:m==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}if(!d){if(!c&&!s)return{i:0,after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==P.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let r=[];for(let i=0;i<e.length;i=n(e.text,i))r.push(t+i);r.push(t+e.length);let i=this.scan(r,n=>{let i=r[n]-t,a=r[n+1]-t;return nt(e.dom,i,a).getClientRects()});return i.after?new W(r[i.i+1],-1):new W(r[i.i],1)}scanTile(e,t){if(!e.length)return new W(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(A(n.dom)?n.dom:nt(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new W(n[r.i+1],-1):new W(a,1)}},rr=`￿`,ir=class{constructor(e,t){this.points=e,this.view=t,this.text=``,this.lineSeparator=t.state.facet(m.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=rr}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let r=e;;){this.findPointBefore(n,r);let e=this.text.length;this.readNode(r);let i=H.get(r),a=r.nextSibling;if(a==t){i?.breakAfter&&!a&&n!=this.view.contentDOM&&this.lineBreak();break}let o=H.get(a);(i&&o?i.breakAfter:(i?i.breakAfter:Ue(r))||Ue(a)&&(r.nodeName!=`BR`||i?.isWidget())&&this.text.length>e)&&!or(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let i=-1,a=1,o;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),a=this.lineSeparator.length):(o=r.exec(t))&&(i=o.index,a=o[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),a>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=a-1);n=i+a}}readNode(e){let t=H.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else Le(e)?this.readTextNode(e):e.nodeName==`BR`?e.nextSibling&&this.lineBreak():A(e)&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(Le(e)?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(ar(e,n.node,n.offset)?t:0))}};function ar(e,t,n){for(;;){if(!t||n<M(t))return!1;if(t==e)return!0;n=j(t)+1,t=t.parentNode}}function or(e,t){let n;for(;e!=t&&e;e=e.nextSibling){let t=H.get(e);if(!t?.isWidget())return!1;t&&(n||=[]).push(t)}if(n){for(let e of n)if(e.overrideDOMText?.length)return!1}return!0}var sr=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},cr=class{constructor(e,t,n,r){this.typeOver=r,this.bounds=null,this.text=``,this.domChanged=t>-1;let{impreciseHead:a,impreciseAnchor:o}=e.docView,s=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=lr(e.docView.tile,t,n,0))){let t=a||o?[]:mr(e),n=new ir(t,e);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=hr(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=a&&a.node==t.focusNode&&a.offset==t.focusOffset||!ze(e.contentDOM,t.focusNode)?s.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),r=o&&o.node==t.anchorNode&&o.offset==t.anchorOffset||!ze(e.contentDOM,t.anchorNode)?s.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset),c=e.viewport;if((E.ios||E.chrome)&&n!=r&&Math.min(n,r)<=s.main.from&&Math.max(n,r)>=s.main.to&&(c.from>0||c.to<e.state.doc.length)){let t=Math.min(n,r),i=Math.max(n,r),a=c.from-t,o=c.to-i;(a==0||a==1||t==0)&&(o==0||o==-1||i==e.state.doc.length)&&(n=0,r=e.state.doc.length)}if(e.inputState.composing>-1&&s.ranges.length>1)this.newSel=s.replaceRange(i.range(r,n));else if(e.lineWrapping&&r==n&&!(s.main.empty&&s.main.head==n)&&e.inputState.lastTouchTime>Date.now()-100){let t=e.coordsAtPos(n,-1),r=0;t&&(r=e.inputState.lastTouchY<=t.bottom?-1:1),this.newSel=i.create([i.cursor(n,r)])}else this.newSel=i.single(r,n)}}};function lr(e,t,n,r){if(e.isComposite()){let i=-1,a=-1,o=-1,s=-1;for(let c=0,l=r,u=r;c<e.children.length;c++){let r=e.children[c],d=l+r.length;if(l<t&&d>n)return lr(r,t,n,l);if(d>=t&&i==-1&&(i=c,a=l),l>n&&r.dom.parentNode==e.dom){o=c,s=u;break}u=d,l=d+r.breakAfter}return{from:a,to:s<0?r+e.length:s,startDOM:(i?e.children[i-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:o<e.children.length&&o>=0?e.children[o].dom:null}}return e.isText()?{from:r,to:r+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function ur(e,t){let n,{newSel:r}=t,{state:a}=e,o=a.selection.main,s=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:e,to:r}=t.bounds,i=o.from,c=null;(s===8||E.android&&t.text.length<r-e)&&(i=o.to,c=`end`);let l=a.doc.sliceString(e,r,rr),d,f;!o.empty&&o.from>=e&&o.to<=r&&(t.typeOver||l!=t.text)&&l.slice(0,o.from-e)==t.text.slice(0,o.from-e)&&l.slice(o.to-e)==t.text.slice(d=t.text.length-(l.length-(o.to-e)))?n={from:o.from,to:o.to,insert:u.of(t.text.slice(o.from-e,d).split(rr))}:(f=pr(l,t.text,i-e,c))&&(E.chrome&&s==13&&f.toB==f.from+2&&t.text.slice(f.from,f.toB)==`￿￿`&&f.toB--,n={from:e+f.from,to:e+f.toA,insert:u.of(t.text.slice(f.from,f.toB).split(rr))})}else r&&(!e.hasFocus&&a.facet(z)||gr(r,o))&&(r=null);if(!n&&!r)return!1;if((E.mac||E.android)&&n&&n.from==n.to&&n.from==o.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute(`autocorrect`)==`off`?(r&&n.insert.length==2&&(r=i.single(r.main.anchor-1,r.main.head-1)),n={from:n.from,to:n.to,insert:u.of([n.insert.toString().replace(`.`,` `)])}):a.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?n={from:o.from,to:o.to,insert:a.toText(e.inputState.insertingText)}:E.chrome&&n&&n.from==n.to&&n.from==o.head&&n.insert.toString()==`
@@ -1 +1 @@
1
- import{i as e,o as t}from"./dist-DPDGd2jl.js";import{LRLanguage as n,LanguageSupport as r,continuedIndent as i,foldInside as a,foldNodeProp as o,indentNodeProp as s}from"./dist-DPvy57Ph.js";import{r as c}from"./dist-DrbUrVWB.js";var l=e({String:t.string,Number:t.number,"True False":t.bool,PropertyName:t.propertyName,Null:t.null,", :":t.separator,"[ ]":t.squareBracket,"{ }":t.brace}),u=c.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[l],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),d=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;let n=f(t,e.state.doc);return[{from:n,message:t.message,severity:`error`,to:n}]}return[]};function f(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}var p=n.define({name:`json`,parser:u.configure({props:[s.add({Object:i({except:/^\s*\}/}),Array:i({except:/^\s*\]/})}),o.add({"Object Array":a})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function m(){return new r(p)}export{m as json,p as jsonLanguage,d as jsonParseLinter};
1
+ import{i as e,o as t}from"./dist-CEJcHfEn.js";import{LRLanguage as n,LanguageSupport as r,continuedIndent as i,foldInside as a,foldNodeProp as o,indentNodeProp as s}from"./dist-zwqOqWyp.js";import{r as c}from"./dist-BO4YrDmO.js";var l=e({String:t.string,Number:t.number,"True False":t.bool,PropertyName:t.propertyName,Null:t.null,", :":t.separator,"[ ]":t.squareBracket,"{ }":t.brace}),u=c.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[l],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),d=()=>e=>{try{JSON.parse(e.state.doc.toString())}catch(t){if(!(t instanceof SyntaxError))throw t;let n=f(t,e.state.doc);return[{from:n,message:t.message,severity:`error`,to:n}]}return[]};function f(e,t){let n;return(n=e.message.match(/at position (\d+)/))?Math.min(+n[1],t.length):(n=e.message.match(/at line (\d+) column (\d+)/))?Math.min(t.line(+n[1]).from+ +n[2]-1,t.length):0}var p=n.define({name:`json`,parser:u.configure({props:[s.add({Object:i({except:/^\s*\}/}),Array:i({except:/^\s*\]/})}),o.add({"Object Array":a})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function m(){return new r(p)}export{m as json,p as jsonLanguage,d as jsonParseLinter};