una-editor 0.4.0-alpha.4 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +15 -0
- package/README.md +15 -0
- package/dist/{index-B6kc5e_c.cjs → index-BcqI91QM.cjs} +1 -1
- package/dist/{index-CJaHSXXm.js → index-BuJ2Gb-B.js} +5061 -4896
- package/dist/{index-CUWKj-Pm.cjs → index-C85rY6gs.cjs} +1 -1
- package/dist/{index-DQaIv52u.cjs → index-CI8bJb1S.cjs} +1 -1
- package/dist/{index-D-lTdNim.js → index-DS8-oUFk.js} +1 -1
- package/dist/{index-B4J47r4S.js → index-GBXAvQ_M.js} +1 -1
- package/dist/index-Kzx2JXPf.cjs +74 -0
- package/dist/{index-BGsEz2lq.js → index-XFoxWCYJ.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/types/components/UnaEditor.vue.d.ts +4 -3
- package/dist/types/components/UnaEditor.vue.d.ts.map +1 -1
- package/dist/types/composables/useEditor.d.ts +3 -9
- package/dist/types/composables/useEditor.d.ts.map +1 -1
- package/dist/types/extensions/codeBlockLivePreview.d.ts.map +1 -1
- package/dist/types/extensions/languageSupport.d.ts.map +1 -1
- package/dist/types/extensions/structuredTable.d.ts.map +1 -1
- package/dist/types/extensions/vim.d.ts +8 -0
- package/dist/types/extensions/vim.d.ts.map +1 -0
- package/dist/types/themes/editorAppearance.d.ts +25 -0
- package/dist/types/themes/editorAppearance.d.ts.map +1 -0
- package/dist/types/types/editor.d.ts +15 -0
- package/dist/types/types/editor.d.ts.map +1 -1
- package/dist/types/types/editorRuntime.d.ts +21 -0
- package/dist/types/types/editorRuntime.d.ts.map +1 -0
- package/dist/una-editor.css +1 -1
- package/package.json +2 -1
- package/dist/index-xk13mx42.cjs +0 -74
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";const ue=require("vue");let Za=[],ld=[];(()=>{let n="lc,34,7n,7,7b,19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77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?ld:Za).push(t=t+n[e])})();function x0(n){if(n<768)return!1;for(let e=0,t=Za.length;;){let i=e+t>>1;if(n<Za[i])t=i;else if(n>=ld[i])e=i+1;else return!0;if(e==t)return!1}}function Qh(n){return n>=127462&&n<=127487}const $h=8205;function Q0(n,e,t=!0,i=!0){return(t?cd:$0)(n,e,i)}function cd(n,e,t){if(e==n.length)return e;e&&hd(n.charCodeAt(e))&&ud(n.charCodeAt(e-1))&&e--;let i=Wo(n,e);for(e+=Ch(i);e<n.length;){let r=Wo(n,e);if(i==$h||r==$h||t&&x0(r))e+=Ch(r),i=r;else if(Qh(r)){let s=0,o=e-2;for(;o>=0&&Qh(Wo(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function $0(n,e,t){for(;e>0;){let i=cd(n,e-2,t);if(i<e)return i;e--}return 0}function Wo(n,e){let t=n.charCodeAt(e);if(!ud(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return hd(i)?(t-55296<<10)+(i-56320)+65536:t}function hd(n){return n>=56320&&n<57344}function ud(n){return n>=55296&&n<56320}function Ch(n){return n<65536?1:2}let be=class fd{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Xn(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),ri.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Xn(this,e,t);let i=[];return this.decompose(e,t,i,0),ri.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new Or(this),s=new Or(e);for(let o=t,a=t;;){if(r.next(o),s.next(o),o=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(a+=r.value.length,r.done||a>=i)return!0}}iter(e=1){return new Or(this,e)}iterRange(e,t=this.length){return new dd(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new pd(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?fd.empty:e.length<=32?new Be(e):ri.from(Be.split(e,[]))}};class Be extends be{constructor(e,t=C0(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.text[s],a=r+o.length;if((t?i:a)>=e)return new P0(r,a,i,o);r=a+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new Be(Ph(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let o=i.pop(),a=vs(s.text,o.text.slice(),0,s.length);if(a.length<=32)i.push(new Be(a,o.length+s.length));else{let l=a.length>>1;i.push(new Be(a.slice(0,l)),new Be(a.slice(l)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof Be))return super.replace(e,t,i);[e,t]=Xn(this,e,t);let r=vs(this.text,vs(i.text,Ph(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new Be(r,s):ri.from(Be.split(r,[]),s)}sliceString(e,t=this.length,i=`
|
|
2
|
+
`){[e,t]=Xn(this,e,t);let r="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(r+=i),e<l&&t>s&&(r+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new Be(i,r)),i=[],r=-1);return r>-1&&t.push(new Be(i,r)),t}}class ri extends be{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let o=this.children[s],a=r+o.length,l=i+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,i,r);r=a+1,i=l+1}}decompose(e,t,i,r){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&t>=o){let h=r&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!h?i.push(a):a.decompose(e-o,t-o,i,h)}o=l+1}}replace(e,t,i){if([e,t]=Xn(this,e,t),i.lines<this.lines)for(let r=0,s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.length;if(e>=s&&t<=a){let l=o.replace(e-s,t-s,i),h=this.lines-o.lines+l.lines;if(l.lines<h>>4&&l.lines>h>>6){let f=this.children.slice();return f[r]=l,new ri(f,this.length-(t-e)+i.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
3
|
+
`){[e,t]=Xn(this,e,t);let r="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(r+=i),e<l&&t>o&&(r+=a.sliceString(e-o,t-o,i)),o=l+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof ri))return 0;let i=0,[r,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==o||s==a)return i;let l=this.children[r],h=e.children[s];if(l!=h)return i+l.scanIdentical(h,t);i+=l.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let b of e)i+=b.lines;if(i<32){let b=[];for(let S of e)S.flatten(b);return new Be(b,t)}let r=Math.max(32,i>>5),s=r<<1,o=r>>1,a=[],l=0,h=-1,f=[];function O(b){let S;if(b.lines>s&&b instanceof ri)for(let Q of b.children)O(Q);else b.lines>o&&(l>o||!l)?(m(),a.push(b)):b instanceof Be&&l&&(S=f[f.length-1])instanceof Be&&b.lines+S.lines<=32?(l+=b.lines,h+=b.length+1,f[f.length-1]=new Be(S.text.concat(b.text),S.length+1+b.length)):(l+b.lines>r&&m(),l+=b.lines,h+=b.length+1,f.push(b))}function m(){l!=0&&(a.push(f.length==1?f[0]:ri.from(f,h)),h=-1,l=f.length=0)}for(let b of e)O(b);return m(),a.length==1?a[0]:new ri(a,t)}}be.empty=new Be([""],0);function C0(n){let e=-1;for(let t of n)e+=t.length+1;return e}function vs(n,e,t=0,i=1e9){for(let r=0,s=0,o=!0;s<n.length&&r<=i;s++){let a=n[s],l=r+a.length;l>=t&&(l>i&&(a=a.slice(0,i-r)),r<t&&(a=a.slice(t-r)),o?(e[e.length-1]+=a,o=!1):e.push(a)),r=l+1}return e}function Ph(n,e,t){return vs(n,[""],e,t)}class Or{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof Be?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],o=s>>1,a=r instanceof Be?r.text.length:r.children.length;if(o==(t>0?a:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
|
+
`,this;e--}else if(r instanceof Be){let l=r.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=r.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof Be?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class dd{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Or(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class pd{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(be.prototype[Symbol.iterator]=function(){return this.iter()},Or.prototype[Symbol.iterator]=dd.prototype[Symbol.iterator]=pd.prototype[Symbol.iterator]=function(){return this});let P0=class{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}};function Xn(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function Ne(n,e,t=!0,i=!0){return Q0(n,e,t,i)}function T0(n){return n>=56320&&n<57344}function A0(n){return n>=55296&&n<56320}function Od(n,e){let t=n.charCodeAt(e);if(!A0(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return T0(i)?(t-55296<<10)+(i-56320)+65536:t}function M0(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function gd(n){return n<65536?1:2}const Ea=/\r\n?|\n/;var He=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(He||(He={}));class hi{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,r=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(i,r,s),r+=s):r+=o,i+=s}}iterChangedRanges(e,t=!1){Xa(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];r<0?e.push(i,r):e.push(r,i)}return new hi(e)}composeDesc(e){return this.empty?e:e.empty?this:md(this,e)}mapDesc(e,t=!1){return e.empty?this:Ba(this,e,t)}mapPos(e,t=-1,i=He.Simple){let r=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],h=r+a;if(l<0){if(h>e)return s+(e-r);s+=a}else{if(i!=He.Simple&&h>=e&&(i==He.TrackDel&&r<e&&h>e||i==He.TrackBefore&&r<e||i==He.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!a)return e==r||t<0?s:s+l;s+=l}r=h}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let s=this.sections[i++],o=this.sections[i++],a=r+s;if(o>=0&&r<=t&&a>=e)return r<e&&a>t?"cover":!0;r=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new hi(e)}static create(e){return new hi(e)}}class Ve extends hi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Xa(this,(t,i,r,s,o)=>e=e.replace(r,r+(i-t),o),!1),e}mapDesc(e,t=!1){return Ba(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r<t.length;r+=2){let o=t[r],a=t[r+1];if(a>=0){t[r]=a,t[r+1]=o;let l=r>>1;for(;i.length<l;)i.push(be.empty);i.push(o?e.slice(s,s+o):be.empty)}s+=o}return new Ve(t,i)}compose(e){return this.empty?e:e.empty?this:md(this,e,!0)}map(e,t=!1){return e.empty?this:Ba(this,e,t,!0)}iterChanges(e,t=!1){Xa(this,e,t)}get desc(){return hi.create(this.sections)}filter(e){let t=[],i=[],r=[],s=new wr(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&s.len==0;){if(s.done)break e;let f=Math.min(s.len,l-a);it(r,f,-1);let O=s.ins==-1?-1:s.off==0?s.ins:0;it(t,f,O),O>0&&Ri(i,t,s.text),s.forward(f),a+=f}let h=e[o++];for(;a<h;){if(s.done)break e;let f=Math.min(s.len,h-a);it(t,f,-1),it(r,f,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(f),a+=f}}return{changes:new Ve(t,i),filtered:hi.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],r=this.sections[t+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],o=0,a=null;function l(f=!1){if(!f&&!r.length)return;o<t&&it(r,t-o,-1);let O=new Ve(r,s);a=a?a.compose(O.map(a)):O,r=[],s=[],o=0}function h(f){if(Array.isArray(f))for(let O of f)h(O);else if(f instanceof Ve){if(f.length!=t)throw new RangeError(`Mismatched change set length (got ${f.length}, expected ${t})`);l(),a=a?a.compose(f.map(a)):f}else{let{from:O,to:m=O,insert:b}=f;if(O>m||O<0||m>t)throw new RangeError(`Invalid change range ${O} to ${m} (in doc of length ${t})`);let S=b?typeof b=="string"?be.of(b.split(i||Ea)):b:be.empty,Q=S.length;if(O==m&&Q==0)return;O<o&&l(),O>o&&it(r,O-o,-1),it(r,m-O,Q),Ri(s,r,S),o=m}}return h(e),l(!a),a}static empty(e){return new Ve(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;r<e.length;r++){let s=e[r];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length<r;)i.push(be.empty);i[r]=be.of(s.slice(1)),t.push(s[0],i[r].length)}}}return new Ve(t,i)}static createSet(e,t){return new Ve(e,t)}}function it(n,e,t,i=!1){if(e==0&&t<=0)return;let r=n.length-2;r>=0&&t<=0&&t==n[r+1]?n[r]+=e:r>=0&&e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function Ri(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(be.empty);n.push(t)}}function Xa(n,e,t){let i=n.inserted;for(let r=0,s=0,o=0;o<n.sections.length;){let a=n.sections[o++],l=n.sections[o++];if(l<0)r+=a,s+=a;else{let h=r,f=s,O=be.empty;for(;h+=a,f+=l,l&&i&&(O=O.append(i[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)a=n.sections[o++],l=n.sections[o++];e(r,h,s,f,O),r=h,s=f}}}function Ba(n,e,t,i=!1){let r=[],s=i?[]:null,o=new wr(n),a=new wr(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let h=Math.min(o.len,a.len);it(r,h,-1),o.forward(h),a.forward(h)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!t))){let h=a.len;for(it(r,a.ins,-1);h;){let f=Math.min(o.len,h);o.ins>=0&&l<o.i&&o.len<=f&&(it(r,0,o.ins),s&&Ri(s,r,o.text),l=o.i),o.forward(f),h-=f}a.next()}else if(o.ins>=0){let h=0,f=o.len;for(;f;)if(a.ins==-1){let O=Math.min(f,a.len);h+=O,f-=O,a.forward(O)}else if(a.ins==0&&a.len<f)f-=a.len,a.next();else break;it(r,h,l<o.i?o.ins:0),s&&l<o.i&&Ri(s,r,o.text),l=o.i,o.forward(o.len-f)}else{if(o.done&&a.done)return s?Ve.createSet(r,s):hi.create(r);throw new Error("Mismatched change set lengths")}}}function md(n,e,t=!1){let i=[],r=t?[]:null,s=new wr(n),o=new wr(e);for(let a=!1;;){if(s.done&&o.done)return r?Ve.createSet(i,r):hi.create(i);if(s.ins==0)it(i,s.len,0,a),s.next();else if(o.len==0&&!o.done)it(i,0,o.ins,a),r&&Ri(r,i,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,o.len),h=i.length;if(s.ins==-1){let f=o.ins==-1?-1:o.off?0:o.ins;it(i,l,f,a),r&&f&&Ri(r,i,o.text)}else o.ins==-1?(it(i,s.off?0:s.len,l,a),r&&Ri(r,i,s.textBit(l))):(it(i,s.off?0:s.len,o.off?0:o.ins,a),r&&!o.off&&Ri(r,i,o.text));a=(s.ins>l||o.ins>=0&&o.len>l)&&(a||i.length>h),s.forward2(l),o.forward(l)}}}}class wr{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?be.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?be.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class rn{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new rn(i,r,this.flags)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return Z.range(e,t,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Z.range(this.anchor,r,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Z.range(e.anchor,e.head)}static create(e,t,i){return new rn(e,t,i)}}class Z{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Z.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new Z([this.main],0)}addRange(e,t=!0){return Z.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,Z.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Z(e.ranges.map(t=>rn.fromJSON(t)),e.main)}static single(e,t=e){return new Z([Z.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let s=e[r];if(s.empty?s.from<=i:s.from<i)return Z.normalized(e.slice(),t);i=s.to}return new Z(e,t)}static cursor(e,t=0,i,r){return rn.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(r??16777215)<<6)}static range(e,t,i,r,s){let o=(i??16777215)<<6|(r==null?7:Math.min(6,r));return!s&&e!=t&&(s=t<e?1:-1),t<e?rn.create(t,e,48|o):rn.create(e,t,(s?s<0?8:16:0)|o)}static normalized(e,t=0){let i=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(i);for(let r=1;r<e.length;r++){let s=e[r],o=e[r-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,l=Math.max(s.to,o.to);r<=t&&t--,e.splice(--r,2,s.anchor>s.head?Z.range(l,a):Z.range(a,l))}}return new Z(e,t)}}function yd(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let _l=0;class F{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=_l++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new F(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:jl),!!e.static,e.enables)}of(e){return new Ss([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ss(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Ss(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function jl(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Ss{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=_l++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,h=!1,f=[];for(let O of this.dependencies)O=="doc"?l=!0:O=="selection"?h=!0:(((t=e[O.id])!==null&&t!==void 0?t:1)&1)==0&&f.push(e[O.id]);return{create(O){return O.values[o]=i(O),1},update(O,m){if(l&&m.docChanged||h&&(m.docChanged||m.selection)||Ia(O,f)){let b=i(O);if(a?!Th(b,O.values[o],r):!r(b,O.values[o]))return O.values[o]=b,1}return 0},reconfigure:(O,m)=>{let b,S=m.config.address[s];if(S!=null){let Q=Rs(m,S);if(this.dependencies.every(P=>P instanceof F?m.facet(P)===O.facet(P):P instanceof Ct?m.field(P,!1)==O.field(P,!1):!0)||(a?Th(b=i(O),Q,r):r(b=i(O),Q)))return O.values[o]=Q,0}else b=i(O);return O.values[o]=b,1}}}}function Th(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function Ia(n,e){let t=!1;for(let i of e)gr(n,i)&1&&(t=!0);return t}function R0(n,e,t){let i=t.map(l=>n[l.id]),r=t.map(l=>l.type),s=i.filter(l=>!(l&1)),o=n[e.id]>>1;function a(l){let h=[];for(let f=0;f<i.length;f++){let O=Rs(l,i[f]);if(r[f]==2)for(let m of O)h.push(m);else h.push(O)}return e.combine(h)}return{create(l){for(let h of i)gr(l,h);return l.values[o]=a(l),1},update(l,h){if(!Ia(l,s))return 0;let f=a(l);return e.compare(f,l.values[o])?0:(l.values[o]=f,1)},reconfigure(l,h){let f=Ia(l,i),O=h.config.facets[e.id],m=h.facet(e);if(O&&!f&&jl(t,O))return l.values[o]=m,0;let b=a(l);return e.compare(b,m)?(l.values[o]=m,0):(l.values[o]=b,1)}}}const Hr=F.define({static:!0});class Ct{constructor(e,t,i,r,s){this.id=e,this.createF=t,this.updateF=i,this.compareF=r,this.spec=s,this.provides=void 0}static define(e){let t=new Ct(_l++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Hr).find(i=>i.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],o=this.updateF(s,r);return this.compareF(s,o)?0:(i.values[t]=o,1)},reconfigure:(i,r)=>{let s=i.facet(Hr),o=r.facet(Hr),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(i.values[t]=a.create(i),1):r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Hr.of({field:this,create:e})]}get extension(){return this}}const tn={lowest:4,low:3,default:2,high:1,highest:0};function er(n){return e=>new bd(e,n)}const wi={highest:er(tn.highest),high:er(tn.high),default:er(tn.default),low:er(tn.low),lowest:er(tn.lowest)};class bd{constructor(e,t){this.inner=e,this.prec=t}}class Fe{of(e){return new Da(this,e)}reconfigure(e){return Fe.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Da{constructor(e,t){this.compartment=e,this.inner=t}}class Ms{constructor(e,t,i,r,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let r=[],s=Object.create(null),o=new Map;for(let m of L0(e,t,o))m instanceof Ct?r.push(m):(s[m.facet.id]||(s[m.facet.id]=[])).push(m);let a=Object.create(null),l=[],h=[];for(let m of r)a[m.id]=h.length<<1,h.push(b=>m.slot(b));let f=i?.config.facets;for(let m in s){let b=s[m],S=b[0].facet,Q=f&&f[m]||[];if(b.every(P=>P.type==0))if(a[S.id]=l.length<<1|1,jl(Q,b))l.push(i.facet(S));else{let P=S.combine(b.map(A=>A.value));l.push(i&&S.compare(P,i.facet(S))?i.facet(S):P)}else{for(let P of b)P.type==0?(a[P.id]=l.length<<1|1,l.push(P.value)):(a[P.id]=h.length<<1,h.push(A=>P.dynamicSlot(A)));a[S.id]=h.length<<1,h.push(P=>R0(P,S,b))}}let O=h.map(m=>m(a));return new Ms(e,o,O,a,l,s)}}function L0(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(o,a){let l=r.get(o);if(l!=null){if(l<=a)return;let h=i[l].indexOf(o);h>-1&&i[l].splice(h,1),o instanceof Da&&t.delete(o.compartment)}if(r.set(o,a),Array.isArray(o))for(let h of o)s(h,a);else if(o instanceof Da){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),s(h,a)}else if(o instanceof bd)s(o.inner,o.prec);else if(o instanceof Ct)i[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof Ss)i[a].push(o),o.facet.extensions&&s(o.facet.extensions,tn.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,a)}}return s(n,tn.default),i.reduce((o,a)=>o.concat(a))}function gr(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function Rs(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const vd=F.define(),_a=F.define({combine:n=>n.some(e=>e),static:!0}),Sd=F.define({combine:n=>n.length?n[0]:void 0,static:!0}),kd=F.define(),wd=F.define(),xd=F.define(),Qd=F.define({combine:n=>n.length?n[0]:!1});class xi{constructor(e,t){this.type=e,this.value=t}static define(){return new Z0}}class Z0{of(e){return new xi(this,e)}}class E0{constructor(e){this.map=e}of(e){return new Oe(this,e)}}class Oe{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Oe(this.type,t)}is(e){return this.type==e}static define(e={}){return new E0(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}}Oe.reconfigure=Oe.define();Oe.appendConfig=Oe.define();class Te{constructor(e,t,i,r,s,o){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,i&&yd(i,t.newLength),s.some(a=>a.type==Te.time)||(this.annotations=s.concat(Te.time.of(Date.now())))}static create(e,t,i,r,s,o){return new Te(e,t,i,r,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Te.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Te.time=xi.define();Te.userEvent=xi.define();Te.addToHistory=xi.define();Te.remote=xi.define();function X0(n,e){let t=[];for(let i=0,r=0;;){let s,o;if(i<n.length&&(r==e.length||e[r]>=n[i]))s=n[i++],o=n[i++];else if(r<e.length)s=e[r++],o=e[r++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function $d(n,e,t){var i;let r,s,o;return t?(r=e.changes,s=Ve.empty(e.changes.length),o=n.changes.compose(e.changes)):(r=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(r)),{changes:o,selection:e.selection?e.selection.map(s):(i=n.selection)===null||i===void 0?void 0:i.map(r),effects:Oe.mapEffects(n.effects,r).concat(Oe.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function ja(n,e,t){let i=e.selection,r=$n(e.annotations);return e.userEvent&&(r=r.concat(Te.userEvent.of(e.userEvent))),{changes:e.changes instanceof Ve?e.changes:Ve.of(e.changes||[],t,n.facet(Sd)),selection:i&&(i instanceof Z?i:Z.single(i.anchor,i.head)),effects:$n(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function Cd(n,e,t){let i=ja(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;i=$d(i,ja(n,e[s],o?i.changes.newLength:n.doc.length),o)}let r=Te.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return I0(t?B0(r):r)}function B0(n){let e=n.startState,t=!0;for(let r of e.facet(kd)){let s=r(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:X0(t,s))}if(t!==!0){let r,s;if(t===!1)s=n.changes.invertedDesc,r=Ve.empty(e.doc.length);else{let o=n.changes.filter(t);r=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}n=Te.create(e,r,n.selection&&n.selection.map(s),Oe.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let i=e.facet(wd);for(let r=i.length-1;r>=0;r--){let s=i[r](n);s instanceof Te?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof Te?n=s[0]:n=Cd(e,$n(s),!1)}return n}function I0(n){let e=n.startState,t=e.facet(xd),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=$d(i,ja(e,s,n.changes.newLength),!0))}return i==n?n:Te.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const D0=[];function $n(n){return n==null?D0:Array.isArray(n)?n:[n]}var Ke=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Ke||(Ke={}));const _0=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Va;try{Va=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function j0(n){if(Va)return Va.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||_0.test(t)))return!0}return!1}function V0(n){return e=>{if(!/\S/.test(e))return Ke.Space;if(j0(e))return Ke.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Ke.Word;return Ke.Other}}class he{constructor(e,t,i,r,s,o){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)gr(this,a<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return gr(this,i),Rs(this,i)}update(...e){return Cd(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:r}=t;for(let a of e.effects)a.is(Fe.reconfigure)?(t&&(r=new Map,t.compartments.forEach((l,h)=>r.set(h,l)),t=null),r.set(a.value.compartment,a.value.extension)):a.is(Oe.reconfigure)?(t=null,i=a.value):a.is(Oe.appendConfig)&&(t=null,i=$n(i).concat(a.value));let s;t?s=e.startState.values.slice():(t=Ms.resolve(i,r,this),s=new he(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,h)=>h.reconfigure(l,this),null).values);let o=e.startState.facet(_a)?e.newSelection:e.newSelection.asSingle();new he(t,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Z.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],o=$n(i.effects);for(let a=1;a<t.ranges.length;a++){let l=e(t.ranges[a]),h=this.changes(l.changes),f=h.map(r);for(let m=0;m<a;m++)s[m]=s[m].map(f);let O=r.mapDesc(h,!0);s.push(l.range.map(O)),r=r.compose(f),o=Oe.mapEffects(o,f).concat(Oe.mapEffects($n(l.effects),O))}return{changes:r,selection:Z.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Ve?e:Ve.of(e,this.doc.length,this.facet(he.lineSeparator))}toText(e){return be.of(e.split(this.facet(he.lineSeparator)||Ea))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(gr(this,t),Rs(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof Ct&&this.config.address[r.id]!=null&&(t[i]=r.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let o=i[s],a=e[s];r.push(o.init(l=>o.spec.fromJSON(a,l)))}}return he.create({doc:e.doc,selection:Z.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Ms.resolve(e.extensions||[],new Map),i=e.doc instanceof be?e.doc:be.of((e.doc||"").split(t.staticFacet(he.lineSeparator)||Ea)),r=e.selection?e.selection instanceof Z?e.selection:Z.single(e.selection.anchor,e.selection.head):Z.single(0);return yd(r,i.length),t.staticFacet(_a)||(r=r.asSingle()),new he(t,i,r,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(he.tabSize)}get lineBreak(){return this.facet(he.lineSeparator)||`
|
|
5
|
+
`}get readOnly(){return this.facet(Qd)}phrase(e,...t){for(let i of this.facet(he.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let s of this.facet(vd))for(let o of s(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&r.push(o[e]);return r}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return V0(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-i,a=e-i;for(;o>0;){let l=Ne(t,o,!1);if(s(t.slice(l,o))!=Ke.Word)break;o=l}for(;a<r;){let l=Ne(t,a);if(s(t.slice(a,l))!=Ke.Word)break;a=l}return o==a?null:Z.range(o+i,a+i)}}he.allowMultipleSelections=_a;he.tabSize=F.define({combine:n=>n.length?n[0]:4});he.lineSeparator=Sd;he.readOnly=Qd;he.phrases=F.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});he.languageData=vd;he.changeFilter=kd;he.transactionFilter=wd;he.transactionExtender=xd;Fe.reconfigure=Oe.define();function lo(n,e,t={}){let i={};for(let r of n)for(let s of Object.keys(r)){let o=r[s],a=i[s];if(a===void 0)i[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Ei{eq(e){return this==e}range(e,t=e){return za.create(e,t,this)}}Ei.prototype.startSide=Ei.prototype.endSide=0;Ei.prototype.point=!1;Ei.prototype.mapMode=He.TrackDel;function Vl(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let za=class Pd{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Pd(e,t,i)}};function Wa(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class zl{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let s=i?this.to:this.from;for(let o=r,a=s.length;;){if(o==a)return o;let l=o+a>>1,h=s[l]-e||(i?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return h>=0?o:a;h>=0?a=l:o=l+1}}between(e,t,i,r){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,s);s<o;s++)if(r(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let i=[],r=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let h=this.value[l],f=this.from[l]+e,O=this.to[l]+e,m,b;if(f==O){let S=t.mapPos(f,h.startSide,h.mapMode);if(S==null||(m=b=S,h.startSide!=h.endSide&&(b=t.mapPos(f,h.endSide),b<m)))continue}else if(m=t.mapPos(f,h.startSide),b=t.mapPos(O,h.endSide),m>b||m==b&&h.startSide>0&&h.endSide<=0)continue;(b-m||h.endSide-h.startSide)<0||(o<0&&(o=m),h.point&&(a=Math.max(a,b-m)),i.push(h),r.push(m-o),s.push(b-o))}return{mapped:i.length?new zl(r,s,i,a):null,pos:o}}}class pe{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new pe(e,t,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Wa)),this.isEmpty)return t.length?pe.of(t):this;let a=new Td(this,null,-1).goto(0),l=0,h=[],f=new Bn;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let O=t[l++];f.addInner(O.from,O.to,O.value)||h.push(O)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!o||r>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&f.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||r>a.to||s<a.from||o(a.from,a.to,a.value))&&(f.addInner(a.from,a.to,a.value)||h.push(za.create(a.from,a.to,a.value))),a.next());return f.finishInner(this.nextLayer.isEmpty&&!h.length?pe.empty:this.nextLayer.update({add:h,filter:o,filterFrom:r,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],r=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],h=e.touchesRange(a,a+l.length);if(h===!1)r=Math.max(r,l.maxPoint),t.push(l),i.push(e.mapPos(a));else if(h===!0){let{mapped:f,pos:O}=l.map(a,e);f&&(r=Math.max(r,f.maxPoint),t.push(f),i.push(O))}}let s=this.nextLayer.map(e);return t.length==0?s:new pe(i,t,s||pe.empty,r)}between(e,t,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return xr.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return xr.from(e).goto(t)}static compare(e,t,i,r,s=-1){let o=e.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),a=t.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),l=Ah(o,a,i),h=new tr(o,l,s),f=new tr(a,l,s);i.iterGaps((O,m,b)=>Mh(h,O,f,m,b,r)),i.empty&&i.length==0&&Mh(h,0,f,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let s=e.filter(f=>!f.isEmpty&&t.indexOf(f)<0),o=t.filter(f=>!f.isEmpty&&e.indexOf(f)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=Ah(s,o),l=new tr(s,a,0).goto(i),h=new tr(o,a,0).goto(i);for(;;){if(l.to!=h.to||!Na(l.active,h.active)||l.point&&(!h.point||!Vl(l.point,h.point)))return!1;if(l.to>r)return!0;l.next(),h.next()}}static spans(e,t,i,r,s=-1){let o=new tr(e,null,s).goto(t),a=t,l=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let f=o.activeForPoint(o.to),O=o.pointFrom<t?f.length+1:o.point.startSide<0?f.length:Math.min(f.length,l);r.point(a,h,o.point,f,O,o.pointRank),l=Math.min(o.openEnd(h),f.length)}else h>a&&(r.span(a,h,o.active,l),l=o.openEnd(h));if(o.to>i)return l+(o.point&&o.to>i?1:0);a=o.to,o.next()}}static of(e,t=!1){let i=new Bn;for(let r of e instanceof za?[e]:t?z0(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return pe.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=pe.empty;r=r.nextLayer)t=new pe(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}pe.empty=new pe([],[],null,-1);function z0(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(Wa(e,i)>0)return n.slice().sort(Wa);e=i}return n}pe.empty.nextLayer=pe.empty;class Bn{finishChunk(e){this.chunks.push(new zl(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Bn)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(pe.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=pe.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Ah(n,e,t){let i=new Map;for(let s of n)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&i.set(s.chunk[o],s.chunkPos[o]);let r=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=i.get(s.chunk[o]);a!=null&&(t?t.mapPos(a):a)==s.chunkPos[o]&&!t?.touchesRange(a,a+s.chunk[o].length)&&r.add(s.chunk[o])}return r}class Td{constructor(e,t,i,r=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class xr{constructor(e){this.heap=e}static from(e,t=null,i=-1){let r=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&r.push(new Td(o,t,i,s));return r.length==1?r[0]:new xr(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)No(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)No(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),No(this.heap,0)}}}function No(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1<n.length&&r.compare(n[i+1])>=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}class tr{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=xr.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Kr(this.active,e),Kr(this.activeTo,e),Kr(this.activeRank,e),this.minActive=Rh(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||r-this.activeTo[t])>0;)t++;Jr(this.active,t,i),Jr(this.activeTo,t,r),Jr(this.activeRank,t,s),e&&Jr(e,t,this.cursor.from),this.minActive=Rh(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Kr(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Mh(n,e,t,i,r,s){n.goto(e),t.goto(i);let o=i+r,a=i,l=i-e,h=!!s.boundChange;for(let f=!1;;){let O=n.to+l-t.to,m=O||n.endSide-t.endSide,b=m<0?n.to+l:t.to,S=Math.min(b,o);if(n.point||t.point?(n.point&&t.point&&Vl(n.point,t.point)&&Na(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(a,S,n.point,t.point),f=!1):(f&&s.boundChange(a),S>a&&!Na(n.active,t.active)&&s.compareRange(a,S,n.active,t.active),h&&S<o&&(O||n.openEnd(b)!=t.openEnd(b))&&(f=!0)),b>o)break;a=b,m<=0&&n.next(),m>=0&&t.next()}}function Na(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!Vl(n[t],e[t]))return!1;return!0}function Kr(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function Jr(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function Rh(n,e){let t=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||n[r].endSide-n[t].endSide)<0&&(t=r,i=e[r]);return t}function Si(n,e,t=n.length){let i=0;for(let r=0;r<t&&r<n.length;)n.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=Ne(n,r));return i}function W0(n,e,t,i){for(let r=0,s=0;;){if(s>=e)return r;if(r==n.length)break;s+=n.charCodeAt(r)==9?t-s%t:1,r=Ne(n,r)}return n.length}const Ya="ͼ",Lh=typeof Symbol>"u"?"__"+Ya:Symbol.for(Ya),qa=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Zh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class Xi{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,h){let f=[],O=/^@(\w+)\b/.exec(o[0]),m=O&&O[1]=="keyframes";if(O&&a==null)return l.push(o[0]+";");for(let b in a){let S=a[b];if(/&/.test(b))s(b.split(/,\s*/).map(Q=>o.map(P=>Q.replace(/&/,P))).reduce((Q,P)=>Q.concat(P)),S,l);else if(S&&typeof S=="object"){if(!O)throw new RangeError("The value of a property ("+b+") should be a primitive value.");s(r(b),S,f,m)}else S!=null&&f.push(b.replace(/_.*/,"").replace(/[A-Z]/g,Q=>"-"+Q.toLowerCase())+": "+S+";")}(f.length||m)&&l.push((i&&!O&&!h?o.map(i):o).join(", ")+" {"+f.join(" ")+"}")}for(let o in e)s(r(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
6
|
+
`)}static newName(){let e=Zh[Lh]||1;return Zh[Lh]=e+1,Ya+e.toString(36)}static mount(e,t,i){let r=e[qa],s=i&&i.nonce;r?s&&r.setNonce(s):r=new N0(e,s),r.mount(Array.isArray(t)?t:[t],e)}}let Eh=new Map;class N0{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Eh.get(i);if(s)return e[qa]=s;this.sheet=new r.CSSStyleSheet,Eh.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[qa]=this}mount(e,t){let i=this.sheet,r=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],l=this.modules.indexOf(a);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),i)for(let h=0;h<a.rules.length;h++)i.insertRule(a.rules[h],r++)}else{for(;s<l;)r+=this.modules[s++].rules.length;r+=a.rules.length,s++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let l=0;l<this.modules.length;l++)o+=this.modules[l].getRules()+`
|
|
7
|
+
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Bi={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:"'"},Qr={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Y0=typeof navigator<"u"&&/Mac/.test(navigator.platform),q0=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Ue=0;Ue<10;Ue++)Bi[48+Ue]=Bi[96+Ue]=String(Ue);for(var Ue=1;Ue<=24;Ue++)Bi[Ue+111]="F"+Ue;for(var Ue=65;Ue<=90;Ue++)Bi[Ue]=String.fromCharCode(Ue+32),Qr[Ue]=String.fromCharCode(Ue);for(var Yo in Bi)Qr.hasOwnProperty(Yo)||(Qr[Yo]=Bi[Yo]);function F0(n){var e=Y0&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||q0&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Qr:Bi)[n.keyCode]||n.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}let ct=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Fa=typeof document<"u"?document:{documentElement:{style:{}}};const Ga=/Edge\/(\d+)/.exec(ct.userAgent),Ad=/MSIE \d/.test(ct.userAgent),Ua=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ct.userAgent),co=!!(Ad||Ua||Ga),Xh=!co&&/gecko\/(\d+)/i.test(ct.userAgent),qo=!co&&/Chrome\/(\d+)/.exec(ct.userAgent),G0="webkitFontSmoothing"in Fa.documentElement.style,Ha=!co&&/Apple Computer/.test(ct.vendor),Bh=Ha&&(/Mobile\/\w+/.test(ct.userAgent)||ct.maxTouchPoints>2);var q={mac:Bh||/Mac/.test(ct.platform),windows:/Win/.test(ct.platform),linux:/Linux|X11/.test(ct.platform),ie:co,ie_version:Ad?Fa.documentMode||6:Ua?+Ua[1]:Ga?+Ga[1]:0,gecko:Xh,gecko_version:Xh?+(/Firefox\/(\d+)/.exec(ct.userAgent)||[0,0])[1]:0,chrome:!!qo,chrome_version:qo?+qo[1]:0,ios:Bh,android:/Android\b/.test(ct.userAgent),webkit_version:G0?+(/\bAppleWebKit\/(\d+)/.exec(ct.userAgent)||[0,0])[1]:0,safari:Ha,safari_version:Ha?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ct.userAgent)||[0,0])[1]:0,tabSize:Fa.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Wl(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Ls=Object.create(null);function Nl(n,e,t){if(n==e)return!0;n||(n=Ls),e||(e=Ls);let i=Object.keys(n),r=Object.keys(e);if(i.length-0!=r.length-0)return!1;for(let s of i)if(s!=t&&(r.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function U0(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function Ih(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r=="style"?n.style.cssText="":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r=="style"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function H0(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}class bt{eq(e){return!1}updateDOM(e,t,i){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,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var mt=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(mt||(mt={}));class H extends Ei{constructor(e,t,i,r){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new _r(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new on(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:o}=Md(e,t);i=(s?t?-3e8:-1:5e8)-1,r=(o?t?2e8:1:-6e8)+1}return new on(e,i,r,t,e.widget||null,!0)}static line(e){return new jr(e)}static set(e,t=!1){return pe.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}H.none=pe.empty;class _r extends H{constructor(e){let{start:t,end:i}=Md(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Wl(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Ls}eq(e){return this==e||e instanceof _r&&this.tagName==e.tagName&&Nl(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}_r.prototype.point=!1;class jr extends H{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof jr&&this.spec.class==e.spec.class&&Nl(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}jr.prototype.mapMode=He.TrackBefore;jr.prototype.point=!0;class on extends H{constructor(e,t,i,r,s,o){super(t,i,s,e),this.block=r,this.isReplace=o,this.mapMode=r?t<=0?He.TrackBefore:He.TrackAfter:He.TrackDel}get type(){return this.startSide!=this.endSide?mt.WidgetRange:this.startSide<=0?mt.WidgetBefore:mt.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof on&&K0(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}on.prototype.point=!0;function Md(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function K0(n,e){return n==e||!!(n&&e&&n.compare(e))}function Cn(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}class $r extends Ei{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof $r&&this.tagName==e.tagName&&Nl(this.attributes,e.attributes)}static create(e){return new $r(e.tagName,e.attributes||Ls)}static set(e,t=!1){return pe.of(e,t)}}$r.prototype.startSide=$r.prototype.endSide=-1;function Cr(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Ka(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function mr(n,e){if(!e.anchorNode)return!1;try{return Ka(n,e.anchorNode)}catch{return!1}}function yr(n){return n.nodeType==3?Tr(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function br(n,e,t,i){return t?Dh(n,e,t,i,-1)||Dh(n,e,t,i,1):!1}function Ii(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Zs(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function Dh(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:ki(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=Ii(n)+(r<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=r<0?ki(n):0}else return!1}}function ki(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Pr(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function J0(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Rd(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function ey(n,e,t,i,r,s,o,a){let l=n.ownerDocument,h=l.defaultView||window;for(let f=n,O=!1;f&&!O;)if(f.nodeType==1){let m,b=f==l.body,S=1,Q=1;if(b)m=J0(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(f).position)&&(O=!0),f.scrollHeight<=f.clientHeight&&f.scrollWidth<=f.clientWidth){f=f.assignedSlot||f.parentNode;continue}let E=f.getBoundingClientRect();({scaleX:S,scaleY:Q}=Rd(f,E)),m={left:E.left,right:E.left+f.clientWidth*S,top:E.top,bottom:E.top+f.clientHeight*Q}}let P=0,A=0;if(r=="nearest")e.top<m.top?(A=e.top-(m.top+o),t>0&&e.bottom>m.bottom+A&&(A=e.bottom-m.bottom+o)):e.bottom>m.bottom&&(A=e.bottom-m.bottom+o,t<0&&e.top-A<m.top&&(A=e.top-(m.top+o)));else{let E=e.bottom-e.top,B=m.bottom-m.top;A=(r=="center"&&E<=B?e.top+E/2-B/2:r=="start"||r=="center"&&t<0?e.top-o:e.bottom-B+o)-m.top}if(i=="nearest"?e.left<m.left?(P=e.left-(m.left+s),t>0&&e.right>m.right+P&&(P=e.right-m.right+s)):e.right>m.right&&(P=e.right-m.right+s,t<0&&e.left<m.left+P&&(P=e.left-(m.left+s))):P=(i=="center"?e.left+(e.right-e.left)/2-(m.right-m.left)/2:i=="start"==a?e.left-s:e.right-(m.right-m.left)+s)-m.left,P||A)if(b)h.scrollBy(P,A);else{let E=0,B=0;if(A){let U=f.scrollTop;f.scrollTop+=A/Q,B=(f.scrollTop-U)*Q}if(P){let U=f.scrollLeft;f.scrollLeft+=P/S,E=(f.scrollLeft-U)*S}e={left:e.left-E,top:e.top-B,right:e.right-E,bottom:e.bottom-B},E&&Math.abs(E-P)<1&&(i="nearest"),B&&Math.abs(B-A)<1&&(r="nearest")}if(b)break;(e.top<m.top||e.bottom>m.bottom||e.left<m.left||e.right>m.right)&&(e={left:Math.max(e.left,m.left),right:Math.min(e.right,m.right),top:Math.max(e.top,m.top),bottom:Math.min(e.bottom,m.bottom)}),f=f.assignedSlot||f.parentNode}else if(f.nodeType==11)f=f.host;else break}function Ld(n,e=!0){let t=n.ownerDocument,i=null,r=null;for(let s=n.parentNode;s&&!(s==t.body||(!e||i)&&r);)if(s.nodeType==1)!r&&s.scrollHeight>s.clientHeight&&(r=s),e&&!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:r}}class ty{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:i}=e;this.set(t,Math.min(e.anchorOffset,t?ki(t):0),i,Math.min(e.focusOffset,i?ki(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}}let Ji=null;q.safari&&q.safari_version>=26&&(Ji=!1);function Zd(n){if(n.setActive)return n.setActive();if(Ji)return n.focus(Ji);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Ji==null?{get preventScroll(){return Ji={preventScroll:!0},!0}}:void 0),!Ji){Ji=!1;for(let t=0;t<e.length;){let i=e[t++],r=e[t++],s=e[t++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=s&&(i.scrollLeft=s)}}}let _h;function Tr(n,e,t=e){let i=_h||(_h=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Pn(n,e,t,i){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let s=new KeyboardEvent("keydown",r);s.synthetic=!0,n.dispatchEvent(s);let o=new KeyboardEvent("keyup",r);return o.synthetic=!0,n.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function iy(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function ny(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,ki(t));;)if(i){if(t.nodeType!=1)return!1;let r=t.childNodes[i-1];r.contentEditable=="false"?i--:(t=r,i=ki(t))}else{if(t==n)return!0;i=Ii(t),t=t.parentNode}}function Ed(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function Xd(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=ki(t)}else if(t.parentNode&&!Zs(t))i=Ii(t),t=t.parentNode;else return null}}function Bd(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!Zs(t))i=Ii(t)+1,t=t.parentNode;else return null}}class Vt{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new Vt(e.parentNode,Ii(e),t)}static after(e,t){return new Vt(e.parentNode,Ii(e)+1,t)}}var Ee=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(Ee||(Ee={}));const an=Ee.LTR,Yl=Ee.RTL;function Id(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const ry=Id("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),sy=Id("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Ja=Object.create(null),Jt=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Ja[e]=t,Ja[t]=-e}function Dd(n){return n<=247?ry[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?sy[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const oy=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class oi{get dir(){return this.level%2?Yl:an}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,r){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==i)return o;(s<0||(r!=0?r<0?a.from<t:a.to>t:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function _d(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let i=n[t],r=e[t];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!_d(i.inner,r.inner))return!1}return!0}const ke=[];function ay(n,e,t,i,r){for(let s=0;s<=i.length;s++){let o=s?i[s-1].to:e,a=s<i.length?i[s].from:t,l=s?256:r;for(let h=o,f=l,O=l;h<a;h++){let m=Dd(n.charCodeAt(h));m==512?m=f:m==8&&O==4&&(m=16),ke[h]=m==4?2:m,m&7&&(O=m),f=m}for(let h=o,f=l,O=l;h<a;h++){let m=ke[h];if(m==128)h<a-1&&f==ke[h+1]&&f&24?m=ke[h]=f:ke[h]=256;else if(m==64){let b=h+1;for(;b<a&&ke[b]==64;)b++;let S=h&&f==8||b<t&&ke[b]==8?O==1?1:8:256;for(let Q=h;Q<b;Q++)ke[Q]=S;h=b-1}else m==8&&O==1&&(ke[h]=1);f=m,m&7&&(O=m)}}}function ly(n,e,t,i,r){let s=r==1?2:1;for(let o=0,a=0,l=0;o<=i.length;o++){let h=o?i[o-1].to:e,f=o<i.length?i[o].from:t;for(let O=h,m,b,S;O<f;O++)if(b=Ja[m=n.charCodeAt(O)])if(b<0){for(let Q=a-3;Q>=0;Q-=3)if(Jt[Q+1]==-b){let P=Jt[Q+2],A=P&2?r:P&4?P&1?s:r:0;A&&(ke[O]=ke[Jt[Q]]=A),a=Q;break}}else{if(Jt.length==189)break;Jt[a++]=O,Jt[a++]=m,Jt[a++]=l}else if((S=ke[O])==2||S==1){let Q=S==r;l=Q?0:1;for(let P=a-3;P>=0;P-=3){let A=Jt[P+2];if(A&2)break;if(Q)Jt[P+2]|=2;else{if(A&4)break;Jt[P+2]|=4}}}}}function cy(n,e,t,i){for(let r=0,s=i;r<=t.length;r++){let o=r?t[r-1].to:n,a=r<t.length?t[r].from:e;for(let l=o;l<a;){let h=ke[l];if(h==256){let f=l+1;for(;;)if(f==a){if(r==t.length)break;f=t[r++].to,a=r<t.length?t[r].from:e}else if(ke[f]==256)f++;else break;let O=s==1,m=(f<e?ke[f]:i)==1,b=O==m?O?1:2:i;for(let S=f,Q=r,P=Q?t[Q-1].to:n;S>l;)S==P&&(S=t[--Q].from,P=Q?t[Q-1].to:n),ke[--S]=b;l=f}else s=h,l++}}}function el(n,e,t,i,r,s,o){let a=i%2?2:1;if(i%2==r%2)for(let l=e,h=0;l<t;){let f=!0,O=!1;if(h==s.length||l<s[h].from){let Q=ke[l];Q!=a&&(f=!1,O=Q==16)}let m=!f&&a==1?[]:null,b=f?i:i+1,S=l;e:for(;;)if(h<s.length&&S==s[h].from){if(O)break e;let Q=s[h];if(!f)for(let P=Q.to,A=h+1;;){if(P==t)break e;if(A<s.length&&s[A].from==P)P=s[A++].to;else{if(ke[P]==a)break e;break}}if(h++,m)m.push(Q);else{Q.from>l&&o.push(new oi(l,Q.from,b));let P=Q.direction==an!=!(b%2);tl(n,P?i+1:i,r,Q.inner,Q.from,Q.to,o),l=Q.to}S=Q.to}else{if(S==t||(f?ke[S]!=a:ke[S]==a))break;S++}m?el(n,l,S,i+1,r,m,o):l<S&&o.push(new oi(l,S,b)),l=S}else for(let l=t,h=s.length;l>e;){let f=!0,O=!1;if(!h||l>s[h-1].to){let Q=ke[l-1];Q!=a&&(f=!1,O=Q==16)}let m=!f&&a==1?[]:null,b=f?i:i+1,S=l;e:for(;;)if(h&&S==s[h-1].to){if(O)break e;let Q=s[--h];if(!f)for(let P=Q.from,A=h;;){if(P==e)break e;if(A&&s[A-1].to==P)P=s[--A].from;else{if(ke[P-1]==a)break e;break}}if(m)m.push(Q);else{Q.to<l&&o.push(new oi(Q.to,l,b));let P=Q.direction==an!=!(b%2);tl(n,P?i+1:i,r,Q.inner,Q.from,Q.to,o),l=Q.from}S=Q.from}else{if(S==e||(f?ke[S-1]!=a:ke[S-1]==a))break;S--}m?el(n,S,l,i+1,r,m,o):S<l&&o.push(new oi(S,l,b)),l=S}}function tl(n,e,t,i,r,s,o){let a=e%2?2:1;ay(n,r,s,i,a),ly(n,r,s,i,a),cy(r,s,i,a),el(n,r,s,e,t,i,o)}function hy(n,e,t){if(!n)return[new oi(0,0,e==Yl?1:0)];if(e==an&&!t.length&&!oy.test(n))return jd(n.length);if(t.length)for(;n.length>ke.length;)ke[ke.length]=256;let i=[],r=e==an?0:1;return tl(n,r,r,t,0,n.length,i),i}function jd(n){return[new oi(0,n,0)]}let Vd="";function uy(n,e,t,i,r){var s;let o=i.head-n.from,a=oi.find(e,o,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc),l=e[a],h=l.side(r,t);if(o==h){let m=a+=r?1:-1;if(m<0||m>=e.length)return null;l=e[a=m],o=l.side(!r,t),h=l.side(r,t)}let f=Ne(n.text,o,l.forward(r,t));(f<l.from||f>l.to)&&(f=h),Vd=n.text.slice(Math.min(o,f),Math.max(o,f));let O=a==(r?e.length-1:0)?null:e[a+(r?1:-1)];return O&&f==h&&O.level+(r?0:1)<l.level?Z.cursor(O.side(!r,t)+n.from,O.forward(r,t)?1:-1,O.level):Z.cursor(f+n.from,l.forward(r,t)?-1:1,l.level)}function fy(n,e,t){for(let i=e;i<t;i++){let r=Dd(n.charCodeAt(i));if(r==1)return an;if(r==2||r==4)return Yl}return an}const zd=F.define(),Wd=F.define(),Nd=F.define(),Yd=F.define(),il=F.define(),qd=F.define(),Fd=F.define(),ql=F.define(),Fl=F.define(),Gd=F.define({combine:n=>n.some(e=>e)}),dy=F.define({combine:n=>n.some(e=>e)}),Ud=F.define();class Tn{constructor(e,t="nearest",i="nearest",r=5,s=5,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new Tn(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Tn(Z.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const es=Oe.define({map:(n,e)=>n.map(e)}),Hd=Oe.define();function ai(n,e,t){let i=n.facet(Yd);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const Oi=F.define({combine:n=>n.length?n[0]:!0});let py=0;const xn=F.define({combine(n){return n.filter((e,t)=>{for(let i=0;i<t;i++)if(n[i].plugin==e.plugin)return!1;return!0})}});class et{constructor(e,t,i,r,s){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(xn.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(xn.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:i,eventObservers:r,provide:s,decorations:o}=t||{};return new et(py++,e,i,r,a=>{let l=[];return o&&l.push(ho.of(h=>{let f=h.plugin(a);return f?o(f):H.none})),s&&l.push(s(a)),l})}static fromClass(e,t){return et.define((i,r)=>new e(i,r),t)}}class Fo{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(ai(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){ai(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){ai(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Kd=F.define(),Gl=F.define(),ho=F.define(),Jd=F.define(),Ul=F.define(),Vr=F.define(),ep=F.define();function jh(n,e){let t=n.state.facet(ep);if(!t.length)return t;let i=t.map(s=>s instanceof Function?s(n):s),r=[];return pe.spans(i,e.from,e.to,{point(){},span(s,o,a,l){let h=s-e.from,f=o-e.from,O=r;for(let m=a.length-1;m>=0;m--,l--){let b=a[m].spec.bidiIsolate,S;if(b==null&&(b=fy(e.text,h,f)),l>0&&O.length&&(S=O[O.length-1]).to==h&&S.direction==b)S.to=f,O=S.inner;else{let Q={from:h,to:f,direction:b,inner:[]};O.push(Q),O=Q.inner}}}}),r}const tp=F.define();function ip(n){let e=0,t=0,i=0,r=0;for(let s of n.state.facet(tp)){let o=s(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(r=Math.max(r,o.bottom)))}return{left:e,right:t,top:i,bottom:r}}const cr=F.define();class Zt{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new Zt(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let r=0,s=0,o=0;;){let a=r<e.length?e[r].fromB:1e9,l=s<t.length?t[s]:1e9,h=Math.min(a,l);if(h==1e9)break;let f=h+o,O=h,m=f;for(;;)if(s<t.length&&t[s]<=O){let b=t[s+1];s+=2,O=Math.max(O,b);for(let S=r;S<e.length&&e[S].fromB<=O;S++)o=e[S].toA-e[S].toB;m=Math.max(m,b+o)}else if(r<e.length&&e[r].fromB<=O){let b=e[r++];O=Math.max(O,b.toB),m=Math.max(m,b.toA),o=b.toA-b.toB}else break;i.push(new Zt(f,m,h,O))}return i}}class Es{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Ve.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,o,a,l)=>r.push(new Zt(s,o,a,l))),this.changedRanges=r}static create(e,t,i){return new Es(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const Oy=[];class Xe{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return Oy}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 t=this.domAttrs;t&&U0(this.dom,t)}}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 i=t;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let i=Ii(this.dom),r=this.length?e>0:t>0;return new Vt(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof fo)return e;return null}static get(e){return e.cmTile}}class uo extends Xe{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,i=null,r,s=e?.node==t?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,r=i?i.nextSibling:t.firstChild,s&&r!=a.dom&&(s.written=!0),a.dom.parentNode==t)for(;r&&r!=a.dom;)r=Vh(r);else t.insertBefore(a.dom,r);i=a.dom}for(r=i?i.nextSibling:t.firstChild,s&&r&&(s.written=!0);r;)r=Vh(r);this.length=o}}function Vh(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class fo extends uo{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=Xe.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,r=0,s=0;;)if(r==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&s++,r=t.pop()}else{let o=i.children[r++];if(o instanceof yi)t.push(r),i=o,r=0;else{let a=s+o.length,l=e(o,s);if(l!==void 0)return l;s=a+o.breakAfter}}}resolveBlock(e,t){let i,r=-1,s,o=-1;if(this.blockTiles((a,l)=>{let h=l+a.length;if(e>=l&&e<=h){if(a.isWidget()&&t>=-1&&t<=1){if(a.flags&32)return!0;a.flags&16&&(i=void 0)}(l<e||e==h&&(t<-1?a.length:a.covers(1)))&&(!i||!a.isWidget()&&i.isWidget())&&(i=a,r=e-l),(h>e||e==l&&(t>1?a.length:a.covers(-1)))&&(!s||!a.isWidget()&&s.isWidget())&&(s=a,o=e-l)}}),!i&&!s)throw new Error("No tile at position "+e);return i&&t<0||!s?{tile:i,offset:r}:{tile:s,offset:o}}}class yi extends uo{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(e,t){let i=new yi(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class In extends uo{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let r=new In(t||document.createElement("div"),e);return(!t||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,i){let r=null,s=-1,o=null,a=-1;function l(f,O){for(let m=0,b=0;m<f.children.length&&b<=O;m++){let S=f.children[m],Q=b+S.length;Q>=O&&(S.isComposite()?l(S,O-b):(!o||o.isHidden&&(t>0||i&&my(o,S)))&&(Q>O||S.flags&32)?(o=S,a=O-b):(b<O||S.flags&16&&!S.isHidden)&&(r=S,s=O-b)),b=Q}}l(this,e);let h=(t<0?r:o)||r||o;return h?{tile:h,offset:h==r?s:a}:null}coordsIn(e,t){let i=this.resolveInline(e,t,!0);return i?i.tile.coordsIn(Math.max(0,i.offset),t):gy(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:r,offset:s}=i;if(this.dom.contains(r.dom))return r.isText()?new Vt(r.dom,Math.min(r.dom.nodeValue.length,s)):r.domPosFor(s,r.flags&16?1:r.flags&32?-1:t);let o=i.tile.parent,a=!1;for(let l of o.children){if(a)return new Vt(l.dom,0);l==i.tile&&(a=!0)}}return new Vt(this.dom,0)}}function gy(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=yr(e);return t[t.length-1]||null}function my(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.top<t.bottom}class Ot extends uo{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let i=new Ot(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class sn extends Xe{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){let i=this.dom.nodeValue.length;e>i&&(e=i);let r=e,s=e,o=0;e==0&&t<0||e==i&&t>=0?q.chrome||q.gecko||(e?(r--,o=1):s<i&&(s++,o=-1)):t<0?r--:s<i&&s++;let a=Tr(this.dom,r,s).getClientRects();if(!a.length)return null;let l=a[(o?o<0:t>=0)?0:a.length-1];return q.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,h=>h.width)||l),o?Pr(l,o<0):l||null}static of(e,t){let i=new sn(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class ln extends Xe{constructor(e,t,i,r){super(e,t,r),this.widget=i}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,i){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(i)return Pr(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?s.length-1:0;o=s[l],!(e>0?l==0:l==s.length-1||o.top<o.bottom);l+=a?-1:1);return Pr(o,!a)}}get overrideDOMText(){if(!this.length)return be.empty;let{root:e}=this;if(!e)return be.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(e,t,i,r,s){return s||(s=e.toDOM(t),e.editable||(s.contentEditable="false")),new ln(s,i,e,r)}}class Xs extends Xe{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 be.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class yy{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:r,index:s,beforeBreak:o,parents:a}=this;for(;e||t>0;)if(r.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(s==r.children.length){if(!e&&!a.length)break;i&&i.leave(r),o=!!r.breakAfter,{tile:r,index:s}=a.pop(),s++}else{let l=r.children[s],h=l.breakAfter;(t>0?l.length<=e:l.length<e)&&(!i||i.skip(l,0,l.length)!==!1||!l.isComposite)?(o=!!h,s++,e-=l.length):(a.push({tile:r,index:s}),r=l,s=0,i&&l.isComposite()&&i.enter(l))}else if(s==r.length)o=!!r.breakAfter,{tile:r,index:s}=a.pop(),s++;else if(e){let l=Math.min(e,r.length-s);i&&i.skip(r,s,s+l),e-=l,s+=l}else break;return this.tile=r,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class by{constructor(e,t,i,r){this.from=e,this.to=t,this.wrapper=i,this.rank=r}}class vy{constructor(e,t,i){this.cache=e,this.root=t,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,i,r){var s;this.flushBuffer();let o=this.ensureMarks(t,i),a=o.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let l=o.children[o.children.length-1]=new sn(a.dom,a.text+e);l.parent=o}else o.append(r||sn.of(e,(s=this.cache.find(sn))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let i=this.curLine;i.dom!=t.line.dom&&(i.setDOM(this.cache.reused.has(t.line)?Go(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=i;for(let a=t.marks.length-1;a>=0;a--){let l=t.marks[a],h=r.lastChild;if(h instanceof Ot&&h.mark.eq(l.mark))h.dom!=l.dom&&h.setDOM(Go(l.dom)),r=h;else{if(this.cache.reused.get(l)){let O=Xe.get(l.dom);O&&O.setDOM(Go(l.dom))}let f=Ot.of(l.mark,l.dom);r.append(f),r=f}this.cache.reused.set(l,2)}let s=Xe.get(e.text);s&&this.cache.reused.set(s,2);let o=new sn(e.text,e.text.nodeValue);o.flags|=8,r.append(o)}addInlineWidget(e,t,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let s=this.ensureMarks(t,i);!r&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).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){var i;e||(e=np);let r=In.start(e,t||((i=this.cache.find(In))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let r=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],a;if(t>0&&(a=r.lastChild)&&a instanceof Ot&&a.mark.eq(o))r=a,t--;else{let l=Ot.of(o,(i=this.cache.find(Ot,h=>h.mark.eq(o)))===null||i===void 0?void 0:i.dom);r.append(l),r=l,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!zh(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(q.ios&&zh(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Uo,0,32)||new ln(Uo.toDOM(),0,Uo,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=new by(e.from,e.to,e.value,e.rank),i=this.wrappers.length;for(;i>0&&(this.wrappers[i-1].rank-t.rank||this.wrappers[i-1].to-t.to)<0;)i--;this.wrappers.splice(i,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let r=t.lastChild;if(i.from<this.pos&&r instanceof yi&&r.wrapper.eq(i.wrapper))t=r;else{let s=yi.of(i.wrapper,(e=this.cache.find(yi,o=>o.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}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),i=this.cache.find(Xs,void 0,1);return i&&(i.flags=t),i||new Xs(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Sy{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=r;let a=this.textOff=Math.min(e,r.length);return s?null:r.slice(0,a)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const Bs=[ln,In,sn,Ot,Xs,yi,fo];for(let n=0;n<Bs.length;n++)Bs[n].bucket=n;class ky{constructor(e){this.view=e,this.buckets=Bs.map(()=>[]),this.index=Bs.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let r=e.bucket,s=this.buckets[r],o=this.index[r];for(let a=s.length-1;a>=0;a--){let l=(a+o)%s.length,h=s[l];if((!t||t(h))&&!this.reused.has(h))return s.splice(l,1),l<o&&this.index[r]--,this.reused.set(h,i),h}return null}findWidget(e,t,i){let r=this.buckets[0];if(r.length)for(let s=0,o=0;;s++){if(s==r.length){if(o)return null;o=1,s=0}let a=r[s];if(!this.reused.has(a)&&(o==0?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view,a.widget)))return r.splice(s,1),s<this.index[0]&&this.index[0]--,a.widget==e&&a.length==t&&(a.flags&497)==i?(this.reused.set(a,1),a):(this.reused.set(a,2),new ln(a.dom,t,e,a.flags&-498|i))}}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}}class wy{constructor(e,t,i,r,s){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new ky(e),this.text=new Sy(e.state.doc),this.builder=new vy(this.cache,new fo(e,e.contentDOM),pe.iter(i)),this.cache.reused.set(t,2),this.old=new yy(t),this.reuseWalker={skip:(o,a,l)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let r=0,s=0,o=0;;){let a=o<e.length?e[o++]:null,l=a?a.fromA:this.old.root.length;if(l>r){let h=l-r;this.preserve(h,!o,!a),r=l,s+=h}if(!a)break;t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.forward(a.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(s,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,i),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,a.toA),this.emit(t.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(s,a.toB)),s=a.toB,r=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,i){let r=$y(this.old),s=this.openMarks;this.old.advance(e,i?1:-1,{skip:(o,a,l)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let h=l>0||a<o.length?ln.of(o.widget,this.view,l-a,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);h.flags&256?(h.flags&=-2,this.builder.addBlockWidget(h)):(this.builder.ensureLine(null),this.builder.addInlineWidget(h,r,s),s=r.length)}else if(o.isText())this.builder.ensureLine(null),!a&&l==o.length&&!this.cache.reused.has(o)?this.builder.addText(o.text,r,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(a,l),r,s)),s=r.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof Xs)this.cache.add(o);else if(o instanceof Ot)this.builder.ensureLine(null),this.builder.addMark(o,r,s),this.cache.reused.set(o,1),s=r.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ot&&r.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?r.length&&(r.length=s=0):o instanceof Ot&&(r.shift(),s=Math.min(s,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,r=this.builder,s=0,o=pe.spans(this.decorations,e,t,{point:(a,l,h,f,O,m)=>{if(h instanceof on){if(this.disallowBlockEffectsFor[m]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=f.length,O>f.length)r.continueWidget(l-a);else{let b=h.widget||(h.block?Dn.block:Dn.inline),S=xy(h),Q=this.cache.findWidget(b,l-a,S)||ln.of(b,this.view,l-a,S);h.block?(h.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(Q)):(r.ensureLine(i),r.addInlineWidget(Q,f,O))}i=null}else i=Qy(i,h);l>a&&this.text.skip(l-a)},span:(a,l,h,f)=>{for(let O=a;O<l;){let m=this.text.next(Math.min(512,l-O));m==null?(r.addLineStartIfNotCovered(i),r.addBreak(),O++):(r.ensureLine(i),r.addText(m,h,O==a?f:h.length),O+=m.length),i=null}}});r.addLineStartIfNotCovered(i),this.openWidget=o>s,this.openMarks=o}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let s=Xe.get(r);if(r==this.view.contentDOM)break;s instanceof Ot?t.push(s):s?.isLine()?i=s:s instanceof yi||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new In(r,np):i||t.push(Ot.of(new _r({tagName:r.nodeName.toLowerCase(),attributes:H0(r)}),r)))}return{line:i,marks:t}}}function zh(n,e){let t=i=>{for(let r of i.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(n)}function xy(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const np={class:"cm-line"};function Qy(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:"cm-line"}),t&&Wl(t,n),i&&(n.class+=" "+i)),n}function $y(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof Ot&&e.push(i.mark)}return e}function Go(n){let e=Xe.get(n);return e&&e.setDOM(n.cloneNode()),n}class Dn extends bt{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}}Dn.inline=new Dn("span");Dn.block=new Dn("div");const Uo=new class extends bt{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Wh{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=H.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 fo(e,e.contentDOM),this.updateInner([new Zt(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:f,toA:O})=>O<this.minWidthFrom||f>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 r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!Ey(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?Py(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:f,to:O}=this.hasComposition;i=new Zt(f,O,e.changes.mapPos(f,-1),e.changes.mapPos(O,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(q.ie||q.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=My(o,this.decorations,e.changes);l.length&&(i=Zt.extendWithRanges(i,l));let h=Ly(a,this.blockWrappers,e.changes);return h.length&&(i=Zt.extendWithRanges(i,h)),s&&!i.some(f=>f.fromA<=s.range.fromA&&f.toA>=s.range.toA)&&(i=s.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let o=this.tile,a=new wy(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&Xe.get(t.text)&&a.cache.reused.set(Xe.get(t.text),2),this.tile=a.run(e,t),nl(o,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=q.chrome||q.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||i.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof Ho&&r.push(s.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(Hd)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,s=r==i,o=!s&&!(this.view.state.facet(Oi)||i.tabIndex>-1)&&mr(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(s||t||o))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,h,f;if(l.empty?f=h=this.inlineDOMNearPos(l.anchor,l.assoc||1):(f=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),h=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),q.gecko&&l.empty&&!this.hasComposition&&Cy(h)){let m=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(m,h.node.childNodes[h.offset]||null)),h=f=new Vt(m,0),a=!0}let O=this.view.observer.selectionRange;(a||!O.focusNode||(!br(h.node,h.offset,O.anchorNode,O.anchorOffset)||!br(f.node,f.offset,O.focusNode,O.focusOffset))&&!this.suppressWidgetCursorChange(O,l))&&(this.view.observer.ignore(()=>{q.android&&q.chrome&&i.contains(O.focusNode)&&Zy(O.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let m=Cr(this.view.root);if(m)if(l.empty){if(q.gecko){let b=Ty(h.node,h.offset);if(b&&b!=3){let S=(b==1?Xd:Bd)(h.node,h.offset);S&&(h=new Vt(S.node,S.offset))}}m.collapse(h.node,h.offset),l.bidiLevel!=null&&m.caretBidiLevel!==void 0&&(m.caretBidiLevel=l.bidiLevel)}else if(m.extend){m.collapse(h.node,h.offset);try{m.extend(f.node,f.offset)}catch{}}else{let b=document.createRange();l.anchor>l.head&&([h,f]=[f,h]),b.setEnd(f.node,f.offset),b.setStart(h.node,h.offset),m.removeAllRanges(),m.addRange(b)}o&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(h,f)),this.impreciseAnchor=h.precise?null:new Vt(O.anchorNode,O.anchorOffset),this.impreciseHead=f.precise?null:new Vt(O.focusNode,O.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&br(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,i=Cr(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let l=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!l||!h||l.bottom>h.top)return;let f=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(f.node,f.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let O=e.observer.selectionRange;e.docView.posFromDOM(O.anchorNode,O.anchorOffset)!=t.from&&i.collapse(r,s)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let s;if(e==i.dom)s=i.dom.childNodes[t];else{let o=ki(e)==0?0:t==0?-1:1;for(;;){let a=e.parentNode;if(a==i.dom)break;o==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?o=-1:o=1),e=a}o<0?s=e:s=e.nextSibling}if(s==i.dom.firstChild)return r;for(;s&&!Xe.get(s);)s=s.nextSibling;if(!s)return r+i.length;for(let o=0,a=r;;o++){let l=i.children[o];if(l.dom==s)return a;a+=l.length+l.breakAfter}}else return i.isText()?e==i.dom?r+t:r+(t?i.length:0):r}domAtPos(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(e,t):i.domIn(r,t)}inlineDOMNearPos(e,t){let i,r=-1,s=!1,o,a=-1,l=!1;return this.tile.blockTiles((h,f)=>{if(h.isWidget()){if(h.flags&32&&f>=e)return!0;h.flags&16&&(s=!0)}else{let O=f+h.length;if(f<=e&&(i=h,r=e-f,s=O<e),O>=e&&!o&&(o=h,a=e-f,l=f>e),f>e&&o)return!0}}),!i&&!o?this.domAtPos(e,t):(s&&o?i=null:l&&i&&(o=null),i&&t<0||!o?i.domIn(r,t):o.domIn(a,t))}coordsAt(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof Ho?null:i.coordsInWidget(r,t,!0):i.coordsIn(r,t)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(s,o){if(s.isComposite())for(let a of s.children){if(a.length>=o){let l=r(a,o);if(l)return l}if(o-=a.length,o<0)break}else if(s.isText()&&o<s.length){let a=Ne(s.text,o);if(a==o)return null;let l=Tr(s.dom,o,a).getClientRects();for(let h=0;h<l.length;h++){let f=l[h];if(h==l.length-1||f.top<f.bottom&&f.left<f.right)return f}}return null}return r(t,i)}measureVisibleLineHeights(e){let t=[],{from:i,to:r}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==Ee.LTR,h=0,f=(O,m,b)=>{for(let S=0;S<O.children.length&&!(m>r);S++){let Q=O.children[S],P=m+Q.length,A=Q.dom.getBoundingClientRect(),{height:E}=A;if(b&&!S&&(h+=A.top-b.top),Q instanceof yi)P>i&&f(Q,m,A);else if(m>=i&&(h>0&&t.push(-h),t.push(E+h),h=0,o)){let B=Q.dom.lastChild,U=B?yr(B):[];if(U.length){let W=U[U.length-1],Y=l?W.right-A.left:A.right-W.left;Y>a&&(a=Y,this.minWidth=s,this.minWidthFrom=m,this.minWidthTo=P)}}b&&S==O.children.length-1&&(h+=b.bottom-A.bottom),m=P+Q.breakAfter}};return f(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?Ee.RTL:Ee.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let a=0,l;for(let h of o.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let f=yr(h.dom);if(f.length!=1)return;a+=f[0].width,l=f[0].height}if(a)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:a/o.length,textHeight:l}}});if(e)return e;let t=document.createElement("div"),i,r,s;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 o=yr(t.firstChild)[0];i=t.getBoundingClientRect().height,r=o&&o.width?o.width/27:7,s=o&&o.height?o.height:i,t.remove()}),{lineHeight:i,charWidth:r,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],o=s?s.from-1:this.view.state.doc.length;if(o>i){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(H.replace({widget:new Ho(a),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!s)break;i=s.to+1}return H.set(e)}updateDeco(){let e=1,t=this.view.state.facet(ho).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),i=!1,r=this.view.state.facet(Ul).map((s,o)=>{let a=typeof s=="function";return a&&(i=!0),a?s(this.view):s});for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(pe.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(Jd).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){var t;if(e.isSnapshot){let f=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=f.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let f of this.view.state.facet(Ud))try{if(f(this.view,e.range,e))return!0}catch(O){ai(this.view.state,O,"scroll handler")}let{range:i}=e,r=this.coordsAt(i.head,(t=i.assoc)!==null&&t!==void 0?t:i.empty?0:i.head>i.anchor?-1:1),s;if(!r)return;!i.empty&&(s=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(r={left:Math.min(r.left,s.left),top:Math.min(r.top,s.top),right:Math.max(r.right,s.right),bottom:Math.max(r.bottom,s.bottom)});let o=ip(this.view),a={left:r.left-o.left,top:r.top-o.top,right:r.right+o.right,bottom:r.bottom+o.bottom},{offsetWidth:l,offsetHeight:h}=this.view.scrollDOM;if(ey(this.view.scrollDOM,a,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,h),-h),this.view.textDirection==Ee.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(r.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||r.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let f=this.view.docView.lineAt(i.head,1);f&&f.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=i=>i.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){nl(this.tile)}}function nl(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)nl(i,e)}}function Cy(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function rp(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=Xd(t.focusNode,t.focusOffset),r=Bd(t.focusNode,t.focusOffset),s=i||r;if(r&&i&&r.node!=i.node){let a=Xe.get(r.node);if(!a||a.isText()&&a.text!=r.node.nodeValue)s=r;else if(n.docView.lastCompositionAfterCursor){let l=Xe.get(i.node);!l||l.isText()&&l.text!=i.node.nodeValue||(s=r)}}if(n.docView.lastCompositionAfterCursor=s!=i,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function Py(n,e,t){let i=rp(n,t);if(!i)return null;let{node:r,from:s,to:o}=i,a=r.nodeValue;if(/[\n\r]/.test(a)||n.state.doc.sliceString(i.from,i.to)!=a)return null;let l=e.invertedDesc;return{range:new Zt(l.mapPos(s),l.mapPos(o),s,o),text:r}}function Ty(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let Ay=class{constructor(){this.changes=[]}compareRange(e,t){Cn(e,t,this.changes)}comparePoint(e,t){Cn(e,t,this.changes)}boundChange(e){Cn(e,e,this.changes)}};function My(n,e,t){let i=new Ay;return pe.compare(n,e,t,i),i.changes}class Ry{constructor(){this.changes=[]}compareRange(e,t){Cn(e,t,this.changes)}comparePoint(){}boundChange(e){Cn(e,e,this.changes)}}function Ly(n,e,t){let i=new Ry;return pe.compare(n,e,t,i),i.changes}function Zy(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function Ey(n,e){let t=!1;return e&&n.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(t=!0)}),t}class Ho extends bt{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 Xy(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),s=e-r.from;if(r.length==0)return Z.cursor(e);s==0?t=1:s==r.length&&(t=-1);let o=s,a=s;t<0?o=Ne(r.text,s,!1):a=Ne(r.text,s);let l=i(r.text.slice(o,a));for(;o>0;){let h=Ne(r.text,o,!1);if(i(r.text.slice(h,o))!=l)break;o=h}for(;a<r.length;){let h=Ne(r.text,a);if(i(r.text.slice(a,h))!=l)break;a=h}return Z.range(o+r.from,a+r.from)}function By(n,e,t,i,r){let s=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight,l=Math.floor((r-t.top-(n.defaultLineHeight-a)*.5)/a);s+=l*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+W0(o,s,n.state.tabSize)}function Iy(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let s of i.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!r||s.type==mt.Text&&(r.type!=s.type||(t<0?s.from<e:s.to>e)))&&(r=s)}}return r||i}return i}function Dy(n,e,t,i){let r=Iy(n,e.head,e.assoc||-1),s=!i||r.type!=mt.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let o=n.dom.getBoundingClientRect(),a=n.textDirectionAt(r.from),l=n.posAtCoords({x:t==(a==Ee.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return Z.cursor(l,t?-1:1)}return Z.cursor(t?r.to:r.from,t?-1:1)}function Nh(n,e,t,i){let r=n.state.doc.lineAt(e.head),s=n.bidiSpans(r),o=n.textDirectionAt(r.from);for(let a=e,l=null;;){let h=uy(r,s,o,a,t),f=Vd;if(!h){if(r.number==(t?n.state.doc.lines:1))return a;f=`
|
|
8
|
+
`,r=n.state.doc.line(r.number+(t?1:-1)),s=n.bidiSpans(r),h=n.visualLineSide(r,!t)}if(l){if(!l(f))return a}else{if(!i)return h;l=i(f)}a=h}}function _y(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return s=>{let o=i(s);return r==Ke.Space&&(r=o),r==o}}function jy(n,e,t,i){let r=e.head,s=t?1:-1;if(r==(t?n.state.doc.length:0))return Z.cursor(r,e.assoc);let o=e.goalColumn,a,l=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(r,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),f=n.documentTop;if(h)o==null&&(o=h.left-l.left),a=s<0?h.top:h.bottom;else{let S=n.viewState.lineBlockAt(r);o==null&&(o=Math.min(l.right-l.left,n.defaultCharacterWidth*(r-S.from))),a=(s<0?S.top:S.bottom)+f}let O=l.left+o,m=n.viewState.heightOracle.textHeight>>1,b=i??m;for(let S=0;;S+=m){let Q=a+(b+S)*s,P=rl(n,{x:O,y:Q},!1,s);if(t?Q>l.bottom:Q<l.top)return Z.cursor(P.pos,P.assoc);let A=n.coordsAtPos(P.pos,P.assoc),E=A?(A.top+A.bottom)/2:0;if(!A||(t?E>a:E<a))return Z.cursor(P.pos,P.assoc,void 0,o)}}function vr(n,e,t){for(;;){let i=0;for(let r of n)r.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=i||t||(e-s<o-e?-1:1);e=l<0?s:o,i=l}});if(!i)return e}}function sp(n,e){let t=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],s=null;if(r.empty){let o=vr(n,r.from,0);o!=r.from&&(s=Z.cursor(o,-1))}else{let o=vr(n,r.from,-1),a=vr(n,r.to,1);(o!=r.from||a!=r.to)&&(s=Z.range(r.from==r.anchor?o:a,r.from==r.head?o:a))}s&&(t||(t=e.ranges.slice()),t[i]=s)}return t?Z.create(t,e.mainIndex):e}function Ko(n,e,t){let i=vr(n.state.facet(Vr).map(r=>r(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:Z.cursor(i,i<t.from?1:-1)}class si{constructor(e,t){this.pos=e,this.assoc=t}}function rl(n,e,t,i){let r=n.contentDOM.getBoundingClientRect(),s=r.top+n.viewState.paddingTop,{x:o,y:a}=e,l=a-s,h;for(;;){if(l<0)return new si(0,1);if(l>n.viewState.docHeight)return new si(n.state.doc.length,-1);if(h=n.elementAtHeight(l),i==null)break;if(h.type==mt.Text){if(i<0?h.to<n.viewport.from:h.from>n.viewport.to)break;let m=n.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(m&&(i<0?m.top<=l+s:m.bottom>=l+s))break}let O=n.viewState.heightOracle.textHeight/2;l=i>0?h.bottom+O:h.top-O}if(n.viewport.from>=h.to||n.viewport.to<=h.from){if(t)return null;if(h.type==mt.Text){let O=By(n,r,h,o,a);return new si(O,O==h.from?1:-1)}}if(h.type!=mt.Text)return l<(h.top+h.bottom)/2?new si(h.from,1):new si(h.to,-1);let f=n.docView.lineAt(h.from,2);return(!f||f.length!=h.length)&&(f=n.docView.lineAt(h.from,-2)),new Vy(n,o,a,n.textDirectionAt(h.from)).scanTile(f,h.from)}class Vy{constructor(e,t,i,r){this.view=e,this.x=t,this.y=i,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:i,spans:r}=this.bidiSpansAt(e);return r[oi.find(r,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:r}=this.bidiSpansAt(e);return r[oi.find(r,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<t)}scan(e,t){let i=0,r=e.length-1,s=new Set,o=this.bidiIn(e[0],e[r]),a,l,h=-1,f=1e9,O;e:for(;i<r;){let b=r-i,S=i+r>>1;t:if(s.has(S)){let P=i+Math.floor(Math.random()*b);for(let A=0;A<b;A++){if(!s.has(P)){S=P;break t}P++,P==r&&(P=i)}break e}s.add(S);let Q=t(S);if(Q)for(let P=0;P<Q.length;P++){let A=Q[P],E=0;if(!(A.width==0&&Q.length>1)){if(A.bottom<this.y)(!a||a.bottom<A.bottom)&&(a=A),E=1;else if(A.top>this.y)(!l||l.top>A.top)&&(l=A),E=-1;else{let B=A.left>this.x?this.x-A.left:A.right<this.x?this.x-A.right:0,U=Math.abs(B);U<f&&(h=S,f=U,O=A),B&&(E=B<0==(this.baseDir==Ee.LTR)?-1:1)}E==-1&&(!o||this.baseDirAt(e[S],1))?r=S:E==1&&(!o||this.baseDirAt(e[S+1],-1))&&(i=S+1)}}}if(!O){let b=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(b.top+b.bottom)/2,this.scan(e,t)}let m=(o?this.dirAt(e[h],1):this.baseDir)==Ee.LTR;return{i:h,after:this.x>(O.left+O.right)/2==m}}scanText(e,t){let i=[];for(let s=0;s<e.length;s=Ne(e.text,s))i.push(t+s);i.push(t+e.length);let r=this.scan(i,s=>{let o=i[s]-t,a=i[s+1]-t;return Tr(e.dom,o,a).getClientRects()});return r.after?new si(i[r.i+1],-1):new si(i[r.i],1)}scanTile(e,t){if(!e.length)return new si(t,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,t);if(a.isComposite())return this.scanTile(a,t)}let i=[t];for(let a=0,l=t;a<e.children.length;a++)i.push(l+=e.children[a].length);let r=this.scan(i,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:Tr(l.dom,0,l.length)).getClientRects()}),s=e.children[r.i],o=i[r.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):r.after?new si(i[r.i+1],-1):new si(o,1)}}const Sn="";class zy{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(he.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Sn}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let o=Xe.get(r),a=r.nextSibling;if(a==t){o?.breakAfter&&!a&&i!=this.view.contentDOM&&this.lineBreak();break}let l=Xe.get(a);(o&&l?o.breakAfter:(o?o.breakAfter:Zs(r))||Zs(a)&&(r.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!Ny(a,t)&&this.lineBreak(),r=a}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(a=r.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);i=s+o}}readNode(e){let t=Xe.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(Wy(e,i.node,i.offset)?t:0))}}function Wy(n,e,t){for(;;){if(!e||t<ki(e))return!1;if(e==n)return!0;t=Ii(e)+1,e=e.parentNode}}function Ny(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let i=Xe.get(n);if(!i?.isWidget())return!1;i&&(t||(t=[])).push(i)}if(t)for(let i of t){let r=i.overrideDOMText;if(r?.length)return!1}return!0}class Yh{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Yy{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView,a=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=op(e.docView.tile,t,i,0))){let l=s||o?[]:Fy(e),h=new zy(l,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=Gy(l,this.bounds.from)}else{let l=e.observer.selectionRange,h=s&&s.node==l.focusNode&&s.offset==l.focusOffset||!Ka(e.contentDOM,l.focusNode)?a.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),f=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Ka(e.contentDOM,l.anchorNode)?a.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),O=e.viewport;if((q.ios||q.chrome)&&a.main.empty&&h!=f&&(O.from>0||O.to<e.state.doc.length)){let m=Math.min(h,f),b=Math.max(h,f),S=O.from-m,Q=O.to-b;(S==0||S==1||m==0)&&(Q==0||Q==-1||b==e.state.doc.length)&&(h=0,f=e.state.doc.length)}if(e.inputState.composing>-1&&a.ranges.length>1)this.newSel=a.replaceRange(Z.range(f,h));else if(e.lineWrapping&&f==h&&!(a.main.empty&&a.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let m=e.coordsAtPos(h,-1),b=0;m&&(b=e.inputState.lastTouchY<=m.bottom?-1:1),this.newSel=Z.create([Z.cursor(h,b)])}else this.newSel=Z.single(f,h)}}}function op(n,e,t,i){if(n.isComposite()){let r=-1,s=-1,o=-1,a=-1;for(let l=0,h=i,f=i;l<n.children.length;l++){let O=n.children[l],m=h+O.length;if(h<e&&m>t)return op(O,e,t,h);if(m>=e&&r==-1&&(r=l,s=h),h>t&&O.dom.parentNode==n.dom){o=l,a=f;break}f=m,h=m+O.breakAfter}return{from:s,to:a<0?i+n.length:a,startDOM:(r?n.children[r-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:o<n.children.length&&o>=0?n.children[o].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function ap(n,e){let t,{newSel:i}=e,{state:r}=n,s=r.selection.main,o=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:a,to:l}=e.bounds,h=s.from,f=null;(o===8||q.android&&e.text.length<l-a)&&(h=s.to,f="end");let O=r.doc.sliceString(a,l,Sn),m,b;!s.empty&&s.from>=a&&s.to<=l&&(e.typeOver||O!=e.text)&&O.slice(0,s.from-a)==e.text.slice(0,s.from-a)&&O.slice(s.to-a)==e.text.slice(m=e.text.length-(O.length-(s.to-a)))?t={from:s.from,to:s.to,insert:be.of(e.text.slice(s.from-a,m).split(Sn))}:(b=lp(O,e.text,h-a,f))&&(q.chrome&&o==13&&b.toB==b.from+2&&e.text.slice(b.from,b.toB)==Sn+Sn&&b.toB--,t={from:a+b.from,to:a+b.toA,insert:be.of(e.text.slice(b.from,b.toB).split(Sn))})}else i&&(!n.hasFocus&&r.facet(Oi)||Is(i,s))&&(i=null);if(!t&&!i)return!1;if((q.mac||q.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=Z.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:be.of([t.insert.toString().replace("."," ")])}):r.doc.lineAt(s.from).to<s.to&&n.docView.lineHasWidget(s.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:s.from,to:s.to,insert:r.toText(n.inputState.insertingText)}:q.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==`
|
|
9
|
+
`&&n.lineWrapping&&(i&&(i=Z.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:be.of([" "])}),t)return Hl(n,t,i,o);if(i&&!Is(i,s)){let a=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(a=!0),l=n.inputState.lastSelectionOrigin,l=="select.pointer"&&(i=sp(r.facet(Vr).map(h=>h(n)),i))),n.dispatch({selection:i,scrollIntoView:a,userEvent:l}),!0}else return!1}function Hl(n,e,t,i=-1){if(q.ios&&n.inputState.flushIOSKey(e))return!0;let r=n.state.selection.main;if(q.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&n.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Pn(n.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Pn(n.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Pn(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=qy(n,e,t));return n.state.facet(qd).some(l=>l(n,e.from,e.to,s,a))||n.dispatch(a()),!0}function qy(n,e,t){let i,r=n.state,s=r.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let l=e.from<s.from?-1:1,h=l<0?s.from:s.to,f=vr(r.facet(Vr).map(O=>O(n)),h,l);e.from==f&&(o=f)}if(o>-1)i={changes:e,selection:Z.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=s.from<e.from?r.sliceDoc(s.from,e.from):"",h=s.to>e.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+h))}else{let l=r.changes(e),h=t&&t.main.to<=l.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let f=n.state.sliceDoc(e.from,e.to),O,m=t&&rp(n,t.main.head);if(m){let S=e.insert.length-(e.to-e.from);O={from:m.from,to:m.to-S}}else O=n.state.doc.lineAt(s.head);let b=s.to-e.to;i=r.changeByRange(S=>{if(S.from==s.from&&S.to==s.to)return{changes:l,range:h||S.map(l)};let Q=S.to-b,P=Q-f.length;if(n.state.sliceDoc(P,Q)!=f||Q>=O.from&&P<=O.to)return{range:S};let A=r.changes({from:P,to:Q,insert:e.insert}),E=S.to-s.to;return{changes:A,range:h?Z.range(Math.max(0,h.anchor+E),Math.max(0,h.head+E)):S.map(A)}})}else i={changes:l,selection:h&&r.selection.replaceRange(h)}}let a="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,a+=".compose",n.inputState.compositionFirstChange&&(a+=".start",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:a,scrollIntoView:!0})}function lp(n,e,t,i){let r=Math.min(n.length,e.length),s=0;for(;s<r&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==r&&n.length==e.length)return null;let o=n.length,a=e.length;for(;o>0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(i=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o<s&&n.length<e.length){let l=t<=s&&t>=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=t<=s&&t>=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function Fy(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new Yh(t,i)),(r!=t||s!=i)&&e.push(new Yh(r,s))),e}function Gy(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?Z.single(t+e,i+e):null}function Is(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class Uy{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,q.safari&&e.contentDOM.addEventListener("input",()=>null),q.gecko&&ub(e.contentDOM.ownerDocument)}handleEvent(e){!rb(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Hy(e),i=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=i[s];a&&o!=!a.handlers.length&&(r.removeEventListener(s,this.handleEvent),a=null),a||r.addEventListener(s,this.handleEvent,{passive:o})}for(let s in i)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&hp.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),q.android&&q.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return q.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=cp.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||Ky.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Pn(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:q.safari&&!q.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function qh(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){ai(t.state,r)}}}function Hy(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec,s=r&&r.plugin.domEventHandlers,o=r&&r.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&t(a).handlers.push(qh(i.value,l))}if(o)for(let a in o){let l=o[a];l&&t(a).observers.push(qh(i.value,l))}}for(let i in zt)t(i).handlers.push(zt[i]);for(let i in yt)t(i).observers.push(yt[i]);return e}const cp=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Ky="dthko",hp=[16,17,18,20,91,92,224,225],ts=6;function is(n){return Math.max(0,n)*.7+8}function Jy(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class eb{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Ld(e.contentDOM),this.atoms=e.state.facet(Vr).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(he.allowMultipleSelections)&&tb(e,t),this.dragging=nb(e,t)&&dp(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Jy(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,r=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=ip(this.view);e.clientX-l.left<=r+ts?t=-is(r-e.clientX):e.clientX+l.right>=o-ts&&(t=is(e.clientX-o)),e.clientY-l.top<=s+ts?i=-is(s-e.clientY):e.clientY+l.bottom>=a-ts&&(i=is(e.clientY-a)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=sp(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function tb(n,e){let t=n.state.facet(zd);return t.length?t[0](e):q.mac?e.metaKey:e.ctrlKey}function ib(n,e){let t=n.state.facet(Wd);return t.length?t[0](e):q.mac?!e.altKey:!e.ctrlKey}function nb(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Cr(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s<r.length;s++){let o=r[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function rb(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=Xe.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const zt=Object.create(null),yt=Object.create(null),up=q.ie&&q.ie_version<15||q.ios&&q.webkit_version<604;function sb(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),fp(n,t.value)},50)}function po(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function fp(n,e){e=po(n.state,ql,e);let{state:t}=n,i,r=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(sl!=null&&t.selection.ranges.every(l=>l.empty)&&sl==s.toString()){let l=-1;i=t.changeByRange(h=>{let f=t.doc.lineAt(h.from);if(f.from==l)return{range:h};l=f.from;let O=t.toText((o?s.line(r++).text:e)+t.lineBreak);return{changes:{from:f.from,insert:O},range:Z.cursor(h.from+O.length)}})}else o?i=t.changeByRange(l=>{let h=s.line(r++);return{changes:{from:l.from,to:l.to,insert:h.text},range:Z.cursor(l.from+h.length)}}):i=t.replaceSelection(s);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}yt.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};yt.wheel=yt.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};zt.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);yt.touchstart=(n,e)=>{let t=n.inputState,i=e.targetTouches[0];t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin("select.pointer")};yt.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};zt.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(Nd))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=ab(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new eb(n,e,t,i)),i&&n.observer.ignore(()=>{Zd(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function Fh(n,e,t,i){if(i==1)return Z.cursor(e,t);if(i==2)return Xy(n.state,e,t);{let r=n.docView.lineAt(e,t),s=n.state.doc.lineAt(r?r.posAtEnd:e),o=r?r.posAtStart:s.from,a=r?r.posAtEnd:s.to;return a<n.state.doc.length&&a==s.to&&a++,Z.range(o,a)}}const ob=q.ie&&q.ie_version<=11;let Gh=null,Uh=0,Hh=0;function dp(n){if(!ob)return n.detail;let e=Gh,t=Hh;return Gh=n,Hh=Date.now(),Uh=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Uh+1)%3:1}function ab(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=dp(e),r=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,o,a){let l=n.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),h,f=Fh(n,l.pos,l.assoc,i);if(t.pos!=l.pos&&!o){let O=Fh(n,t.pos,t.assoc,i),m=Math.min(O.from,f.from),b=Math.max(O.to,f.to);f=m<f.from?Z.range(m,b,f.assoc):Z.range(b,m,f.assoc)}return o?r.replaceRange(r.main.extend(f.from,f.to,f.assoc)):a&&i==1&&r.ranges.length>1&&(h=lb(r,l.pos))?h:a?r.addRange(f):Z.create([f])}}}function lb(n,e){for(let t=0;t<n.ranges.length;t++){let{from:i,to:r}=n.ranges[t];if(i<=e&&r>=e)return Z.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}zt.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.tile.nearest(e.target);if(r&&r.isWidget()){let s=r.posAtStart,o=s+r.length;(s>=t.to||o<=t.from)&&(t=Z.range(s,o))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",po(n.state,Fl,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};zt.dragend=n=>(n.inputState.draggedContent=null,!1);function Kh(n,e,t,i){if(t=po(n.state,ql,t),!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,o=i&&s&&ib(n,e)?{from:s.from,to:s.to}:null,a={from:r,insert:t},l=n.state.changes(o?[o,a]:a);n.focus(),n.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}zt.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,s=()=>{++r==t.length&&Kh(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(i[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Kh(n,e,i,!0),!0}return!1};zt.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=up?null:e.clipboardData;return t?(fp(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(sb(n),!1)};function cb(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function hb(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of n.selection.ranges){let o=n.doc.lineAt(s);o.number>r&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),r=o.number}i=!0}return{text:po(n,Fl,e.join(n.lineBreak)),ranges:t,linewise:i}}let sl=null;zt.copy=zt.cut=(n,e)=>{if(!mr(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:r}=hb(n.state);if(!t&&!r)return!1;sl=r?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=up?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(cb(n,t),!1)};const pp=xi.define();function Op(n,e){let t=[];for(let i of n.facet(Fd)){let r=i(n,e);r&&t.push(r)}return t.length?n.update({effects:t,annotations:pp.of(!0)}):null}function gp(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Op(n.state,e);t?n.dispatch(t):n.update([])}},10)}yt.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),gp(n)};yt.blur=n=>{n.observer.clearSelectionRange(),gp(n)};yt.compositionstart=yt.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};yt.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,q.chrome&&q.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};yt.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};zt.beforeinput=(n,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=n.posAtDOM(a.startContainer,a.startOffset),h=n.posAtDOM(a.endContainer,a.endOffset);return Hl(n,{from:l,to:h,insert:n.state.toText(s)},null),!0}}let r;if(q.chrome&&q.android&&(r=cp.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let s=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return q.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),q.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>yt.compositionend(n,e),20),!1};const Jh=new Set;function ub(n){Jh.has(n)||(Jh.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const eu=["pre-wrap","normal","pre-line","break-spaces"];let _n=!1;function tu(){_n=!1}class fb{constructor(e){this.lineWrapping=e,this.doc=be.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return eu.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,i,r,s,o){let a=eu.indexOf(e)>-1,l=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(i-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=s,l){this.heightSamples={};for(let h=0;h<o.length;h++){let f=o[h];f<0?h++:this.heightSamples[Math.floor(f*10)]=!0}}return l}}class db{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class jt{constructor(e,t,i,r,s){this.from=e,this.length=t,this.top=i,this.height=r,this._content=s}get type(){return typeof this._content=="number"?mt.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof on?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new jt(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Ce=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(Ce||(Ce={}));const ks=.001;class dt{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ks&&(_n=!0),this.height=e)}replace(e,t,i){return dt.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let s=this,o=i.doc;for(let a=r.length-1;a>=0;a--){let{fromA:l,toA:h,fromB:f,toB:O}=r[a],m=s.lineAt(l,Ce.ByPosNoHeight,i.setDoc(t),0,0),b=m.to>=h?m:s.lineAt(h,Ce.ByPosNoHeight,i,0,0);for(O+=b.to-h,h=b.to;a>0&&m.from<=r[a-1].toA;)l=r[a-1].fromA,f=r[a-1].fromB,a--,l<m.from&&(m=s.lineAt(l,Ce.ByPosNoHeight,i,0,0));f+=m.from-l,l=m.from;let S=Kl.build(i.setDoc(o),e,f,O);s=Ds(s,s.replace(l,h,S))}return s.updateHeight(i,0)}static empty(){return new xt(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,r=0,s=0;for(;;)if(t==i)if(r>s*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),i+=1+a.break,r-=a.size}else if(s>r*2){let a=e[i];a.break?e.splice(i,1,a.left,null,a.right):e.splice(i,1,a.left,a.right),i+=2+a.break,s-=a.size}else break;else if(r<s){let a=e[t++];a&&(r+=a.size)}else{let a=e[--i];a&&(s+=a.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,i++),new Ob(dt.of(e.slice(0,t)),o,dt.of(e.slice(i)))}}function Ds(n,e){return n==e?n:(n.constructor!=e.constructor&&(_n=!0),e)}dt.prototype.size=1;const pb=H.replace({});class mp extends dt{constructor(e,t,i){super(e,t),this.deco=i,this.spaceAbove=0}mainBlock(e,t){return new jt(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new jt(r,0,i,this.spaceAbove,pb):this.mainBlock(i,r)}lineAt(e,t,i,r,s){let o=this.mainBlock(r,s);return this.spaceAbove?this.blockAt(0,i,r,s).join(o):o}forEachLine(e,t,i,r,s,o){e<=s+this.length&&t>=s&&o(this.lineAt(0,Ce.ByPos,i,r,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class xt extends mp{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new jt(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof xt||r instanceof Ge&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Ge?r=new xt(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):dt.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ge extends dt{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:i,lastLine:r,perLine:o,perChar:a}}blockAt(e,t,i,r){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(t,r);if(t.lineWrapping){let h=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),f=t.doc.lineAt(h),O=a+f.length*l,m=Math.max(i,e-O/2);return new jt(f.from,f.length,m,O,0)}else{let h=Math.max(0,Math.min(o-s,Math.floor((e-i)/a))),{from:f,length:O}=t.doc.line(s+h);return new jt(f,O,i+a*h,a,0)}}lineAt(e,t,i,r,s){if(t==Ce.ByHeight)return this.blockAt(e,i,r,s);if(t==Ce.ByPosNoHeight){let{from:b,to:S}=i.doc.lineAt(e);return new jt(b,S-b,0,0,0)}let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(i,s),h=i.doc.lineAt(e),f=a+h.length*l,O=h.number-o,m=r+a*O+l*(h.from-s-O);return new jt(h.from,h.length,Math.max(r,Math.min(m,r+this.height-f)),f,0)}forEachLine(e,t,i,r,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:a,perLine:l,perChar:h}=this.heightMetrics(i,s);for(let f=e,O=r;f<=t;){let m=i.doc.lineAt(f);if(f==e){let S=m.number-a;O+=l*S+h*(e-s-S)}let b=l+h*m.length;o(new jt(m.from,m.length,O,b,0)),O+=b,f=m.to+1}}replace(e,t,i){let r=this.length-t;if(r>0){let s=i[i.length-1];s instanceof Ge?i[i.length-1]=new Ge(s.length+r):i.push(null,new Ge(r-1))}if(e>0){let s=i[0];s instanceof Ge?i[0]=new Ge(e+s.length):i.unshift(new Ge(e-1),null)}return dt.of(i)}decomposeLeft(e,t){t.push(new Ge(e-1),null)}decomposeRight(e,t){t.push(null,new Ge(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let o=[],a=Math.max(t,r.from),l=-1;for(r.from>t&&o.push(new Ge(r.from-t-1).updateHeight(e,t));a<=s&&r.more;){let f=e.doc.lineAt(a).length;o.length&&o.push(null);let O=r.heights[r.index++],m=0;O<0&&(m=-O,O=r.heights[r.index++]),l==-1?l=O:Math.abs(O-l)>=ks&&(l=-2);let b=new xt(f,O,m);b.outdated=!1,o.push(b),a+=f+1}a<=s&&o.push(null,new Ge(s-a).updateHeight(e,a));let h=dt.of(o);return(l<0||Math.abs(h.height-this.height)>=ks||Math.abs(l-this.heightMetrics(e,t).perLine)>=ks)&&(_n=!0),Ds(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Ob extends dt{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let s=i+this.left.height;return e<s?this.left.blockAt(e,t,i,r):this.right.blockAt(e,t,s,r+this.left.length+this.break)}lineAt(e,t,i,r,s){let o=r+this.left.height,a=s+this.left.length+this.break,l=t==Ce.ByHeight?e<o:e<a,h=l?this.left.lineAt(e,t,i,r,s):this.right.lineAt(e,t,i,o,a);if(this.break||(l?h.to<a:h.from>a))return h;let f=t==Ce.ByPosNoHeight?Ce.ByPosNoHeight:Ce.ByPos;return l?h.join(this.right.lineAt(a,f,i,o,a)):this.left.lineAt(a,f,i,r,s).join(h)}forEachLine(e,t,i,r,s,o){let a=r+this.left.height,l=s+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,i,r,s,o),t>=l&&this.right.forEachLine(e,t,i,a,l,o);else{let h=this.lineAt(l,Ce.ByPos,i,r,s);e<h.from&&this.left.forEachLine(e,h.from-1,i,r,s,o),h.to>=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,a,l,o)}}replace(e,t,i){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of i)s.push(a);if(e>0&&iu(s,o-1),t<this.length){let a=s.length;this.decomposeRight(t,s),iu(s,a)}return dt.of(s)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?dt.of(this.break?[e,null,t]:[e,t]):(this.left=Ds(this.left,e),this.right=Ds(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,r){let{left:s,right:o}=this,a=t+s.length+this.break,l=null;return r&&r.from<=t+s.length&&r.more?l=s=s.updateHeight(e,t,i,r):s.updateHeight(e,t,i),r&&r.from<=a+o.length&&r.more?l=o=o.updateHeight(e,a,i,r):o.updateHeight(e,a,i),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function iu(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof Ge&&(i=n[e+1])instanceof Ge&&n.splice(e-1,3,new Ge(t.length+1+i.length))}const gb=5;class Kl{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof xt?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new xt(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,s=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let o=t-e;i.block?this.addBlock(new mp(o,r,i)):(o||s||r>=gb)&&this.addLineDeco(r,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new xt(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new Ge(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof xt)return e;let t=new xt(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof xt)&&!this.isCovered?this.nodes.push(new xt(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof xt&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,t,i,r){let s=new Kl(i,e);return pe.spans(t,i,r,s,0),s.finish(i)}}function mb(n,e,t){let i=new yb;return pe.compare(n,e,t,i,0),i.changes}class yb{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,r){(e<t||i&&i.heightRelevant||r&&r.heightRelevant)&&Cn(e,t,this.changes,5)}}function bb(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,r=i.defaultView||window,s=Math.max(0,t.left),o=Math.min(r.innerWidth,t.right),a=Math.max(0,t.top),l=Math.min(r.innerHeight,t.bottom);for(let h=n.parentNode;h&&h!=i.body;)if(h.nodeType==1){let f=h,O=window.getComputedStyle(f);if((f.scrollHeight>f.clientHeight||f.scrollWidth>f.clientWidth)&&O.overflow!="visible"){let m=f.getBoundingClientRect();s=Math.max(s,m.left),o=Math.min(o,m.right),a=Math.max(a,m.top),l=Math.min(h==n.parentNode?r.innerHeight:l,m.bottom)}h=O.position=="absolute"||O.position=="fixed"?f.offsetParent:f.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function vb(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function Sb(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Jo{constructor(e,t,i,r){this.from=e,this.to=t,this.size=i,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],s=t[i];if(r.from!=s.from||r.to!=s.to||r.size!=s.size)return!1}return!0}draw(e,t){return H.replace({widget:new kb(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class kb extends bt{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class nu{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=ru,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=Ee.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=t.facet(Gl).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new fb(i),this.stateDeco=su(t),this.heightMap=dt.empty().applyChanges(this.stateDeco,be.empty,this.heightOracle.setDoc(t.doc),[new Zt(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=H.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:s,to:o})=>r>=s&&r<=o)){let{from:s,to:o}=this.lineBlockAt(r);e.push(new ns(s,o))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?ru:new Jl(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(hr(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=su(this.state);let r=e.changedRanges,s=Zt.extendWithRanges(r,mb(i,this.stateDeco,e?e.changes:Ve.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);tu(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||_n)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let h=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(h||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(dy)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Ee.RTL:Ee.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent==="refresh",a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let h=0,f=0;if(a.width&&a.height){let{scaleX:W,scaleY:Y}=Rd(t,a);(W>.005&&Math.abs(this.scaleX-W)>.005||Y>.005&&Math.abs(this.scaleY-Y)>.005)&&(this.scaleX=W,this.scaleY=Y,h|=16,o=l=!0)}let O=(parseInt(i.paddingTop)||0)*this.scaleY,m=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=O||this.paddingBottom!=m)&&(this.paddingTop=O,this.paddingBottom=m,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let b=Ld(this.view.contentDOM,!1).y;b!=this.scrollParent&&(this.scrollParent=b,this.scrollAnchorHeight=-1,this.scrollOffset=0);let S=this.getScrollOffset();this.scrollOffset!=S&&(this.scrollAnchorHeight=-1,this.scrollOffset=S),this.scrolledToBottom=Ed(this.scrollParent||e.win);let Q=(this.printing?Sb:bb)(t,this.paddingTop),P=Q.top-this.pixelViewport.top,A=Q.bottom-this.pixelViewport.bottom;this.pixelViewport=Q;let E=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(E!=this.inView&&(this.inView=E,E&&(l=!0)),!this.inView&&!this.scrollTarget&&!vb(e.dom))return 0;let B=a.width;if((this.contentDOMWidth!=B||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),l){let W=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(W)&&(o=!0),o||r.lineWrapping&&Math.abs(B-this.contentDOMWidth)>r.charWidth){let{lineHeight:Y,charWidth:_,textHeight:ge}=e.docView.measureTextSize();o=Y>0&&r.refresh(s,Y,_,ge,Math.max(5,B/_),W),o&&(e.docView.minWidth=0,h|=16)}P>0&&A>0?f=Math.max(P,A):P<0&&A<0&&(f=Math.min(P,A)),tu();for(let Y of this.viewports){let _=Y.from==this.viewport.from?W:e.docView.measureVisibleLineHeights(Y);this.heightMap=(o?dt.empty().applyChanges(this.stateDeco,be.empty,this.heightOracle,[new Zt(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,o,new db(Y.from,_))}_n&&(h|=2)}let U=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return U&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(f,this.scrollTarget),h|=this.updateForViewport()),(h&2||U)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new ns(r.lineAt(o-i*1e3,Ce.ByHeight,s,0,0).from,r.lineAt(a+(1-i)*1e3,Ce.ByHeight,s,0,0).to);if(t){let{head:h}=t.range;if(h<l.from||h>l.to){let f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),O=r.lineAt(h,Ce.ByPos,s,0,0),m;t.y=="center"?m=(O.top+O.bottom)/2-f/2:t.y=="start"||t.y=="nearest"&&h<l.from?m=O.top:m=O.bottom-f,l=new ns(r.lineAt(m-1e3/2,Ce.ByHeight,s,0,0).from,r.lineAt(m+f+1e3/2,Ce.ByHeight,s,0,0).to)}}return l}mapViewport(e,t){let i=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new ns(this.heightMap.lineAt(i,Ce.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Ce.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Ce.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,Ce.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||r<=o-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||s>=a+Math.max(10,Math.min(i,250)))&&r>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let r of e)t.touchesRange(r.from,r.to)||i.push(new Jo(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,s=r>>1,o=r<<1;if(this.defaultTextDirection!=Ee.LTR&&!i)return[];let a=[],l=(f,O,m,b)=>{if(O-f<s)return;let S=this.state.selection.main,Q=[S.from];S.empty||Q.push(S.to);for(let A of Q)if(A>f&&A<O){l(f,A-10,m,b),l(A+10,O,m,b);return}let P=xb(e,A=>A.from>=m.from&&A.to<=m.to&&Math.abs(A.from-f)<s&&Math.abs(A.to-O)<s&&!Q.some(E=>A.from<E&&A.to>E));if(!P){if(O<m.to&&t&&i&&t.visibleRanges.some(B=>B.from<=O&&B.to>=O)){let B=t.moveToLineBoundary(Z.cursor(O),!1,!0).head;B>f&&(O=B)}let A=this.gapSize(m,f,O,b),E=i||A<2e6?A:2e6;P=new Jo(f,O,A,E)}a.push(P)},h=f=>{if(f.length<o||f.type!=mt.Text)return;let O=wb(f.from,f.to,this.stateDeco);if(O.total<o)return;let m=this.scrollTarget?this.scrollTarget.range.head:null,b,S;if(i){let Q=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,P,A;if(m!=null){let E=ss(O,m),B=((this.visibleBottom-this.visibleTop)/2+Q)/f.height;P=E-B,A=E+B}else P=(this.visibleTop-f.top-Q)/f.height,A=(this.visibleBottom-f.top+Q)/f.height;b=rs(O,P),S=rs(O,A)}else{let Q=O.total*this.heightOracle.charWidth,P=r*this.heightOracle.charWidth,A=0;if(Q>2e6)for(let Y of e)Y.from>=f.from&&Y.from<f.to&&Y.size!=Y.displaySize&&Y.from*this.heightOracle.charWidth+A<this.pixelViewport.left&&(A=Y.size-Y.displaySize);let E=this.pixelViewport.left+A,B=this.pixelViewport.right+A,U,W;if(m!=null){let Y=ss(O,m),_=((B-E)/2+P)/Q;U=Y-_,W=Y+_}else U=(E-P)/Q,W=(B+P)/Q;b=rs(O,U),S=rs(O,W)}b>f.from&&l(f.from,b,f,O),S<f.to&&l(S,f.to,f,O)};for(let f of this.viewportLines)Array.isArray(f.type)?f.type.forEach(h):h(f);return a}gapSize(e,t,i,r){let s=ss(r,i)-ss(r,t);return this.heightOracle.lineWrapping?e.height*s:r.total*this.heightOracle.charWidth*s}updateLineGaps(e){Jo.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=H.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];pe.spans(t,this.viewport.from,this.viewport.to,{span(s,o){i.push({from:s,to:o})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let s=0;s<i.length&&!(r&8);s++){let o=this.visibleRanges[s],a=i[s];(o.from!=a.from||o.to!=a.to)&&(r|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||hr(this.heightMap.lineAt(e,Ce.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||hr(this.heightMap.lineAt(this.scaler.fromDOM(e),Ce.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return hr(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ns{constructor(e,t){this.from=e,this.to=t}}function wb(n,e,t){let i=[],r=n,s=0;return pe.spans(t,n,e,{span(){},point(o,a){o>r&&(i.push({from:r,to:o}),s+=o-r),r=a}},20),r<e&&(i.push({from:r,to:e}),s+=e-r),{total:s,ranges:i}}function rs({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:s,to:o}=e[r],a=o-s;if(i<=a)return s+i;i-=a}}function ss(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function xb(n,e){for(let t of n)if(e(t))return t}const ru={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function su(n){let e=n.facet(ho).filter(i=>typeof i!="function"),t=n.facet(Ul).filter(i=>typeof i!="function");return t.length&&e.push(pe.join(t)),e}class Jl{constructor(e,t,i){let r=0,s=0,o=0;this.viewports=i.map(({from:a,to:l})=>{let h=t.lineAt(a,Ce.ByPos,e,0,0).top,f=t.lineAt(l,Ce.ByPos,e,0,0).bottom;return r+=f-h,{from:a,to:l,top:h,bottom:f,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return r+(e-i)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);i=s.bottom,r=s.domBottom}}fromDOM(e){for(let t=0,i=0,r=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return i+(e-r)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);i=s.bottom,r=s.domBottom}}eq(e){return e instanceof Jl?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function hr(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new jt(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(r=>hr(r,e)):n._content)}const os=F.define({combine:n=>n.join(" ")}),ol=F.define({combine:n=>n.indexOf(!0)>-1}),al=Xi.newName(),yp=Xi.newName(),bp=Xi.newName(),vp={"&light":"."+yp,"&dark":"."+bp};function ll(n,e,t){return new Xi(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+" "+i}})}const Qb=ll("."+al,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},vp),$b={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},ea=q.ie&&q.ie_version<=11;class Cb{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new ty,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(q.ie&&q.ie_version<=11||q.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&q.android&&e.constructor.EDIT_CONTEXT!==!1&&!(q.chrome&&q.chrome_version<126)&&(this.editContext=new Tb(e),e.state.facet(Oi)&&(e.contentDOM.editContext=this.editContext.editContext)),ea&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(Oi)?i.root.activeElement!=this.dom:!mr(this.dom,r))return;let s=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(q.ie&&q.ie_version<=11||q.android&&q.chrome)&&!i.state.selection.main.empty&&r.focusNode&&br(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Cr(e.root);if(!t)return!1;let i=q.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Pb(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let r=mr(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&ny(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,$b),ea&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),ea&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let r=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Pn(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,r=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(r=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&mr(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new Yy(this.view,e,t,i);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,r=ap(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!Is(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let i=ou(t,e.previousSibling||e.target.previousSibling,-1),r=ou(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Oi)!=e.state.facet(Oi)&&(e.view.contentDOM.editContext=e.state.facet(Oi)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function ou(n,e,t){for(;e;){let i=Xe.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function au(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,s=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor,1);return br(o.node,o.offset,r,s)&&([t,i,r,s]=[r,s,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}}function Pb(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return au(n,r)}let t=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?au(n,t):null}class Tb{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:s,head:o}=r,a=this.toEditorPos(i.updateRangeStart),l=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:a,drifted:!1});let h=l-a>i.text.length;a==this.from&&s<this.from?a=s:l==this.to&&s>this.to&&(l=s);let f=lp(e.state.sliceDoc(a,l),i.text,(h?r.from:r.to)-a,h?"end":null);if(!f){let m=Z.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Is(m,r)||e.dispatch({selection:m,userEvent:"select"});return}let O={from:f.from+a,to:f.toA+a,insert:be.of(i.text.slice(f.from,f.toB).split(`
|
|
10
|
+
`))};if((q.mac||q.android)&&O.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(O={from:a,to:l,insert:be.of([i.text.replace("."," ")])}),this.pendingContextChange=O,!e.state.readOnly){let m=this.to-this.from+(O.to-O.from+O.insert.length);Hl(e,O,Z.single(this.toEditorPos(i.selectionStart,m),this.toEditorPos(i.selectionEnd,m)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),O.from<O.to&&!O.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],s=null;for(let o=this.toEditorPos(i.rangeStart),a=this.toEditorPos(i.rangeEnd);o<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,r.push(s)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let s of i.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),h=this.toEditorPos(s.rangeEnd);if(l<h){let f=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;r.push(H.mark({attributes:{style:f}}).range(l,h))}}}e.dispatch({effects:Hd.of(H.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let r=Cr(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,h)=>{if(i)return;let f=h.length-(o-s);if(r&&o>=r.to)if(r.from==s&&r.to==o&&r.insert.eq(h)){r=this.pendingContextChange=null,t+=f,this.to+=f;return}else r=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=f,this.to+=f;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),h.toString()),this.to+=f}t+=f}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class z{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(s=>i(s,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||iy(e.parent)||document,this.viewState=new nu(this,e.state||he.create(e)),e.scrollTo&&e.scrollTo.is(es)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(xn).map(r=>new Fo(r));for(let r of this.plugins)r.update(this);this.observer=new Cb(this),this.inputState=new Uy(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Wh(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Te?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,r,s=this.state;for(let m of e){if(m.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=m.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(m=>m.annotation(pp))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=Op(s,o),l||(a=1));let h=this.observer.delayedAndroidKey,f=null;if(h?(this.observer.clearDelayedAndroidKey(),f=this.observer.readChange(),(f&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(f=null)):this.observer.clear(),s.facet(he.phrases)!=this.state.facet(he.phrases))return this.setState(s);r=Es.create(this,s,e),r.flags|=a;let O=this.viewState.scrollTarget;try{this.updateState=2;for(let m of e){if(O&&(O=O.map(m.changes)),m.scrollIntoView){let{main:b}=m.state.selection;O=new Tn(b.empty?b:Z.cursor(b.head,b.head>b.anchor?-1:1))}for(let b of m.effects)b.is(es)&&(O=b.value.clip(this.state))}this.viewState.update(r,O),this.bidiCache=_s.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(cr)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(m=>m.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(os)!=r.state.facet(os)&&(this.viewState.mustMeasureContent=!0),(t||i||O||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let m of this.state.facet(il))try{m(r)}catch(b){ai(this.state,b,"update listener")}(l||f)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),f&&!ap(this,f)&&h.force&&Pn(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new nu(this,e),this.plugins=e.facet(xn).map(i=>new Fo(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Wh(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(xn),i=e.state.facet(xn);if(t!=i){let r=[];for(let s of i){let o=t.indexOf(s);if(o<0)r.push(new Fo(s));else{let a=this.plugins[o];a.mustUpdate=e,r.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){ai(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(Ed(i||this.win))s=-1,o=this.viewState.heightMap.height;else{let b=this.viewState.scrollAnchorAt(r);s=b.from,o=b.top}this.updateState=1;let l=this.viewState.measure();if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];l&4||([this.measureRequests,h]=[h,this.measureRequests]);let f=h.map(b=>{try{return b.read(this)}catch(S){return ai(this.state,S),lu}}),O=Es.create(this,this.state,[]),m=!1;O.flags|=l,t?t.flags|=l:t=O,this.updateState=2,O.empty||(this.updatePlugins(O),this.inputState.update(O),this.updateAttrs(),m=this.docView.update(O),m&&this.docViewUpdate());for(let b=0;b<h.length;b++)if(f[b]!=lu)try{let S=h[b];S.write&&S.write(f[b],this)}catch(S){ai(this.state,S)}if(m&&this.docView.updateSelection(!0),!O.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let S=((s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o)/this.scaleY;if((S>1||S<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+S,i?i.scrollTop+=S:this.win.scrollBy(0,S),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(il))a(t)}get themeClasses(){return al+" "+(this.state.facet(ol)?bp:yp)+" "+this.state.facet(os)}updateAttrs(){let e=cu(this,Kd,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Oi)?"true":"false",class:"cm-content",style:`${q.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),cu(this,Gl,t);let i=this.observer.ignore(()=>{let r=Ih(this.contentDOM,this.contentAttrs,t),s=Ih(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(z.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(cr);let e=this.state.facet(z.cspNonce);Xi.mount(this.root,this.styleModules.concat(Qb).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Ko(this,e,Nh(this,e,t,i))}moveByGroup(e,t){return Ko(this,e,Nh(this,e,t,i=>_y(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),s=i[t?i.length-1:0];return Z.cursor(s.side(t,r)+e.from,s.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return Dy(this,e,t,i)}moveVertically(e,t,i){return Ko(this,e,jy(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=rl(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),rl(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),o=s[oi.find(s,e-r.from,-1,t)];return Pr(i,o.dir==Ee.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Gd)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Ab)return jd(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||_d(s.isolates,i=jh(this,e))))return s.order;i||(i=jh(this,e));let r=hy(e.text,t,i);return this.bidiCache.push(new _s(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||q.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Zd(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return es.of(new Tn(typeof e=="number"?Z.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return es.of(new Tn(Z.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return et.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return et.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=Xi.newName(),r=[os.of(i),cr.of(ll(`.${i}`,e))];return t&&t.dark&&r.push(ol.of(!0)),r}static baseTheme(e){return wi.lowest(cr.of(ll("."+al,e,vp)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&Xe.get(i)||Xe.get(e);return((t=r?.root)===null||t===void 0?void 0:t.view)||null}}z.styleModule=cr;z.inputHandler=qd;z.clipboardInputFilter=ql;z.clipboardOutputFilter=Fl;z.scrollHandler=Ud;z.focusChangeEffect=Fd;z.perLineTextDirection=Gd;z.exceptionSink=Yd;z.updateListener=il;z.editable=Oi;z.mouseSelectionStyle=Nd;z.dragMovesSelection=Wd;z.clickAddsSelectionRange=zd;z.decorations=ho;z.blockWrappers=Jd;z.outerDecorations=Ul;z.atomicRanges=Vr;z.bidiIsolatedRanges=ep;z.scrollMargins=tp;z.darkTheme=ol;z.cspNonce=F.define({combine:n=>n.length?n[0]:""});z.contentAttributes=Gl;z.editorAttributes=Kd;z.lineWrapping=z.contentAttributes.of({class:"cm-lineWrapping"});z.announce=Oe.define();const Ab=4096,lu={};class _s{constructor(e,t,i,r,s,o){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:Ee.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==r&&!t.touchesRange(o.from,o.to)&&i.push(new _s(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function cu(n,e,t){for(let i=n.state.facet(e),r=i.length-1;r>=0;r--){let s=i[r],o=typeof s=="function"?s(n):s;o&&Wl(o,t)}return t}const Mb=q.mac?"mac":q.windows?"win":q.linux?"linux":"key";function Rb(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,s,o,a;for(let l=0;l<t.length-1;++l){const h=t[l];if(/^(cmd|meta|m)$/i.test(h))a=!0;else if(/^a(lt)?$/i.test(h))r=!0;else if(/^(c|ctrl|control)$/i.test(h))s=!0;else if(/^s(hift)?$/i.test(h))o=!0;else if(/^mod$/i.test(h))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+h)}return r&&(i="Alt-"+i),s&&(i="Ctrl-"+i),a&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function as(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const Lb=wi.default(z.domEventHandlers({keydown(n,e){return kp(Sp(e.state),n,e,"editor")}})),Li=F.define({enables:Lb}),hu=new WeakMap;function Sp(n){let e=n.facet(Li),t=hu.get(e);return t||hu.set(e,t=Eb(e.reduce((i,r)=>i.concat(r),[]))),t}function vn(n,e,t){return kp(Sp(n.state),e,n,t)}let Mi=null;const Zb=4e3;function Eb(n,e=Mb){let t=Object.create(null),i=Object.create(null),r=(o,a)=>{let l=i[o];if(l==null)i[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,h,f)=>{var O,m;let b=t[o]||(t[o]=Object.create(null)),S=a.split(/ (?!$)/).map(A=>Rb(A,e));for(let A=1;A<S.length;A++){let E=S.slice(0,A).join(" ");r(E,!0),b[E]||(b[E]={preventDefault:!0,stopPropagation:!1,run:[B=>{let U=Mi={view:B,prefix:E,scope:o};return setTimeout(()=>{Mi==U&&(Mi=null)},Zb),!0}]})}let Q=S.join(" ");r(Q,!1);let P=b[Q]||(b[Q]={preventDefault:!1,stopPropagation:!1,run:((m=(O=b._any)===null||O===void 0?void 0:O.run)===null||m===void 0?void 0:m.slice())||[]});l&&P.run.push(l),h&&(P.preventDefault=!0),f&&(P.stopPropagation=!0)};for(let o of n){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of a){let f=t[h]||(t[h]=Object.create(null));f._any||(f._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:O}=o;for(let m in f)f[m].run.push(b=>O(b,cl))}let l=o[e]||o.key;if(l)for(let h of a)s(h,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(h,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}let cl=null;function kp(n,e,t,i){cl=e;let r=F0(e),s=Od(r,0),o=gd(s)==r.length&&r!=" ",a="",l=!1,h=!1,f=!1;Mi&&Mi.view==t&&Mi.scope==i&&(a=Mi.prefix+" ",hp.indexOf(e.keyCode)<0&&(h=!0,Mi=null));let O=new Set,m=P=>{if(P){for(let A of P.run)if(!O.has(A)&&(O.add(A),A(t)))return P.stopPropagation&&(f=!0),!0;P.preventDefault&&(P.stopPropagation&&(f=!0),h=!0)}return!1},b=n[i],S,Q;return b&&(m(b[a+as(r,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(q.windows&&e.ctrlKey&&e.altKey)&&!(q.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(S=Bi[e.keyCode])&&S!=r?(m(b[a+as(S,e,!0)])||e.shiftKey&&(Q=Qr[e.keyCode])!=r&&Q!=S&&m(b[a+as(Q,e,!1)]))&&(l=!0):o&&e.shiftKey&&m(b[a+as(r,e,!0)])&&(l=!0),!l&&m(b._any)&&(l=!0)),h&&(l=!0),l&&f&&e.stopPropagation(),cl=null,l}const Xb=F.define({combine(n){return lo(n,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function Bb(n){return n.facet(Xb)}class Ib extends bt{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?yr(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),r=Pr(t[0],i.direction!="rtl"),s=parseInt(i.lineHeight);return r.bottom-r.top>s*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+s}:r}ignoreEvent(){return!1}}function wp(n){let e=et.fromClass(class{constructor(t){this.view=t,this.placeholder=n?H.set([H.widget({widget:new Ib(n),side:1}).range(0)]):H.none}get decorations(){return this.view.state.doc.length?H.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,z.contentAttributes.of({"aria-placeholder":n})]:e}const uu=F.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}}),Db=et.fromClass(class{constructor(n){this.input=n.state.facet(js),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(uu);this.top=new ls(n,!0,e.topContainer),this.bottom=new ls(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(uu);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new ls(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new ls(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(js);if(t!=this.input){let i=t.filter(l=>l),r=[],s=[],o=[],a=[];for(let l of i){let h=this.specs.indexOf(l),f;h<0?(f=l(n.view),a.push(f)):(f=this.panels[h],f.update&&f.update(n)),r.push(f),(f.top?s:o).push(f)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>z.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class ls{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=fu(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=fu(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function fu(n){let e=n.nextSibling;return n.remove(),e}const js=F.define({enables:Db});class Di extends Ei{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Di.prototype.elementClass="";Di.prototype.toDOM=void 0;Di.prototype.mapMode=He.TrackBefore;Di.prototype.startSide=Di.prototype.endSide=-1;Di.prototype.point=!0;const ta=F.define(),_b=F.define(),ws=F.define(),du=F.define({combine:n=>n.some(e=>e)});function jb(n){return[Vb]}const Vb=et.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(ws).map(e=>new Ou(n,e)),this.fixed=!n.state.facet(du);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(du)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=pe.iter(this.view.state.facet(ta),this.view.viewport.from),i=[],r=this.gutters.map(s=>new zb(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==mt.Text&&o){hl(t,i,a.from);for(let l of r)l.line(this.view,a,i);o=!1}else if(a.widget)for(let l of r)l.widget(this.view,a)}else if(s.type==mt.Text){hl(t,i,s.from);for(let o of r)o.line(this.view,s,i)}else if(s.widget)for(let o of r)o.widget(this.view,s);for(let s of r)s.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(ws),t=n.state.facet(ws),i=n.docChanged||n.heightChanged||n.viewportChanged||!pe.eq(n.startState.facet(ta),n.state.facet(ta),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let s of t){let o=e.indexOf(s);o<0?r.push(new Ou(this.view,s)):(this.gutters[o].update(n),r.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>z.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ee.LTR?{left:i,right:r}:{right:i,left:r}})});function pu(n){return Array.isArray(n)?n:[n]}function hl(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class zb{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=pe.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==r.elements.length){let a=new xp(e,o,s,i);r.elements.push(a),r.dom.appendChild(a.dom)}else r.elements[this.i].update(e,o,s,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];hl(this.cursor,r,t.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let o=this.gutter;r.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),r=i?[i]:null;for(let s of e.state.facet(_b)){let o=s(e,t.widget,t);o&&(r||(r=[])).push(o)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Ou{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=r.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,a,r)&&r.preventDefault()});this.markers=pu(t.markers(e)),t.initialSpacer&&(this.spacer=new xp(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=pu(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!pe.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class xp{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),Wb(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=s<t.length?t[s++]:null,h=!1;if(l){let f=l.elementClass;f&&(i+=" "+f);for(let O=o;O<this.markers.length;O++)if(this.markers[O].compare(l)){a=O,h=!0;break}}else a=this.markers.length;for(;o<a;){let f=this.markers[o++];if(f.toDOM){f.destroy(r);let O=r.nextSibling;r.remove(),r=O}}if(!l)break;l.toDOM&&(h?r=r.nextSibling:this.dom.insertBefore(l.toDOM(e),r)),h&&o++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function Wb(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const Nb=F.define(),Qp=F.define(),Qn=F.define({combine(n){return lo(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let r in t){let s=i[r],o=t[r];i[r]=s?(a,l,h)=>s(a,l,h)||o(a,l,h):o}return i}})}});class ia extends Di{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function na(n,e){return n.state.facet(Qn).formatNumber(e,n.state)}const Yb=ws.compute([Qn],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Nb)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new ia(na(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let r of e.state.facet(Qp)){let s=r(e,t,i);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Qn)!=e.state.facet(Qn),initialSpacer(e){return new ia(na(e,gu(e.state.doc.lines)))},updateSpacer(e,t){let i=na(t.view,gu(t.view.state.doc.lines));return i==e.number?e:new ia(i)},domEventHandlers:n.facet(Qn).domEventHandlers,side:"before"}));function $p(n={}){return[Qn.of(n),jb(),Yb]}function gu(n){let e=9;for(;e<n;)e=e*10+9;return e}const Cp=1024;let qb=0;class Et{constructor(e,t){this.from=e,this.to=t}}class ee{constructor(e={}){this.id=qb++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=je.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}ee.closedBy=new ee({deserialize:n=>n.split(" ")});ee.openedBy=new ee({deserialize:n=>n.split(" ")});ee.group=new ee({deserialize:n=>n.split(" ")});ee.isolate=new ee({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});ee.contextHash=new ee({perNode:!0});ee.lookAhead=new ee({perNode:!0});ee.mounted=new ee({perNode:!0});class An{constructor(e,t,i,r=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[ee.mounted.id]}}const Fb=Object.create(null);class je{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):Fb,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new je(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ee.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(ee.group),s=-1;s<(r?r.length:0);s++){let o=t[s<0?i.name:r[s]];if(o)return o}}}}je.none=new je("",Object.create(null),0,8);class qn{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let r=null;for(let s of e){let o=s(i);if(o){r||(r=Object.assign({},i.props));let a=o[1],l=o[0];l.combine&&l.id in r&&(a=l.combine(r[l.id],a)),r[l.id]=a}}t.push(r?new je(i.name,r,i.id,i.flags):i)}return new qn(t)}}const cs=new WeakMap,mu=new WeakMap;exports.IterMode=void 0;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(exports.IterMode||(exports.IterMode={}));class le{constructor(e,t,i,r,s){if(this.type=e,this.children=t,this.positions=i,this.length=r,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=An.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let r=i.toString();r&&(t&&(t+=","),t+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Vs(this.topNode,e)}cursorAt(e,t=0,i=0){let r=cs.get(this)||this.topNode,s=new Vs(r);return s.moveTo(e,t),cs.set(this,s._tree),s}get topNode(){return new nt(this,0,0,null)}resolve(e,t=0){let i=Ar(cs.get(this)||this.topNode,e,t,!1);return cs.set(this,i),i}resolveInner(e,t=0){let i=Ar(mu.get(this)||this.topNode,e,t,!0);return mu.set(this,i),i}resolveStack(e,t=0){return Hb(this,e,t)}iterate(e){let{enter:t,leave:i,from:r=0,to:s=this.length}=e,o=e.mode||0,a=(o&exports.IterMode.IncludeAnonymous)>0;for(let l=this.cursor(o|exports.IterMode.IncludeAnonymous);;){let h=!1;if(l.from<=s&&l.to>=r&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;h=!0}for(;h&&i&&(a||!l.type.isAnonymous)&&i(l),!l.nextSibling();){if(!l.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:ic(je.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new le(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new le(je.none,t,i,r)))}static build(e){return Kb(e)}}le.empty=new le(je.none,[],[],0);class ec{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new ec(this.buffer,this.index)}}class _i{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return je.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],r=this.set.types[t],s=r.name;if(/\W/.test(s)&&!r.isError&&(s=JSON.stringify(s)),e+=4,i==e)return s;let o=[];for(;e<i;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,i,r,s){let{buffer:o}=this,a=-1;for(let l=e;l!=t&&!(Pp(s,r,o[l+1],o[l+2])&&(a=l,i>0));l=o[l+3]);return a}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a<t;){s[l++]=r[a++],s[l++]=r[a++]-i;let h=s[l++]=r[a++]-i;s[l++]=r[a++]-e,o=Math.max(o,h)}return new _i(s,o,this.set)}}function Pp(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Ar(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!i&&n instanceof nt&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=i?0:exports.IterMode.IgnoreOverlays;if(i)for(let o=n,a=o.parent;a;o=a,a=o.parent)o instanceof nt&&o.index<0&&((r=a.enter(e,t,s))===null||r===void 0?void 0:r.from)!=o.from&&(n=a);for(;;){let o=n.enter(e,t,s);if(!o)return n;n=o}}class Tp{cursor(e=0){return new Vs(this,e)}getChild(e,t=null,i=null){let r=yu(this,e,t,i);return r.length?r[0]:null}getChildren(e,t=null,i=null){return yu(this,e,t,i)}resolve(e,t=0){return Ar(this,e,t,!1)}resolveInner(e,t=0){return Ar(this,e,t,!0)}matchContext(e){return ul(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(i=t,t=r.prevSibling):t=r}return i}get node(){return this}get next(){return this.parent}}class nt extends Tp{constructor(e,t,i,r){super(),this._tree=e,this.from=t,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,r,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,h=t>0?a.length:-1;e!=h;e+=t){let f=a[e],O=l[e]+o.from,m;if(!(!(s&exports.IterMode.EnterBracketed&&f instanceof le&&(m=An.get(f))&&!m.overlay&&m.bracketed&&i>=O&&i<=O+f.length)&&!Pp(r,i,O,O+f.length))){if(f instanceof _i){if(s&exports.IterMode.ExcludeBuffers)continue;let b=f.findChild(0,f.buffer.length,t,i-O,r);if(b>-1)return new li(new Gb(o,f,e,O),null,b)}else if(s&exports.IterMode.IncludeAnonymous||!f.type.isAnonymous||tc(f)){let b;if(!(s&exports.IterMode.IgnoreMounts)&&(b=An.get(f))&&!b.overlay)return new nt(b.tree,O,e,o);let S=new nt(f,O,e,o);return s&exports.IterMode.IncludeAnonymous||!S.type.isAnonymous?S:S.nextChild(t<0?f.children.length-1:0,t,i,r,s)}}}if(s&exports.IterMode.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let r;if(!(i&exports.IterMode.IgnoreOverlays)&&(r=An.get(this._tree))&&r.overlay){let s=e-this.from,o=i&exports.IterMode.EnterBracketed&&r.bracketed;for(let{from:a,to:l}of r.overlay)if((t>0||o?a<=s:a<s)&&(t<0||o?l>=s:l>s))return new nt(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function yu(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=r.type.is(t),!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function ul(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class Gb{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class li extends Tp{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new li(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&exports.IterMode.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new li(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new li(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new li(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let o=i.buffer[this.index+1];e.push(i.slice(r,s,o)),t.push(0)}return new le(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function Ap(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let o=n[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let i=t instanceof nt&&t.index<0?null:t.parent,r=n.slice();return i?r[e]=i:r.splice(e,1),new Ub(r,t)}class Ub{constructor(e,t){this.heads=e,this.node=t}get next(){return Ap(this.heads)}}function Hb(n,e,t){let i=n.resolveInner(e,t),r=null;for(let s=i instanceof nt?i:i.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(r||(r=[i])).push(o.resolve(e,t)),s=o}else{let o=An.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new nt(o.tree,o.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(Ar(a,e,t,!1))}}return r?Ap(r):i}class Vs{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~exports.IterMode.EnterBracketed,e instanceof nt)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof nt?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&exports.IterMode.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&exports.IterMode.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&exports.IterMode.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(r.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:i}=r)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let s=t+e,o=e<0?-1:i._tree.children.length;s!=o;s+=e){let a=i._tree.children[s];if(this.mode&exports.IterMode.IncludeAnonymous||a instanceof _i||!a.type.isAnonymous||tc(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==r){if(r==this.index)return o;t=o,i=s+1;break e}r=this.stack[--s]}for(let r=i;r<this.stack.length;r++)t=new li(this.buffer,t,this.stack[r]);return this.bufferNode=new li(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return ul(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let r=e.length-1,s=this.stack.length-1;r>=0;s--){if(s<0)return ul(this._tree,e,r);let o=i[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[r]&&e[r]!=o.name)return!1;r--}}return!0}}function tc(n){return n.children.some(e=>e instanceof _i||!e.type.isAnonymous||tc(e))}function Kb(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=Cp,reused:s=[],minRepeatType:o=i.types.length}=n,a=Array.isArray(t)?new ec(t,t.length):t,l=i.types,h=0,f=0;function O(W,Y,_,ge,ve,me){let{id:ne,start:J,end:ae,size:Pe}=a,De=f,qt=h;if(Pe<0)if(a.next(),Pe==-1){let st=s[ne];_.push(st),ge.push(J-W);return}else if(Pe==-3){h=ne;return}else if(Pe==-4){f=ne;return}else throw new RangeError(`Unrecognized record size: ${Pe}`);let Pt=l[ne],N,Ft,pn=J-W;if(ae-J<=r&&(Ft=P(a.pos-Y,ve))){let st=new Uint16Array(Ft.size-Ft.skip),xe=a.pos-Ft.size,Ye=st.length;for(;a.pos>xe;)Ye=A(Ft.start,st,Ye);N=new _i(st,ae-Ft.start,i),pn=Ft.start-W}else{let st=a.pos-Pe;a.next();let xe=[],Ye=[],Tt=ne>=o?ne:-1,Se=0,On=ae;for(;a.pos>st;)Tt>=0&&a.id==Tt&&a.size>=0?(a.end<=On-r&&(S(xe,Ye,J,Se,a.end,On,Tt,De,qt),Se=xe.length,On=a.end),a.next()):me>2500?m(J,st,xe,Ye):O(J,st,xe,Ye,Tt,me+1);if(Tt>=0&&Se>0&&Se<xe.length&&S(xe,Ye,J,Se,J,On,Tt,De,qt),xe.reverse(),Ye.reverse(),Tt>-1&&Se>0){let Qi=b(Pt,qt);N=ic(Pt,xe,Ye,0,xe.length,0,ae-J,Qi,Qi)}else N=Q(Pt,xe,Ye,ae-J,De-ae,qt)}_.push(N),ge.push(pn)}function m(W,Y,_,ge){let ve=[],me=0,ne=-1;for(;a.pos>Y;){let{id:J,start:ae,end:Pe,size:De}=a;if(De>4)a.next();else{if(ne>-1&&ae<ne)break;ne<0&&(ne=Pe-r),ve.push(J,ae,Pe),me++,a.next()}}if(me){let J=new Uint16Array(me*4),ae=ve[ve.length-2];for(let Pe=ve.length-3,De=0;Pe>=0;Pe-=3)J[De++]=ve[Pe],J[De++]=ve[Pe+1]-ae,J[De++]=ve[Pe+2]-ae,J[De++]=De;_.push(new _i(J,ve[2]-ae,i)),ge.push(ae-W)}}function b(W,Y){return(_,ge,ve)=>{let me=0,ne=_.length-1,J,ae;if(ne>=0&&(J=_[ne])instanceof le){if(!ne&&J.type==W&&J.length==ve)return J;(ae=J.prop(ee.lookAhead))&&(me=ge[ne]+J.length+ae)}return Q(W,_,ge,ve,me,Y)}}function S(W,Y,_,ge,ve,me,ne,J,ae){let Pe=[],De=[];for(;W.length>ge;)Pe.push(W.pop()),De.push(Y.pop()+_-ve);W.push(Q(i.types[ne],Pe,De,me-ve,J-me,ae)),Y.push(ve-_)}function Q(W,Y,_,ge,ve,me,ne){if(me){let J=[ee.contextHash,me];ne=ne?[J].concat(ne):[J]}if(ve>25){let J=[ee.lookAhead,ve];ne=ne?[J].concat(ne):[J]}return new le(W,Y,_,ge,ne)}function P(W,Y){let _=a.fork(),ge=0,ve=0,me=0,ne=_.end-r,J={size:0,start:0,skip:0};e:for(let ae=_.pos-W;_.pos>ae;){let Pe=_.size;if(_.id==Y&&Pe>=0){J.size=ge,J.start=ve,J.skip=me,me+=4,ge+=4,_.next();continue}let De=_.pos-Pe;if(Pe<0||De<ae||_.start<ne)break;let qt=_.id>=o?4:0,Pt=_.start;for(_.next();_.pos>De;){if(_.size<0)if(_.size==-3||_.size==-4)qt+=4;else break e;else _.id>=o&&(qt+=4);_.next()}ve=Pt,ge+=Pe,me+=qt}return(Y<0||ge==W)&&(J.size=ge,J.start=ve,J.skip=me),J.size>4?J:void 0}function A(W,Y,_){let{id:ge,start:ve,end:me,size:ne}=a;if(a.next(),ne>=0&&ge<o){let J=_;if(ne>4){let ae=a.pos-(ne-4);for(;a.pos>ae;)_=A(W,Y,_)}Y[--_]=J,Y[--_]=me-W,Y[--_]=ve-W,Y[--_]=ge}else ne==-3?h=ge:ne==-4&&(f=ge);return _}let E=[],B=[];for(;a.pos>0;)O(n.start||0,n.bufferStart||0,E,B,-1,0);let U=(e=n.length)!==null&&e!==void 0?e:E.length?B[0]+E[0].length:0;return new le(l[n.topID],E.reverse(),B.reverse(),U)}const bu=new WeakMap;function xs(n,e){if(!n.isAnonymous||e instanceof _i||e.type!=n)return 1;let t=bu.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof le)){t=1;break}t+=xs(n,i)}bu.set(e,t)}return t}function ic(n,e,t,i,r,s,o,a,l){let h=0;for(let S=i;S<r;S++)h+=xs(n,e[S]);let f=Math.ceil(h*1.5/8),O=[],m=[];function b(S,Q,P,A,E){for(let B=P;B<A;){let U=B,W=Q[B],Y=xs(n,S[B]);for(B++;B<A;B++){let _=xs(n,S[B]);if(Y+_>=f)break;Y+=_}if(B==U+1){if(Y>f){let _=S[U];b(_.children,_.positions,0,_.children.length,Q[U]+E);continue}O.push(S[U])}else{let _=Q[B-1]+S[B-1].length-W;O.push(ic(n,S,Q,U,B,W,_,null,l))}m.push(W+E-s)}}return b(e,t,i,r,0),(a||l)(O,m,o)}class nc{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof li?this.setBuffer(e.context.buffer,e.index,t):e instanceof nt&&this.map.set(e.tree,t)}get(e){return e instanceof li?this.getBuffer(e.context.buffer,e.index):e instanceof nt?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class bi{constructor(e,t,i,r,s=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new bi(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,h=0;;a++){let f=a<t.length?t[a]:null,O=f?f.fromA:1e9;if(O-l>=i)for(;o&&o.from<O;){let m=o;if(l>=m.from||O<=m.to||h){let b=Math.max(m.from,l)-h,S=Math.min(m.to,O)-h;m=b>=S?null:new bi(b,S,m.tree,m.offset+h,a>0,!!f)}if(m&&r.push(m),o.to>O)break;o=s<e.length?e[s++]:null}if(!f)break;l=f.toA,h=f.toA-f.toB}return r}}class Oo{startParse(e,t,i){return typeof e=="string"&&(e=new Jb(e)),i=i?i.length?i.map(r=>new Et(r.from,r.to)):[new Et(0,0)]:[new Et(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}}class Jb{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function rc(n){return(e,t,i,r)=>new tv(e,n,t,i,r)}class vu{constructor(e,t,i,r,s,o){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=r,this.target=s,this.from=o}}function Su(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class ev{constructor(e,t,i,r,s,o,a,l){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.bracketed=o,this.target=a,this.prev=l,this.depth=0,this.ranges=[]}}const fl=new ee({perNode:!0});class tv{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new le(i.type,i.children,i.positions,i.length,i.propValues.concat([[fl,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[ee.mounted.id]=new An(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new rv(this.fragments),t=null,i=null,r=new Vs(new nt(this.baseTree,this.ranges[0].from,0,null),exports.IterMode.IncludeAnonymous|exports.IterMode.IgnoreMounts);e:for(let s,o;;){let a=!0,l;if(this.stoppedAt!=null&&r.from>=this.stoppedAt)a=!1;else if(e.hasNode(r)){if(t){let h=t.mounts.find(f=>f.frag.from<=r.from&&f.frag.to>=r.to&&f.mount.overlay);if(h)for(let f of h.mount.overlay){let O=f.from+h.pos,m=f.to+h.pos;O>=r.from&&m<=r.to&&!t.ranges.some(b=>b.from<m&&b.to>O)&&t.ranges.push({from:O,to:m})}}a=!1}else if(i&&(o=iv(i.ranges,r.from,r.to)))a=o!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.from<r.to||!s.overlay)){r.tree||(nv(r),t&&t.depth++,i&&i.depth++);let h=e.findMounts(r.from,s.parser);if(typeof s.overlay=="function")t=new ev(s.parser,s.overlay,h,this.inner.length,r.from,!!s.bracketed,r.tree,t);else{let f=xu(this.ranges,s.overlay||(r.from<r.to?[new Et(r.from,r.to)]:[]));f.length&&Su(f),(f.length||!s.overlay)&&this.inner.push(new vu(s.parser,f.length?s.parser.startParse(this.input,Qu(h,f),f):s.parser.startParse(""),s.overlay?s.overlay.map(O=>new Et(O.from-r.from,O.to-r.from)):null,!!s.bracketed,r.tree,f.length?f[0].from:r.from)),s.overlay?f.length&&(i={ranges:f,depth:0,prev:i}):a=!1}}else if(t&&(l=t.predicate(r))&&(l===!0&&(l=new Et(r.from,r.to)),l.from<l.to)){let h=t.ranges.length-1;h>=0&&t.ranges[h].to==l.from?t.ranges[h]={from:t.ranges[h].from,to:l.to}:t.ranges.push(l)}if(a&&r.firstChild())t&&t.depth++,i&&i.depth++;else for(;!r.nextSibling();){if(!r.parent())break e;if(t&&!--t.depth){let h=xu(this.ranges,t.ranges);h.length&&(Su(h),this.inner.splice(t.index,0,new vu(t.parser,t.parser.startParse(this.input,Qu(t.mounts,h),h),t.ranges.map(f=>new Et(f.from-t.start,f.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function iv(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function ku(n,e,t,i,r,s){if(e<t){let o=n.buffer[e+1];i.push(n.slice(e,t,o)),r.push(o-s)}}function nv(n){let{node:e}=n,t=[],i=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let r=n.tree,s=r.children.indexOf(i),o=r.children[s],a=o.buffer,l=[s];function h(f,O,m,b,S,Q){let P=t[Q],A=[],E=[];ku(o,f,P,A,E,b);let B=a[P+1],U=a[P+2];l.push(A.length);let W=Q?h(P+4,a[P+3],o.set.types[a[P]],B,U-B,Q-1):e.toTree();return A.push(W),E.push(B-b),ku(o,a[P+3],O,A,E,b),new le(m,A,E,S)}r.children[s]=h(0,a.length,je.none,0,o.length,t.length-1);for(let f of l){let O=n.tree.children[f],m=n.tree.positions[f];n.yield(new nt(O,m+n.from,f,n._tree))}}class wu{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(exports.IterMode.IncludeAnonymous|exports.IterMode.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from<i;)t.to>=e&&t.enter(i,1,exports.IterMode.IgnoreOverlays|exports.IterMode.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof le)t=t.children[0];else break}return!1}}let rv=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(fl))!==null&&t!==void 0?t:i.to,this.inner=new wu(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(fl))!==null&&e!==void 0?e:t.to,this.inner=new wu(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(i=s.tree)===null||i===void 0?void 0:i.prop(ee.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=s.to)break;l.tree==this.curFrag.tree&&r.push({frag:l,pos:s.from-l.offset,mount:o})}}}return r}};function xu(n,e){let t=null,i=e;for(let r=1,s=0;r<n.length;r++){let o=n[r-1].to,a=n[r].from;for(;s<i.length;s++){let l=i[s];if(l.from>=a)break;l.to<=o||(t||(i=t=e.slice()),l.from<o?(t[s]=new Et(l.from,o),l.to>a&&t.splice(s+1,0,new Et(a,l.to))):l.to>a?t[s--]=new Et(a,l.to):t.splice(s--,1))}}return i}function sv(n,e,t,i){let r=0,s=0,o=!1,a=!1,l=-1e9,h=[];for(;;){let f=r==n.length?1e9:o?n[r].to:n[r].from,O=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let m=Math.max(l,t),b=Math.min(f,O,i);m<b&&h.push(new Et(m,b))}if(l=Math.min(f,O),l==1e9)break;f==l&&(o?(o=!1,r++):o=!0),O==l&&(a?(a=!1,s++):a=!0)}return h}function Qu(n,e){let t=[];for(let{pos:i,mount:r,frag:s}of n){let o=i+(r.overlay?r.overlay[0].from:0),a=o+r.tree.length,l=Math.max(s.from,o),h=Math.min(s.to,a);if(r.overlay){let f=r.overlay.map(m=>new Et(m.from+i,m.to+i)),O=sv(e,f,l,h);for(let m=0,b=l;;m++){let S=m==O.length,Q=S?h:O[m].from;if(Q>b&&t.push(new bi(b,Q,r.tree,-o,s.from>=b||s.openStart,s.to<=Q||s.openEnd)),S)break;b=O[m].to}}else t.push(new bi(l,h,r.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}let ov=0;class $t{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=ov++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof $t&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let r=new $t(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new zs(e);return i=>i.modified.indexOf(t)>-1?i:zs.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}}let av=0;class zs{constructor(e){this.name=e,this.instances=[],this.id=av++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(a=>a.base==e&&lv(t,a.modified));if(i)return i;let r=[],s=new $t(e.name,r,e,t);for(let a of t)a.instances.push(s);let o=cv(t);for(let a of e.set)if(!a.modified.length)for(let l of o)r.push(zs.get(a,l));return s}}function lv(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function cv(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function dn(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let s=[],o=2,a=r;for(let O=0;;){if(a=="..."&&O>0&&O+3==r.length){o=1;break}let m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!m)throw new RangeError("Invalid path: "+r);if(s.push(m[0]=="*"?"":m[0][0]=='"'?JSON.parse(m[0]):m[0]),O+=m[0].length,O==r.length)break;let b=r[O++];if(O==r.length&&b=="!"){o=0;break}if(b!="/")throw new RangeError("Invalid path: "+r);a=r.slice(O)}let l=s.length-1,h=s[l];if(!h)throw new RangeError("Invalid path: "+r);let f=new Mr(i,o,l>0?s.slice(0,l):null);e[h]=f.sort(e[h])}}return Mp.add(e)}const Mp=new ee({combine(n,e){let t,i,r;for(;n||e;){if(!n||e&&n.depth>=e.depth?(r=e,e=e.next):(r=n,n=n.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let s=new Mr(r.tags,r.mode,r.context);t?t.next=s:i=s,t=s}return i}});class Mr{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Mr.empty=new Mr([],2,null);function Rp(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:i,all:r=null}=e||{};return{style:s=>{let o=r;for(let a of s)for(let l of a.set){let h=t[l.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function hv(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function uv(n,e,t,i=0,r=n.length){let s=new fv(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,"",s.highlighters),s.flush(r)}class fv{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,s){let{type:o,from:a,to:l}=e;if(a>=i||l<=t)return;o.isTop&&(s=this.highlighters.filter(b=>!b.scope||b.scope(o)));let h=r,f=dv(e)||Mr.empty,O=hv(s,f.tags);if(O&&(h&&(h+=" "),h+=O,f.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,a),h),f.opaque)return;let m=e.tree&&e.tree.prop(ee.mounted);if(m&&m.overlay){let b=e.node.enter(m.overlay[0].from+a,1),S=this.highlighters.filter(P=>!P.scope||P.scope(m.tree.type)),Q=e.firstChild();for(let P=0,A=a;;P++){let E=P<m.overlay.length?m.overlay[P]:null,B=E?E.from+a:l,U=Math.max(t,A),W=Math.min(i,B);if(U<W&&Q)for(;e.from<W&&(this.highlightRange(e,U,W,r,s),this.startSpan(Math.min(W,e.to),h),!(e.to>=B||!e.nextSibling())););if(!E||B>i)break;A=E.to+a,A>t&&(this.highlightRange(b.cursor(),Math.max(t,E.from+a),Math.min(i,A),"",S),this.startSpan(Math.min(i,A),h))}Q&&e.parent()}else if(e.firstChild()){m&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function dv(n){let e=n.type.prop(Mp);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const j=$t.define,hs=j(),Ti=j(),$u=j(Ti),Cu=j(Ti),Ai=j(),us=j(Ai),ra=j(Ai),ii=j(),Ki=j(ii),ei=j(),ti=j(),dl=j(),ir=j(dl),fs=j(),x={comment:hs,lineComment:j(hs),blockComment:j(hs),docComment:j(hs),name:Ti,variableName:j(Ti),typeName:$u,tagName:j($u),propertyName:Cu,attributeName:j(Cu),className:j(Ti),labelName:j(Ti),namespace:j(Ti),macroName:j(Ti),literal:Ai,string:us,docString:j(us),character:j(us),attributeValue:j(us),number:ra,integer:j(ra),float:j(ra),bool:j(Ai),regexp:j(Ai),escape:j(Ai),color:j(Ai),url:j(Ai),keyword:ei,self:j(ei),null:j(ei),atom:j(ei),unit:j(ei),modifier:j(ei),operatorKeyword:j(ei),controlKeyword:j(ei),definitionKeyword:j(ei),moduleKeyword:j(ei),operator:ti,derefOperator:j(ti),arithmeticOperator:j(ti),logicOperator:j(ti),bitwiseOperator:j(ti),compareOperator:j(ti),updateOperator:j(ti),definitionOperator:j(ti),typeOperator:j(ti),controlOperator:j(ti),punctuation:dl,separator:j(dl),bracket:ir,angleBracket:j(ir),squareBracket:j(ir),paren:j(ir),brace:j(ir),content:ii,heading:Ki,heading1:j(Ki),heading2:j(Ki),heading3:j(Ki),heading4:j(Ki),heading5:j(Ki),heading6:j(Ki),contentSeparator:j(ii),list:j(ii),quote:j(ii),emphasis:j(ii),strong:j(ii),link:j(ii),monospace:j(ii),strikethrough:j(ii),inserted:j(),deleted:j(),changed:j(),invalid:j(),meta:fs,documentMeta:j(fs),annotation:j(fs),processingInstruction:j(fs),definition:$t.defineModifier("definition"),constant:$t.defineModifier("constant"),function:$t.defineModifier("function"),standard:$t.defineModifier("standard"),local:$t.defineModifier("local"),special:$t.defineModifier("special")};for(let n in x){let e=x[n];e instanceof $t&&(e.name=n)}const pv=Rp([{tag:x.link,class:"tok-link"},{tag:x.heading,class:"tok-heading"},{tag:x.emphasis,class:"tok-emphasis"},{tag:x.strong,class:"tok-strong"},{tag:x.keyword,class:"tok-keyword"},{tag:x.atom,class:"tok-atom"},{tag:x.bool,class:"tok-bool"},{tag:x.url,class:"tok-url"},{tag:x.labelName,class:"tok-labelName"},{tag:x.inserted,class:"tok-inserted"},{tag:x.deleted,class:"tok-deleted"},{tag:x.literal,class:"tok-literal"},{tag:x.string,class:"tok-string"},{tag:x.number,class:"tok-number"},{tag:[x.regexp,x.escape,x.special(x.string)],class:"tok-string2"},{tag:x.variableName,class:"tok-variableName"},{tag:x.local(x.variableName),class:"tok-variableName tok-local"},{tag:x.definition(x.variableName),class:"tok-variableName tok-definition"},{tag:x.special(x.variableName),class:"tok-variableName2"},{tag:x.definition(x.propertyName),class:"tok-propertyName tok-definition"},{tag:x.typeName,class:"tok-typeName"},{tag:x.namespace,class:"tok-namespace"},{tag:x.className,class:"tok-className"},{tag:x.macroName,class:"tok-macroName"},{tag:x.propertyName,class:"tok-propertyName"},{tag:x.operator,class:"tok-operator"},{tag:x.comment,class:"tok-comment"},{tag:x.meta,class:"tok-meta"},{tag:x.invalid,class:"tok-invalid"},{tag:x.punctuation,class:"tok-punctuation"}]);var sa;const gi=new ee;function zr(n){return F.define({combine:n?e=>e.concat(n):void 0})}const go=new ee;class ft{constructor(e,t,i=[],r=""){this.data=e,this.name=r,he.prototype.hasOwnProperty("tree")||Object.defineProperty(he.prototype,"tree",{get(){return ce(this)}}),this.parser=t,this.extension=[cn.of(this),he.languageData.of((s,o,a)=>{let l=Pu(s,o,a),h=l.type.prop(gi);if(!h)return[];let f=s.facet(h),O=l.type.prop(go);if(O){let m=l.resolve(o-l.from,a);for(let b of O)if(b.test(m,s)){let S=s.facet(b.facet);return b.type=="replace"?S:S.concat(f)}}return f})].concat(i)}isActiveAt(e,t,i=-1){return Pu(e,t,i).type.prop(gi)==this.data}findRegions(e){let t=e.facet(cn);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,o)=>{if(s.prop(gi)==this.data){i.push({from:o,to:o+s.length});return}let a=s.prop(ee.mounted);if(a){if(a.tree.prop(gi)==this.data){if(a.overlay)for(let l of a.overlay)i.push({from:l.from+o,to:l.to+o});else i.push({from:o,to:o+s.length});return}else if(a.overlay){let l=i.length;if(r(a.tree,a.overlay[0].from+o),i.length>l)return}}for(let l=0;l<s.children.length;l++){let h=s.children[l];h instanceof le&&r(h,s.positions[l]+o)}};return r(ce(e),0),i}get allowsNesting(){return!0}}ft.setState=Oe.define();function Pu(n,e,t){let i=n.facet(cn),r=ce(n).topNode;if(!i||i.allowsNesting)for(let s=r;s;s=s.enter(e,t,exports.IterMode.ExcludeBuffers|exports.IterMode.EnterBracketed))s.type.isTop&&(r=s);return r}class ji extends ft{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=zr(e.languageData);return new ji(t,e.parser.configure({props:[gi.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new ji(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ce(n){let e=n.field(ft.state,!1);return e?e.tree:le.empty}function sc(n,e,t=50){var i;let r=(i=n.field(ft.state,!1))===null||i===void 0?void 0:i.context;if(!r)return null;let s=r.viewport;r.updateViewport({from:0,to:e});let o=r.isDone(e)||r.work(t,e)?r.tree:null;return r.updateViewport(s),o}class Lp{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let nr=null;class Vi{constructor(e,t,i=[],r,s,o,a,l){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Vi(e,t,[],le.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Lp(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=le.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(bi.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(bi.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=nr;nr=this;try{return e()}finally{nr=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Tu(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((h,f,O,m)=>l.push({fromA:h,toA:f,fromB:O,toB:m})),i=bi.applyChanges(i,l),r=le.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let h of this.skipped){let f=e.mapPos(h.from,1),O=e.mapPos(h.to,-1);f<O&&a.push({from:f,to:O})}}}return new Vi(this.parser,t,i,r,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:s}=this.skipped[i];r<e.to&&s>e.from&&(this.fragments=Tu(this.fragments,r,s),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Oo{createParse(t,i,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let l=nr;if(l){for(let h of r)l.tempSkipped.push(h);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new le(je.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return nr}}function Tu(n,e,t){return bi.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class jn{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new jn(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Vi.create(e.facet(cn).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new jn(i)}}ft.state=Ct.define({create:jn.init,update(n,e){for(let t of e.effects)if(t.is(ft.setState))return t.value;return e.startState.facet(cn)!=e.state.facet(cn)?jn.init(e.state):n.apply(e)}});let Zp=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Zp=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const oa=typeof navigator<"u"&&(!((sa=navigator.scheduling)===null||sa===void 0)&&sa.isInputPending)?()=>navigator.scheduling.isInputPending():null,Ov=et.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(ft.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(ft.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Zp(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,s=i.field(ft.state);if(s.tree==s.context.tree&&s.context.isDone(r+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!oa?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<r&&i.doc.length>r+1e3,l=s.context.work(()=>oa&&oa()||Date.now()>o,r+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:ft.setState.of(new jn(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ai(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),cn=F.define({combine(n){return n.length?n[0]:null},enables:n=>[ft.state,Ov,z.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class ut{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class hn{constructor(e,t,i,r,s,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=r,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new hn(e.name,(e.alias||[]).concat(e.name).map(r=>r.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let r of e)if(r.filename&&r.filename.test(t))return r;let i=/\.([^.]+)$/.exec(t);if(i){for(let r of e)if(r.extensions.indexOf(i[1])>-1)return r}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let r of e)if(r.alias.some(s=>s==t))return r;if(i)for(let r of e)for(let s of r.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return r}return null}}const Ep=F.define(),zi=F.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Wi(n){let e=n.facet(zi);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Rr(n,e){let t="",i=n.tabSize,r=n.facet(zi)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let s=0;s<e;s++)t+=r;return t}function oc(n,e){n instanceof he&&(n=new Wr(n));for(let i of n.state.facet(Ep)){let r=i(n,e);if(r!==void 0)return r}let t=ce(n.state);return t.length>=e?gv(n,t,e):null}class Wr{constructor(e,t={}){this.state=e,this.options=t,this.unit=Wi(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,t);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.countColumn(i,e-r),o=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return o>-1&&(s+=o-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return Si(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(r);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Yi=new ee;function gv(n,e,t){let i=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let o=r;o&&!(o.from<i.node.from||o.to>i.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)i={node:s[o],next:i}}return Xp(i,n,t)}function Xp(n,e,t){for(let i=n;i;i=i.next){let r=yv(i.node);if(r)return r(mo.create(e,t,i))}return 0}function mv(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function yv(n){let e=n.type.prop(Yi);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(ee.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return o=>Bp(o,!0,1,void 0,s&&!mv(o)?r.from:void 0)}return n.parent==null?bv:null}function bv(){return 0}class mo extends Wr{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new mo(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(vv(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return Xp(this.context.next,this.base,this.pos)}}function vv(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Sv(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==i)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let h=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+h}}a=l.to}}function ac({closing:n,align:e=!0,units:t=1}){return i=>Bp(i,e,t,n)}function Bp(n,e,t,i,r){let s=n.textAfter,o=s.match(/^\s*/)[0].length,a=i&&s.slice(o,o+i.length)==i||r==n.pos+o,l=e?Sv(n):null;return l?a?n.column(l.from):n.column(l.to):n.baseIndent+(a?0:n.unit*t)}const lc=n=>n.baseIndent;function Mn({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const cc=F.define(),qi=new ee;function yo(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function kv(n,e,t){let i=ce(n);if(i.length<t)return null;let r=i.resolveStack(t,1),s=null;for(let o=r;o;o=o.next){let a=o.node;if(a.to<=t||a.from>t)continue;if(s&&a.from<e)break;let l=a.type.prop(qi);if(l&&(a.to<i.length-50||i.length==n.doc.length||!wv(a))){let h=l(a,n);h&&h.from<=t&&h.from>=e&&h.to>t&&(s=h)}}return s}function wv(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Ip(n,e,t){for(let i of n.facet(cc)){let r=i(n,e,t);if(r)return r}return kv(n,e,t)}function Dp(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const hc=Oe.define({map:Dp}),uc=Oe.define({map:Dp});function xv(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const bo=Ct.define({create(){return H.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>n=Au(n,t,i)),n=n.map(e.changes);for(let t of e.effects)if(t.is(hc)&&!$v(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(jp),r=i?H.replace({widget:new Av(i(e.state,t.value))}):Mu;n=n.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(uc)&&(n=n.update({filter:(i,r)=>t.value.from!=i||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(n=Au(n,e.selection.main.head)),n},provide:n=>z.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,r)=>{t.push(i,r)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let i=n[t++],r=n[t++];if(typeof i!="number"||typeof r!="number")throw new RangeError("Invalid JSON for fold state");e.push(Mu.range(i,r))}return H.set(e,!0)}});function Au(n,e,t=e){let i=!1;return n.between(e,t,(r,s)=>{r<t&&s>e&&(i=!0)}),i?n.update({filterFrom:e,filterTo:t,filter:(r,s)=>r>=t||s<=e}):n}function Qv(n,e,t){var i;let r=null;return(i=n.field(bo,!1))===null||i===void 0||i.between(e,t,(s,o)=>{(!r||r.from>s)&&(r={from:s,to:o})}),r}function $v(n,e,t){let i=!1;return n.between(e,e,(r,s)=>{r==e&&s==t&&(i=!0)}),i}function Cv(n,e){return n.field(bo,!1)?e:e.concat(Oe.appendConfig.of(Vp()))}const _p=n=>{for(let e of xv(n)){let t=Ip(n.state,e.from,e.to);if(t)return n.dispatch({effects:Cv(n.state,[hc.of(t),Pv(n,t)])}),!0}return!1};function Pv(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,r=n.state.doc.lineAt(e.to).number;return z.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${r}.`)}const Tv={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},jp=F.define({combine(n){return lo(n,Tv)}});function Vp(n){return[bo,Mv]}function zp(n,e){let{state:t}=n,i=t.facet(jp),r=o=>{let a=n.lineBlockAt(n.posAtDOM(o.target)),l=Qv(n.state,a.from,a.to);l&&n.dispatch({effects:uc.of(l)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const Mu=H.replace({widget:new class extends bt{toDOM(n){return zp(n,null)}}});class Av extends bt{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return zp(e,this.value)}}const Mv=z.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Fn{constructor(e,t){this.specs=e;let i;function r(a){let l=Xi.newName();return(i||(i=Object.create(null)))["."+l]=a,l}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,o=t.scope;this.scope=o instanceof ft?a=>a.prop(gi)==o.data:o?a=>a==o:void 0,this.style=Rp(e.map(a=>({tag:a.tag,class:a.class||r(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=i?new Xi(i):null,this.themeType=t.themeType}static define(e,t){return new Fn(e,t||{})}}const pl=F.define(),Wp=F.define({combine(n){return n.length?[n[0]]:null}});function aa(n){let e=n.facet(pl);return e.length?e:n.facet(Wp)}function vo(n,e){let t=[Lv],i;return n instanceof Fn&&(n.module&&t.push(z.styleModule.of(n.module)),i=n.themeType),e?.fallback?t.push(Wp.of(n)):i?t.push(pl.computeN([z.darkTheme],r=>r.facet(z.darkTheme)==(i=="dark")?[n]:[])):t.push(pl.of(n)),t}class Rv{constructor(e){this.markCache=Object.create(null),this.tree=ce(e.state),this.decorations=this.buildDeco(e,aa(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=ce(e.state),i=aa(e.state),r=i!=aa(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!r&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return H.none;let i=new Bn;for(let{from:r,to:s}of e.visibleRanges)uv(this.tree,t,(o,a,l)=>{i.add(o,a,this.markCache[l]||(this.markCache[l]=H.mark({class:l})))},r,s);return i.finish()}}const Lv=wi.high(et.fromClass(Rv,{decorations:n=>n.decorations})),Np=Fn.define([{tag:x.meta,color:"#404740"},{tag:x.link,textDecoration:"underline"},{tag:x.heading,textDecoration:"underline",fontWeight:"bold"},{tag:x.emphasis,fontStyle:"italic"},{tag:x.strong,fontWeight:"bold"},{tag:x.strikethrough,textDecoration:"line-through"},{tag:x.keyword,color:"#708"},{tag:[x.atom,x.bool,x.url,x.contentSeparator,x.labelName],color:"#219"},{tag:[x.literal,x.inserted],color:"#164"},{tag:[x.string,x.deleted],color:"#a11"},{tag:[x.regexp,x.escape,x.special(x.string)],color:"#e40"},{tag:x.definition(x.variableName),color:"#00f"},{tag:x.local(x.variableName),color:"#30a"},{tag:[x.typeName,x.namespace],color:"#085"},{tag:x.className,color:"#167"},{tag:[x.special(x.variableName),x.macroName],color:"#256"},{tag:x.definition(x.propertyName),color:"#00c"},{tag:x.comment,color:"#940"},{tag:x.invalid,color:"#f00"}]),Zv=1e4,Ev="()[]{}",fc=new ee;function Ol(n,e,t){let i=n.prop(e<0?ee.openedBy:ee.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function gl(n){let e=n.type.prop(fc);return e?e(n.node):n}function mi(n,e,t,i={}){let r=i.maxScanDistance||Zv,s=i.brackets||Ev,o=ce(n),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let h=Ol(l.type,t,s);if(h&&l.from<l.to){let f=gl(l);if(f&&(t>0?e>=f.from&&e<f.to:e>f.from&&e<=f.to))return Xv(n,e,t,l,f,h,s)}}return Bv(n,e,t,o,a.type,r,s)}function Xv(n,e,t,i,r,s,o){let a=i.parent,l={from:r.from,to:r.to},h=0,f=a?.cursor();if(f&&(t<0?f.childBefore(i.from):f.childAfter(i.to)))do if(t<0?f.to<=i.from:f.from>=i.to){if(h==0&&s.indexOf(f.type.name)>-1&&f.from<f.to){let O=gl(f);return{start:l,end:O?{from:O.from,to:O.to}:void 0,matched:!0}}else if(Ol(f.type,t,o))h++;else if(Ol(f.type,-t,o)){if(h==0){let O=gl(f);return{start:l,end:O&&O.from<O.to?{from:O.from,to:O.to}:void 0,matched:!1}}h--}}while(t<0?f.prevSibling():f.nextSibling());return{start:l,matched:!1}}function Bv(n,e,t,i,r,s,o){if(t<0?!e:e==n.doc.length)return null;let a=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=t>0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},f=n.doc.iterRange(e,t>0?n.doc.length:0),O=0;for(let m=0;!f.next().done&&m<=s;){let b=f.value;t<0&&(m+=b.length);let S=e+m*t;for(let Q=t>0?0:b.length-1,P=t>0?b.length:-1;Q!=P;Q+=t){let A=o.indexOf(b[Q]);if(!(A<0||i.resolveInner(S+Q,1).type!=r))if(A%2==0==t>0)O++;else{if(O==1)return{start:h,end:{from:S+Q,to:S+Q+1},matched:A>>1==l>>1};O--}}t>0&&(m+=b.length)}return f.done?{start:h,matched:!1}:null}function Ru(n,e,t,i=0,r=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let s=r;for(let o=i;o<e;o++)n.charCodeAt(o)==9?s+=t-s%t:s++;return s}class So{constructor(e,t,i,r){this.string=e,this.tabSize=t,this.indentUnit=i,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e instanceof RegExp?e.test(t):e(t)),i)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Ru(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:Ru(this.string,null,this.tabSize)}match(e,t,i){if(typeof e=="string"){let r=o=>i?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return r(s)==r(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let r=this.string.slice(this.pos).match(e);return r&&r.index>0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}}current(){return this.string.slice(this.start,this.pos)}}function Iv(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Dv,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||pc,mergeTokens:n.mergeTokens!==!1}}function Dv(n){if(typeof n!="object")return n;let e={};for(let t in n){let i=n[t];e[t]=i instanceof Array?i.slice():i}return e}const Lu=new WeakMap;class Rn extends ft{constructor(e){let t=zr(e.languageData),i=Iv(e),r,s=new class extends Oo{createParse(o,a,l){return new jv(r,o,a,l)}};super(t,s,[],e.name),this.topNode=Wv(t,this),r=this,this.streamParser=i,this.stateAfter=new ee({perNode:!0}),this.tokenTable=e.tokenTable?new Gp(i.tokenTable):zv}static define(e){return new Rn(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=Lu.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let r=dc(this,e.node.tree,e.node.from,e.node.from,t??e.pos),s,o;if(r?(o=r.state,s=r.pos+1):(o=this.streamParser.startState(e.unit),s=e.node.from),e.pos-s>1e4)return null;for(;s<e.pos;){let l=e.state.doc.lineAt(s),h=Math.min(e.pos,l.to);if(l.length){let f=i?i(l.from):-1,O=new So(l.text,e.state.tabSize,e.unit,f<0?void 0:f);for(;O.pos<h-l.from;)qp(this.streamParser.token,O,o)}else this.streamParser.blankLine(o,e.unit);if(h==e.pos)break;s=l.to+1}let a=e.lineAt(e.pos);return i&&t==null&&Lu.set(e.state,a.from),this.streamParser.indent(o,/^\s*(.*)/.exec(a.text)[1],e)}get allowsNesting(){return!1}}function dc(n,e,t,i,r){let s=t>=i&&t+e.length<=r&&e.prop(n.stateAfter);if(s)return{state:n.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=t+e.positions[o],h=a instanceof le&&l<r&&dc(n,a,l,i,r);if(h)return h}return null}function Yp(n,e,t,i,r){if(r&&t<=0&&i>=e.length)return e;!r&&t==0&&e.type==n.topNode&&(r=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],l;if(o<i&&a instanceof le){if(!(l=Yp(n,a,t-o,i-o,r)))break;return r?new le(e.type,e.children.slice(0,s).concat(l),e.positions.slice(0,s+1),o+l.length):l}}return null}function _v(n,e,t,i,r){for(let s of e){let o=s.from+(s.openStart?25:0),a=s.to-(s.openEnd?25:0),l=o<=t&&a>t&&dc(n,s.tree,0-s.offset,t,a),h;if(l&&l.pos<=i&&(h=Yp(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:h}}return{state:n.streamParser.startState(r?Wi(r):4),tree:le.empty}}let jv=class{constructor(e,t,i,r){this.lang=e,this.input=t,this.fragments=i,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=Vi.get(),o=r[0].from,{state:a,tree:l}=_v(e,i,o,this.to,s?.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let h=0;h<l.children.length;h++)this.chunks.push(l.children[h]),this.chunkPos.push(l.positions[h]);s&&this.parsedPos<s.viewport.from-1e5&&r.some(h=>h.from<=s.viewport.from&&h.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(Wi(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=Vi.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos<i;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
|
|
11
|
+
`&&(t="");else{let i=t.indexOf(`
|
|
12
|
+
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let r=this.rangeIndex;;){let s=this.ranges[r].to;if(s>=i||(t=t.slice(0,s-(i-t.length)),r++,r==this.ranges.length))break;let o=this.ranges[r].from,a=this.lineAfter(o);t+=a,i=o+a.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let r=this.ranges[this.rangeIndex].to,s=e+t;if(i>0?r>s:r>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,r){let s=4;if(this.ranges.length>1){r=this.skipGapsTo(t,r,1),t+=r;let a=this.chunk.length;r=this.skipGapsTo(i,r,-1),i+=r,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,s),r}parseLine(e){let{line:t,end:i}=this.nextLine(),r=0,{streamParser:s}=this.lang,o=new So(t,e?e.state.tabSize:4,e?Wi(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=qp(s.token,o,this.state);if(a&&(r=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,r)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=le.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Vv,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new le(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new le(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function qp(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let r=n(e,t);if(e.pos>e.start)return r}throw new Error("Stream parser failed to advance stream.")}const pc=Object.create(null),Lr=[je.none],Vv=new qn(Lr),Zu=[],Eu=Object.create(null),Fp=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Fp[n]=Up(pc,e);class Gp{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Fp)}resolve(e){return e?this.table[e]||(this.table[e]=Up(this.extra,e)):0}}const zv=new Gp(pc);function la(n,e){Zu.indexOf(n)>-1||(Zu.push(n),console.warn(e))}function Up(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let h of a.split(".")){let f=n[h]||x[h];f?typeof f=="function"?l.length?l=l.map(f):la(h,`Modifier ${h} used at start of tag`):l.length?la(h,`Tag ${h} used as modifier`):l=Array.isArray(f)?f:[f]:la(h,`Unknown highlighting tag ${h}`)}for(let h of l)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+t.map(a=>a.id),s=Eu[r];if(s)return s.id;let o=Eu[r]=je.define({id:Lr.length,name:i,props:[dn({[i]:t})]});return Lr.push(o),o.id}function Wv(n,e){let t=je.define({id:Lr.length,name:"Document",props:[gi.add(()=>n),Yi.add(()=>i=>e.getIndent(i))],top:!0});return Lr.push(t),t}Ee.RTL,Ee.LTR;const rr=Object.freeze(Object.defineProperty({__proto__:null,DocInput:Lp,HighlightStyle:Fn,IndentContext:Wr,LRLanguage:ji,Language:ft,LanguageDescription:hn,LanguageSupport:ut,ParseContext:Vi,StreamLanguage:Rn,StringStream:So,TreeIndentContext:mo,bracketMatchingHandle:fc,codeFolding:Vp,continuedIndent:Mn,defaultHighlightStyle:Np,defineLanguageFacet:zr,delimitedIndent:ac,ensureSyntaxTree:sc,flatIndent:lc,foldCode:_p,foldEffect:hc,foldInside:yo,foldNodeProp:qi,foldService:cc,foldState:bo,foldable:Ip,getIndentUnit:Wi,getIndentation:oc,indentNodeProp:Yi,indentService:Ep,indentString:Rr,indentUnit:zi,language:cn,languageDataProp:gi,matchBrackets:mi,sublanguageProp:go,syntaxHighlighting:vo,syntaxTree:ce,unfoldEffect:uc},Symbol.toStringTag,{value:"Module"})),Nv=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=gc(n.state,t.from);return i.line?Yv(n):i.block?Fv(n):!1};function Oc(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}const Yv=Oc(Hv,0),qv=Oc(Hp,0),Fv=Oc((n,e)=>Hp(n,e,Uv(e)),0);function gc(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const sr=50;function Gv(n,{open:e,close:t},i,r){let s=n.sliceDoc(i-sr,i),o=n.sliceDoc(r,r+sr),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,h=s.length-a;if(s.slice(h-e.length,h)==e&&o.slice(l,l+t.length)==t)return{open:{pos:i-a,margin:a&&1},close:{pos:r+l,margin:l&&1}};let f,O;r-i<=2*sr?f=O=n.sliceDoc(i,r):(f=n.sliceDoc(i,i+sr),O=n.sliceDoc(r-sr,r));let m=/^\s*/.exec(f)[0].length,b=/\s*$/.exec(O)[0].length,S=O.length-b-t.length;return f.slice(m,m+e.length)==e&&O.slice(S,S+t.length)==t?{open:{pos:i+m+e.length,margin:/\s/.test(f.charAt(m+e.length))?1:0},close:{pos:r-b-t.length,margin:/\s/.test(O.charAt(S-1))?1:0}}:null}function Uv(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to);r.from>i.from&&r.from==t.to&&(r=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function Hp(n,e,t=e.selection.ranges){let i=t.map(s=>gc(e,s.from).block);if(!i.every(s=>s))return null;let r=t.map((s,o)=>Gv(e,i[o],s.from,s.to));if(n!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,o)=>r[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(n!=1&&r.some(s=>s)){let s=[];for(let o=0,a;o<r.length;o++)if(a=r[o]){let l=i[o],{open:h,close:f}=a;s.push({from:h.pos-l.open.length,to:h.pos+h.margin},{from:f.pos-f.margin,to:f.pos+l.close.length})}return{changes:s}}return null}function Hv(n,e,t=e.selection.ranges){let i=[],r=-1;e:for(let{from:s,to:o}of t){let a=i.length,l=1e9,h;for(let f=s;f<=o;){let O=e.doc.lineAt(f);if(h==null&&(h=gc(e,O.from).line,!h))continue e;if(O.from>r&&(s==o||o>O.from)){r=O.from;let m=/^\s*/.exec(O.text)[0].length,b=m==O.length,S=O.text.slice(m,m+h.length)==h?m:-1;m<O.text.length&&m<l&&(l=m),i.push({line:O,comment:S,token:h,indent:m,empty:b,single:!1})}f=O.to+1}if(l<1e9)for(let f=a;f<i.length;f++)i[f].indent<i[f].line.text.length&&(i[f].indent=l);i.length==a+1&&(i[a].single=!0)}if(n!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:h,empty:f,single:O}of i)(O||!f)&&s.push({from:a.from+h,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of i)if(a>=0){let h=o.from+a,f=h+l.length;o.text[f-o.from]==" "&&f++,s.push({from:h,to:f})}return{changes:s}}return null}const ml=xi.define(),Kv=xi.define(),Jv=F.define(),Kp=F.define({combine(n){return lo(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}}),Jp=Ct.define({create(){return ci.empty},update(n,e){let t=e.state.facet(Kp),i=e.annotation(ml);if(i){let l=gt.fromTransaction(e,i.selection),h=i.side,f=h==0?n.undone:n.done;return l?f=Ws(f,f.length,t.minDepth,l):f=tO(f,e.startState.selection),new ci(h==0?i.rest:f,h==0?f:i.rest)}let r=e.annotation(Kv);if((r=="full"||r=="before")&&(n=n.isolate()),e.annotation(Te.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=gt.fromTransaction(e),o=e.annotation(Te.time),a=e.annotation(Te.userEvent);return s?n=n.addChanges(s,o,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(r=="full"||r=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new ci(n.done.map(gt.fromJSON),n.undone.map(gt.fromJSON))}});function e1(n={}){return[Jp,Kp.of(n),z.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Nr:e.inputType=="historyRedo"?un:null;return i?(e.preventDefault(),i(t)):!1}})]}function ko(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field(Jp,!1);if(!r)return!1;let s=r.pop(n,t,e);return s?(i(s),!0):!1}}const Nr=ko(0,!1),un=ko(1,!1),t1=ko(0,!0),i1=ko(1,!0);class gt{constructor(e,t,i,r,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new gt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new gt(e.changes&&Ve.fromJSON(e.changes),[],e.mapped&&hi.fromJSON(e.mapped),e.startSelection&&Z.fromJSON(e.startSelection),e.selectionsAfter.map(Z.fromJSON))}static fromTransaction(e,t){let i=Xt;for(let r of e.startState.facet(Jv)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new gt(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Xt)}static selection(e){return new gt(void 0,Xt,void 0,void 0,e)}}function Ws(n,e,t,i){let r=e+1>t+20?e-t-1:0,s=n.slice(r,e);return s.push(i),s}function n1(n,e){let t=[],i=!1;return n.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,o,a)=>{for(let l=0;l<t.length;){let h=t[l++],f=t[l++];a>=h&&o<=f&&(i=!0)}}),i}function r1(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function eO(n,e){return n.length?e.length?n.concat(e):n:e}const Xt=[],s1=200;function tO(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-s1));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Ws(n,n.length-1,1e9,t.setSelAfter(i)))}else return[gt.selection([e])]}function o1(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function ca(n,e){if(!n.length)return n;let t=n.length,i=Xt;for(;t;){let r=a1(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=n.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[gt.selection(i)]:Xt}function a1(n,e,t){let i=eO(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):Xt,t);if(!n.changes)return gt.selection(i);let r=n.changes.map(e),s=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(s):s;return new gt(r,Oe.mapEffects(n.effects,e),o,n.startSelection.map(s),i)}const l1=/^(input\.type|delete)($|\.)/;class ci{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new ci(this.done,this.undone):this}addChanges(e,t,i,r,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!i||l1.test(i))&&(!a.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(s,n1(a.changes,e.changes))||i=="input.type.compose")?o=Ws(o,o.length-1,r.minDepth,new gt(e.changes.compose(a.changes),eO(Oe.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Xt)):o=Ws(o,o.length,r.minDepth,e),new ci(o,Xt,t,i)}addSelection(e,t,i,r){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Xt;return s.length>0&&t-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&r1(s[s.length-1],e)?this:new ci(tO(this.done,e),this.undone,t,i)}addMapping(e){return new ci(ca(this.done,e),ca(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let s=r[r.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):t.selection);if(i&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:ml.of({side:e,rest:o1(r),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=r.length==1?Xt:r.slice(0,r.length-1);return s.mapped&&(a=ca(a,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:ml.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}ci.empty=new ci(Xt,Xt);const c1=[{key:"Mod-z",run:Nr,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:un,preventDefault:!0},{linux:"Ctrl-Shift-z",run:un,preventDefault:!0},{key:"Mod-u",run:t1,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:i1,preventDefault:!0}];function Gn(n,e){return Z.create(n.ranges.map(e),n.mainIndex)}function Nt(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Yt({state:n,dispatch:e},t){let i=Gn(n.selection,t);return i.eq(n.selection,!0)?!1:(e(Nt(n,i)),!0)}function wo(n,e){return Z.cursor(e?n.to:n.from)}function mc(n,e){return Yt(n,t=>t.empty?n.moveByChar(t,e):wo(t,e))}function rt(n){return n.textDirectionAt(n.state.selection.main.head)==Ee.LTR}const yc=n=>mc(n,!rt(n)),iO=n=>mc(n,rt(n)),h1=n=>mc(n,!1);function nO(n,e){return Yt(n,t=>t.empty?n.moveByGroup(t,e):wo(t,e))}const u1=n=>nO(n,!rt(n)),f1=n=>nO(n,rt(n));function d1(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function xo(n,e,t){let i=ce(n).resolveInner(e.head),r=t?ee.closedBy:ee.openedBy;for(let l=e.head;;){let h=t?i.childAfter(l):i.childBefore(l);if(!h)break;d1(n,h,r)?i=h:l=t?h.to:h.from}let s=i.type.prop(r),o,a;return s&&(o=t?mi(n,i.from,1):mi(n,i.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?i.to:i.from,Z.cursor(a,t?-1:1)}const p1=n=>Yt(n,e=>xo(n.state,e,!rt(n))),O1=n=>Yt(n,e=>xo(n.state,e,rt(n)));function rO(n,e){return Yt(n,t=>{if(!t.empty)return wo(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const sO=n=>rO(n,!1),oO=n=>rO(n,!0);function aO(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,r;if(e){for(let s of n.state.facet(z.scrollMargins)){let o=s(n);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(i=Math.max(o?.bottom,i))}r=n.scrollDOM.clientHeight-t-i}else r=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:i,selfScroll:e,height:Math.max(n.defaultLineHeight,r-5)}}function lO(n,e){let t=aO(n),{state:i}=n,r=Gn(i.selection,o=>o.empty?n.moveVertically(o,e,t.height):wo(o,e));if(r.eq(i.selection))return!1;let s;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,h=a.bottom-t.marginBottom;o&&o.top>l&&o.bottom<h&&(s=z.scrollIntoView(r.main.head,{y:"start",yMargin:o.top-l}))}return n.dispatch(Nt(i,r),{effects:s}),!0}const Xu=n=>lO(n,!1),yl=n=>lO(n,!0);function Fi(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let s=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=Z.cursor(i.from+s))}return r}const cO=n=>Yt(n,e=>Fi(n,e,!0)),hO=n=>Yt(n,e=>Fi(n,e,!1)),g1=n=>Yt(n,e=>Fi(n,e,!rt(n))),m1=n=>Yt(n,e=>Fi(n,e,rt(n))),y1=n=>Yt(n,e=>Z.cursor(n.lineBlockAt(e.head).from,1)),b1=n=>Yt(n,e=>Z.cursor(n.lineBlockAt(e.head).to,-1));function v1(n,e,t){let i=!1,r=Gn(n.selection,s=>{let o=mi(n,s.head,-1)||mi(n,s.head,1)||s.head>0&&mi(n,s.head-1,1)||s.head<n.doc.length&&mi(n,s.head+1,-1);if(!o||!o.end)return s;i=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return Z.cursor(a)});return i?(e(Nt(n,r)),!0):!1}const S1=({state:n,dispatch:e})=>v1(n,e);function Bt(n,e){let t=Gn(n.state.selection,i=>{let r=e(i);return Z.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return t.eq(n.state.selection)?!1:(n.dispatch(Nt(n.state,t)),!0)}function uO(n,e){return Bt(n,t=>n.moveByChar(t,e))}const fO=n=>uO(n,!rt(n)),dO=n=>uO(n,rt(n));function pO(n,e){return Bt(n,t=>n.moveByGroup(t,e))}const k1=n=>pO(n,!rt(n)),w1=n=>pO(n,rt(n)),x1=n=>Bt(n,e=>xo(n.state,e,!rt(n))),Q1=n=>Bt(n,e=>xo(n.state,e,rt(n)));function OO(n,e){return Bt(n,t=>n.moveVertically(t,e))}const gO=n=>OO(n,!1),mO=n=>OO(n,!0);function yO(n,e){return Bt(n,t=>n.moveVertically(t,e,aO(n).height))}const Bu=n=>yO(n,!1),Iu=n=>yO(n,!0),$1=n=>Bt(n,e=>Fi(n,e,!0)),C1=n=>Bt(n,e=>Fi(n,e,!1)),P1=n=>Bt(n,e=>Fi(n,e,!rt(n))),T1=n=>Bt(n,e=>Fi(n,e,rt(n))),A1=n=>Bt(n,e=>Z.cursor(n.lineBlockAt(e.head).from)),M1=n=>Bt(n,e=>Z.cursor(n.lineBlockAt(e.head).to)),Du=({state:n,dispatch:e})=>(e(Nt(n,{anchor:0})),!0),_u=({state:n,dispatch:e})=>(e(Nt(n,{anchor:n.doc.length})),!0),ju=({state:n,dispatch:e})=>(e(Nt(n,{anchor:n.selection.main.anchor,head:0})),!0),Vu=({state:n,dispatch:e})=>(e(Nt(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),R1=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),L1=({state:n,dispatch:e})=>{let t=Qo(n).map(({from:i,to:r})=>Z.range(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:Z.create(t),userEvent:"select"})),!0},Z1=({state:n,dispatch:e})=>{let t=Gn(n.selection,i=>{let r=ce(n),s=r.resolveStack(i.from,1);if(i.empty){let o=r.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from<i.from&&a.to>=i.to||a.to>i.to&&a.from<=i.from)&&o.next)return Z.range(a.to,a.from)}return i});return t.eq(n.selection)?!1:(e(Nt(n,t)),!0)};function bO(n,e){let{state:t}=n,i=t.selection,r=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to<n.state.doc.length:o.from>0)for(let a=s;;){let l=n.moveVertically(a,e);if(l.head<o.from||l.head>o.to){r.some(h=>h.head==l.head)||r.push(l);break}else{if(l.head==a.head)break;a=l}}}return r.length==i.ranges.length?!1:(n.dispatch(Nt(t,Z.create(r,r.length-1))),!0)}const E1=n=>bO(n,!1),X1=n=>bO(n,!0),B1=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=Z.create([t.main]):t.main.empty||(i=Z.create([Z.cursor(t.main.head)])),i?(e(Nt(n,i)),!0):!1};function Yr(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,r=i.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);l<o?(t="delete.backward",l=ds(n,l,!1)):l>o&&(t="delete.forward",l=ds(n,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=ds(n,o,!1),a=ds(n,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:Z.cursor(o,o<s.head?-1:1)}});return r.changes.empty?!1:(n.dispatch(i.update(r,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?z.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function ds(n,e,t){if(n instanceof z)for(let i of n.state.facet(z.atomicRanges).map(r=>r(n)))i.between(e,e,(r,s)=>{r<e&&s>e&&(e=t?s:r)});return e}const vO=(n,e,t)=>Yr(n,i=>{let r=i.from,{state:s}=n,o=s.doc.lineAt(r),a,l;if(t&&!e&&r>o.from&&r<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,r-o.from))){if(a[a.length-1]==" ")return r-1;let h=Si(a,s.tabSize),f=h%Wi(s)||Wi(s);for(let O=0;O<f&&a[a.length-1-O]==" ";O++)r--;l=r}else l=Ne(o.text,r-o.from,e,e)+o.from,l==r&&o.number!=(e?s.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,r-o.from))&&(l=Ne(o.text,l-o.from,!1,!1)+o.from);return l}),bl=n=>vO(n,!1,!0),SO=n=>vO(n,!0,!1),kO=(n,e)=>Yr(n,t=>{let i=t.head,{state:r}=n,s=r.doc.lineAt(i),o=r.charCategorizer(i);for(let a=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let l=Ne(s.text,i-s.from,e)+s.from,h=s.text.slice(Math.min(i,l)-s.from,Math.max(i,l)-s.from),f=o(h);if(a!=null&&f!=a)break;(h!=" "||i!=t.head)&&(a=f),i=l}return i}),wO=n=>kO(n,!1),I1=n=>kO(n,!0),D1=n=>Yr(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),_1=n=>Yr(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),j1=n=>Yr(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),V1=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:be.of(["",""])},range:Z.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},z1=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,s=n.doc.lineAt(r),o=r==s.from?r-1:Ne(s.text,r-s.from,!1)+s.from,a=r==s.to?r+1:Ne(s.text,r-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:n.doc.slice(r,a).append(n.doc.slice(o,r))},range:Z.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Qo(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),s=n.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=n.doc.lineAt(i.to-1)),t>=r.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});t=s.number+1}return e}function xO(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let s of Qo(n)){if(t?s.to==n.doc.length:s.from==0)continue;let o=n.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+n.lineBreak});for(let l of s.ranges)r.push(Z.range(Math.min(n.doc.length,l.anchor+a),Math.min(n.doc.length,l.head+a)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:n.lineBreak+o.text});for(let l of s.ranges)r.push(Z.range(l.anchor-a,l.head-a))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:Z.create(r,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const W1=({state:n,dispatch:e})=>xO(n,e,!1),N1=({state:n,dispatch:e})=>xO(n,e,!0);function QO(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of Qo(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});let r=n.changes(i);return e(n.update({changes:r,selection:n.selection.map(r,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Y1=({state:n,dispatch:e})=>QO(n,e,!1),q1=({state:n,dispatch:e})=>QO(n,e,!0),F1=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Qo(e).map(({from:r,to:s})=>(r>0?r--:s<e.doc.length&&s++,{from:r,to:s}))),i=Gn(e.selection,r=>{let s;if(n.lineWrapping){let o=n.lineBlockAt(r.head),a=n.coordsAtPos(r.head,r.assoc||1);a&&(s=o.bottom+n.documentTop-a.bottom+n.defaultLineHeight/2)}return n.moveVertically(r,!0,s)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function G1(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ce(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(ee.closedBy))&&s.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const vl=$O(!1),U1=$O(!0);function $O(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:o}=r,a=e.doc.lineAt(s),l=!n&&s==o&&G1(e,s);n&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let h=new Wr(e,{simulateBreak:s,simulateDoubleBreak:!!l}),f=oc(h,s);for(f==null&&(f=Si(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:s,to:o}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let O=["",Rr(e,f)];return l&&O.push(Rr(e,h.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:be.of(O)},range:Z.cursor(s+1+O[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function bc(n,e){let t=-1;return n.changeByRange(i=>{let r=[];for(let o=i.from;o<=i.to;){let a=n.doc.lineAt(o);a.number>t&&(i.empty||i.to>a.from)&&(e(a,r,i),t=a.number),o=a.to+1}let s=n.changes(r);return{changes:r,range:Z.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const CO=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new Wr(n,{overrideIndentation:s=>{let o=t[s];return o??-1}}),r=bc(n,(s,o,a)=>{let l=oc(i,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let h=/^\s*/.exec(s.text)[0],f=Rr(n,l);(h!=f||a.from<s.from+h.length)&&(t[s.from]=l,o.push({from:s.from,to:s.from+h.length,insert:f}))});return r.changes.empty||e(n.update(r,{userEvent:"indent"})),!0},PO=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(bc(n,(t,i)=>{i.push({from:t.from,insert:n.facet(zi)})}),{userEvent:"input.indent"})),!0),TO=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(bc(n,(t,i)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=Si(r,n.tabSize),o=0,a=Rr(n,Math.max(0,s-Wi(n)));for(;o<r.length&&o<a.length&&r.charCodeAt(o)==a.charCodeAt(o);)o++;i.push({from:t.from+o,to:t.from+r.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),H1=n=>(n.setTabFocusMode(),!0),K1=[{key:"Ctrl-b",run:yc,shift:fO,preventDefault:!0},{key:"Ctrl-f",run:iO,shift:dO},{key:"Ctrl-p",run:sO,shift:gO},{key:"Ctrl-n",run:oO,shift:mO},{key:"Ctrl-a",run:y1,shift:A1},{key:"Ctrl-e",run:b1,shift:M1},{key:"Ctrl-d",run:SO},{key:"Ctrl-h",run:bl},{key:"Ctrl-k",run:D1},{key:"Ctrl-Alt-h",run:wO},{key:"Ctrl-o",run:V1},{key:"Ctrl-t",run:z1},{key:"Ctrl-v",run:yl}],J1=[{key:"ArrowLeft",run:yc,shift:fO,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:u1,shift:k1,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:g1,shift:P1,preventDefault:!0},{key:"ArrowRight",run:iO,shift:dO,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:f1,shift:w1,preventDefault:!0},{mac:"Cmd-ArrowRight",run:m1,shift:T1,preventDefault:!0},{key:"ArrowUp",run:sO,shift:gO,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Du,shift:ju},{mac:"Ctrl-ArrowUp",run:Xu,shift:Bu},{key:"ArrowDown",run:oO,shift:mO,preventDefault:!0},{mac:"Cmd-ArrowDown",run:_u,shift:Vu},{mac:"Ctrl-ArrowDown",run:yl,shift:Iu},{key:"PageUp",run:Xu,shift:Bu},{key:"PageDown",run:yl,shift:Iu},{key:"Home",run:hO,shift:C1,preventDefault:!0},{key:"Mod-Home",run:Du,shift:ju},{key:"End",run:cO,shift:$1,preventDefault:!0},{key:"Mod-End",run:_u,shift:Vu},{key:"Enter",run:vl,shift:vl},{key:"Mod-a",run:R1},{key:"Backspace",run:bl,shift:bl,preventDefault:!0},{key:"Delete",run:SO,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:wO,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:I1,preventDefault:!0},{mac:"Mod-Backspace",run:_1,preventDefault:!0},{mac:"Mod-Delete",run:j1,preventDefault:!0}].concat(K1.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),eS=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:p1,shift:x1},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:O1,shift:Q1},{key:"Alt-ArrowUp",run:W1},{key:"Shift-Alt-ArrowUp",run:Y1},{key:"Alt-ArrowDown",run:N1},{key:"Shift-Alt-ArrowDown",run:q1},{key:"Mod-Alt-ArrowUp",run:E1},{key:"Mod-Alt-ArrowDown",run:X1},{key:"Escape",run:B1},{key:"Mod-Enter",run:U1},{key:"Alt-l",mac:"Ctrl-l",run:L1},{key:"Mod-i",run:Z1,preventDefault:!0},{key:"Mod-[",run:TO},{key:"Mod-]",run:PO},{key:"Mod-Alt-\\",run:CO},{key:"Shift-Mod-k",run:F1},{key:"Shift-Mod-\\",run:S1},{key:"Mod-/",run:Nv},{key:"Alt-A",run:qv},{key:"Ctrl-m",mac:"Shift-Alt-m",run:H1}].concat(J1);class tS{constructor(e,t,i,r){this.state=e,this.pos=t,this.explicit=i,this.view=r,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=ce(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),s=r.search(nS(e));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,i){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),i&&i.onDocChange&&(this.abortOnDocChange=!0))}}function zu(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function iS(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let s=1;s<r.length;s++)t[r[s]]=!0}let i=zu(e)+zu(t)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function AO(n){let e=n.map(r=>typeof r=="string"?{label:r}:r),[t,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:iS(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function MO(n,e){return t=>{for(let i=ce(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}function nS(n,e){var t;let{source:i}=n,r=i[i.length-1]!="$";return r?new RegExp(`(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":""):n}const rS=xi.define(),sS=z.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class oS{constructor(e,t,i,r){this.field=e,this.line=t,this.from=i,this.to=r}}class vc{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,He.TrackDel),i=e.mapPos(this.to,1,He.TrackDel);return t==null||i==null?null:new vc(this.field,t,i)}}class Sc{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],r=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(i.length){let h=o,f=/^\t*/.exec(l)[0].length;for(let O=0;O<f;O++)h+=e.facet(zi);r.push(t+h.length-f),l=h+l.slice(f)}i.push(l),t+=l.length+1}let a=this.fieldPositions.map(l=>new vc(l.field,r[l.line]+l.from,r[l.line]+l.to));return{text:i,ranges:a}}static parse(e){let t=[],i=[],r=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",h=-1,f=l.replace(/\\[{}]/g,O=>O[1]);for(let O=0;O<t.length;O++)(a!=null?t[O].seq==a:f&&t[O].name==f)&&(h=O);if(h<0){let O=0;for(;O<t.length&&(a==null||t[O].seq!=null&&t[O].seq<a);)O++;t.splice(O,0,{seq:a,name:f}),h=O;for(let m of r)m.field>=h&&m.field++}for(let O of r)if(O.line==i.length&&O.from>s.index){let m=s[2]?3+(s[1]||"").length:2;O.from-=m,O.to-=m}r.push(new oS(h,i.length,s.index,s.index+f.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,h)=>{for(let f of r)f.line==i.length&&f.from>h&&(f.from--,f.to--);return l}),i.push(o)}return new Sc(i,r)}}let aS=H.widget({widget:new class extends bt{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),lS=H.mark({class:"cm-snippetField"});class Un{constructor(e,t){this.ranges=e,this.active=t,this.deco=H.set(e.map(i=>(i.from==i.to?aS:lS).range(i.from,i.to)),!0)}map(e){let t=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;t.push(r)}return new Un(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const qr=Oe.define({map(n,e){return n&&n.map(e)}}),cS=Oe.define(),Zr=Ct.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(qr))return t.value;if(t.is(cS)&&n)return new Un(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>z.decorations.from(n,e=>e?e.deco:H.none)});function kc(n,e){return Z.create(n.filter(t=>t.field==e).map(t=>Z.range(t.from,t.to)))}function hS(n){let e=Sc.parse(n);return(t,i,r,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,r),{main:l}=t.state.selection,h={changes:{from:r,to:s==l.from?l.to:s,insert:be.of(o)},scrollIntoView:!0,annotations:i?[rS.of(i),Te.userEvent.of("input.complete")]:void 0};if(a.length&&(h.selection=kc(a,0)),a.some(f=>f.field>0)){let f=new Un(a,0),O=h.effects=[qr.of(f)];t.state.field(Zr,!1)===void 0&&O.push(Oe.appendConfig.of([Zr,OS,gS,sS]))}t.dispatch(t.state.update(h))}}function RO(n){return({state:e,dispatch:t})=>{let i=e.field(Zr,!1);if(!i||n<0&&i.active==0)return!1;let r=i.active+n,s=n>0&&!i.ranges.some(o=>o.field==r+n);return t(e.update({selection:kc(i.ranges,r),effects:qr.of(s?null:new Un(i.ranges,r)),scrollIntoView:!0})),!0}}const uS=({state:n,dispatch:e})=>n.field(Zr,!1)?(e(n.update({effects:qr.of(null)})),!0):!1,fS=RO(1),dS=RO(-1),pS=[{key:"Tab",run:fS,shift:dS},{key:"Escape",run:uS}],Wu=F.define({combine(n){return n.length?n[0]:pS}}),OS=wi.highest(Li.compute([Wu],n=>n.facet(Wu)));function lt(n,e){return{...e,apply:hS(n)}}const gS=z.domEventHandlers({mousedown(n,e){let t=e.state.field(Zr,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==t.active?!1:(e.dispatch({selection:kc(t.ranges,r.field),effects:qr.of(t.ranges.some(s=>s.field>r.field)?new Un(t.ranges,r.field):null),scrollIntoView:!0}),!0)}}),LO=new class extends Ei{};LO.startSide=1;LO.endSide=-1;class Ns{static create(e,t,i,r,s){let o=r+(r<<8)+e+(t<<4)|0;return new Ns(e,t,i,o,s,[],[])}constructor(e,t,i,r,s,o,a){this.type=e,this.value=t,this.from=i,this.hash=r,this.end=s,this.children=o,this.positions=a,this.hashProp=[[ee.contextHash,r]]}addChild(e,t){e.prop(ee.contextHash)!=this.hash&&(e=new le(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let i=this.children.length-1;return i>=0&&(t=Math.max(t,this.positions[i]+this.children[i].length+this.from)),new le(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(r,s,o)=>new le(je.none,r,s,o,this.hashProp)})}}var D;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(D||(D={}));class mS{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class yS{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 Sr(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,i=0){for(let r=t;r<e;r++)i+=this.text.charCodeAt(r)==9?4-i%4:1;return i}findColumn(e){let t=0;for(let i=0;t<this.text.length&&i<e;t++)i+=this.text.charCodeAt(t)==9?4-i%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 Nu(n,e,t){if(t.pos==t.text.length||n!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let i=(n.type==D.OrderedList?Qc:xc)(t,e,!1);return i>0&&(n.type!=D.BulletList||wc(t,e,!1)<0)&&t.text.charCodeAt(t.pos+i-1)==n.value}const ZO={[D.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(fe(D.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(It(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[D.ListItem](n,e,t){return t.indent<t.baseIndent+n.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[D.OrderedList]:Nu,[D.BulletList]:Nu,[D.Document](){return!0}};function It(n){return n==32||n==9||n==10||n==13}function Sr(n,e=0){for(;e<n.length&&It(n.charCodeAt(e));)e++;return e}function Yu(n,e,t){for(;e>t&&It(n.charCodeAt(e-1));)e--;return e}function EO(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;if(e<n.pos+3)return-1;if(n.next==96){for(let t=e;t<n.text.length;t++)if(n.text.charCodeAt(t)==96)return-1}return e}function XO(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function wc(n,e,t){if(n.next!=42&&n.next!=45&&n.next!=95)return-1;let i=1;for(let r=n.pos+1;r<n.text.length;r++){let s=n.text.charCodeAt(r);if(s==n.next)i++;else if(!It(s))return-1}return t&&n.next==45&&DO(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(zO.SetextHeading)>-1||i<3?-1:1}function BO(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function xc(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||It(n.text.charCodeAt(n.pos+1)))&&(!t||BO(e,D.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function Qc(n,e,t){let i=n.pos,r=n.next;for(;r>=48&&r<=57;){i++;if(i==n.text.length)return-1;r=n.text.charCodeAt(i)}return i==n.pos||i>n.pos+9||r!=46&&r!=41||i<n.text.length-1&&!It(n.text.charCodeAt(i+1))||t&&!BO(e,D.OrderedList)&&(n.skipSpace(i+1)==n.text.length||i>n.pos+1||n.next!=49)?-1:i+1-n.pos}function IO(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==35;)e++;if(e<n.text.length&&n.text.charCodeAt(e)!=32)return-1;let t=e-n.pos;return t>6?-1:t}function DO(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;let t=e;for(;e<n.text.length&&It(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const Sl=/^[ \t]*$/,_O=/-->/,jO=/\?>/,kl=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,_O],[/^\s*<\?/,jO],[/^\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,Sl],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,Sl]];function VO(n,e,t){if(n.next!=60)return-1;let i=n.text.slice(n.pos);for(let r=0,s=kl.length-(t?1:0);r<s;r++)if(kl[r][0].test(i))return r;return-1}function qu(n,e){let t=n.countIndent(e,n.pos,n.indent),i=n.countIndent(n.skipSpace(e),e,t);return i>=t+5?t+1:i}function Pi(n,e,t){let i=n.length-1;i>=0&&n[i].to==e&&n[i].type==D.CodeText?n[i].to=t:n.push(fe(D.CodeText,e,t))}const ps={LinkReference:void 0,IndentedCode(n,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let i=e.findColumn(t),r=n.lineStart+i,s=n.lineStart+e.text.length,o=[],a=[];for(Pi(o,r,s);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){Pi(a,n.lineStart-1,n.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<t)break;{if(a.length){for(let h of a)h.type==D.CodeText?Pi(o,h.from,h.to):o.push(h);a=[]}Pi(o,n.lineStart-1,n.lineStart);for(let h of e.markers)o.push(h);s=n.lineStart+e.text.length;let l=n.lineStart+e.findColumn(e.baseIndent+4);l<s&&Pi(o,l,s)}}return a.length&&(a=a.filter(l=>l.type!=D.CodeText),a.length&&(e.markers=a.concat(e.markers))),n.addNode(n.buffer.writeElements(o,-r).finish(D.CodeBlock,s-r),r),!0},FencedCode(n,e){let t=EO(e);if(t<0)return!1;let i=n.lineStart+e.pos,r=e.next,s=t-e.pos,o=e.skipSpace(t),a=Yu(e.text,e.text.length,o),l=[fe(D.CodeMark,i,i+s)];o<a&&l.push(fe(D.CodeInfo,n.lineStart+o,n.lineStart+a));for(let h=!0,f=!0,O=!1;n.nextLine()&&e.depth>=n.stack.length;h=!1){let m=e.pos;if(e.indent-e.baseIndent<4)for(;m<e.text.length&&e.text.charCodeAt(m)==r;)m++;if(m-e.pos>=s&&e.skipSpace(m)==e.text.length){for(let b of e.markers)l.push(b);f&&O&&Pi(l,n.lineStart-1,n.lineStart),l.push(fe(D.CodeMark,n.lineStart+e.pos,n.lineStart+m)),n.nextLine();break}else{O=!0,h||(Pi(l,n.lineStart-1,n.lineStart),f=!1);for(let Q of e.markers)l.push(Q);let b=n.lineStart+e.basePos,S=n.lineStart+e.text.length;b<S&&(Pi(l,b,S),f=!1)}}return n.addNode(n.buffer.writeElements(l,-i).finish(D.FencedCode,n.prevLineEnd()-i),i),!0},Blockquote(n,e){let t=XO(e);return t<0?!1:(n.startContext(D.Blockquote,e.pos),n.addNode(D.QuoteMark,n.lineStart+e.pos,n.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(n,e){if(wc(e,n,!1)<0)return!1;let t=n.lineStart+e.pos;return n.nextLine(),n.addNode(D.HorizontalRule,t),!0},BulletList(n,e){let t=xc(e,n,!1);if(t<0)return!1;n.block.type!=D.BulletList&&n.startContext(D.BulletList,e.basePos,e.next);let i=qu(e,e.pos+1);return n.startContext(D.ListItem,e.basePos,i-e.baseIndent),n.addNode(D.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(i),null},OrderedList(n,e){let t=Qc(e,n,!1);if(t<0)return!1;n.block.type!=D.OrderedList&&n.startContext(D.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let i=qu(e,e.pos+t);return n.startContext(D.ListItem,e.basePos,i-e.baseIndent),n.addNode(D.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(i),null},ATXHeading(n,e){let t=IO(e);if(t<0)return!1;let i=e.pos,r=n.lineStart+i,s=Yu(e.text,e.text.length,i),o=s;for(;o>i&&e.text.charCodeAt(o-1)==e.next;)o--;(o==s||o==i||!It(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=n.buffer.write(D.HeaderMark,0,t).writeElements(n.parser.parseInline(e.text.slice(i+t+1,o),r+t+1),-r);o<e.text.length&&a.write(D.HeaderMark,o-i,s-i);let l=a.finish(D.ATXHeading1-1+t,e.text.length-i);return n.nextLine(),n.addNode(l,r),!0},HTMLBlock(n,e){let t=VO(e,n,!1);if(t<0)return!1;let i=n.lineStart+e.pos,r=kl[t][1],s=[],o=r!=Sl;for(;!r.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){o=!1;break}for(let h of e.markers)s.push(h)}o&&n.nextLine();let a=r==_O?D.CommentBlock:r==jO?D.ProcessingInstructionBlock:D.HTMLBlock,l=n.prevLineEnd();return n.addNode(n.buffer.writeElements(s,-i).finish(a,l-i),i),!0},SetextHeading:void 0};class bS{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,i){if(this.stage==-1)return!1;let r=i.content+`
|
|
13
|
+
`+t.scrub(),s=this.advance(r);return s>-1&&s<r.length?this.complete(e,i,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&Sr(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,i){return e.addLeafElement(t,fe(D.LinkReference,this.start,this.start+i,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;if(this.stage==0){if(!this.nextStage(KO(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(fe(D.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(UO(e,Sr(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=Sr(e,this.pos),i=0;if(t>this.pos){let r=HO(e,t,this.start);if(r){let s=ha(e,r.to-this.start);s>0&&(this.nextStage(r),i=s)}}return i||(i=ha(e,this.pos)),i>0&&i<e.length?i:-1}else return ha(e,this.pos)}}}function ha(n,e){for(;e<n.length;e++){let t=n.charCodeAt(e);if(t==10)break;if(!It(t))return-1}return e}class vS{nextLine(e,t,i){let r=t.depth<e.stack.length?-1:DO(t),s=t.next;if(r<0)return!1;let o=fe(D.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(i,fe(s==61?D.SetextHeading1:D.SetextHeading2,i.start,e.prevLineEnd(),[...e.parser.parseInline(i.content,i.start),o])),!0}finish(){return!1}}const zO={LinkReference(n,e){return e.content.charCodeAt(0)==91?new bS(e):null},SetextHeading(){return new vS}},SS=[(n,e)=>IO(e)>=0,(n,e)=>EO(e)>=0,(n,e)=>XO(e)>=0,(n,e)=>xc(e,n,!0)>=0,(n,e)=>Qc(e,n,!0)>=0,(n,e)=>wc(e,n,!0)>=0,(n,e)=>VO(e,n,!0)>=0],kS={text:"",end:0};class wS{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.line=new yS,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=Ns.create(D.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=i.length?new $S(i,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 i=0;;){let r=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;i<e.markers.length&&(!r||e.markers[i].from<r.end);){let s=e.markers[i++];this.addNode(s.type,s.from,s.to)}if(!r)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;e:for(;;){for(let i of this.parser.blockParsers)if(i){let r=i(this,e);if(r!=!1){if(r==!0)return null;e.forward();continue e}}break}let t=new mS(this.lineStart+e.pos,e.text.slice(e.pos));for(let i of this.parser.leafBlockParsers)if(i){let r=i(this,t);r&&t.parsers.push(r)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let i of this.parser.endLeafBlock)if(i(this,e,t))break e}for(let i of t.parsers)if(i.nextLine(this,e,t))return null;t.content+=`
|
|
14
|
+
`+e.scrub();for(let i of e.markers)t.marks.push(i)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new 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=JO(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=kS;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 i=this.absoluteLineStart,r=this.rangeI;for(;this.ranges[r].to<t.end;){r++;let s=this.ranges[r].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[r-1].to-i)+o,i=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:i}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=i,e.reset(t);e.depth<this.stack.length;e.depth++){let r=this.stack[e.depth],s=this.parser.skipContextMarkup[r.type];if(!s)throw new Error("Unhandled block context "+D[r.type]);let o=this.line.markers.length;if(!s(r,this,e)){this.line.markers.length>o&&(r.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),i;if(this.input.lineChunks)i=t==`
|
|
15
|
+
`?"":t;else{let r=t.indexOf(`
|
|
16
|
+
`);i=r<0?t:t.slice(0,r)}return e+i.length>this.to?i.slice(0,this.to-e):i}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,i=0){this.block=Ns.create(e,i,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,i=0){this.startContext(this.parser.getNodeType(e),t,i)}addNode(e,t,i){typeof e=="number"&&(e=new le(this.parser.nodeSet.types[e],Vn,Vn,(i??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(xl(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?WO(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let i of e.parsers)if(i.finish(this,e))return;let t=xl(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(D.Paragraph,e.content.length),e.start)}elt(e,t,i,r){return typeof e=="string"?fe(this.parser.getNodeType(e),t,i,r):new qO(e,t)}get buffer(){return new YO(this.parser.nodeSet)}}function WO(n,e,t,i,r){let s=n[e].to,o=[],a=[],l=t.from+i;function h(f,O){for(;O?f>=s:f>s;){let m=n[e+1].from-s;i+=m,f+=m,e++,s=n[e].to}}for(let f=t.firstChild;f;f=f.nextSibling){h(f.from+i,!0);let O=f.from+i,m,b=r.get(f.tree);b?m=b:f.to+i>s?(m=WO(n,e,f,i,r),h(f.to+i,!1)):m=f.toTree(),o.push(m),a.push(O-l)}return h(t.to+i,!1),new le(t.type,o,a,t.to+i-l,t.tree?t.tree.propValues:void 0)}class $o extends Oo{constructor(e,t,i,r,s,o,a,l,h){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=l,this.wrappers=h,this.nodeTypes=Object.create(null);for(let f of e.types)this.nodeTypes[f.name]=f.id}createParse(e,t,i){let r=new wS(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}configure(e){let t=wl(e);if(!t)return this;let{nodeSet:i,skipContextMarkup:r}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),h=this.inlineNames.slice(),f=this.endLeafBlock.slice(),O=this.wrappers;if(or(t.defineNodes)){r=Object.assign({},r);let m=i.types.slice(),b;for(let S of t.defineNodes){let{name:Q,block:P,composite:A,style:E}=typeof S=="string"?{name:S}:S;if(m.some(W=>W.name==Q))continue;A&&(r[m.length]=(W,Y,_)=>A(Y,_,W.value));let B=m.length,U=A?["Block","BlockContext"]:P?B>=D.ATXHeading1&&B<=D.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;m.push(je.define({id:B,name:Q,props:U&&[[ee.group,U]]})),E&&(b||(b={}),Array.isArray(E)||E instanceof $t?b[Q]=E:Object.assign(b,E))}i=new qn(m),b&&(i=i.extend(dn(b)))}if(or(t.props)&&(i=i.extend(...t.props)),or(t.remove))for(let m of t.remove){let b=this.blockNames.indexOf(m),S=this.inlineNames.indexOf(m);b>-1&&(s[b]=o[b]=void 0),S>-1&&(l[S]=void 0)}if(or(t.parseBlock))for(let m of t.parseBlock){let b=a.indexOf(m.name);if(b>-1)s[b]=m.parse,o[b]=m.leaf;else{let S=m.before?Os(a,m.before):m.after?Os(a,m.after)+1:a.length-1;s.splice(S,0,m.parse),o.splice(S,0,m.leaf),a.splice(S,0,m.name)}m.endLeaf&&f.push(m.endLeaf)}if(or(t.parseInline))for(let m of t.parseInline){let b=h.indexOf(m.name);if(b>-1)l[b]=m.parse;else{let S=m.before?Os(h,m.before):m.after?Os(h,m.after)+1:h.length-1;l.splice(S,0,m.parse),h.splice(S,0,m.name)}}return t.wrap&&(O=O.concat(t.wrap)),new $o(i,s,o,a,f,r,l,h,O)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let i=new $c(this,e,t);e:for(let r=t;r<i.end;){let s=i.char(r);for(let o of this.inlineParsers)if(o){let a=o(i,s,r);if(a>=0){r=a;continue e}}r++}return i.resolveMarkers(0)}}function or(n){return n!=null&&n.length>0}function wl(n){if(!Array.isArray(n))return n;if(n.length==0)return null;let e=wl(n[0]);if(n.length==1)return e;let t=wl(n.slice(1));if(!t||!e)return e||t;let i=(o,a)=>(o||Vn).concat(a||Vn),r=e.wrap,s=t.wrap;return{props:i(e.props,t.props),defineNodes:i(e.defineNodes,t.defineNodes),parseBlock:i(e.parseBlock,t.parseBlock),parseInline:i(e.parseInline,t.parseInline),remove:i(e.remove,t.remove),wrap:r?s?(o,a,l,h)=>r(s(o,a,l,h),a,l,h):r:s}}function Os(n,e){let t=n.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let NO=[je.none];for(let n=1,e;e=D[n];n++)NO[n]=je.define({id:n,name:e,props:n>=D.Escape?[]:[[ee.group,n in ZO?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const Vn=[];class YO{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,i,r=0){return this.content.push(e,t,i,4+r*4),this}writeElements(e,t=0){for(let i of e)i.writeTo(this,t);return this}finish(e,t){return le.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let Er=class{constructor(e,t,i,r=Vn){this.type=e,this.from=t,this.to=i,this.children=r}writeTo(e,t){let i=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-i)}toTree(e){return new YO(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class qO{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return Vn}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function fe(n,e,t,i){return new Er(n,e,t,i)}const FO={resolve:"Emphasis",mark:"EmphasisMark"},GO={resolve:"Emphasis",mark:"EmphasisMark"},nn={},Ys={};class Qt{constructor(e,t,i,r){this.type=e,this.from=t,this.to=i,this.side=r}}const Fu="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Xr=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Xr=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const ua={Escape(n,e,t){if(e!=92||t==n.end-1)return-1;let i=n.char(t+1);for(let r=0;r<Fu.length;r++)if(Fu.charCodeAt(r)==i)return n.append(fe(D.Escape,t,t+2));return-1},Entity(n,e,t){if(e!=38)return-1;let i=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(n.slice(t+1,t+31));return i?n.append(fe(D.Entity,t,t+1+i[0].length)):-1},InlineCode(n,e,t){if(e!=96||t&&n.char(t-1)==96)return-1;let i=t+1;for(;i<n.end&&n.char(i)==96;)i++;let r=i-t,s=0;for(;i<n.end;i++)if(n.char(i)==96){if(s++,s==r&&n.char(i+1)!=96)return n.append(fe(D.InlineCode,t,i+1,[fe(D.CodeMark,t,t+r),fe(D.CodeMark,i+1-r,i+1)]))}else s=0;return-1},HTMLTag(n,e,t){if(e!=60||t==n.end-1)return-1;let i=n.slice(t+1,n.end),r=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(i);if(r)return n.append(fe(D.Autolink,t,t+1+r[0].length,[fe(D.LinkMark,t,t+1),fe(D.URL,t+1,t+r[0].length),fe(D.LinkMark,t+r[0].length,t+1+r[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(i);if(s)return n.append(fe(D.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(i);if(o)return n.append(fe(D.ProcessingInstruction,t,t+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(i);return a?n.append(fe(D.HTMLTag,t,t+1+a[0].length)):-1},Emphasis(n,e,t){if(e!=95&&e!=42)return-1;let i=t+1;for(;n.char(i)==e;)i++;let r=n.slice(t-1,t),s=n.slice(i,i+1),o=Xr.test(r),a=Xr.test(s),l=/\s|^$/.test(r),h=/\s|^$/.test(s),f=!h&&(!a||l||o),O=!l&&(!o||h||a),m=f&&(e==42||!O||o),b=O&&(e==42||!f||a);return n.append(new Qt(e==95?FO:GO,t,i,(m?1:0)|(b?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(fe(D.HardBreak,t,t+2));if(e==32){let i=t+1;for(;n.char(i)==32;)i++;if(n.char(i)==10&&i>=t+2)return n.append(fe(D.HardBreak,t,i+1))}return-1},Link(n,e,t){return e==91?n.append(new Qt(nn,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new Qt(Ys,t,t+2,1)):-1},LinkEnd(n,e,t){if(e!=93)return-1;for(let i=n.parts.length-1;i>=0;i--){let r=n.parts[i];if(r instanceof Qt&&(r.type==nn||r.type==Ys)){if(!r.side||n.skipSpace(r.to)==t&&!/[(\[]/.test(n.slice(t+1,t+2)))return n.parts[i]=null,-1;let s=n.takeContent(i),o=n.parts[i]=xS(n,s,r.type==nn?D.Link:D.Image,r.from,t+1);if(r.type==nn)for(let a=0;a<i;a++){let l=n.parts[a];l instanceof Qt&&l.type==nn&&(l.side=0)}return o.to}}return-1}};function xS(n,e,t,i,r){let{text:s}=n,o=n.char(r),a=r;if(e.unshift(fe(D.LinkMark,i,i+(t==D.Image?2:1))),e.push(fe(D.LinkMark,r-1,r)),o==40){let l=n.skipSpace(r+1),h=UO(s,l-n.offset,n.offset),f;h&&(l=n.skipSpace(h.to),l!=h.to&&(f=HO(s,l-n.offset,n.offset),f&&(l=n.skipSpace(f.to)))),n.char(l)==41&&(e.push(fe(D.LinkMark,r,r+1)),a=l+1,h&&e.push(h),f&&e.push(f),e.push(fe(D.LinkMark,l,a)))}else if(o==91){let l=KO(s,r-n.offset,n.offset,!1);l&&(e.push(l),a=l.to)}return fe(t,i,a,e)}function UO(n,e,t){if(n.charCodeAt(e)==60){for(let r=e+1;r<n.length;r++){let s=n.charCodeAt(r);if(s==62)return fe(D.URL,e+t,r+1+t);if(s==60||s==10)return!1}return null}else{let r=0,s=e;for(let o=!1;s<n.length;s++){let a=n.charCodeAt(s);if(It(a))break;if(o)o=!1;else if(a==40)r++;else if(a==41){if(!r)break;r--}else a==92&&(o=!0)}return s>e?fe(D.URL,e+t,s+t):s==n.length?null:!1}}function HO(n,e,t){let i=n.charCodeAt(e);if(i!=39&&i!=34&&i!=40)return!1;let r=i==40?41:i;for(let s=e+1,o=!1;s<n.length;s++){let a=n.charCodeAt(s);if(o)o=!1;else{if(a==r)return fe(D.LinkTitle,e+t,s+1+t);a==92&&(o=!0)}}return null}function KO(n,e,t,i){for(let r=!1,s=e+1,o=Math.min(n.length,s+999);s<o;s++){let a=n.charCodeAt(s);if(r)r=!1;else{if(a==93)return i?!1:fe(D.LinkLabel,e+t,s+1+t);if(i&&!It(a)&&(i=!1),a==91)return!1;a==92&&(r=!0)}}return null}class $c{constructor(e,t,i){this.parser=e,this.text=t,this.offset=i,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,i,r,s){return this.append(new Qt(e,t,i,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Qt&&(t.type==nn||t.type==Ys))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let i=e;i<this.parts.length;i++){let r=this.parts[i];if(!(r instanceof Qt&&r.type.resolve&&r.side&2))continue;let s=r.type==FO||r.type==GO,o=r.to-r.from,a,l=i-1;for(;l>=e;l--){let Q=this.parts[l];if(Q instanceof Qt&&Q.side&1&&Q.type==r.type&&!(s&&(r.side&1||Q.side&2)&&(Q.to-Q.from+o)%3==0&&((Q.to-Q.from)%3||o%3))){a=Q;break}}if(!a)continue;let h=r.type.resolve,f=[],O=a.from,m=r.to;if(s){let Q=Math.min(2,a.to-a.from,o);O=a.to-Q,m=r.from+Q,h=Q==1?"Emphasis":"StrongEmphasis"}a.type.mark&&f.push(this.elt(a.type.mark,O,a.to));for(let Q=l+1;Q<i;Q++)this.parts[Q]instanceof Er&&f.push(this.parts[Q]),this.parts[Q]=null;r.type.mark&&f.push(this.elt(r.type.mark,r.from,m));let b=this.elt(h,O,m,f);this.parts[l]=s&&a.from!=O?new Qt(a.type,a.from,O,a.side):null,(this.parts[i]=s&&r.to!=m?new Qt(r.type,m,r.to,r.side):null)?this.parts.splice(i,0,b):this.parts[i]=b}let t=[];for(let i=e;i<this.parts.length;i++){let r=this.parts[i];r instanceof Er&&t.push(r)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let i=this.parts[t];if(i instanceof Qt&&i.type==e&&i.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Qt?t:null}skipSpace(e){return Sr(this.text,e-this.offset)+this.offset}elt(e,t,i,r){return typeof e=="string"?fe(this.parser.getNodeType(e),t,i,r):new qO(e,t)}}$c.linkStart=nn;$c.imageStart=Ys;function xl(n,e){if(!e.length)return n;if(!n.length)return e;let t=n.slice(),i=0;for(let r of e){for(;i<t.length&&t[i].to<r.to;)i++;if(i<t.length&&t[i].from<r.from){let s=t[i];s instanceof Er&&(t[i]=new Er(s.type,s.from,s.to,xl(s.children,[r])))}else t.splice(i++,0,r)}return t}const QS=[D.CodeBlock,D.ListItem,D.OrderedList,D.BulletList];let $S=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
|
|
17
|
+
`;)s--;this.fragmentEnd=s?s-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let r=e+this.fragment.offset;for(;i.to<=r;)if(!i.parent())return!1;for(;;){if(i.from>=r)return this.fragment.from<=t;if(!i.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ee.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,l=o,h=a;for(;;){if(t.to-i>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let f=JO(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,f);else{let O=new le(e.parser.nodeSet.types[D.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(O,t.tree),e.addNode(O,f)}if(t.type.is("Block")&&(QS.indexOf(t.type.id)<0?(o=t.to-i,a=e.block.children.length):(o=l,a=h),l=t.to-i,h=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}};function JO(n,e){let t=n;for(let i=1;i<e.length;i++){let r=e[i-1].to,s=e[i].from;r<n&&(t-=s-r)}return t}const CS=dn({"Blockquote/...":x.quote,HorizontalRule:x.contentSeparator,"ATXHeading1/... SetextHeading1/...":x.heading1,"ATXHeading2/... SetextHeading2/...":x.heading2,"ATXHeading3/...":x.heading3,"ATXHeading4/...":x.heading4,"ATXHeading5/...":x.heading5,"ATXHeading6/...":x.heading6,"Comment CommentBlock":x.comment,Escape:x.escape,Entity:x.character,"Emphasis/...":x.emphasis,"StrongEmphasis/...":x.strong,"Link/... Image/...":x.link,"OrderedList/... BulletList/...":x.list,"BlockQuote/...":x.quote,"InlineCode CodeText":x.monospace,"URL Autolink":x.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":x.processingInstruction,"CodeInfo LinkLabel":x.labelName,LinkTitle:x.string,Paragraph:x.content}),PS=new $o(new qn(NO).extend(CS),Object.keys(ps).map(n=>ps[n]),Object.keys(ps).map(n=>zO[n]),Object.keys(ps),SS,ZO,Object.keys(ua).map(n=>ua[n]),Object.keys(ua),[]);function TS(n,e,t){let i=[];for(let r=n.firstChild,s=e;;r=r.nextSibling){let o=r?r.from:t;if(o>s&&i.push({from:s,to:o}),!r)break;s=r.to}return i}function AS(n){let{codeParser:e,htmlParser:t}=n;return{wrap:rc((r,s)=>{let o=r.type.id;if(e&&(o==D.CodeBlock||o==D.FencedCode)){let a="";if(o==D.FencedCode){let h=r.node.getChild(D.CodeInfo);h&&(a=s.read(h.from,h.to))}let l=e(a);if(l)return{parser:l,overlay:h=>h.type.id==D.CodeText,bracketed:o==D.FencedCode}}else if(t&&(o==D.HTMLBlock||o==D.HTMLTag||o==D.CommentBlock))return{parser:t,overlay:TS(r.node,r.from,r.to)};return null})}}const MS={resolve:"Strikethrough",mark:"StrikethroughMark"},RS={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":x.strikethrough}},{name:"StrikethroughMark",style:x.processingInstruction}],parseInline:[{name:"Strikethrough",parse(n,e,t){if(e!=126||n.char(t+1)!=126||n.char(t+2)==126)return-1;let i=n.slice(t-1,t),r=n.slice(t+2,t+3),s=/\s|^$/.test(i),o=/\s|^$/.test(r),a=Xr.test(i),l=Xr.test(r);return n.addDelimiter(MS,t,t+2,!o&&(!l||s||a),!s&&(!a||o||l))},after:"Emphasis"}]};function kr(n,e,t=0,i,r=0){let s=0,o=!0,a=-1,l=-1,h=!1,f=()=>{i.push(n.elt("TableCell",r+a,r+l,n.parser.parseInline(e.slice(a,l),r+a)))};for(let O=t;O<e.length;O++){let m=e.charCodeAt(O);m==124&&!h?((!o||a>-1)&&s++,o=!1,i&&(a>-1&&f(),i.push(n.elt("TableDelimiter",O+r,O+r+1))),a=l=-1):(h||m!=32&&m!=9)&&(a<0&&(a=O),l=O+1),h=!h&&m==92}return a>-1&&(s++,i&&f()),s}function Gu(n,e){for(let t=e;t<n.length;t++){let i=n.charCodeAt(t);if(i==124)return!0;i==92&&t++}return!1}const eg=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class Uu{constructor(){this.rows=null}nextLine(e,t,i){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&eg.test(r=t.text.slice(t.pos))){let s=[];kr(e,i.content,0,s,i.start)==kr(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",i.start,i.start+i.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];kr(e,t.text,t.pos,r,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,r))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const LS={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":x.heading}},"TableRow",{name:"TableCell",style:x.content},{name:"TableDelimiter",style:x.processingInstruction}],parseBlock:[{name:"Table",leaf(n,e){return Gu(e.content,0)?new Uu:null},endLeaf(n,e,t){if(t.parsers.some(r=>r instanceof Uu)||!Gu(e.text,e.basePos))return!1;let i=n.peekLine();return eg.test(i)&&kr(n,e.text,e.basePos)==kr(n,i,e.basePos)},before:"SetextHeading"}]};class ZS{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const ES={defineNodes:[{name:"Task",block:!0,style:x.list},{name:"TaskMarker",style:x.atom}],parseBlock:[{name:"TaskList",leaf(n,e){return/^\[[ xX]\][ \t]/.test(e.content)&&n.parentType().name=="ListItem"?new ZS:null},after:"SetextHeading"}]},Hu=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Ku=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,XS=/[\w-]+\.[\w-]+($|\/)/,Ju=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,ef=/\/[a-zA-Z\d@.]+/gy;function tf(n,e,t,i){let r=0;for(let s=e;s<t;s++)n[s]==i&&r++;return r}function BS(n,e){Ku.lastIndex=e;let t=Ku.exec(n);if(!t||XS.exec(t[0])[0].indexOf("_")>-1)return-1;let i=e+t[0].length;for(;;){let r=n[i-1],s;if(/[?!.,:*_~]/.test(r)||r==")"&&tf(n,e,i,")")>tf(n,e,i,"("))i--;else if(r==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(n.slice(e,i))))i=e+s.index;else break}return i}function nf(n,e){Ju.lastIndex=e;let t=Ju.exec(n);if(!t)return-1;let i=t[0][t[0].length-1];return i=="_"||i=="-"?-1:e+t[0].length-(i=="."?1:0)}const IS={parseInline:[{name:"Autolink",parse(n,e,t){let i=t-n.offset;if(i&&/\w/.test(n.text[i-1]))return-1;Hu.lastIndex=i;let r=Hu.exec(n.text),s=-1;if(!r)return-1;if(r[1]||r[2]){if(s=BS(n.text,i+r[0].length),s>-1&&n.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(n.text.slice(i,s));s=i+o[0].length}}else r[3]?s=nf(n.text,i):(s=nf(n.text,i+r[0].length),s>-1&&r[0]=="xmpp:"&&(ef.lastIndex=s,r=ef.exec(n.text),r&&(s=r.index+r[0].length)));return s<0?-1:(n.addElement(n.elt("URL",t,s+n.offset)),s+n.offset)}}]},DS=[LS,ES,RS,IS];function tg(n,e,t){return(i,r,s)=>{if(r!=n||i.char(s+1)==n)return-1;let o=[i.elt(t,s,s+1)];for(let a=s+1;a<i.end;a++){let l=i.char(a);if(l==n)return i.addElement(i.elt(e,s,a+1,o.concat(i.elt(t,a,a+1))));if(l==92&&o.push(i.elt("Escape",a,a+++2)),It(l))break}return-1}}const _S={defineNodes:[{name:"Superscript",style:x.special(x.content)},{name:"SuperscriptMark",style:x.processingInstruction}],parseInline:[{name:"Superscript",parse:tg(94,"Superscript","SuperscriptMark")}]},jS={defineNodes:[{name:"Subscript",style:x.special(x.content)},{name:"SubscriptMark",style:x.processingInstruction}],parseInline:[{name:"Subscript",parse:tg(126,"Subscript","SubscriptMark")}]},VS={defineNodes:[{name:"Emoji",style:x.character}],parseInline:[{name:"Emoji",parse(n,e,t){let i;return e!=58||!(i=/^[a-zA-Z_0-9]+:/.exec(n.slice(t+1,n.end)))?-1:n.addElement(n.elt("Emoji",t,t+1+i[0].length))}}]};class qs{constructor(e,t,i,r,s,o,a,l,h,f=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=r,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=h,this.lookAhead=f,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let r=e.parser.context;return new qs(e,[],t,i,i,0,[],0,r?new rf(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,r=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=s.dynamicPrecedence(r);if(a&&(this.score+=a),i==0){this.pushState(s.getGoto(this.state,r,!0),this.reducePos),r<s.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(r,this.reducePos);return}let l=this.stack.length-(i-1)*3-(e&262144?6:0),h=l?this.stack[l-2]:this.p.ranges[0].from,f=this.reducePos-h;f>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(h==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=f):this.p.lastBigReductionSize<f&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=h,this.p.lastBigReductionSize=f));let O=l?this.stack[l-1]:0,m=this.bufferBase+this.buffer.length-O;if(r<s.minRepeatTerm||e&131072){let b=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,h,b,m+4,!0)}if(e&262144)this.state=this.stack[l];else{let b=this.stack[l-3];this.state=s.getGoto(b,r,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(r,h)}storeNode(e,t,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,a=this.buffer.length;if(a==0&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(t==i)return;if(o.buffer[a-2]>=t){o.buffer[a-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,r);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>i;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,r>4&&(r-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=i,this.buffer[o+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=r;let a=o.stateFlag(s,1);!a&&(r>i||t<=o.maxNode)&&(this.reducePos=r),this.pushState(s,a?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=o.maxNode&&this.buffer.push(t,i,r,4)}else this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4)}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new qs(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new zS(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let s=0,o;s<t.length;s+=2)(o=t[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&r.push(t[s],o);if(this.stack.length<120)for(let s=0;r.length<8&&s<t.length;s+=2){let o=t[s+1];r.some((a,l)=>l&1&&a==o)||r.push(t[s],o)}t=r}let i=[];for(let r=0;r<t.length&&i.length<4;r+=2){let s=t[r+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[r],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let i=t>>19,r=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,h=this.stack.length-a*3;if(h>=0&&e.getGoto(this.stack[h],l,!1)>=0)return a<<19|65536|l}}else{let a=i(o,s+1);if(a!=null)return a}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new rf(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class rf{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class zS{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class Fs{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Fs(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Fs(this.stack,this.pos,this.index)}}function ur(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,r=0;i<n.length;){let s=0;for(;;){let o=n.charCodeAt(i++),a=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class Qs{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const sf=new Qs;class WS{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=sf,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,r=this.rangeIndex,s=this.pos+e;for(;s<i.from;){if(!r)return null;let o=this.ranges[--r];s-=i.from-o.to,i=o}for(;t<0?s>i.to:s>=i.to;){if(r==this.ranges.length-1)return null;let o=this.ranges[++r];s+=o.from-i.to,i=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(i=s,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,a=this.range;for(;a.to<=i;)a=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=sf,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}}class Ln{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;ig(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Ln.prototype.contextual=Ln.prototype.fallback=Ln.prototype.extend=!1;class Gs{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?ur(e):e}token(e,t){let i=e.pos,r=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(ig(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,o==null)break;e.reset(o,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}}Gs.prototype.contextual=Ln.prototype.fallback=Ln.prototype.extend=!1;class vt{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function ig(n,e,t,i,r,s){let o=0,a=1<<i,{dialect:l}=t.p.parser;e:for(;(a&n[o])!=0;){let h=n[o+1];for(let b=o+3;b<h;b+=2)if((n[b+1]&a)>0){let S=n[b];if(l.allows(S)&&(e.token.value==-1||e.token.value==S||NS(S,e.token.value,r,s))){e.acceptToken(S);break}}let f=e.next,O=0,m=n[o+2];if(e.next<0&&m>O&&n[h+m*3-3]==65535){o=n[h+m*3-1];continue e}for(;O<m;){let b=O+m>>1,S=h+b+(b<<1),Q=n[S],P=n[S+1]||65536;if(f<Q)m=b;else if(f>=P)O=b+1;else{o=n[S+2],e.advance();continue e}}break}}function of(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function NS(n,e,t,i){let r=of(t,i,e);return r<0||of(t,i,n)<r}const St=typeof process<"u"&&process.env&&/\bparse\b/.test(process.env.LOG);let fa=null;function af(n,e,t){let i=n.cursor(exports.IterMode.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class YS{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?af(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?af(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],r=this.index[t];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=i.children[r],o=this.start[t]+i.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof le){if(o==e){if(o<this.safeFrom)return null;let a=o+s.length;if(a<=this.safeTo){let l=s.prop(ee.lookAhead);if(!l||a+l<this.fragment.to)return s}}this.index[t]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}}class qS{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Qs)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,o=r.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let h=0;h<s.length;h++){if((1<<h&o)==0)continue;let f=s[h],O=this.tokens[h];if(!(i&&!f.fallback)&&((f.contextual||O.start!=e.pos||O.mask!=o||O.context!=a)&&(this.updateCachedToken(O,f,e),O.mask=o,O.context=a),O.lookAhead>O.end+25&&(l=Math.max(O.lookAhead,l)),O.value!=0)){let m=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!f.extend&&(i=O,t>m))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!i&&e.pos==this.stream.end&&(i=new Qs,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Qs,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let a=s.specializers[o](this.stream.read(e.start,e.end),i);if(a>=0&&i.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let s=0;s<r;s+=3)if(this.actions[s]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=i,r}addActions(e,t,i,r){let{state:s}=e,{parser:o}=e.p,{data:a}=o;for(let l=0;l<2;l++)for(let h=o.stateSlot(s,l?2:1);;h+=3){if(a[h]==65535)if(a[h+1]==1)h=pi(a,h+2);else{r==0&&a[h+1]==2&&(r=this.putAction(pi(a,h+2),t,i,r));break}a[h]==t&&(r=this.putAction(pi(a,h+1),t,i,r))}return r}}class FS{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new WS(t,r),this.tokens=new qS(e,this.stream),this.topTerm=e.top[1];let{from:s}=r[0];this.stacks=[qs.start(this,e.top[0],s)],this.fragments=i.length&&this.stream.end-s>e.bufferLength*4?new YS(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let a=e[o];for(;;){if(this.tokens.mainToken=null,a.pos>t)i.push(a);else{if(this.advanceStack(a,i,e))continue;{r||(r=[],s=[]),r.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!i.length){let o=r&&US(r);if(o)return St&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw St&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let o=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(o)return St&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((a,l)=>l.score-a.score);i.length>o;)i.pop();i.some(a=>a.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let o=0;o<i.length-1;o++){let a=i[o];for(let l=o+1;l<i.length;l++){let h=i[l];if(a.sameState(h)||a.buffer.length>500&&h.buffer.length>500)if((a.score-h.score||a.buffer.length-h.buffer.length)>0)i.splice(l--,1);else{i.splice(o--,1);continue e}}}i.length>12&&(i.sort((o,a)=>a.score-o.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let r=e.pos,{parser:s}=this,o=St?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,f=h?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let m=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(m>-1&&O.length&&(!h||(O.prop(ee.contextHash)||0)==f))return e.useNode(O,m),St&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof le)||O.children.length==0||O.positions[0]>0)break;let b=O.children[0];if(b instanceof le&&O.positions[0]==0)O=b;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),St&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let h=0;h<l.length;){let f=l[h++],O=l[h++],m=l[h++],b=h==l.length||!i,S=b?e:e.split(),Q=this.tokens.mainToken;if(S.apply(f,O,Q?Q.start:S.pos,m),St&&console.log(o+this.stackID(S)+` (via ${(f&65536)==0?"shift":`reduce of ${s.getName(f&65535)}`} for ${s.getName(O)} @ ${r}${S==e?"":", split"})`),b)return!0;S.pos>r?t.push(S):i.push(S)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return lf(e,t),!0}}runRecovery(e,t,i){let r=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o],l=t[o<<1],h=t[(o<<1)+1],f=St?this.stackID(a)+" -> ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),St&&console.log(f+this.stackID(a)+" (restarted)"),this.advanceFully(a,i))))continue;let O=a.split(),m=f;for(let b=0;b<10&&O.forceReduce()&&(St&&console.log(m+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));b++)St&&(m=this.stackID(O)+" -> ");for(let b of a.recoverByInsert(l))St&&console.log(f+this.stackID(b)+" (via recover-insert)"),this.advanceFully(b,i);this.stream.end>a.pos?(h==a.pos&&(h++,l=0),a.recoverByDelete(l,h),St&&console.log(f+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),lf(a,i)):(!r||r.score<O.score)&&(r=O)}return r}stackToTree(e){return e.close(),le.build({buffer:Fs.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(fa||(fa=new WeakMap)).get(e);return t||fa.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function lf(n,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==n.pos&&i.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class GS{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}const da=n=>n;class Cc{constructor(e){this.start=e.start,this.shift=e.shift||da,this.reduce=e.reduce||da,this.reuse=e.reuse||da,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class fn extends Oo{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;a<e.repeatNodeCount;a++)t.push("");let i=Object.keys(e.topRules).map(a=>e.topRules[a][1]),r=[];for(let a=0;a<t.length;a++)r.push([]);function s(a,l,h){r[a].push([l,l.deserialize(String(h))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=ee[l]);for(let h=1;h<a.length;){let f=a[h++];if(f>=0)s(f,l,a[h++]);else{let O=a[h+-f];for(let m=-f;m>0;m--)s(a[h++],l,O);h++}}}this.nodeSet=new qn(t.map((a,l)=>je.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:r[l],top:i.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Cp;let o=ur(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(cf),this.states=ur(e.states,Uint32Array),this.data=ur(e.stateData),this.goto=ur(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Ln(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let r=new FS(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let o=r[s++],a=o&1,l=r[s++];if(a&&i)return l;for(let h=s+(o>>1);s<h;s++)if(r[s]==e)return l;if(a)return-1}}hasAction(e,t){let i=this.data;for(let r=0;r<2;r++)for(let s=this.stateSlot(e,r?2:1),o;;s+=3){if((o=i[s])==65535)if(i[s+1]==1)o=i[s=pi(i,s+2)];else{if(i[s+1]==2)return pi(i,s+2);break}if(o==t||o==0)return pi(i,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=pi(this.data,s+2);else break;r=t(pi(this.data,s+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=pi(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];t.some((s,o)=>o&1&&s==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(fn.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(a=>a.from==i.external);if(!s)return i;let o=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[r]=cf(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(i[o]=!0)}let r=null;for(let s=0;s<t.length;s++)if(!i[s])for(let o=this.dialects[t[s]],a;(a=this.data[o++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[a]=1;return new GS(e,i,r)}static deserialize(e){return new fn(e)}}function pi(n,e){return n[e]|n[e+1]<<16}function US(n){let e=null;for(let t of n){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function cf(n){if(n.external){let e=n.extend?1:0;return(t,i)=>n.external(t,i)<<1|e}return n.get}const HS=55,KS=1,JS=56,ek=2,tk=57,ik=3,hf=4,nk=5,Pc=6,ng=7,rg=8,sg=9,og=10,rk=11,sk=12,ok=13,pa=58,ak=14,lk=15,uf=59,ag=21,ck=23,lg=24,hk=25,Ql=27,cg=28,uk=29,fk=32,dk=35,pk=37,Ok=38,gk=0,mk=1,yk={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},bk={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},ff={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function vk(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}let df=null,pf=null,Of=0;function $l(n,e){let t=n.pos+e;if(Of==t&&pf==n)return df;let i=n.peek(e),r="";for(;vk(i);)r+=String.fromCharCode(i),i=n.peek(++e);return pf=n,Of=t,df=r?r.toLowerCase():i==Sk||i==kk?void 0:null}const hg=60,Us=62,Tc=47,Sk=63,kk=33,wk=45;function gf(n,e){this.name=n,this.parent=e}const xk=[Pc,og,ng,rg,sg],Qk=new Cc({start:null,shift(n,e,t,i){return xk.indexOf(e)>-1?new gf($l(i,1)||"",n):n},reduce(n,e){return e==ag&&n?n.parent:n},reuse(n,e,t,i){let r=e.type.id;return r==Pc||r==pk?new gf($l(i,1)||"",n):n},strict:!1}),$k=new vt((n,e)=>{if(n.next!=hg){n.next<0&&e.context&&n.acceptToken(pa);return}n.advance();let t=n.next==Tc;t&&n.advance();let i=$l(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?lk:ak);let r=e.context?e.context.name:null;if(t){if(i==r)return n.acceptToken(rk);if(r&&bk[r])return n.acceptToken(pa,-2);if(e.dialectEnabled(gk))return n.acceptToken(sk);for(let s=e.context;s;s=s.parent)if(s.name==i)return;n.acceptToken(ok)}else{if(i=="script")return n.acceptToken(ng);if(i=="style")return n.acceptToken(rg);if(i=="textarea")return n.acceptToken(sg);if(yk.hasOwnProperty(i))return n.acceptToken(og);r&&ff[r]&&ff[r][i]?n.acceptToken(pa,-1):n.acceptToken(Pc)}},{contextual:!0}),Ck=new vt(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(uf);break}if(n.next==wk)e++;else if(n.next==Us&&e>=2){t>=3&&n.acceptToken(uf,-2);break}else e=0;n.advance()}});function Pk(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const Tk=new vt((n,e)=>{if(n.next==Tc&&n.peek(1)==Us){let t=e.dialectEnabled(mk)||Pk(e.context);n.acceptToken(t?nk:hf,2)}else n.next==Us&&n.acceptToken(hf,1)});function Ac(n,e,t){let i=2+n.length;return new vt(r=>{for(let s=0,o=0,a=0;;a++){if(r.next<0){a&&r.acceptToken(e);break}if(s==0&&r.next==hg||s==1&&r.next==Tc||s>=2&&s<i&&r.next==n.charCodeAt(s-2))s++,o++;else if(s==i&&r.next==Us){a>o?r.acceptToken(e,-o):r.acceptToken(t,-(o-2));break}else if((r.next==10||r.next==13)&&a){r.acceptToken(e,1);break}else s=o=0;r.advance()}})}const Ak=Ac("script",HS,KS),Mk=Ac("style",JS,ek),Rk=Ac("textarea",tk,ik),Lk=dn({"Text RawText IncompleteTag IncompleteCloseTag":x.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":x.angleBracket,TagName:x.tagName,"MismatchedCloseTag/TagName":[x.tagName,x.invalid],AttributeName:x.attributeName,"AttributeValue UnquotedAttributeValue":x.attributeValue,Is:x.definitionOperator,"EntityReference CharacterReference":x.character,Comment:x.blockComment,ProcessingInst:x.processingInstruction,DoctypeDecl:x.documentMeta}),Zk=fn.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)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uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:Qk,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[Lk],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q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!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[Ak,Mk,Rk,Tk,$k,Ck,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function ug(n,e){let t=Object.create(null);for(let i of n.getChildren(lg)){let r=i.getChild(hk),s=i.getChild(Ql)||i.getChild(cg);r&&(t[e.read(r.from,r.to)]=s?s.type.id==Ql?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return t}function mf(n,e){let t=n.getChild(ck);return t?e.read(t.from,t.to):" "}function Oa(n,e,t){let i;for(let r of t)if(!r.attrs||r.attrs(i||(i=ug(n.node.parent.firstChild,e))))return{parser:r.parser,bracketed:!0};return null}function fg(n=[],e=[]){let t=[],i=[],r=[],s=[];for(let a of n)(a.tag=="script"?t:a.tag=="style"?i:a.tag=="textarea"?r:s).push(a);let o=e.length?Object.create(null):null;for(let a of e)(o[a.name]||(o[a.name]=[])).push(a);return rc((a,l)=>{let h=a.type.id;if(h==uk)return Oa(a,l,t);if(h==fk)return Oa(a,l,i);if(h==dk)return Oa(a,l,r);if(h==ag&&s.length){let f=a.node,O=f.firstChild,m=O&&mf(O,l),b;if(m){for(let S of s)if(S.tag==m&&(!S.attrs||S.attrs(b||(b=ug(O,l))))){let Q=f.lastChild,P=Q.type.id==Ok?Q.from:f.to;if(P>O.to)return{parser:S.parser,overlay:[{from:O.to,to:P}]}}}}if(o&&h==lg){let f=a.node,O;if(O=f.firstChild){let m=o[l.read(O.from,O.to)];if(m)for(let b of m){if(b.tagName&&b.tagName!=mf(f.parent,l))continue;let S=f.lastChild;if(S.type.id==Ql){let Q=S.from+1,P=S.lastChild,A=S.to-(P&&P.isError?0:1);if(A>Q)return{parser:b.parser,overlay:[{from:Q,to:A}],bracketed:!0}}else if(S.type.id==cg)return{parser:b.parser,overlay:[{from:S.from,to:S.to}]}}}}return null})}const Ek=135,yf=1,Xk=136,Bk=137,dg=2,Ik=138,Dk=3,_k=4,pg=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],jk=58,Vk=40,Og=95,zk=91,$s=45,Wk=46,Nk=35,Yk=37,qk=38,Fk=92,Gk=10,Uk=42;function Br(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function Mc(n){return n>=48&&n<=57}function bf(n){return Mc(n)||n>=97&&n<=102||n>=65&&n<=70}const gg=(n,e,t)=>(i,r)=>{for(let s=!1,o=0,a=0;;a++){let{next:l}=i;if(Br(l)||l==$s||l==Og||s&&Mc(l))!s&&(l!=$s||a>0)&&(s=!0),o===a&&l==$s&&o++,i.advance();else if(l==Fk&&i.peek(1)!=Gk){if(i.advance(),bf(i.next)){do i.advance();while(bf(i.next));i.next==32&&i.advance()}else i.next>-1&&i.advance();s=!0}else{s&&i.acceptToken(o==2&&r.canShift(dg)?e:l==Vk?t:n);break}}},Hk=new vt(gg(Xk,dg,Bk),{contextual:!0}),Kk=new vt(gg(Ik,Dk,_k),{contextual:!0}),Jk=new vt(n=>{if(pg.includes(n.peek(-1))){let{next:e}=n;(Br(e)||e==Og||e==Nk||e==Wk||e==Uk||e==zk||e==jk&&Br(n.peek(1))||e==$s||e==qk)&&n.acceptToken(Ek)}}),ew=new vt(n=>{if(!pg.includes(n.peek(-1))){let{next:e}=n;if(e==Yk&&(n.advance(),n.acceptToken(yf)),Br(e)){do n.advance();while(Br(n.next)||Mc(n.next));n.acceptToken(yf)}}}),tw=dn({"AtKeyword import charset namespace keyframes media supports font-feature-values":x.definitionKeyword,"from to selector scope MatchFlag":x.keyword,NamespaceName:x.namespace,KeyframeName:x.labelName,KeyframeRangeName:x.operatorKeyword,TagName:x.tagName,ClassName:x.className,PseudoClassName:x.constant(x.className),IdName:x.labelName,"FeatureName PropertyName":x.propertyName,AttributeName:x.attributeName,NumberLiteral:x.number,KeywordQuery:x.keyword,UnaryQueryOp:x.operatorKeyword,"CallTag ValueName FontName":x.atom,VariableName:x.variableName,Callee:x.operatorKeyword,Unit:x.unit,"UniversalSelector NestingSelector":x.definitionOperator,"MatchOp CompareOp":x.compareOperator,"ChildOp SiblingOp, LogicOp":x.logicOperator,BinOp:x.arithmeticOperator,Important:x.modifier,Comment:x.blockComment,ColorLiteral:x.color,"ParenthesizedContent StringLiteral":x.string,":":x.punctuation,"PseudoOp #":x.derefOperator,"; , |":x.separator,"( )":x.paren,"[ ]":x.squareBracket,"{ }":x.brace}),iw={__proto__:null,lang:44,"nth-child":44,"nth-last-child":44,"nth-of-type":44,"nth-last-of-type":44,dir:44,"host-context":44,if:90,url:132,"url-prefix":132,domain:132,regexp:132},nw={__proto__:null,or:104,and:104,not:112,only:112,layer:186},rw={__proto__:null,selector:118,layer:182},sw={__proto__:null,"@import":178,"@media":190,"@charset":194,"@namespace":198,"@keyframes":204,"@supports":216,"@scope":220,"@font-feature-values":226},ow={__proto__:null,to:223},aw=fn.deserialize({version:14,states:"IpQYQdOOO#}QdOOP$UO`OOO%OQaO'#CfOOQP'#Ce'#CeO%VQdO'#CgO%[Q`O'#CgO%aQaO'#FdO&XQdO'#CkO&xQaO'#CcO'SQdO'#CnO'_QdO'#DtO'dQdO'#DvO'oQdO'#D}O'oQdO'#EQOOQP'#Fd'#FdO)OQhO'#EsOOQS'#Fc'#FcOOQS'#Ev'#EvQYQdOOO)VQdO'#EWO*cQhO'#E^O)VQdO'#E`O*jQdO'#EbO*uQdO'#EeO)zQhO'#EkO*}QdO'#EmO+YQdO'#EpO+_QaO'#CfO+fQ`O'#ETO+kQ`O'#FnO+vQdO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nP!RQ#]oQ$|#ZR&Z$}ZmPo!R#Z$}Q${#YQ&X$yR'P&WR$e!qQ&n%oR'm'_R!}gR#PhR$q#PS&O$p&PR'f&wV%|$p&P&wR#XkQ#_qR%Q#_QcOSoP!RU!kco$}R$}#ZQ%Z#pY&`%Z&f'U'^'sQ&f%_Q'U&aQ'^&kR's'kQ$Y!mQ$[!nQ$^!oV%j$Y$[$^Q%t$gR&t%tQ&j%gS']&j'lR'l'^Q&b%ZR'V&bQ&^%WR'T&^Q!QXR#l!QQ&W$yR'O&WQ#[nS%O#[%PR%P#]Q'`&nR'n'`Q$k!xR%x$kQ&P$pR&z&PQ&x&OR'g&xQ#WkR$w#WQ$O!dR%d$O_bOPco!R#Z$}^XOPco!R#Z$}Q!`]Q!a^Q#h|Q#i}Q#j!OQ#k!PQ$s#RQ%W#oR'S&]R%[#pQ!qdQ!zf[$V!m!n!o$Y$[$^Q$y#Yd%Y#p%Z%_&a&f&k'U'^'k'sQ%^#uQ%n$aS&U$y&WQ&[%UQ&}&VR'b&p]$X!m!n!o$Y$[$^Q!d`U!xe!q$eQ#QiQ#x!cS#{!d$OQ$Q!eQ%b#|Q%c#}Q%g$RS%r$g%tQ%w$jR'Z&iQ#z!cQ&h%`R'j'YR%i$RR%X#oQpPR#n!RQ!yeQ$d!qR%q$e",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NamespacedTagSelector NamespaceName TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , PseudoQuery CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName NamespacedAttribute NamespaceName AttributeName MatchOp MatchFlag ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to FontFeatureStatement font-feature-values FontName AtRule Styles",maxTerm:159,nodeProps:[["isolate",-2,5,39,""],["openedBy",23,"(",31,"[",34,"{"],["closedBy",24,")",32,"]",35,"}"]],propSources:[tw],skippedNodes:[0,5,117],repeatNodeCount:17,tokenData:"K`~R!bOX%ZX^&R^p%Zpq&Rqr)ers)vst+jtu2Xuv%Zvw3Rwx3dxy5Ryz5dz{5i{|6S|}:u}!O;W!O!P;u!P!Q<^!Q![=V![!]>Q!]!^>|!^!_?_!_!`@Z!`!a@n!a!b%Z!b!cAo!c!k%Z!k!lC|!l!u%Z!u!vC|!v!}%Z!}#OD_#O#P%Z#P#QDp#Q#R2X#R#]%Z#]#^ER#^#g%Z#g#hC|#h#o%Z#o#pIf#p#qIw#q#rJ`#r#sJq#s#y%Z#y#z&R#z$f%Z$f$g&R$g#BY%Z#BY#BZ&R#BZ$IS%Z$IS$I_&R$I_$I|%Z$I|$JO&R$JO$JT%Z$JT$JU&R$JU$KV%Z$KV$KW&R$KW&FU%Z&FU&FV&R&FV;'S%Z;'S;=`KY<%lO%Z`%^SOy%jz;'S%j;'S;=`%{<%lO%j`%oS!e`Oy%jz;'S%j;'S;=`%{<%lO%j`&OP;=`<%l%j~&Wh$Q~OX%jX^'r^p%jpq'rqy%jz#y%j#y#z'r#z$f%j$f$g'r$g#BY%j#BY#BZ'r#BZ$IS%j$IS$I_'r$I_$I|%j$I|$JO'r$JO$JT%j$JT$JU'r$JU$KV%j$KV$KW'r$KW&FU%j&FU&FV'r&FV;'S%j;'S;=`%{<%lO%j~'yh$Q~!e`OX%jX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K]P;=`<%l%Z",tokenizers:[Jk,ew,Hk,Kk,1,2,3,4,new Gs("m~RRYZ[z{a~~g~aO$T~~dP!P!Qg~lO$U~~",28,142)],topRules:{StyleSheet:[0,6],Styles:[1,116]},dynamicPrecedences:{84:1},specialized:[{term:137,get:n=>iw[n]||-1},{term:138,get:n=>nw[n]||-1},{term:4,get:n=>rw[n]||-1},{term:28,get:n=>sw[n]||-1},{term:136,get:n=>ow[n]||-1}],tokenPrec:2256});let ga=null;function ma(){if(!ga&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));ga=e.sort().map(i=>({type:"property",label:i,apply:i+": "}))}return ga||[]}const vf=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),Sf=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),lw=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),cw=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(n=>({type:"keyword",label:n})),di=/^(\w[\w-]*|-\w[\w-]*|)$/,hw=/^-(-[\w-]*)?$/;function uw(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return i?.name!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const kf=new nc,fw=["Declaration"];function dw(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function mg(n,e,t){if(e.to-e.from>4096){let i=kf.get(e);if(i)return i;let r=[],s=new Set,o=e.cursor(exports.IterMode.IncludeAnonymous);if(o.firstChild())do for(let a of mg(n,o.node,t))s.has(a.label)||(s.add(a.label),r.push(a));while(o.nextSibling());return kf.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(fw)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=n.sliceString(s.from,s.to);r.has(a)||(r.add(a),i.push({label:a,type:"variable"}))}}),i}}const pw=n=>e=>{let{state:t,pos:i}=e,r=ce(t).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:ma(),validFor:di};if(r.name=="ValueName")return{from:r.from,options:Sf,validFor:di};if(r.name=="PseudoClassName")return{from:r.from,options:vf,validFor:di};if(n(r)||(e.explicit||s)&&uw(r,t.doc))return{from:n(r)||s?r.from:i,options:mg(t.doc,dw(r),n),validFor:hw};if(r.name=="TagName"){for(let{parent:l}=r;l;l=l.parent)if(l.name=="Block")return{from:r.from,options:ma(),validFor:di};return{from:r.from,options:lw,validFor:di}}if(r.name=="AtKeyword")return{from:r.from,options:cw,validFor:di};if(!e.explicit)return null;let o=r.resolve(i),a=o.childBefore(i);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:vf,validFor:di}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:Sf,validFor:di}:o.name=="Block"||o.name=="Styles"?{from:i,options:ma(),validFor:di}:null},Ow=pw(n=>n.name=="VariableName"),Hs=ji.define({name:"css",parser:aw.configure({props:[Yi.add({Declaration:Mn()}),qi.add({"Block KeyframeList":yo})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function yg(){return new ut(Hs,Hs.data.of({autocomplete:Ow}))}const gw=316,mw=317,wf=1,yw=2,bw=3,vw=4,Sw=318,kw=320,ww=321,xw=5,Qw=6,$w=0,Cl=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],bg=125,Cw=59,Pl=47,Pw=42,Tw=43,Aw=45,Mw=60,Rw=44,Lw=63,Zw=46,Ew=91,Xw=new Cc({start:!1,shift(n,e){return e==xw||e==Qw||e==kw?n:e==ww},strict:!1}),Bw=new vt((n,e)=>{let{next:t}=n;(t==bg||t==-1||e.context)&&n.acceptToken(Sw)},{contextual:!0,fallback:!0}),Iw=new vt((n,e)=>{let{next:t}=n,i;Cl.indexOf(t)>-1||t==Pl&&((i=n.peek(1))==Pl||i==Pw)||t!=bg&&t!=Cw&&t!=-1&&!e.context&&n.acceptToken(gw)},{contextual:!0}),Dw=new vt((n,e)=>{n.next==Ew&&!e.context&&n.acceptToken(mw)},{contextual:!0}),_w=new vt((n,e)=>{let{next:t}=n;if(t==Tw||t==Aw){if(n.advance(),t==n.next){n.advance();let i=!e.context&&e.canShift(wf);n.acceptToken(i?wf:yw)}}else t==Lw&&n.peek(1)==Zw&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(bw))},{contextual:!0});function ya(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}const jw=new vt((n,e)=>{if(n.next!=Mw||!e.dialectEnabled($w)||(n.advance(),n.next==Pl))return;let t=0;for(;Cl.indexOf(n.next)>-1;)n.advance(),t++;if(ya(n.next,!0)){for(n.advance(),t++;ya(n.next,!1);)n.advance(),t++;for(;Cl.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==Rw)return;for(let i=0;;i++){if(i==7){if(!ya(n.next,!0))return;break}if(n.next!="extends".charCodeAt(i))break;n.advance(),t++}}n.acceptToken(vw,-t)}),Vw=dn({"get set async static":x.modifier,"for while do if else switch try catch finally return throw break continue default case defer":x.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":x.operatorKeyword,"let var const using function class extends":x.definitionKeyword,"import export from":x.moduleKeyword,"with debugger new":x.keyword,TemplateString:x.special(x.string),super:x.atom,BooleanLiteral:x.bool,this:x.self,null:x.null,Star:x.modifier,VariableName:x.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":x.function(x.variableName),VariableDefinition:x.definition(x.variableName),Label:x.labelName,PropertyName:x.propertyName,PrivatePropertyName:x.special(x.propertyName),"CallExpression/MemberExpression/PropertyName":x.function(x.propertyName),"FunctionDeclaration/VariableDefinition":x.function(x.definition(x.variableName)),"ClassDeclaration/VariableDefinition":x.definition(x.className),"NewExpression/VariableName":x.className,PropertyDefinition:x.definition(x.propertyName),PrivatePropertyDefinition:x.definition(x.special(x.propertyName)),UpdateOp:x.updateOperator,"LineComment Hashbang":x.lineComment,BlockComment:x.blockComment,Number:x.number,String:x.string,Escape:x.escape,ArithOp:x.arithmeticOperator,LogicOp:x.logicOperator,BitOp:x.bitwiseOperator,CompareOp:x.compareOperator,RegExp:x.regexp,Equals:x.definitionOperator,Arrow:x.function(x.punctuation),": Spread":x.punctuation,"( )":x.paren,"[ ]":x.squareBracket,"{ }":x.brace,"InterpolationStart InterpolationEnd":x.special(x.brace),".":x.derefOperator,", ;":x.separator,"@":x.meta,TypeName:x.typeName,TypeDefinition:x.definition(x.typeName),"type enum interface implements namespace module declare":x.definitionKeyword,"abstract global Privacy readonly override":x.modifier,"is keyof unique infer asserts":x.operatorKeyword,JSXAttributeValue:x.attributeValue,JSXText:x.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":x.angleBracket,"JSXIdentifier JSXNameSpacedName":x.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":x.attributeName,"JSXBuiltin/JSXIdentifier":x.standard(x.tagName)}),zw={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},Ww={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},Nw={__proto__:null,"<":193},Yw=fn.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6[Q!0MxO'#JsO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO9XQMhO'#F|O9`Q`O'#F{OOQ!0Lf'#Js'#JsOOQ!0Lb'#Jr'#JrO9eQ`O'#GwOOQ['#K_'#K_O9pQ`O'#IYO9uQ!0LrO'#IZOOQ['#J`'#J`OOQ['#I_'#I_Q`QlOOQ`QlOOO9}Q!L^O'#DvO:UQlO'#EOO:]QlO'#EQO9kQ`O'#GsO:dQMhO'#CoO:rQ`O'#EnO:}Q`O'#EyO;hQMhO'#FeO;xQ`O'#GsOOQO'#K`'#K`O;}Q`O'#K`O<]Q`O'#G{O<]Q`O'#G|O<]Q`O'#HOO9kQ`O'#HRO=SQ`O'#HUO>kQ`O'#CeO>{Q`O'#HcO?TQ`O'#HiO?TQ`O'#HkO`QlO'#HmO?TQ`O'#HoO?TQ`O'#HrO?YQ`O'#HxO?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiO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SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:Xw,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[Vw],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku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rec:15201}),vg=[lt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),lt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),lt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),lt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),lt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),lt(`try {
|
|
18
|
+
\${}
|
|
19
|
+
} catch (\${error}) {
|
|
20
|
+
\${}
|
|
21
|
+
}`,{label:"try",detail:"/ catch block",type:"keyword"}),lt("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),lt(`if (\${}) {
|
|
22
|
+
\${}
|
|
23
|
+
} else {
|
|
24
|
+
\${}
|
|
25
|
+
}`,{label:"if",detail:"/ else block",type:"keyword"}),lt(`class \${name} {
|
|
26
|
+
constructor(\${params}) {
|
|
27
|
+
\${}
|
|
28
|
+
}
|
|
29
|
+
}`,{label:"class",detail:"definition",type:"keyword"}),lt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),lt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],qw=vg.concat([lt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),lt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),lt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),xf=new nc,Sg=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function ar(n){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,n),!0}}const Fw=["FunctionDeclaration"],Gw={FunctionDeclaration:ar("function"),ClassDeclaration:ar("class"),ClassExpression:()=>!0,EnumDeclaration:ar("constant"),TypeAliasDeclaration:ar("type"),NamespaceDeclaration:ar("namespace"),VariableDefinition(n,e){n.matchContext(Fw)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function kg(n,e){let t=xf.get(e);if(t)return t;let i=[],r=!0;function s(o,a){let l=n.sliceString(o.from,o.to);i.push({label:l,type:a})}return e.cursor(exports.IterMode.IncludeAnonymous).iterate(o=>{if(r)r=!1;else if(o.name){let a=Gw[o.name];if(a&&a(o,s)||Sg.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of kg(n,o.node))i.push(a);return!1}}),xf.set(e,i),i}const Qf=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,wg=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Uw(n){let e=ce(n.state).resolveInner(n.pos,-1);if(wg.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Qf.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let r=e;r;r=r.parent)Sg.has(r.name)&&(i=i.concat(kg(n.state.doc,r)));return{options:i,from:t?e.from:n.pos,validFor:Qf}}const ui=ji.define({name:"javascript",parser:Yw.configure({props:[Yi.add({IfStatement:Mn({except:/^\s*({|else\b)/}),TryStatement:Mn({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:lc,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:ac({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":Mn({except:/^\s*{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),qi.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":yo,BlockComment(n){return{from:n.from+2,to:n.to-2}},JSXElement(n){let e=n.firstChild;if(!e||e.name=="JSXSelfClosingTag")return null;let t=n.lastChild;return{from:e.to,to:t.type.isError?n.to:t.from}},"JSXSelfClosingTag JSXOpenTag"(n){var e;let t=(e=n.firstChild)===null||e===void 0?void 0:e.nextSibling,i=n.lastChild;return!t||t.type.isError?null:{from:t.to,to:i.type.isError?n.to:i.from}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),xg={test:n=>/^JSX/.test(n.name),facet:zr({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Qg=ui.configure({dialect:"ts"},"typescript"),$g=ui.configure({dialect:"jsx",props:[go.add(n=>n.isTop?[xg]:void 0)]}),Cg=ui.configure({dialect:"jsx ts",props:[go.add(n=>n.isTop?[xg]:void 0)]},"typescript");let Pg=n=>({label:n,type:"keyword"});const Tg="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(Pg),Hw=Tg.concat(["declare","implements","private","protected","public"].map(Pg));function en(n={}){let e=n.jsx?n.typescript?Cg:$g:n.typescript?Qg:ui,t=n.typescript?qw.concat(Hw):vg.concat(Tg);return new ut(e,[ui.data.of({autocomplete:MO(wg,AO(t))}),ui.data.of({autocomplete:Uw}),n.jsx?ex:[]])}function Kw(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function $f(n,e,t=n.length){for(let i=e?.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return n.sliceString(i.from,Math.min(i.to,t));return""}const Jw=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),ex=z.inputHandler.of((n,e,t,i,r)=>{if((Jw?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=">"&&i!="/"||!ui.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:o}=s,a=o.changeByRange(l=>{var h;let{head:f}=l,O=ce(o).resolveInner(f-1,-1),m;if(O.name=="JSXStartTag"&&(O=O.parent),!(o.doc.sliceString(f-1,f)!=i||O.name=="JSXAttributeValue"&&O.to>f)){if(i==">"&&O.name=="JSXFragmentTag")return{range:l,changes:{from:f,insert:"</>"}};if(i=="/"&&O.name=="JSXStartCloseTag"){let b=O.parent,S=b.parent;if(S&&b.from==f-2&&((m=$f(o.doc,S.firstChild,f))||((h=S.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let Q=`${m}>`;return{range:Z.cursor(f+Q.length,-1),changes:{from:f,insert:Q}}}}else if(i==">"){let b=Kw(O);if(b&&b.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(f,f+2))&&(m=$f(o.doc,b,f)))return{range:l,changes:{from:f,insert:`</${m}>`}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),lr=["_blank","_self","_top","_parent"],ba=["ascii","utf-8","utf-16","latin1","latin1"],va=["get","post","put","delete"],Sa=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],kt=["true","false"],G={},tx={a:{attrs:{href:null,ping:null,type:null,media:null,target:lr,hreflang:null}},abbr:G,address:G,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:G,aside:G,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:G,base:{attrs:{href:null,target:lr}},bdi:G,bdo:G,blockquote:{attrs:{cite:null}},body:G,br:G,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Sa,formmethod:va,formnovalidate:["novalidate"],formtarget:lr,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:G,center:G,cite:G,code:G,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:G,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:G,div:G,dl:G,dt:G,em:G,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:G,figure:G,footer:G,form:{attrs:{action:null,name:null,"accept-charset":ba,autocomplete:["on","off"],enctype:Sa,method:va,novalidate:["novalidate"],target:lr}},h1:G,h2:G,h3:G,h4:G,h5:G,h6:G,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:G,hgroup:G,hr:G,html:{attrs:{manifest:null}},i:G,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Sa,formmethod:va,formnovalidate:["novalidate"],formtarget:lr,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:G,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:G,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:G,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:ba,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:G,noscript:G,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:G,param:{attrs:{name:null,value:null}},pre:G,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:G,rt:G,ruby:G,samp:G,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:ba}},section:G,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:G,source:{attrs:{src:null,type:null,media:null}},span:G,strong:G,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:G,summary:G,sup:G,table:G,tbody:G,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:G,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:G,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:G,time:{attrs:{datetime:null}},title:G,tr:G,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:G,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:G},Ag={accesskey:null,class:null,contenteditable:kt,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:kt,autocorrect:kt,autocapitalize:kt,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":kt,"aria-autocomplete":["inline","list","both","none"],"aria-busy":kt,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":kt,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":kt,"aria-hidden":kt,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":kt,"aria-multiselectable":kt,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":kt,"aria-relevant":null,"aria-required":kt,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Mg="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(n=>"on"+n);for(let n of Mg)Ag[n]=null;class Ir{constructor(e,t){this.tags={...tx,...e},this.globalAttrs={...Ag,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Ir.default=new Ir;function zn(n,e,t=n.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?n.sliceString(r.from,Math.min(r.to,t)):""}function Wn(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function Rg(n,e,t){let i=t.tags[zn(n,Wn(e))];return i?.children||t.allTags}function Rc(n,e){let t=[];for(let i=Wn(e);i&&!i.type.isTop;i=Wn(i.parent)){let r=zn(n,i);if(r&&i.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(r)}return t}const Lg=/^[:\-\.\w\u00b7-\uffff]*$/;function Cf(n,e,t,i,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">",o=Wn(t,t.name=="StartTag"||t.name=="TagName");return{from:i,to:r,options:Rg(n.doc,o,e).map(a=>({label:a,type:"type"})).concat(Rc(n.doc,t).map((a,l)=>({label:"/"+a,apply:"/"+a+s,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Pf(n,e,t,i){let r=/\s*>/.test(n.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:Rc(n.doc,e).map((s,o)=>({label:s,apply:s+r,type:"type",boost:99-o})),validFor:Lg}}function ix(n,e,t,i){let r=[],s=0;for(let o of Rg(n.doc,t,e))r.push({label:"<"+o,type:"type"});for(let o of Rc(n.doc,t))r.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function nx(n,e,t,i,r){let s=Wn(t),o=s?e.tags[zn(n.doc,s)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:l.map(h=>({label:h,type:"property"})),validFor:Lg}}function rx(n,e,t,i,r){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),a=[],l;if(o){let h=n.sliceDoc(o.from,o.to),f=e.globalAttrs[h];if(!f){let O=Wn(t),m=O?e.tags[zn(n.doc,O)]:null;f=m?.attrs&&m.attrs[h]}if(f){let O=n.sliceDoc(i,r).toLowerCase(),m='"',b='"';/^['"]/.test(O)?(l=O[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",b=n.sliceDoc(r,r+1)==O[0]?"":O[0],O=O.slice(1),i++):l=/^[^\s<>='"]*$/;for(let S of f)a.push({label:S,apply:m+S+b,type:"constant"})}}return{from:i,to:r,options:a,validFor:l}}function Zg(n,e){let{state:t,pos:i}=e,r=ce(t).resolveInner(i,-1),s=r.resolve(i);for(let o=i,a;s==r&&(a=r.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;s=r=a,o=l.from}return r.name=="TagName"?r.parent&&/CloseTag$/.test(r.parent.name)?Pf(t,r,r.from,i):Cf(t,n,r,r.from,i):r.name=="StartTag"||r.name=="IncompleteTag"?Cf(t,n,r,i,i):r.name=="StartCloseTag"||r.name=="IncompleteCloseTag"?Pf(t,r,i,i):r.name=="OpenTag"||r.name=="SelfClosingTag"||r.name=="AttributeName"?nx(t,n,r,r.name=="AttributeName"?r.from:i,i):r.name=="Is"||r.name=="AttributeValue"||r.name=="UnquotedAttributeValue"?rx(t,n,r,r.name=="Is"?i:r.from,i):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?ix(t,n,r,i):null}function sx(n){return Zg(Ir.default,n)}function ox(n){let{extraTags:e,extraGlobalAttributes:t}=n,i=t||e?new Ir(e,t):Ir.default;return r=>Zg(i,r)}const ax=ui.parser.configure({top:"SingleExpression"}),Eg=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:Qg.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:$g.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:Cg.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:ax},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:ui.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:Hs.parser}],Xg=[{name:"style",parser:Hs.parser.configure({top:"Styles"})}].concat(Mg.map(n=>({name:n,parser:ui.parser}))),Bg=ji.define({name:"html",parser:Zk.configure({props:[Yi.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let i=n.node;;){let r=i.lastChild;if(!r||r.name!="Element"||r.to!=i.to)break;e=i=r}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),qi.add({Element(n){let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:n.to}}}),fc.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Cs=Bg.configure({wrap:fg(Eg,Xg)});function Lc(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=fg((n.nestedLanguages||[]).concat(Eg),(n.nestedAttributes||[]).concat(Xg)));let i=t?Bg.configure({wrap:t,dialect:e}):e?Cs.configure({dialect:e}):Cs;return new ut(i,[Cs.data.of({autocomplete:ox(n)}),n.autoCloseTags!==!1?lx:[],en().support,yg().support])}const Tf=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),lx=z.inputHandler.of((n,e,t,i,r)=>{if(n.composing||n.state.readOnly||e!=t||i!=">"&&i!="/"||!Cs.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:o}=s,a=o.changeByRange(l=>{var h,f,O;let m=o.doc.sliceString(l.from-1,l.to)==i,{head:b}=l,S=ce(o).resolveInner(b,-1),Q;if(m&&i==">"&&S.name=="EndTag"){let P=S.parent;if(((f=(h=P.parent)===null||h===void 0?void 0:h.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(Q=zn(o.doc,P.parent,b))&&!Tf.has(Q)){let A=b+(o.doc.sliceString(b,b+1)===">"?1:0),E=`</${Q}>`;return{range:l,changes:{from:b,to:A,insert:E}}}}else if(m&&i=="/"&&S.name=="IncompleteCloseTag"){let P=S.parent;if(S.from==b-2&&((O=P.lastChild)===null||O===void 0?void 0:O.name)!="CloseTag"&&(Q=zn(o.doc,P,b))&&!Tf.has(Q)){let A=b+(o.doc.sliceString(b,b+1)===">"?1:0),E=`${Q}>`;return{range:Z.cursor(b+E.length,-1),changes:{from:b,to:A,insert:E}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Ig=zr({commentTokens:{block:{open:"<!--",close:"-->"}}}),Dg=new ee,_g=PS.configure({props:[qi.add(n=>!n.is("Block")||n.is("Document")||Tl(n)!=null||cx(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Dg.add(Tl),Yi.add({Document:()=>null}),gi.add({Document:Ig})]});function Tl(n){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(n.name);return e?+e[1]:void 0}function cx(n){return n.name=="OrderedList"||n.name=="BulletList"}function hx(n,e){let t=n;for(;;){let i=t.nextSibling,r;if(!i||(r=Tl(i.type))!=null&&r<=e)break;t=i}return t.to}const ux=cc.of((n,e,t)=>{for(let i=ce(n).resolveInner(t,-1);i&&!(i.from<e);i=i.parent){let r=i.type.prop(Dg);if(r==null)continue;let s=hx(i,r);if(s>t)return{from:t,to:s}}return null});function Zc(n){return new ft(Ig,n,[],"markdown")}const fx=Zc(_g),dx=_g.configure([DS,jS,_S,VS,{props:[qi.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),Nn=Zc(dx);function px(n,e){return t=>{if(t&&n){let i=null;if(t=/\S*/.exec(t)[0],typeof n=="function"?i=n(t):i=hn.matchLanguageName(n,t,!0),i instanceof hn)return i.support?i.support.language.parser:Vi.getSkippingParser(i.load());if(i)return i.parser}return e?e.parser:null}}class ka{constructor(e,t,i,r,s,o,a){this.node=e,this.from=t,this.to=i,this.spaceBefore=r,this.spaceAfter=s,this.type=o,this.item=a}blank(e,t=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;i.length<e;)i+=" ";return i}else{for(let r=this.to-this.from-i.length-this.spaceAfter.length;r>0;r--)i+=" ";return i+(t?this.spaceAfter:"")}}marker(e,t){let i=this.node.name=="OrderedList"?String(+Vg(this.item,e)[2]+t):"";return this.spaceBefore+i+this.type+this.spaceAfter}}function jg(n,e){let t=[],i=[];for(let r=n;r;r=r.parent){if(r.name=="FencedCode")return i;(r.name=="ListItem"||r.name=="Blockquote")&&t.push(r)}for(let r=t.length-1;r>=0;r--){let s=t[r],o,a=e.lineAt(s.from),l=s.from-a.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(l))))i.push(new ka(s,l,l+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let h=o[3],f=o[0].length;h.length>=4&&(h=h.slice(0,h.length-4),f-=4),i.push(new ka(s.parent,l,l+f,o[1],h,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let h=o[4],f=o[0].length;h.length>4&&(h=h.slice(0,h.length-4),f-=4);let O=o[2];o[3]&&(O+=o[3].replace(/[xX]/," ")),i.push(new ka(s.parent,l,l+f,o[1],h,O,s))}}return i}function Vg(n,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function wa(n,e,t,i=0){for(let r=-1,s=n;;){if(s.name=="ListItem"){let a=Vg(s,e),l=+a[2];if(r>=0){if(l!=r+1)return;t.push({from:s.from+a[1].length,to:s.from+a[0].length,insert:String(r+2+i)})}r=l}let o=s.nextSibling;if(!o)break;s=o}}function Ec(n,e){let t=/^[ \t]*/.exec(n)[0].length;if(!t||e.facet(zi)!=" ")return n;let i=Si(n,4,t),r="";for(let s=i;s>0;)s>=4?(r+=" ",s-=4):(r+=" ",s--);return r+n.slice(t)}const Ox=(n={})=>({state:e,dispatch:t})=>{let i=ce(e),{doc:r}=e,s=null,o=e.changeByRange(a=>{if(!a.empty||!Nn.isActiveAt(e,a.from,-1)&&!Nn.isActiveAt(e,a.from,1))return s={range:a};let l=a.from,h=r.lineAt(l),f=jg(i.resolveInner(l,-1),r);for(;f.length&&f[f.length-1].from>l-h.from;)f.pop();if(!f.length)return s={range:a};let O=f[f.length-1];if(O.to-O.spaceAfter.length>l-h.from)return s={range:a};let m=l>=O.to-O.spaceAfter.length&&!/\S/.test(h.text.slice(O.to));if(O.item&&m){let A=O.node.firstChild,E=O.node.getChild("ListItem","ListItem");if(A.to>=l||E&&E.to<l||h.from>0&&!/[^\s>]/.test(r.lineAt(h.from-1).text)||n.nonTightLists===!1){let B=f.length>1?f[f.length-2]:null,U,W="";B&&B.item?(U=h.from+B.from,W=B.marker(r,1)):U=h.from+(B?B.to:0);let Y=[{from:U,to:l,insert:W}];return O.node.name=="OrderedList"&&wa(O.item,r,Y,-2),B&&B.node.name=="OrderedList"&&wa(B.item,r,Y),{range:Z.cursor(U+W.length),changes:Y}}else{let B=Mf(f,e,h);return{range:Z.cursor(l+B.length+1),changes:{from:h.from,insert:B+e.lineBreak}}}}if(O.node.name=="Blockquote"&&m&&h.from){let A=r.lineAt(h.from-1),E=/>\s*$/.exec(A.text);if(E&&E.index==O.from){let B=e.changes([{from:A.from+E.index,to:A.to},{from:h.from+O.from,to:h.to}]);return{range:a.map(B),changes:B}}}let b=[];O.node.name=="OrderedList"&&wa(O.item,r,b);let S=O.item&&O.item.from<h.from,Q="";if(!S||/^[\s\d.)\-+*>]*/.exec(h.text)[0].length>=O.to)for(let A=0,E=f.length-1;A<=E;A++)Q+=A==E&&!S?f[A].marker(r,1):f[A].blank(A<E?Si(h.text,4,f[A+1].from)-Q.length:null);let P=l;for(;P>h.from&&/\s/.test(h.text.charAt(P-h.from-1));)P--;return Q=Ec(Q,e),mx(O.node,e.doc)&&(Q=Mf(f,e,h)+e.lineBreak+Q),b.push({from:P,to:l,insert:e.lineBreak+Q}),{range:Z.cursor(P+Q.length+1),changes:b}});return s?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},gx=Ox();function Af(n){return n.name=="QuoteMark"||n.name=="ListMark"}function mx(n,e){if(n.name!="OrderedList"&&n.name!="BulletList")return!1;let t=n.firstChild,i=n.getChild("ListItem","ListItem");if(!i)return!1;let r=e.lineAt(t.to),s=e.lineAt(i.from),o=/^[\s>]*$/.test(r.text);return r.number+(o?0:1)<s.number}function Mf(n,e,t){let i="";for(let r=0,s=n.length-2;r<=s;r++)i+=n[r].blank(r<s?Si(t.text,4,n[r+1].from)-i.length:null,r<s);return Ec(i,e)}function yx(n,e){let t=n.resolveInner(e,-1),i=e;Af(t)&&(i=t.from,t=t.parent);for(let r;r=t.childBefore(i);)if(Af(r))i=r.from;else if(r.name=="OrderedList"||r.name=="BulletList")t=r.lastChild,i=t.to;else break;return t}const bx=({state:n,dispatch:e})=>{let t=ce(n),i=null,r=n.changeByRange(s=>{let o=s.from,{doc:a}=n;if(s.empty&&Nn.isActiveAt(n,s.from)){let l=a.lineAt(o),h=jg(yx(t,o),a);if(h.length){let f=h[h.length-1],O=f.to-f.spaceAfter.length+(f.spaceAfter?1:0);if(o-l.from>O&&!/\S/.test(l.text.slice(O,o-l.from)))return{range:Z.cursor(l.from+O),changes:{from:l.from+O,to:o}};if(o-l.from==O&&(!f.item||l.from<=f.item.from||!/\S/.test(l.text.slice(0,f.to)))){let m=l.from+f.from;if(f.item&&f.node.from<f.item.from&&/\S/.test(l.text.slice(f.from,f.to))){let b=f.blank(Si(l.text,4,f.to)-Si(l.text,4,f.from));return m==l.from&&(b=Ec(b,n)),{range:Z.cursor(m+b.length),changes:{from:m,to:l.from+f.to,insert:b}}}if(m<o)return{range:Z.cursor(m),changes:{from:m,to:o}}}}}return i={range:s}});return i?!1:(e(n.update(r,{scrollIntoView:!0,userEvent:"delete"})),!0)},vx=[{key:"Enter",run:gx},{key:"Backspace",run:bx}],zg=Lc({matchClosingTags:!1});function Sx(n={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:i=!0,base:{parser:r}=fx,completeHTMLTags:s=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=zg}=n;if(!(r instanceof $o))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=n.extensions?[n.extensions]:[],h=[a.support,ux],f;o&&h.push(Qx),t instanceof ut?(h.push(t.support),f=t.language):t&&(f=t);let O=e||f?px(e,f):void 0;l.push(AS({codeParser:O,htmlParser:a.language.parser})),i&&h.push(wi.high(Li.of(vx)));let m=Zc(r.configure(l));return s&&h.push(m.data.of({autocomplete:kx})),new ut(m,h)}function kx(n){let{state:e,pos:t}=n,i=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!i)return null;let r=ce(e).resolveInner(t,-1);for(;r&&!r.type.isTop;){if(r.name=="CodeBlock"||r.name=="FencedCode"||r.name=="ProcessingInstructionBlock"||r.name=="CommentBlock"||r.name=="Link"||r.name=="Image")return null;r=r.parent}return{from:t-i[0].length,to:t,options:wx(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let xa=null;function wx(){if(xa)return xa;let n=sx(new tS(he.create({extensions:zg}),0,!0));return xa=n?n.options:[]}const xx=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Qx=z.domEventHandlers({paste:(n,e)=>{var t;let{main:i}=e.state.selection;if(i.empty)return!1;let r=(t=n.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r="https://"+r),!Nn.isActiveAt(e.state,i.from,1)))return!1;let s=ce(e.state),o=!1;return s.iterate({from:i.from,to:i.to,enter:a=>{(a.from>i.from||xx.test(a.name))&&(o=!0)},leave:a=>{a.to<i.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:i.from,insert:"["},{from:i.to,insert:`](${r})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),Rf=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Wg{constructor(e,t,i=0,r=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,r),this.bufferStart=i,this.normalize=s?a=>s(Rf(a)):Rf,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Od(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=M0(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=gd(e);let r=this.normalize(t);if(r.length)for(let s=0,o=i;;s++){let a=r.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==r.length-1){if(l)return this.value=l,this;break}o==i&&s<t.length&&t.charCodeAt(s)==a&&o++}}}match(e,t,i){let r=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?r={from:this.matches[s+1],to:i}:(this.matches[s]++,a=!0)),a||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?r={from:t,to:i}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}typeof Symbol<"u"&&(Wg.prototype[Symbol.iterator]=function(){return this});const Ng={from:-1,to:-1,match:/.*/.exec("")},Xc="gm"+(/x/.unicode==null?"":"u");class Bc{constructor(e,t,i,r=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=Ng,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new Yg(e,t,i,r,s);this.re=new RegExp(t,Xc+(i?.ignoreCase?"i":"")),this.test=i?.test,this.iter=e.iter();let o=e.lineAt(r);this.curLineStart=o.from,this.matchPos=Ks(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,r=i+t[0].length;if(this.matchPos=Ks(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<r||i>this.value.to)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const Qa=new WeakMap;class Zn{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,i){let r=Qa.get(e);if(!r||r.from>=i||r.to<=t){let a=new Zn(t,e.sliceString(t,i));return Qa.set(e,a),a}if(r.from==t&&r.to==i)return r;let{text:s,from:o}=r;return o>t&&(s=e.sliceString(t,o)+s,o=t),r.to<i&&(s+=e.sliceString(r.to,i)),Qa.set(e,new Zn(o,s)),new Zn(t,s.slice(t-o,i-o))}}class Yg{constructor(e,t,i,r,s){this.text=e,this.to=s,this.done=!1,this.value=Ng,this.matchPos=Ks(e,r),this.re=new RegExp(t,Xc+(i?.ignoreCase?"i":"")),this.test=i?.test,this.flat=Zn.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,r=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this.matchPos=Ks(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Zn.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Bc.prototype[Symbol.iterator]=Yg.prototype[Symbol.iterator]=function(){return this});function $x(n){try{return new RegExp(n,Xc),!0}catch{return!1}}function Ks(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e<t.to&&(i=t.text.charCodeAt(e-t.from))>=56320&&i<57344;)e++;return e}class Cx{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||$x(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?`
|
|
30
|
+
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Lx(this):new Ax(this)}getCursor(e,t=0,i){let r=e.doc?e:he.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?wn(this,r,t,i):kn(this,r,t,i)}}class qg{constructor(e){this.spec=e}}function Px(n,e,t){return(i,r,s,o)=>{if(t&&!t(i,r,s,o))return!1;let a=i>=o&&r<=o+s.length?s.slice(i-o,r-o):e.doc.sliceString(i,r);return n(a,e,i,r)}}function kn(n,e,t,i){let r;return n.wholeWord&&(r=Tx(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(r=Px(n.test,e,r)),new Wg(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),r)}function Tx(n,e){return(t,i,r,s)=>((s>t||s+r.length<i)&&(s=Math.max(0,t-2),r=n.sliceString(s,Math.min(n.length,i+2))),(e(Js(r,t-s))!=Ke.Word||e(eo(r,t-s))!=Ke.Word)&&(e(eo(r,i-s))!=Ke.Word||e(Js(r,i-s))!=Ke.Word))}class Ax extends qg{constructor(e){super(e)}nextMatch(e,t,i){let r=kn(this.spec,e,i,e.doc.length).nextOverlapping();if(r.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);r=kn(this.spec,e,0,s).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==i?null:r.value}prevMatchInRange(e,t,i){for(let r=i;;){let s=Math.max(t,r-1e4-this.spec.unquoted.length),o=kn(this.spec,e,s,r),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;r-=1e4}}prevMatch(e,t,i){let r=this.prevMatchInRange(e,0,t);return r||(r=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),r&&(r.from!=t||r.to!=i)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=kn(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=kn(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function Mx(n,e,t){return(i,r,s)=>(!t||t(i,r,s))&&n(s[0],e,i,r)}function wn(n,e,t,i){let r;return n.wholeWord&&(r=Rx(e.charCategorizer(e.selection.main.head))),n.test&&(r=Mx(n.test,e,r)),new Bc(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:r},t,i)}function Js(n,e){return n.slice(Ne(n,e,!1),e)}function eo(n,e){return n.slice(e,Ne(n,e))}function Rx(n){return(e,t,i)=>!i[0].length||(n(Js(i.input,i.index))!=Ke.Word||n(eo(i.input,i.index))!=Ke.Word)&&(n(eo(i.input,i.index+i[0].length))!=Ke.Word||n(Js(i.input,i.index+i[0].length))!=Ke.Word)}class Lx extends qg{nextMatch(e,t,i){let r=wn(this.spec,e,i,e.doc.length).next();return r.done&&(r=wn(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let s=Math.max(t,i-r*1e4),o=wn(this.spec,e,s,i),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let r=i.length;r>0;r--){let s=+i.slice(0,r);if(s>0&&s<e.match.length)return e.match[s]+i.slice(r)}return t})}matchAll(e,t){let i=wn(this.spec,e,0,e.doc.length),r=[];for(;!i.next().done;){if(r.length>=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=wn(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const Al=Oe.define();function Zx(n){var e=n.Pos;function t(c,u,d){if(u.line===d.line&&u.ch>=d.ch-1){var p=c.getLine(u.line),g=p.charCodeAt(u.ch);55296<=g&&g<=55551&&(d.ch+=1)}return{start:u,end:d}}var i=[{keys:"<Left>",type:"keyToKey",toKeys:"h"},{keys:"<Right>",type:"keyToKey",toKeys:"l"},{keys:"<Up>",type:"keyToKey",toKeys:"k"},{keys:"<Down>",type:"keyToKey",toKeys:"j"},{keys:"g<Up>",type:"keyToKey",toKeys:"gk"},{keys:"g<Down>",type:"keyToKey",toKeys:"gj"},{keys:"<Space>",type:"keyToKey",toKeys:"l"},{keys:"<BS>",type:"keyToKey",toKeys:"h"},{keys:"<Del>",type:"keyToKey",toKeys:"x"},{keys:"<C-Space>",type:"keyToKey",toKeys:"W"},{keys:"<C-BS>",type:"keyToKey",toKeys:"B"},{keys:"<S-Space>",type:"keyToKey",toKeys:"w"},{keys:"<S-BS>",type:"keyToKey",toKeys:"b"},{keys:"<C-n>",type:"keyToKey",toKeys:"j"},{keys:"<C-p>",type:"keyToKey",toKeys:"k"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-[>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-c>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>"},{keys:"<C-Esc>",type:"keyToKey",toKeys:"<Esc>",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"<Home>",type:"keyToKey",toKeys:"0"},{keys:"<End>",type:"keyToKey",toKeys:"$"},{keys:"<PageUp>",type:"keyToKey",toKeys:"<C-b>"},{keys:"<PageDown>",type:"keyToKey",toKeys:"<C-f>"},{keys:"<CR>",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"<Ins>",type:"keyToKey",toKeys:"i",context:"normal"},{keys:"<Ins>",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"(",type:"motion",motion:"moveBySentence",motionArgs:{forward:!1}},{keys:")",type:"motion",motion:"moveBySentence",motionArgs:{forward:!0}},{keys:"<C-f>",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"<C-b>",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"<C-d>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"<C-u>",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"g$",type:"motion",motion:"moveToEndOfDisplayLine"},{keys:"g^",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"g0",type:"motion",motion:"moveToStartOfDisplayLine"},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F<character>",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T<character>",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`<register>",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[<character>",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:"=",type:"operator",operator:"indentAuto"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"gn",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!0}},{keys:"gN",type:"motion",motion:"findAndSelectNextInclusive",motionArgs:{forward:!1}},{keys:"gq",type:"operator",operator:"hardWrap"},{keys:"gw",type:"operator",operator:"hardWrap",operatorArgs:{keepCursor:!0}},{keys:"g?",type:"operator",operator:"rot13"},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"expandToLine",motionArgs:{linewise:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"<C-u>",type:"operatorMotion",operator:"delete",motion:"moveToStartOfLine",context:"insert"},{keys:"<C-w>",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"<C-w>",type:"idle",context:"normal"},{keys:"<C-i>",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"<C-o>",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"<C-e>",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"<C-y>",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"gi",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"lastEdit"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"gI",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"bol"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"<C-v>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"<C-q>",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"gJ",type:"action",action:"joinLines",actionArgs:{keepSpaces:!0},isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r<character>",type:"action",action:"replace",isEdit:!0},{keys:"@<register>",type:"action",action:"replayMacro"},{keys:"q<register>",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0},context:"normal"},{keys:"R",type:"operator",operator:"change",operatorArgs:{linewise:!0,fullLine:!0},context:"visual",exitVisualBlock:!0},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"<C-r>",type:"action",action:"redo"},{keys:"m<register>",type:"action",action:"setMark"},{keys:'"<register>',type:"action",action:"setRegister"},{keys:"<C-r><register>",type:"action",action:"insertRegister",context:"insert",isEdit:!0},{keys:"<C-o>",type:"action",action:"oneNormalCommand",context:"insert"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z<CR>",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"<C-a>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"<C-x>",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"<C-t>",type:"action",action:"indent",actionArgs:{indentRight:!0},context:"insert"},{keys:"<C-d>",type:"action",action:"indent",actionArgs:{indentRight:!1},context:"insert"},{keys:"a<register>",type:"motion",motion:"textObjectManipulation"},{keys:"i<register>",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],r=Object.create(null),s=i.length,o=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"omap",shortName:"om"},{name:"noremap",shortName:"no"},{name:"nnoremap",shortName:"nn"},{name:"vnoremap",shortName:"vn"},{name:"inoremap",shortName:"ino"},{name:"onoremap",shortName:"ono"},{name:"unmap"},{name:"mapclear",shortName:"mapc"},{name:"nmapclear",shortName:"nmapc"},{name:"vmapclear",shortName:"vmapc"},{name:"imapclear",shortName:"imapc"},{name:"omapclear",shortName:"omapc"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"startinsert",shortName:"start"},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"marks",excludeFromCommandHistory:!0},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"vglobal",shortName:"v"},{name:"delete",shortName:"d"},{name:"join",shortName:"j"},{name:"normal",shortName:"norm"},{name:"global",shortName:"g"}],a=qc("");function l(c){c.setOption("disableInput",!0),c.setOption("showCursorWhenSelecting",!1),n.signal(c,"vim-mode-change",{mode:"normal"}),c.on("cursorActivity",bh),Pt(c),n.on(c.getInputField(),"paste",f(c))}function h(c){c.setOption("disableInput",!1),c.off("cursorActivity",bh),n.off(c.getInputField(),"paste",f(c)),c.state.vim=null,Jn&&clearTimeout(Jn)}function f(c){var u=c.state.vim;return u.onPasteFn||(u.onPasteFn=function(){u.insertMode||(c.setCursor(_e(c.getCursor(),0,1)),mn.enterInsertMode(c,{},u))}),u.onPasteFn}var O=/[\d]/,m=[n.isWordChar,function(c){return c&&!n.isWordChar(c)&&!/\s/.test(c)}],b=[function(c){return/\S/.test(c)}],S=["<",">"],Q=["-",'"',".",":","_","/","+"],P=/^\w$/,A=/^[A-Z]$/;try{A=new RegExp("^[\\p{Lu}]$","u")}catch{}function E(c,u){return u>=c.firstLine()&&u<=c.lastLine()}function B(c){return/^[a-z]$/.test(c)}function U(c){return"()[]{}".indexOf(c)!=-1}function W(c){return O.test(c)}function Y(c){return A.test(c)}function _(c){return/^\s*$/.test(c)}function ge(c){return".?!".indexOf(c)!=-1}function ve(c,u){for(var d=0;d<u.length;d++)if(u[d]==c)return!0;return!1}var me={};function ne(c,u,d,p,g){if(u===void 0&&!g)throw Error("defaultValue is required unless callback is provided");if(d||(d="string"),me[c]={type:d,defaultValue:u,callback:g},p)for(var y=0;y<p.length;y++)me[p[y]]=me[c];u&&J(c,u)}function J(c,u,d,p){var g=me[c];p=p||{};var y=p.scope;if(!g)return new Error("Unknown option: "+c);if(g.type=="boolean"){if(u&&u!==!0)return new Error("Invalid argument: "+c+"="+u);u!==!1&&(u=!0)}g.callback?(y!=="local"&&g.callback(u,void 0),y!=="global"&&d&&g.callback(u,d)):(y!=="local"&&(g.value=g.type=="boolean"?!!u:u),y!=="global"&&d&&(d.state.vim.options[c]={value:u}))}function ae(c,u,d){var p=me[c];d=d||{};var g=d.scope;if(!p)return new Error("Unknown option: "+c);if(p.callback){let y=u&&p.callback(void 0,u);return g!=="global"&&y!==void 0?y:g!=="local"?p.callback():void 0}else return(g!=="global"&&u&&u.state.vim.options[c]||g!=="local"&&p||{}).value}ne("filetype",void 0,"string",["ft"],function(c,u){if(u!==void 0)if(c===void 0){let d=u.getOption("mode");return d=="null"?"":d}else{let d=c==""?"null":c;u.setOption("mode",d)}}),ne("textwidth",80,"number",["tw"],function(c,u){if(u!==void 0)if(c===void 0){var d=u.getOption("textwidth");return d}else{var p=Math.round(c);p>1&&u.setOption("textwidth",p)}});var Pe=function(){var c=100,u=-1,d=0,p=0,g=new Array(c);function y(w,C,$){var M=u%c,R=g[M];function L(X){var I=++u%c,K=g[I];K&&K.clear(),g[I]=w.setBookmark(X)}if(R){var T=R.find();T&&!At(T,C)&&L(C)}else L(C);L($),d=u,p=u-c+1,p<0&&(p=0)}function v(w,C){u+=C,u>d?u=d:u<p&&(u=p);var $=g[(c+u)%c];if($&&!$.find()){var M=C>0?1:-1,R,L=w.getCursor();do if(u+=M,$=g[(c+u)%c],$&&(R=$.find())&&!At(L,R))break;while(u<d&&u>p)}return $}function k(w,C){var $=u,M=v(w,C);return u=$,M&&M.find()}return{cachedCursor:void 0,add:y,find:k,move:v}},De=function(c){return c?{changes:c.changes,expectCursorActivityForChange:c.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};class qt{constructor(){this.latestRegister=void 0,this.isPlaying=!1,this.isRecording=!1,this.replaySearchQueries=[],this.onRecordingDone=void 0,this.lastInsertModeChanges=De()}exitMacroRecordMode(){var u=N.macroModeState;u.onRecordingDone&&u.onRecordingDone(),u.onRecordingDone=void 0,u.isRecording=!1}enterMacroRecordMode(u,d){var p=N.registerController.getRegister(d);if(p){if(p.clear(),this.latestRegister=d,u.openDialog){var g=_t("span",{class:"cm-vim-message"},"recording @"+d);this.onRecordingDone=u.openDialog(g,function(){},{bottom:!0})}this.isRecording=!0}}}function Pt(c){return c.state.vim||(c.state.vim={inputState:new Fc,lastEditInputState:void 0,lastEditActionCommand:void 0,lastHPos:-1,lastHSPos:-1,lastMotion:null,marks:{},insertMode:!1,insertModeReturn:!1,insertModeRepeat:void 0,visualMode:!1,visualLine:!1,visualBlock:!1,lastSelection:null,lastPastedText:void 0,sel:{anchor:new e(0,0),head:new e(0,0)},options:{},expectLiteralNext:!1,status:""}),c.state.vim}var N;function Ft(){N={searchQuery:null,searchIsReversed:!1,lastSubstituteReplacePart:void 0,jumpList:Pe(),macroModeState:new qt,lastCharacterSearch:{increment:0,forward:!0,selectedCharacter:""},registerController:new Lm({}),searchHistoryController:new Gc,exCommandHistoryController:new Gc};for(var c in me){var u=me[c];u.value=u.defaultValue}}class pn{constructor(u,d){this.keyName=u,this.key=d.key,this.ctrlKey=d.ctrlKey,this.altKey=d.altKey,this.metaKey=d.metaKey,this.shiftKey=d.shiftKey}}var st,xe={enterVimMode:l,leaveVimMode:h,buildKeyMap:function(){},getRegisterController:function(){return N.registerController},resetVimGlobalState_:Ft,getVimGlobalState_:function(){return N},maybeInitVimState_:Pt,suppressErrorLogging:!1,InsertModeKey:pn,map:function(c,u,d){pt.map(c,u,d)},unmap:function(c,u){return pt.unmap(c,u)},noremap:function(c,u,d){pt.map(c,u,d,!0)},mapclear:function(c){var u=i.length,d=s,p=i.slice(0,u-d);if(i=i.slice(u-d),c)for(var g=p.length-1;g>=0;g--){var y=p[g];if(c!==y.context)if(y.context)this._mapCommand(y);else{var v=["normal","insert","visual"];for(var k in v)if(v[k]!==c){var w=Object.assign({},y);w.context=v[k],this._mapCommand(w)}}}},langmap:Yc,vimKeyFromEvent:Hn,setOption:J,getOption:ae,defineOption:ne,defineEx:function(c,u,d){if(!u)u=c;else if(c.indexOf(u)!==0)throw new Error('(Vim.defineEx) "'+u+'" is not a prefix of "'+c+'", command not registered');mh[c]=d,pt.commandMap_[u]={name:c,shortName:u,type:"api"}},handleKey:function(c,u,d){var p=this.findKey(c,u,d);if(typeof p=="function")return p()},multiSelectHandleKey:k0,findKey:function(c,u,d){var p=Pt(c),g=c;function y(){var $=N.macroModeState;if($.isRecording){if(u=="q")return $.exitMacroRecordMode(),ze(g),!0;d!="mapping"&&b0($,u)}}function v(){if(u=="<Esc>"){if(p.visualMode)Ht(g);else if(p.insertMode)Ci(g);else return;return ze(g),!0}}function k(){if(v())return!0;p.inputState.keyBuffer.push(u);var $=p.inputState.keyBuffer.join(""),M=u.length==1,R=Ui.matchCommand($,i,p.inputState,"insert"),L=p.inputState.changeQueue;if(R.type=="none")return ze(g),!1;if(R.type=="partial"){if(R.expectLiteralNext&&(p.expectLiteralNext=!0),st&&window.clearTimeout(st),st=M&&window.setTimeout(function(){p.insertMode&&p.inputState.keyBuffer.length&&ze(g)},ae("insertModeEscKeysTimeout")),M){var T=g.listSelections();(!L||L.removed.length!=T.length)&&(L=p.inputState.changeQueue=new Mm),L.inserted+=u;for(var X=0;X<T.length;X++){var I=at(T[X].anchor,T[X].head),K=$i(T[X].anchor,T[X].head),V=g.getRange(I,g.state.overwrite?_e(K,0,1):K);L.removed[X]=(L.removed[X]||"")+V}}return!M}else R.type=="full"&&(p.inputState.keyBuffer.length=0);if(p.expectLiteralNext=!1,st&&window.clearTimeout(st),R.command&&L){for(var T=g.listSelections(),X=0;X<T.length;X++){var ie=T[X].head;g.replaceRange(L.removed[X]||"",_e(ie,0,-L.inserted.length),ie,"+input")}N.macroModeState.lastInsertModeChanges.changes.pop()}return R.command||ze(g),R.command}function w(){if(y()||v())return!0;p.inputState.keyBuffer.push(u);var $=p.inputState.keyBuffer.join("");if(/^[1-9]\d*$/.test($))return!0;var M=/^(\d*)(.*)$/.exec($);if(!M)return ze(g),!1;var R=p.visualMode?"visual":"normal",L=M[2]||M[1];p.inputState.operatorShortcut&&p.inputState.operatorShortcut.slice(-1)==L&&(L=p.inputState.operatorShortcut);var T=Ui.matchCommand(L,i,p.inputState,R);return T.type=="none"?(ze(g),!1):T.type=="partial"?(T.expectLiteralNext&&(p.expectLiteralNext=!0),!0):T.type=="clear"?(ze(g),!0):(p.expectLiteralNext=!1,p.inputState.keyBuffer.length=0,M=/^(\d*)(.*)$/.exec($),M&&M[1]&&M[1]!="0"&&p.inputState.pushRepeatDigit(M[1]),T.command)}var C=p.insertMode?k():w();if(C===!1)return!p.insertMode&&(u.length===1||n.isMac&&/<A-.>/.test(u))?function(){return!0}:void 0;if(C===!0)return function(){return!0};if(C)return function(){return g.operation(function(){g.curOp.isVimOp=!0;try{if(typeof C!="object")return;C.type=="keyToKey"?Qi(g,C.toKeys,C):Ui.processCommand(g,p,C)}catch($){throw g.state.vim=void 0,Pt(g),xe.suppressErrorLogging||console.log($),$}return!0})}},handleEx:function(c,u){pt.processCommand(c,u)},defineMotion:Zm,defineAction:Xm,defineOperator:Em,mapCommand:m0,_mapCommand:jo,defineRegister:Rm,exitVisualMode:Ht,exitInsertMode:Ci},Ye=[],Tt=!1,Se;function On(c){if(!Se)throw new Error("No prompt to send key to");if(c[0]=="<"){var u=c.toLowerCase().slice(1,-1),d=u.split("-");if(u=d.pop()||"",u=="lt")c="<";else if(u=="space")c=" ";else if(u=="cr")c=`
|
|
31
|
+
`;else if(gn[u]){var p=Se.value||"",g={key:gn[u],target:{value:p,selectionEnd:p.length,selectionStart:p.length}};Se.onKeyDown&&Se.onKeyDown(g,Se.value,v),Se&&Se.onKeyUp&&Se.onKeyUp(g,Se.value,v);return}}if(c==`
|
|
32
|
+
`){var y=Se;Se=null,y.onClose&&y.onClose(y.value)}else Se.value=(Se.value||"")+c;function v(k){Se&&(typeof k=="string"?Se.value=k:Se=null)}}function Qi(c,u,d){var p=Tt;if(d){if(Ye.indexOf(d)!=-1)return;Ye.push(d),Tt=d.noremap!=!1}try{for(var g=Pt(c),y=/<(?:[CSMA]-)*\w+>|./gi,v;v=y.exec(u);){var k=v[0],w=g.insertMode;if(Se){On(k);continue}var C=xe.handleKey(c,k,"mapping");if(!C&&w&&g.insertMode){if(k[0]=="<"){var $=k.toLowerCase().slice(1,-1),M=$.split("-");if($=M.pop()||"",$=="lt")k="<";else if($=="space")k=" ";else if($=="cr")k=`
|
|
33
|
+
`;else if(gn.hasOwnProperty($)){k=gn[$],wh(c,k);continue}else k=k[0],y.lastIndex=v.index+1}c.replaceSelection(k)}}}finally{if(Ye.pop(),Tt=Ye.length?p:!1,!Ye.length&&Se){var R=Se;Se=null,Gr(c,R)}}}var Lo={Return:"CR",Backspace:"BS",Delete:"Del",Escape:"Esc",Insert:"Ins",ArrowLeft:"Left",ArrowRight:"Right",ArrowUp:"Up",ArrowDown:"Down",Enter:"CR"," ":"Space"},Am={Shift:1,Alt:1,Command:1,Control:1,CapsLock:1,AltGraph:1,Dead:1,Unidentified:1},gn={};"Left|Right|Up|Down|End|Home".split("|").concat(Object.keys(Lo)).forEach(function(c){gn[(Lo[c]||"").toLowerCase()]=gn[c.toLowerCase()]=c});function Hn(c,u){var d=c.key;if(!Am[d]){d.length>1&&d[0]=="n"&&(d=d.replace("Numpad","")),d=Lo[d]||d;var p="";if(c.ctrlKey&&(p+="C-"),c.altKey&&(p+="A-"),c.metaKey&&(p+="M-"),n.isMac&&p=="A-"&&d.length==1&&(p=p.slice(2)),(p||d.length>1)&&c.shiftKey&&(p+="S-"),u&&!u.expectLiteralNext&&d.length==1){if(a.keymap&&d in a.keymap)(a.remapCtrl!=!1||!p)&&(d=a.keymap[d]);else if(d.charCodeAt(0)>128&&!r[d]){var g=c.code?.slice(-1)||"";c.shiftKey||(g=g.toLowerCase()),g&&(d=g,!p&&c.altKey&&(p="A-"))}}return p+=d,p.length>1&&(p="<"+p+">"),p}}function Yc(c,u){a.string!==c&&(a=qc(c)),a.remapCtrl=u}function qc(c){let u={};if(!c)return{keymap:u,string:""};function d(p){return p.split(/\\?(.)/).filter(Boolean)}return c.split(/((?:[^\\,]|\\.)+),/).map(p=>{if(!p)return;const g=p.split(/((?:[^\\;]|\\.)+);/);if(g.length==3){const y=d(g[1]),v=d(g[2]);if(y.length!==v.length)return;for(let k=0;k<y.length;++k)u[y[k]]=v[k]}else if(g.length==1){const y=d(p);if(y.length%2!==0)return;for(let v=0;v<y.length;v+=2)u[y[v]]=y[v+1]}}),{keymap:u,string:c}}ne("langmap",void 0,"string",["lmap"],function(c,u){if(c===void 0)return a.string;Yc(c)});class Fc{constructor(){this.prefixRepeat=[],this.motionRepeat=[],this.operator=null,this.operatorArgs=null,this.motion=null,this.motionArgs=null,this.keyBuffer=[],this.registerName=void 0,this.changeQueue=null}pushRepeatDigit(u){this.operator?this.motionRepeat=this.motionRepeat.concat(u):this.prefixRepeat=this.prefixRepeat.concat(u)}getRepeat(){var u=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(u=1,this.prefixRepeat.length>0&&(u*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(u*=parseInt(this.motionRepeat.join(""),10))),u}}function ze(c,u){c.state.vim.inputState=new Fc,c.state.vim.expectLiteralNext=!1,n.signal(c,"vim-command-done",u)}function Mm(){this.removed=[],this.inserted=""}class Gt{constructor(u,d,p){this.clear(),this.keyBuffer=[u||""],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!!d,this.blockwise=!!p}setText(u,d,p){this.keyBuffer=[u||""],this.linewise=!!d,this.blockwise=!!p}pushText(u,d){d&&(this.linewise||this.keyBuffer.push(`
|
|
34
|
+
`),this.linewise=!0),this.keyBuffer.push(u)}pushInsertModeChanges(u){this.insertModeChanges.push(De(u))}pushSearchQuery(u){this.searchQueries.push(u)}clear(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1}toString(){return this.keyBuffer.join("")}}function Rm(c,u){var d=N.registerController.registers;if(!c||c.length!=1)throw Error("Register name must be 1 character");if(d[c])throw Error("Register already defined "+c);d[c]=u,Q.push(c)}class Lm{constructor(u){this.registers=u,this.unnamedRegister=u['"']=new Gt,u["."]=new Gt,u[":"]=new Gt,u["/"]=new Gt,u["+"]=new Gt}pushText(u,d,p,g,y){if(u!=="_"){g&&p.charAt(p.length-1)!==`
|
|
35
|
+
`&&(p+=`
|
|
36
|
+
`);var v=this.isValidRegister(u)?this.getRegister(u):null;if(!v||!u){switch(d){case"yank":this.registers[0]=new Gt(p,g,y);break;case"delete":case"change":p.indexOf(`
|
|
37
|
+
`)==-1?this.registers["-"]=new Gt(p,g):(this.shiftNumericRegisters_(),this.registers[1]=new Gt(p,g));break}this.unnamedRegister.setText(p,g,y);return}var k=Y(u);k?v.pushText(p,g):v.setText(p,g,y),u==="+"&&navigator.clipboard.writeText(p),this.unnamedRegister.setText(v.toString(),g)}}getRegister(u){return this.isValidRegister(u)?(u=u.toLowerCase(),this.registers[u]||(this.registers[u]=new Gt),this.registers[u]):this.unnamedRegister}isValidRegister(u){return u&&(ve(u,Q)||P.test(u))}shiftNumericRegisters_(){for(var u=9;u>=2;u--)this.registers[u]=this.getRegister(""+(u-1))}}class Gc{constructor(){this.historyBuffer=[],this.iterator=0,this.initialPrefix=null}nextMatch(u,d){var p=this.historyBuffer,g=d?-1:1;this.initialPrefix===null&&(this.initialPrefix=u);for(var y=this.iterator+g;d?y>=0:y<p.length;y+=g)for(var v=p[y],k=0;k<=v.length;k++)if(this.initialPrefix==v.substring(0,k))return this.iterator=y,v;if(y>=p.length)return this.iterator=p.length,this.initialPrefix;if(y<0)return u}pushInput(u){var d=this.historyBuffer.indexOf(u);d>-1&&this.historyBuffer.splice(d,1),u.length&&this.historyBuffer.push(u)}reset(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}}var Ui={matchCommand:function(c,u,d,p){var g=Bm(c,u,p,d),y=g.full[0];if(!y)return g.partial.length?{type:"partial",expectLiteralNext:g.partial.length==1&&g.partial[0].keys.slice(-11)=="<character>"}:{type:"none"};if(y.keys.slice(-11)=="<character>"||y.keys.slice(-10)=="<register>"){var v=Dm(c);if(!v||v.length>1)return{type:"clear"};d.selectedCharacter=v}return{type:"full",command:y}},processCommand:function(c,u,d){switch(u.inputState.repeatOverride=d.repeatOverride,d.type){case"motion":this.processMotion(c,u,d);break;case"operator":this.processOperator(c,u,d);break;case"operatorMotion":this.processOperatorMotion(c,u,d);break;case"action":this.processAction(c,u,d);break;case"search":this.processSearch(c,u,d);break;case"ex":case"keyToEx":this.processEx(c,u,d);break}},processMotion:function(c,u,d){u.inputState.motion=d.motion,u.inputState.motionArgs=Fr(d.motionArgs),this.evalInput(c,u)},processOperator:function(c,u,d){var p=u.inputState;if(p.operator)if(p.operator==d.operator){p.motion="expandToLine",p.motionArgs={linewise:!0,repeat:1},this.evalInput(c,u);return}else ze(c);p.operator=d.operator,p.operatorArgs=Fr(d.operatorArgs),d.keys.length>1&&(p.operatorShortcut=d.keys),d.exitVisualBlock&&(u.visualBlock=!1,yn(c)),u.visualMode&&this.evalInput(c,u)},processOperatorMotion:function(c,u,d){var p=u.visualMode,g=Fr(d.operatorMotionArgs);g&&p&&g.visualLine&&(u.visualLine=!0),this.processOperator(c,u,d),p||this.processMotion(c,u,d)},processAction:function(c,u,d){var p=u.inputState,g=p.getRepeat(),y=!!g,v=Fr(d.actionArgs)||{repeat:1};p.selectedCharacter&&(v.selectedCharacter=p.selectedCharacter),d.operator&&this.processOperator(c,u,d),d.motion&&this.processMotion(c,u,d),(d.motion||d.operator)&&this.evalInput(c,u),v.repeat=g||1,v.repeatIsExplicit=y,v.registerName=p.registerName,ze(c),u.lastMotion=null,d.isEdit&&this.recordLastEdit(u,p,d),mn[d.action](c,v,u)},processSearch:function(c,u,d){if(!c.getSearchCursor)return;var p=d.searchArgs.forward,g=d.searchArgs.wholeWordOnly;Dt(c).setReversed(!p);var y=p?"/":"?",v=Dt(c).getQuery(),k=c.getScrollInfo(),w="";function C(V,ie,oe){N.searchHistoryController.pushInput(V),N.searchHistoryController.reset();try{Kn(c,V,ie,oe)}catch{ye(c,"Invalid regex: "+V),ze(c);return}Ui.processMotion(c,u,{keys:"",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:d.searchArgs.toJumplist}})}function $(V){c.scrollTo(k.left,k.top),C(V,!0,!0);var ie=N.macroModeState;ie.isRecording&&S0(ie,V)}function M(){return ae("pcre")?"(JavaScript regexp: set pcre)":"(Vim regexp: set nopcre)"}function R(V,ie,oe){var re=Hn(V),Ae,Re;re=="<Up>"||re=="<Down>"?(Ae=re=="<Up>",Re=V.target?V.target.selectionEnd:0,ie=N.searchHistoryController.nextMatch(ie,Ae)||"",oe(ie),Re&&V.target&&(V.target.selectionEnd=V.target.selectionStart=Math.min(Re,V.target.value.length))):re&&re!="<Left>"&&re!="<Right>"&&N.searchHistoryController.reset(),w=ie,L()}function L(){var V;try{V=Kn(c,w,!0,!0)}catch{}V?c.scrollIntoView(Oh(c,!p,V),30):(bn(c),c.scrollTo(k.left,k.top))}function T(V,ie,oe){var re=Hn(V);re=="<Esc>"||re=="<C-c>"||re=="<C-[>"||re=="<BS>"&&ie==""?(N.searchHistoryController.pushInput(ie),N.searchHistoryController.reset(),Kn(c,v?.source||""),bn(c),c.scrollTo(k.left,k.top),n.e_stop(V),ze(c),oe(),c.focus()):re=="<Up>"||re=="<Down>"?n.e_stop(V):re=="<C-u>"&&(n.e_stop(V),oe(""))}switch(d.searchArgs.querySrc){case"prompt":var X=N.macroModeState;if(X.isPlaying){let ie=X.replaySearchQueries.shift();C(ie||"",!0,!1)}else Gr(c,{onClose:$,prefix:y,desc:_t("span",{$cursor:"pointer",onmousedown:function(ie){ie.preventDefault(),J("pcre",!ae("pcre")),this.textContent=M(),L()}},M()),onKeyUp:R,onKeyDown:T});break;case"wordUnderCursor":var I=Bo(c,{noSymbol:!0}),K=!0;if(I||(I=Bo(c,{noSymbol:!1}),K=!1),!I){ye(c,"No word under cursor"),ze(c);return}let V=c.getLine(I.start.line).substring(I.start.ch,I.end.ch);K&&g?V="\\b"+V+"\\b":V=_m(V),N.jumpList.cachedCursor=c.getCursor(),c.setCursor(I.start),C(V,!0,!1);break}},processEx:function(c,u,d){function p(k){N.exCommandHistoryController.pushInput(k),N.exCommandHistoryController.reset(),pt.processCommand(c,k),c.state.vim&&ze(c),bn(c)}function g(k,w,C){var $=Hn(k),M,R;($=="<Esc>"||$=="<C-c>"||$=="<C-[>"||$=="<BS>"&&w=="")&&(N.exCommandHistoryController.pushInput(w),N.exCommandHistoryController.reset(),n.e_stop(k),ze(c),bn(c),C(),c.focus()),$=="<Up>"||$=="<Down>"?(n.e_stop(k),M=$=="<Up>",R=k.target?k.target.selectionEnd:0,w=N.exCommandHistoryController.nextMatch(w,M)||"",C(w),R&&k.target&&(k.target.selectionEnd=k.target.selectionStart=Math.min(R,k.target.value.length))):$=="<C-u>"?(n.e_stop(k),C("")):$&&$!="<Left>"&&$!="<Right>"&&N.exCommandHistoryController.reset()}function y(k,w){var C=new n.StringStream(w),$={};try{if(pt.parseInput_(c,C,$),$.commandName!="s"){bn(c);return}var M=pt.matchCommand_($.commandName);if(!M||(pt.parseCommandArgs_(C,$,M),!$.argString))return;var R=ph($.argString.slice(1),!0,!0);R&&Do(c,R)}catch{}}if(d.type=="keyToEx")pt.processCommand(c,d.exArgs.input);else{var v={onClose:p,onKeyDown:g,onKeyUp:y,prefix:":"};u.visualMode&&(v.value="'<,'>",v.selectValueOnOpen=!1),Gr(c,v)}},evalInput:function(c,u){var d=u.inputState,p=d.motion,g=d.motionArgs||{repeat:1},y=d.operator,v=d.operatorArgs||{},k=d.registerName,w=u.sel,C=Qe(u.visualMode?ot(c,w.head):c.getCursor("head")),$=Qe(u.visualMode?ot(c,w.anchor):c.getCursor("anchor")),M=Qe(C),R=Qe($),L,T,X;if(y&&this.recordLastEdit(u,d),d.repeatOverride!==void 0?X=d.repeatOverride:X=d.getRepeat(),X>0&&g.explicitRepeat?g.repeatIsExplicit=!0:(g.noRepeat||!g.explicitRepeat&&X===0)&&(X=1,g.repeatIsExplicit=!1),d.selectedCharacter&&(g.selectedCharacter=v.selectedCharacter=d.selectedCharacter),g.repeat=X,ze(c),p){var I=Ut[p](c,C,g,u,d);if(u.lastMotion=Ut[p],!I)return;if(g.toJumplist){var K=N.jumpList,V=K.cachedCursor;V?(ih(c,V,I),delete K.cachedCursor):ih(c,C,I)}I instanceof Array?(T=I[0],L=I[1]):L=I,L||(L=Qe(C)),u.visualMode?(u.visualBlock&&L.ch===1/0||(L=ot(c,L,M)),T&&(T=ot(c,T)),T=T||R,w.anchor=T,w.head=L,yn(c),fi(c,u,"<",Ze(T,L)?T:L),fi(c,u,">",Ze(T,L)?L:T)):y||(L=ot(c,L,M),c.setCursor(L.line,L.ch))}if(y){if(v.lastSel){T=R;var ie=v.lastSel,oe=Math.abs(ie.head.line-ie.anchor.line),re=Math.abs(ie.head.ch-ie.anchor.ch);ie.visualLine?L=new e(R.line+oe,R.ch):ie.visualBlock?L=new e(R.line+oe,R.ch+re):ie.head.line==ie.anchor.line?L=new e(R.line,R.ch+re):L=new e(R.line+oe,R.ch),u.visualMode=!0,u.visualLine=ie.visualLine,u.visualBlock=ie.visualBlock,w=u.sel={anchor:T,head:L},yn(c)}else u.visualMode&&(v.lastSel={anchor:Qe(w.anchor),head:Qe(w.head),visualBlock:u.visualBlock,visualLine:u.visualLine});var Ae,Re,de,te,$e;if(u.visualMode){Ae=at(w.head,w.anchor),Re=$i(w.head,w.anchor),de=u.visualLine||v.linewise,te=u.visualBlock?"block":de?"line":"char";var Mt=t(c,Ae,Re);if($e=Xo(c,{anchor:Mt.start,head:Mt.end},te),de){var qe=$e.ranges;if(te=="block")for(var Rt=0;Rt<qe.length;Rt++)qe[Rt].head.ch=tt(c,qe[Rt].head.line);else te=="line"&&(qe[0].head=new e(qe[0].head.line+1,0))}}else{if(Ae=Qe(T||R),Re=Qe(L||M),Ze(Re,Ae)){var Hi=Ae;Ae=Re,Re=Hi}de=g.linewise||v.linewise,de?qm(c,Ae,Re):g.forward&&Ym(c,Ae,Re),te="char";var w0=!g.inclusive||de,Mt=t(c,Ae,Re);$e=Xo(c,{anchor:Mt.start,head:Mt.end},te,w0)}c.setSelections($e.ranges,$e.primary),u.lastMotion=null,v.repeat=X,v.registerName=k,v.linewise=de;var zo=Zo[y](c,v,$e.ranges,R,L);u.visualMode&&Ht(c,zo!=null),zo&&c.setCursor(zo)}},recordLastEdit:function(c,u,d){var p=N.macroModeState;p.isPlaying||(c.lastEditInputState=u,c.lastEditActionCommand=d,p.lastInsertModeChanges.changes=[],p.lastInsertModeChanges.expectCursorActivityForChange=!1,p.lastInsertModeChanges.visualBlock=c.visualBlock?c.sel.head.line-c.sel.anchor.line:0)}},Ut={moveToTopLine:function(c,u,d){var p=_o(c).top+d.repeat-1;return new e(p,Kt(c.getLine(p)))},moveToMiddleLine:function(c){var u=_o(c),d=Math.floor((u.top+u.bottom)*.5);return new e(d,Kt(c.getLine(d)))},moveToBottomLine:function(c,u,d){var p=_o(c).bottom-d.repeat+1;return new e(p,Kt(c.getLine(p)))},expandToLine:function(c,u,d){var p=u;return new e(p.line+d.repeat-1,1/0)},findNext:function(c,u,d){var p=Dt(c),g=p.getQuery();if(g){var y=!d.forward;y=p.isReversed()?!y:y,Do(c,g);var v=Oh(c,y,g,d.repeat);return v||ye(c,"No match found "+g+(ae("pcre")?" (set nopcre to use Vim regexps)":"")),v}},findAndSelectNextInclusive:function(c,u,d,p,g){var y=Dt(c),v=y.getQuery();if(v){var k=!d.forward;k=y.isReversed()?!k:k;var w=u0(c,k,v,d.repeat,p);if(w){if(g.operator)return w;var C=w[0],$=new e(w[1].line,w[1].ch-1);if(p.visualMode){(p.visualLine||p.visualBlock)&&(p.visualLine=!1,p.visualBlock=!1,n.signal(c,"vim-mode-change",{mode:"visual",subMode:""}));var M=p.sel.anchor;if(M)return y.isReversed()?d.forward?[M,C]:[M,$]:d.forward?[M,$]:[M,C]}else p.visualMode=!0,p.visualLine=!1,p.visualBlock=!1,n.signal(c,"vim-mode-change",{mode:"visual",subMode:""});return k?[$,C]:[C,$]}}},goToMark:function(c,u,d,p){var g=Ur(c,p,d.selectedCharacter||"");return g?d.linewise?{line:g.line,ch:Kt(c.getLine(g.line))}:g:null},moveToOtherHighlightedEnd:function(c,u,d,p){var g=p.sel;return p.visualBlock&&d.sameLine?[ot(c,new e(g.anchor.line,g.head.ch)),ot(c,new e(g.head.line,g.anchor.ch))]:[g.head,g.anchor]},jumpToMark:function(c,u,d,p){for(var g=u,y=0;y<d.repeat;y++){var v=g;for(var k in p.marks)if(B(k)){var w=p.marks[k].find(),C=d.forward?Ze(w,v):Ze(v,w);if(!C&&!(d.linewise&&w.line==v.line)){var $=At(v,g),M=d.forward?Kc(v,w,g):Kc(g,w,v);($||M)&&(g=w)}}}return d.linewise&&(g=new e(g.line,Kt(c.getLine(g.line)))),g},moveByCharacters:function(c,u,d){var p=u,g=d.repeat,y=d.forward?p.ch+g:p.ch-g;return new e(p.line,y)},moveByLines:function(c,u,d,p){var g=u,y=g.ch;switch(p.lastMotion){case this.moveByLines:case this.moveByDisplayLines:case this.moveByScroll:case this.moveToColumn:case this.moveToEol:y=p.lastHPos;break;default:p.lastHPos=y}var v=d.repeat+(d.repeatOffset||0),k=d.forward?g.line+v:g.line-v,w=c.firstLine(),C=c.lastLine(),$=c.findPosV(g,d.forward?v:-v,"line",p.lastHSPos),M=d.forward?$.line>k:$.line<k;return M&&(k=$.line,y=$.ch),k<w&&g.line==w?this.moveToStartOfLine(c,u,d,p):k>C&&g.line==C?oh(c,u,d,p,!0):(d.toFirstChar&&(y=Kt(c.getLine(k)),p.lastHPos=y),p.lastHSPos=c.charCoords(new e(k,y),"div").left,new e(k,y))},moveByDisplayLines:function(c,u,d,p){var g=u;switch(p.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:p.lastHSPos=c.charCoords(g,"div").left}var y=d.repeat,v=c.findPosV(g,d.forward?y:-y,"line",p.lastHSPos);if(v.hitSide)if(d.forward){var k=c.charCoords(v,"div"),w={top:k.top+8,left:p.lastHSPos};v=c.coordsChar(w,"div")}else{var C=c.charCoords(new e(c.firstLine(),0),"div");C.left=p.lastHSPos,v=c.coordsChar(C,"div")}return p.lastHPos=v.ch,v},moveByPage:function(c,u,d){var p=u,g=d.repeat;return c.findPosV(p,d.forward?g:-g,"page")},moveByParagraph:function(c,u,d){var p=d.forward?1:-1;return ah(c,u,d.repeat,p).start},moveBySentence:function(c,u,d){var p=d.forward?1:-1;return e0(c,u,d.repeat,p)},moveByScroll:function(c,u,d,p){var g=c.getScrollInfo(),y=null,v=d.repeat;v||(v=g.clientHeight/(2*c.defaultTextHeight()));var k=c.charCoords(u,"local");if(d.repeat=v,y=Ut.moveByDisplayLines(c,u,d,p),!y)return null;var w=c.charCoords(y,"local");return c.scrollTo(null,g.top+w.top-k.top),y},moveByWords:function(c,u,d){return Hm(c,u,d.repeat,!!d.forward,!!d.wordEnd,!!d.bigWord)},moveTillCharacter:function(c,u,d){var p=d.repeat,g=Io(c,p,d.forward,d.selectedCharacter,u),y=d.forward?-1:1;return nh(y,d),g?(g.ch+=y,g):null},moveToCharacter:function(c,u,d){var p=d.repeat;return nh(0,d),Io(c,p,d.forward,d.selectedCharacter,u)||u},moveToSymbol:function(c,u,d){var p=d.repeat;return d.selectedCharacter&&Um(c,p,d.forward,d.selectedCharacter)||u},moveToColumn:function(c,u,d,p){var g=d.repeat;return p.lastHPos=g-1,p.lastHSPos=c.charCoords(u,"div").left,Km(c,g)},moveToEol:function(c,u,d,p){return oh(c,u,d,p,!1)},moveToFirstNonWhiteSpaceCharacter:function(c,u){var d=u;return new e(d.line,Kt(c.getLine(d.line)))},moveToMatchedSymbol:function(c,u){for(var d=u,p=d.line,g=d.ch,y=c.getLine(p),v;g<y.length;g++)if(v=y.charAt(g),v&&U(v)){var k=c.getTokenTypeAt(new e(p,g+1));if(k!=="string"&&k!=="comment")break}if(g<y.length){var w=v==="<"||v===">"?/[(){}[\]<>]/:/[(){}[\]]/,C=c.findMatchingBracket(new e(p,g),{bracketRegex:w});return C.to}else return d},moveToStartOfLine:function(c,u){return new e(u.line,0)},moveToLineOrEdgeOfDocument:function(c,u,d){var p=d.forward?c.lastLine():c.firstLine();return d.repeatIsExplicit&&(p=d.repeat-c.getOption("firstLineNumber")),new e(p,Kt(c.getLine(p)))},moveToStartOfDisplayLine:function(c){return c.execCommand("goLineLeft"),c.getCursor()},moveToEndOfDisplayLine:function(c){c.execCommand("goLineRight");var u=c.getCursor();return u.sticky=="before"&&u.ch--,u},textObjectManipulation:function(c,u,d,p){var g={"(":")",")":"(","{":"}","}":"{","[":"]","]":"[","<":">",">":"<"},y={"'":!0,'"':!0,"`":!0},v=d.selectedCharacter||"";v=="b"?v="(":v=="B"&&(v="{");var k=!d.textObjectInner,w,C;if(g[v]){if(C=!0,w=ch(c,u,v,k),!w){var $=c.getSearchCursor(new RegExp("\\"+v,"g"),u);$.find()&&(w=ch(c,$.from(),v,k))}}else if(y[v])C=!0,w=t0(c,u,v,k);else if(v==="W"||v==="w")for(var M=d.repeat||1;M-- >0;){var R=Bo(c,{inclusive:k,innerWord:!k,bigWord:v==="W",noSymbol:v==="W",multiline:!0},w&&w.end);R&&(w||(w=R),w.end=R.end)}else if(v==="p")if(w=ah(c,u,d.repeat,0,k),d.linewise=!0,p.visualMode)p.visualLine||(p.visualLine=!0);else{var L=p.inputState.operatorArgs;L&&(L.linewise=!0),w.end.line--}else if(v==="t")w=Fm(c,u,k);else if(v==="s"){var T=c.getLine(u.line);u.ch>0&&ge(T[u.ch])&&(u.ch-=1);var X=lh(c,u,d.repeat,1,k),I=lh(c,u,d.repeat,-1,k);_(c.getLine(I.line)[I.ch])&&_(c.getLine(X.line)[X.ch-1])&&(I={line:I.line,ch:I.ch+1}),w={start:I,end:X}}return w?c.state.vim.visualMode?Wm(c,w.start,w.end,C):[w.start,w.end]:null},repeatLastCharacterSearch:function(c,u,d){var p=N.lastCharacterSearch,g=d.repeat,y=d.forward===p.forward,v=(p.increment?1:0)*(y?-1:1);c.moveH(-v,"char"),d.inclusive=!!y;var k=Io(c,g,y,p.selectedCharacter);return k?(k.ch+=v,k):(c.moveH(v,"char"),u)}};function Zm(c,u){Ut[c]=u}function Uc(c,u){for(var d=[],p=0;p<u;p++)d.push(c);return d}var Zo={change:function(c,u,d){var p,g,y=c.state.vim,v=d[0].anchor,k=d[0].head;if(y.visualMode)if(u.fullLine)k.ch=Number.MAX_VALUE,k.line--,c.setSelection(v,k),g=c.getSelection(),c.replaceSelection(""),p=v;else{g=c.getSelection();var $=Uc("",d.length);c.replaceSelections($),p=at(d[0].head,d[0].anchor)}else{g=c.getRange(v,k);var w=y.lastEditInputState;if(w?.motion=="moveByWords"&&!_(g)){var C=/\s+$/.exec(g);C&&w.motionArgs&&w.motionArgs.forward&&(k=_e(k,0,-C[0].length),g=g.slice(0,-C[0].length))}u.linewise&&(v=new e(v.line,Kt(c.getLine(v.line))),k.line>v.line&&(k=new e(k.line-1,Number.MAX_VALUE))),c.replaceRange("",v,k),p=v}N.registerController.pushText(u.registerName,"change",g,u.linewise,d.length>1),mn.enterInsertMode(c,{head:p},c.state.vim)},delete:function(c,u,d){var p,g,y=c.state.vim;if(y.visualBlock){g=c.getSelection();var w=Uc("",d.length);c.replaceSelections(w),p=at(d[0].head,d[0].anchor)}else{var v=d[0].anchor,k=d[0].head;u.linewise&&k.line!=c.firstLine()&&v.line==c.lastLine()&&v.line==k.line-1&&(v.line==c.firstLine()?v.ch=0:v=new e(v.line-1,tt(c,v.line-1))),g=c.getRange(v,k),c.replaceRange("",v,k),p=v,u.linewise&&(p=Ut.moveToFirstNonWhiteSpaceCharacter(c,v))}return N.registerController.pushText(u.registerName,"delete",g,u.linewise,y.visualBlock),ot(c,p)},indent:function(c,u,d){var p=c.state.vim,g=p.visualMode&&u.repeat||1;if(p.visualBlock){for(var y=c.getOption("tabSize"),v=c.getOption("indentWithTabs")?" ":" ".repeat(y),k,w=d.length-1;w>=0;w--)if(k=at(d[w].anchor,d[w].head),u.indentRight)c.replaceRange(v.repeat(g),k,k);else{for(var C=c.getLine(k.line),$=0,M=0;M<g;M++){var R=C[k.ch+$];if(R==" ")$++;else if(R==" "){$++;for(var L=1;L<v.length&&(R=C[k.ch+$],R===" ");L++)$++}else break}c.replaceRange("",k,_e(k,0,$))}return k}else if(c.indentMore)for(var M=0;M<g;M++)u.indentRight?c.indentMore():c.indentLess();else{var T=d[0].anchor.line,X=p.visualBlock?d[d.length-1].anchor.line:d[0].head.line;u.linewise&&X--;for(var w=T;w<=X;w++)for(var M=0;M<g;M++)c.indentLine(w,u.indentRight)}return Ut.moveToFirstNonWhiteSpaceCharacter(c,d[0].anchor)},indentAuto:function(c,u,d){return c.execCommand("indentAuto"),Ut.moveToFirstNonWhiteSpaceCharacter(c,d[0].anchor)},hardWrap:function(c,u,d,p){if(c.hardWrap){var g=d[0].anchor.line,y=d[0].head.line;u.linewise&&y--;var v=c.hardWrap({from:g,to:y});return v>g&&u.linewise&&v--,u.keepCursor?p:new e(v,0)}},changeCase:function(c,u,d,p,g){for(var y=c.getSelections(),v=[],k=u.toLower,w=0;w<y.length;w++){var C=y[w],$="";if(k===!0)$=C.toLowerCase();else if(k===!1)$=C.toUpperCase();else for(var M=0;M<C.length;M++){var R=C.charAt(M);$+=Y(R)?R.toLowerCase():R.toUpperCase()}v.push($)}return c.replaceSelections(v),u.shouldMoveCursor?g:!c.state.vim.visualMode&&u.linewise&&d[0].anchor.line+1==d[0].head.line?Ut.moveToFirstNonWhiteSpaceCharacter(c,p):u.linewise?p:at(d[0].anchor,d[0].head)},yank:function(c,u,d,p){var g=c.state.vim,y=c.getSelection(),v=g.visualMode?at(g.sel.anchor,g.sel.head,d[0].head,d[0].anchor):p;return N.registerController.pushText(u.registerName,"yank",y,u.linewise,g.visualBlock),v},rot13:function(c,u,d,p,g){for(var y=c.getSelections(),v=[],k=0;k<y.length;k++){const w=y[k].split("").map(C=>{const $=C.charCodeAt(0);return $>=65&&$<=90?String.fromCharCode(65+($-65+13)%26):$>=97&&$<=122?String.fromCharCode(97+($-97+13)%26):C}).join("");v.push(w)}return c.replaceSelections(v),u.shouldMoveCursor?g:!c.state.vim.visualMode&&u.linewise&&d[0].anchor.line+1==d[0].head.line?Ut.moveToFirstNonWhiteSpaceCharacter(c,p):u.linewise?p:at(d[0].anchor,d[0].head)}};function Em(c,u){Zo[c]=u}var mn={jumpListWalk:function(c,u,d){if(!d.visualMode){var p=u.repeat||1,g=u.forward,y=N.jumpList,v=y.move(c,g?p:-p),k=v?v.find():void 0;k=k||c.getCursor(),c.setCursor(k)}},scroll:function(c,u,d){if(!d.visualMode){var p=u.repeat||1,g=c.defaultTextHeight(),y=c.getScrollInfo().top,v=g*p,k=u.forward?y+v:y-v,w=Qe(c.getCursor()),C=c.charCoords(w,"local");if(u.forward)k>C.top?(w.line+=(k-C.top)/g,w.line=Math.ceil(w.line),c.setCursor(w),C=c.charCoords(w,"local"),c.scrollTo(null,C.top)):c.scrollTo(null,k);else{var $=k+c.getScrollInfo().clientHeight;$<C.bottom?(w.line-=(C.bottom-$)/g,w.line=Math.floor(w.line),c.setCursor(w),C=c.charCoords(w,"local"),c.scrollTo(null,C.bottom-c.getScrollInfo().clientHeight)):c.scrollTo(null,k)}}},scrollToCursor:function(c,u){var d=c.getCursor().line,p=c.charCoords(new e(d,0),"local"),g=c.getScrollInfo().clientHeight,y=p.top;switch(u.position){case"center":y=p.bottom-g/2;break;case"bottom":var v=new e(d,c.getLine(d).length-1),k=c.charCoords(v,"local"),w=k.bottom-y;y=y-g+w;break}c.scrollTo(null,y)},replayMacro:function(c,u,d){var p=u.selectedCharacter||"",g=u.repeat||1,y=N.macroModeState;for(p=="@"?p=y.latestRegister||"":y.latestRegister=p;g--;)y0(c,d,y,p)},enterMacroRecordMode:function(c,u){var d=N.macroModeState,p=u.selectedCharacter;N.registerController.isValidRegister(p)&&d.enterMacroRecordMode(c,p)},toggleOverwrite:function(c){c.state.overwrite?(c.toggleOverwrite(!1),c.setOption("keyMap","vim-insert"),n.signal(c,"vim-mode-change",{mode:"insert"})):(c.toggleOverwrite(!0),c.setOption("keyMap","vim-replace"),n.signal(c,"vim-mode-change",{mode:"replace"}))},enterInsertMode:function(c,u,d){if(!c.getOption("readOnly")){d.insertMode=!0,d.insertModeRepeat=u&&u.repeat||1;var p=u?u.insertAt:null,g=d.sel,y=u.head||c.getCursor("head"),v=c.listSelections().length;if(p=="eol")y=new e(y.line,tt(c,y.line));else if(p=="bol")y=new e(y.line,0);else if(p=="charAfter"){var k=t(c,y,_e(y,0,1));y=k.end}else if(p=="firstNonBlank"){var k=t(c,y,Ut.moveToFirstNonWhiteSpaceCharacter(c,y));y=k.end}else if(p=="startOfSelectedArea"){if(!d.visualMode)return;d.visualBlock?(y=new e(Math.min(g.head.line,g.anchor.line),Math.min(g.head.ch,g.anchor.ch)),v=Math.abs(g.head.line-g.anchor.line)+1):g.head.line<g.anchor.line?y=g.head:y=new e(g.anchor.line,0)}else if(p=="endOfSelectedArea"){if(!d.visualMode)return;d.visualBlock?(y=new e(Math.min(g.head.line,g.anchor.line),Math.max(g.head.ch,g.anchor.ch)+1),v=Math.abs(g.head.line-g.anchor.line)+1):g.head.line>=g.anchor.line?y=_e(g.head,0,1):y=new e(g.anchor.line,0)}else if(p=="inplace"){if(d.visualMode)return}else p=="lastEdit"&&(y=gh(c)||y);c.setOption("disableInput",!1),u&&u.replace?(c.toggleOverwrite(!0),c.setOption("keyMap","vim-replace"),n.signal(c,"vim-mode-change",{mode:"replace"})):(c.toggleOverwrite(!1),c.setOption("keyMap","vim-insert"),n.signal(c,"vim-mode-change",{mode:"insert"})),N.macroModeState.isPlaying||(c.on("change",yh),d.insertEnd&&d.insertEnd.clear(),d.insertEnd=c.setBookmark(y,{insertLeft:!0}),n.on(c.getInputField(),"keydown",Sh)),d.visualMode&&Ht(c),eh(c,y,v)}},toggleVisualMode:function(c,u,d){var p=u.repeat,g=c.getCursor(),y;if(d.visualMode)d.visualLine!=!!u.linewise||d.visualBlock!=!!u.blockwise?(d.visualLine=!!u.linewise,d.visualBlock=!!u.blockwise,n.signal(c,"vim-mode-change",{mode:"visual",subMode:d.visualLine?"linewise":d.visualBlock?"blockwise":""}),yn(c)):Ht(c);else{d.visualMode=!0,d.visualLine=!!u.linewise,d.visualBlock=!!u.blockwise,y=ot(c,new e(g.line,g.ch+p-1));var v=t(c,g,y);d.sel={anchor:v.start,head:v.end},n.signal(c,"vim-mode-change",{mode:"visual",subMode:d.visualLine?"linewise":d.visualBlock?"blockwise":""}),yn(c),fi(c,d,"<",at(g,y)),fi(c,d,">",$i(g,y))}},reselectLastSelection:function(c,u,d){var p=d.lastSelection;if(d.visualMode&&th(c,d),p){var g=p.anchorMark.find(),y=p.headMark.find();if(!g||!y)return;d.sel={anchor:g,head:y},d.visualMode=!0,d.visualLine=p.visualLine,d.visualBlock=p.visualBlock,yn(c),fi(c,d,"<",at(g,y)),fi(c,d,">",$i(g,y)),n.signal(c,"vim-mode-change",{mode:"visual",subMode:d.visualLine?"linewise":d.visualBlock?"blockwise":""})}},joinLines:function(c,u,d){var p,g;if(d.visualMode){if(p=c.getCursor("anchor"),g=c.getCursor("head"),Ze(g,p)){var y=g;g=p,p=y}g.ch=tt(c,g.line)-1}else{var v=Math.max(u.repeat,2);p=c.getCursor(),g=ot(c,new e(p.line+v-1,1/0))}for(var k=0,w=p.line;w<g.line;w++){k=tt(c,p.line);var C="",$=0;if(!u.keepSpaces){var M=c.getLine(p.line+1);$=M.search(/\S/),$==-1?$=M.length:C=" "}c.replaceRange(C,new e(p.line,k),new e(p.line+1,$))}var R=ot(c,new e(p.line,k));d.visualMode&&Ht(c,!1),c.setCursor(R)},newLineAndEnterInsertMode:function(c,u,d){d.insertMode=!0;var p=Qe(c.getCursor());if(p.line===c.firstLine()&&!u.after)c.replaceRange(`
|
|
38
|
+
`,new e(c.firstLine(),0)),c.setCursor(c.firstLine(),0);else{p.line=u.after?p.line:p.line-1,p.ch=tt(c,p.line),c.setCursor(p);var g=n.commands.newlineAndIndentContinueComment||n.commands.newlineAndIndent;g(c)}this.enterInsertMode(c,{repeat:u.repeat},d)},paste:function(c,u,d){var p=N.registerController.getRegister(u.registerName);if(u.registerName==="+")navigator.clipboard.readText().then(y=>{this.continuePaste(c,u,d,y,p)});else{var g=p.toString();this.continuePaste(c,u,d,g,p)}},continuePaste:function(c,u,d,p,g){var y=Qe(c.getCursor());if(p){if(u.matchIndent){var v=c.getOption("tabSize"),k=function(qe){var Rt=qe.split(" ").length-1,Hi=qe.split(" ").length-1;return Rt*v+Hi*1},w=c.getLine(c.getCursor().line),C=k(w.match(/^\s*/)[0]),$=p.replace(/\n$/,""),M=p!==$,R=k(p.match(/^\s*/)[0]),p=$.replace(/^\s*/gm,function(qe){var Rt=C+(k(qe)-R);if(Rt<0)return"";if(c.getOption("indentWithTabs")){var Hi=Math.floor(Rt/v);return Array(Hi+1).join(" ")}else return Array(Rt+1).join(" ")});p+=M?`
|
|
39
|
+
`:""}u.repeat>1&&(p=Array(u.repeat+1).join(p));var L=g.linewise,T=g.blockwise,X=T?p.split(`
|
|
40
|
+
`):void 0;if(X){L&&X.pop();for(var I=0;I<X.length;I++)X[I]=X[I]==""?" ":X[I];y.ch+=u.after?1:0,y.ch=Math.min(tt(c,y.line),y.ch)}else L?d.visualMode?p=d.visualLine?p.slice(0,-1):`
|
|
41
|
+
`+p.slice(0,p.length-1)+`
|
|
42
|
+
`:u.after?(p=`
|
|
43
|
+
`+p.slice(0,p.length-1),y.ch=tt(c,y.line)):y.ch=0:y.ch+=u.after?1:0;var K;if(d.visualMode){d.lastPastedText=p;var V,ie=zm(c),oe=ie[0],re=ie[1],Ae=c.getSelection(),Re=c.listSelections(),de=new Array(Re.length).join("1").split("1");d.lastSelection&&(V=d.lastSelection.headMark.find()),N.registerController.unnamedRegister.setText(Ae),T?(c.replaceSelections(de),re=new e(oe.line+p.length-1,oe.ch),c.setCursor(oe),Jc(c,re),c.replaceSelections(p),K=oe):d.visualBlock?(c.replaceSelections(de),c.setCursor(oe),c.replaceRange(p,oe,oe),K=oe):(c.replaceRange(p,oe,re),K=c.posFromIndex(c.indexFromPos(oe)+p.length-1)),V&&(d.lastSelection.headMark=c.setBookmark(V)),L&&(K.ch=0)}else if(T&&X){c.setCursor(y);for(var I=0;I<X.length;I++){var te=y.line+I;te>c.lastLine()&&c.replaceRange(`
|
|
44
|
+
`,new e(te,0));var $e=tt(c,te);$e<y.ch&&jm(c,te,y.ch)}c.setCursor(y),Jc(c,new e(y.line+X.length-1,y.ch)),c.replaceSelections(X),K=y}else if(c.replaceRange(p,y),L){var te=u.after?y.line+1:y.line;K=new e(te,Kt(c.getLine(te)))}else K=Qe(y),/\n/.test(p)||(K.ch+=p.length-(u.after?1:0));d.visualMode&&Ht(c,!1),c.setCursor(K)}},undo:function(c,u){c.operation(function(){Hc(c,n.commands.undo,u.repeat)(),c.setCursor(ot(c,c.getCursor("start")))})},redo:function(c,u){Hc(c,n.commands.redo,u.repeat)()},setRegister:function(c,u,d){d.inputState.registerName=u.selectedCharacter},insertRegister:function(c,u,d){var p=u.selectedCharacter,g=N.registerController.getRegister(p),y=g&&g.toString();y&&c.replaceSelection(y)},oneNormalCommand:function(c,u,d){Ci(c,!0),d.insertModeReturn=!0,n.on(c,"vim-command-done",function p(){d.visualMode||(d.insertModeReturn&&(d.insertModeReturn=!1,d.insertMode||mn.enterInsertMode(c,{},d)),n.off(c,"vim-command-done",p))})},setMark:function(c,u,d){var p=u.selectedCharacter;p&&fi(c,d,p,c.getCursor())},replace:function(c,u,d){var p=u.selectedCharacter||"",g=c.getCursor(),y,v,k=c.listSelections();if(d.visualMode)g=c.getCursor("start"),v=c.getCursor("end");else{var w=c.getLine(g.line);y=g.ch+u.repeat,y>w.length&&(y=w.length),v=new e(g.line,y)}var C=t(c,g,v);if(g=C.start,v=C.end,p==`
|
|
45
|
+
`)d.visualMode||c.replaceRange("",g,v),(n.commands.newlineAndIndentContinueComment||n.commands.newlineAndIndent)(c);else{var $=c.getRange(g,v);if($=$.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,p),$=$.replace(/[^\n]/g,p),d.visualBlock){var M=new Array(c.getOption("tabSize")+1).join(" ");$=c.getSelection(),$=$.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,p);var R=$.replace(/\t/g,M).replace(/[^\n]/g,p).split(`
|
|
46
|
+
`);c.replaceSelections(R)}else c.replaceRange($,g,v);d.visualMode?(g=Ze(k[0].anchor,k[0].head)?k[0].anchor:k[0].head,c.setCursor(g),Ht(c,!1)):c.setCursor(_e(v,0,-1))}},incrementNumberToken:function(c,u){for(var d=c.getCursor(),p=c.getLine(d.line),g=/(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi,y,v,k,w;(y=g.exec(p))!==null&&(v=y.index,k=v+y[0].length,!(d.ch<k)););if(!(!u.backtrack&&k<=d.ch)){if(y){var C=y[2]||y[4],$=y[3]||y[5],M=u.increase?1:-1,R={"0b":2,0:8,"":10,"0x":16}[C.toLowerCase()],L=parseInt(y[1]+$,R)+M*u.repeat;w=L.toString(R);var T=C?new Array($.length-w.length+1+y[1].length).join("0"):"";w.charAt(0)==="-"?w="-"+C+T+w.substr(1):w=C+T+w;var X=new e(d.line,v),I=new e(d.line,k);c.replaceRange(w,X,I)}else return;c.setCursor(new e(d.line,v+w.length-1))}},repeatLastEdit:function(c,u,d){var p=d.lastEditInputState;if(p){var g=u.repeat;g&&u.repeatIsExplicit?p.repeatOverride=g:g=p.repeatOverride||g,kh(c,d,g,!1)}},indent:function(c,u){c.indentLine(c.getCursor().line,u.indentRight)},exitInsertMode:function(c,u){Ci(c)}};function Xm(c,u){mn[c]=u}function ot(c,u,d){var p=c.state.vim,g=p.insertMode||p.visualMode,y=Math.min(Math.max(c.firstLine(),u.line),c.lastLine()),v=c.getLine(y),k=v.length-1+ +!!g,w=Math.min(Math.max(0,u.ch),k),C=v.charCodeAt(w);if(56320<=C&&C<=57343){var $=1;d&&d.line==y&&d.ch>w&&($=-1),w+=$,w>k&&(w-=2)}return new e(y,w)}function Fr(c){var u={};for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(u[d]=c[d]);return u}function _e(c,u,d){return typeof u=="object"&&(d=u.ch,u=u.line),new e(c.line+u,c.ch+d)}function Bm(c,u,d,p){p.operator&&(d="operatorPending");for(var g,y=[],v=[],k=Tt?u.length-s:0,w=k;w<u.length;w++){var C=u[w];d=="insert"&&C.context!="insert"||C.context&&C.context!=d||p.operator&&C.type=="action"||!(g=Im(c,C.keys))||(g=="partial"&&y.push(C),g=="full"&&v.push(C))}return{partial:y,full:v}}function Im(c,u){const d=u.slice(-11)=="<character>",p=u.slice(-10)=="<register>";if(d||p){var g=u.length-(d?11:10),y=c.slice(0,g),v=u.slice(0,g);return y==v&&c.length>g?"full":v.indexOf(y)==0?"partial":!1}else return c==u?"full":u.indexOf(c)==0?"partial":!1}function Dm(c){var u=/^.*(<[^>]+>)$/.exec(c),d=u?u[1]:c.slice(-1);if(d.length>1)switch(d){case"<CR>":case"<S-CR>":d=`
|
|
47
|
+
`;break;case"<Space>":case"<S-Space>":d=" ";break;default:d="";break}return d}function Hc(c,u,d){return function(){for(var p=0;p<d;p++)u(c)}}function Qe(c){return new e(c.line,c.ch)}function At(c,u){return c.ch==u.ch&&c.line==u.line}function Ze(c,u){return c.line<u.line||c.line==u.line&&c.ch<u.ch}function at(c,u){return arguments.length>2&&(u=at.apply(void 0,Array.prototype.slice.call(arguments,1))),Ze(c,u)?c:u}function $i(c,u){return arguments.length>2&&(u=$i.apply(void 0,Array.prototype.slice.call(arguments,1))),Ze(c,u)?u:c}function Kc(c,u,d){var p=Ze(c,u),g=Ze(u,d);return p&&g}function tt(c,u){return c.getLine(u).length}function Eo(c){return c.trim?c.trim():c.replace(/^\s+|\s+$/g,"")}function _m(c){return c.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function jm(c,u,d){var p=tt(c,u),g=new Array(d-p+1).join(" ");c.setCursor(new e(u,p)),c.replaceRange(g,c.getCursor())}function Jc(c,u){var d=[],p=c.listSelections(),g=Qe(c.clipPos(u)),y=!At(u,g),v=c.getCursor("head"),k=Vm(p,v),w=At(p[k].head,p[k].anchor),C=p.length-1,$=C-k>k?C:0,M=p[$].anchor,R=Math.min(M.line,g.line),L=Math.max(M.line,g.line),T=M.ch,X=g.ch,I=p[$].head.ch-T,K=X-T;I>0&&K<=0?(T++,y||X--):I<0&&K>=0?(T--,w||X++):I<0&&K==-1&&(T--,X++);for(var V=R;V<=L;V++){var ie={anchor:new e(V,T),head:new e(V,X)};d.push(ie)}return c.setSelections(d),u.ch=X,M.ch=T,M}function eh(c,u,d){for(var p=[],g=0;g<d;g++){var y=_e(u,g,0);p.push({anchor:y,head:y})}c.setSelections(p,0)}function Vm(c,u,d){for(var p=0;p<c.length;p++){var g=At(c[p].anchor,u),y=At(c[p].head,u);if(g||y)return p}return-1}function zm(c,u){var d=c.listSelections(),p=d[0],g=d[d.length-1],y=Ze(p.anchor,p.head)?p.anchor:p.head,v=Ze(g.anchor,g.head)?g.head:g.anchor;return[y,v]}function th(c,u){var d=u.sel.anchor,p=u.sel.head;u.lastPastedText&&(p=c.posFromIndex(c.indexFromPos(d)+u.lastPastedText.length),u.lastPastedText=void 0),u.lastSelection={anchorMark:c.setBookmark(d),headMark:c.setBookmark(p),anchor:Qe(d),head:Qe(p),visualMode:u.visualMode,visualLine:u.visualLine,visualBlock:u.visualBlock}}function Wm(c,u,d,p){var g=c.state.vim.sel,y=p?u:g.head,v=p?u:g.anchor,k;return Ze(d,u)&&(k=d,d=u,u=k),Ze(y,v)?(y=at(u,y),v=$i(v,d)):(v=at(u,v),y=$i(y,d),y=_e(y,0,-1),y.ch==-1&&y.line!=c.firstLine()&&(y=new e(y.line-1,tt(c,y.line-1)))),[v,y]}function yn(c,u,d){var p=c.state.vim;u=u||p.sel,d||(d=p.visualLine?"line":p.visualBlock?"block":"char");var g=Xo(c,u,d);c.setSelections(g.ranges,g.primary)}function Xo(c,u,d,p){var g=Qe(u.head),y=Qe(u.anchor);if(d=="char"){var v=!p&&!Ze(u.head,u.anchor)?1:0,k=Ze(u.head,u.anchor)?1:0;return g=_e(u.head,0,v),y=_e(u.anchor,0,k),{ranges:[{anchor:y,head:g}],primary:0}}else if(d=="line"){if(Ze(u.head,u.anchor))g.ch=0,y.ch=tt(c,y.line);else{y.ch=0;var w=c.lastLine();g.line>w&&(g.line=w),g.ch=tt(c,g.line)}return{ranges:[{anchor:y,head:g}],primary:0}}else if(d=="block"){var C=Math.min(y.line,g.line),$=y.ch,M=Math.max(y.line,g.line),R=g.ch;$<R?R+=1:$+=1;for(var L=M-C+1,T=g.line==C?0:L-1,X=[],I=0;I<L;I++)X.push({anchor:new e(C+I,$),head:new e(C+I,R)});return{ranges:X,primary:T}}throw"never happens"}function Nm(c){var u=c.getCursor("head");return c.getSelection().length==1&&(u=at(u,c.getCursor("anchor"))),u}function Ht(c,u){var d=c.state.vim;u!==!1&&c.setCursor(ot(c,d.sel.head)),th(c,d),d.visualMode=!1,d.visualLine=!1,d.visualBlock=!1,d.insertMode||n.signal(c,"vim-mode-change",{mode:"normal"})}function Ym(c,u,d){var p=c.getRange(u,d);if(/\n\s*$/.test(p)){var g=p.split(`
|
|
48
|
+
`);g.pop();for(var y=g.pop();g.length>0&&y&&_(y);y=g.pop())d.line--,d.ch=0;y?(d.line--,d.ch=tt(c,d.line)):d.ch=0}}function qm(c,u,d){u.ch=0,d.ch=0,d.line++}function Kt(c){if(!c)return 0;var u=c.search(/\S/);return u==-1?c.length:u}function Bo(c,{inclusive:u,innerWord:d,bigWord:p,noSymbol:g,multiline:y},v){var k=v||Nm(c),w=c.getLine(k.line),C=w,$=k.line,M=$,R=k.ch,L,T=g?m[0]:b[0];if(d&&/\s/.test(w.charAt(R)))T=function(oe){return/\s/.test(oe)};else{for(;!T(w.charAt(R));)if(R++,R>=w.length){if(!y)return null;R--,L=sh(c,k,!0,p,!0);break}p?T=b[0]:(T=m[0],T(w.charAt(R))||(T=m[1]))}for(var X=R,I=R;T(w.charAt(I))&&I>=0;)I--;if(I++,L)X=L.to,M=L.line,C=c.getLine(M),!C&&X==0&&X++;else for(;T(w.charAt(X))&&X<w.length;)X++;if(u){var K=X,V=k.ch<=I&&/\s/.test(w.charAt(k.ch));if(!V)for(;/\s/.test(C.charAt(X))&&X<C.length;)X++;if(K==X||V){for(var ie=I;/\s/.test(w.charAt(I-1))&&I>0;)I--;!I&&!V&&(I=ie)}}return{start:new e($,I),end:new e(M,X)}}function Fm(c,u,d){var p=u;if(!n.findMatchingTag||!n.findEnclosingTag)return{start:p,end:p};var g=n.findMatchingTag(c,u)||n.findEnclosingTag(c,u);return!g||!g.open||!g.close?{start:p,end:p}:d?{start:g.open.from,end:g.close.to}:{start:g.open.to,end:g.close.from}}function ih(c,u,d){At(u,d)||N.jumpList.add(c,u,d)}function nh(c,u){N.lastCharacterSearch.increment=c,N.lastCharacterSearch.forward=u.forward,N.lastCharacterSearch.selectedCharacter=u.selectedCharacter}var Gm={"(":"bracket",")":"bracket","{":"bracket","}":"bracket","[":"section","]":"section","*":"comment","/":"comment",m:"method",M:"method","#":"preprocess"},rh={bracket:{isComplete:function(c){if(c.nextCh===c.symb){if(c.depth++,c.depth>=1)return!0}else c.nextCh===c.reverseSymb&&c.depth--;return!1}},section:{init:function(c){c.curMoveThrough=!0,c.symb=(c.forward?"]":"[")===c.symb?"{":"}"},isComplete:function(c){return c.index===0&&c.nextCh===c.symb}},comment:{isComplete:function(c){var u=c.lastCh==="*"&&c.nextCh==="/";return c.lastCh=c.nextCh,u}},method:{init:function(c){c.symb=c.symb==="m"?"{":"}",c.reverseSymb=c.symb==="{"?"}":"{"},isComplete:function(c){return c.nextCh===c.symb}},preprocess:{init:function(c){c.index=0},isComplete:function(c){if(c.nextCh==="#"){var u=c.lineText.match(/^#(\w+)/)?.[1];if(u==="endif"){if(c.forward&&c.depth===0)return!0;c.depth++}else if(u==="if"){if(!c.forward&&c.depth===0)return!0;c.depth--}if(u==="else"&&c.depth===0)return!0}return!1}}};function Um(c,u,d,p){var g=Qe(c.getCursor()),y=d?1:-1,v=d?c.lineCount():-1,k=g.ch,w=g.line,C=c.getLine(w),$={lineText:C,nextCh:C.charAt(k),lastCh:null,index:k,symb:p,reverseSymb:(d?{")":"(","}":"{"}:{"(":")","{":"}"})[p],forward:d,depth:0,curMoveThrough:!1},M=Gm[p];if(!M)return g;var R=rh[M].init,L=rh[M].isComplete;for(R&&R($);w!==v&&u;){if($.index+=y,$.nextCh=$.lineText.charAt($.index),!$.nextCh){if(w+=y,$.lineText=c.getLine(w)||"",y>0)$.index=0;else{var T=$.lineText.length;$.index=T>0?T-1:0}$.nextCh=$.lineText.charAt($.index)}L($)&&(g.line=w,g.ch=$.index,u--)}return $.nextCh||$.curMoveThrough?new e(w,$.index):g}function sh(c,u,d,p,g){var y=u.line,v=u.ch,k=c.getLine(y),w=d?1:-1,C=p?b:m;if(g&&k==""){if(y+=w,k=c.getLine(y),!E(c,y))return null;v=d?0:k.length}for(;;){if(g&&k=="")return{from:0,to:0,line:y};for(var $=w>0?k.length:-1,M=$,R=$;v!=$;){for(var L=!1,T=0;T<C.length&&!L;++T)if(C[T](k.charAt(v))){for(M=v;v!=$&&C[T](k.charAt(v));)v+=w;if(R=v,L=M!=R,M==u.ch&&y==u.line&&R==M+w)continue;return{from:Math.min(M,R+1),to:Math.max(M,R),line:y}}L||(v+=w)}if(y+=w,!E(c,y))return null;k=c.getLine(y),v=w>0?0:k.length}}function Hm(c,u,d,p,g,y){var v=Qe(u),k=[];(p&&!g||!p&&g)&&d++;for(var w=!(p&&g),C=0;C<d;C++){var $=sh(c,u,p,y,w);if(!$){var M=tt(c,c.lastLine());k.push(p?{line:c.lastLine(),from:M,to:M}:{line:0,from:0,to:0});break}k.push($),u=new e($.line,p?$.to-1:$.from)}var R=k.length!=d,L=k[0],T=k.pop();return p&&!g?(!R&&(L.from!=v.ch||L.line!=v.line)&&(T=k.pop()),T&&new e(T.line,T.from)):p&&g?T&&new e(T.line,T.to-1):!p&&g?(!R&&(L.to!=v.ch||L.line!=v.line)&&(T=k.pop()),T&&new e(T.line,T.to)):T&&new e(T.line,T.from)}function oh(c,u,d,p,g){var y=u,v=new e(y.line+d.repeat-1,1/0),k=c.clipPos(v);return k.ch--,g||(p.lastHPos=1/0,p.lastHSPos=c.charCoords(k,"div").left),v}function Io(c,u,d,p,g){if(p){for(var y=g||c.getCursor(),v=y.ch,k,w=0;w<u;w++){var C=c.getLine(y.line);if(k=Jm(v,C,p,d),k==-1)return;v=k}if(k!=null)return new e(c.getCursor().line,k)}}function Km(c,u){var d=c.getCursor().line;return ot(c,new e(d,u-1))}function fi(c,u,d,p){!ve(d,S)&&!P.test(d)||(u.marks[d]&&u.marks[d].clear(),u.marks[d]=c.setBookmark(p))}function Jm(c,u,d,p,g){var y;return p?y=u.indexOf(d,c+1):y=u.lastIndexOf(d,c-1),y}function ah(c,u,d,p,g){var y=u.line,v=c.firstLine(),k=c.lastLine(),w,C,$=y;function M(I){return!c.getLine(I)}function R(I,K,V){return V?M(I)!=M(I+K):!M(I)&&M(I+K)}if(p){for(;v<=$&&$<=k&&d>0;)R($,p)&&d--,$+=p;return{start:new e($,0),end:u}}var L=c.state.vim;if(L.visualLine&&R(y,1,!0)){var T=L.sel.anchor;R(T.line,-1,!0)&&(!g||T.line!=y)&&(y+=1)}var X=M(y);for($=y;$<=k&&d;$++)R($,1,!0)&&(!g||M($)!=X)&&d--;for(C=new e($,0),$>k&&!X?X=!0:g=!1,$=y;$>v&&!((!g||M($)==X||$==y)&&R($,-1,!0));$--);return w=new e($,0),{start:w,end:C}}function lh(c,u,d,p,g){function y(C){C.line!==null&&(C.pos+C.dir<0||C.pos+C.dir>=C.line.length?C.line=null:C.pos+=C.dir)}function v(C,$,M,R){var L=C.getLine($),T={line:L,ln:$,pos:M,dir:R};if(T.line==="")return{ln:T.ln,pos:T.pos};var X=T.pos;for(y(T);T.line!==null;){if(X=T.pos,ge(T.line[T.pos]))if(g){for(y(T);T.line!==null&&_(T.line[T.pos]);)X=T.pos,y(T);return{ln:T.ln,pos:X+1}}else return{ln:T.ln,pos:T.pos+1};y(T)}return{ln:T.ln,pos:X+1}}function k(C,$,M,R){var L=C.getLine($),T={line:L,ln:$,pos:M,dir:R};if(T.line==="")return{ln:T.ln,pos:T.pos};var X=T.pos;for(y(T);T.line!==null;){if(!_(T.line[T.pos])&&!ge(T.line[T.pos]))X=T.pos;else if(ge(T.line[T.pos]))return g?_(T.line[T.pos+1])?{ln:T.ln,pos:T.pos+1}:{ln:T.ln,pos:X}:{ln:T.ln,pos:X};y(T)}return T.line=L,g&&_(T.line[T.pos])?{ln:T.ln,pos:T.pos}:{ln:T.ln,pos:X}}for(var w={ln:u.line,pos:u.ch};d>0;)p<0?w=k(c,w.ln,w.pos,p):w=v(c,w.ln,w.pos,p),d--;return new e(w.ln,w.pos)}function e0(c,u,d,p){function g(w,C){if(C.line!==null)if(C.pos+C.dir<0||C.pos+C.dir>=C.line.length){if(C.ln+=C.dir,!E(w,C.ln)){C.line=null;return}C.line=w.getLine(C.ln),C.pos=C.dir>0?0:C.line.length-1}else C.pos+=C.dir}function y(w,C,$,M){var I=w.getLine(C),R=I==="",L={line:I,ln:C,pos:$,dir:M},T={ln:L.ln,pos:L.pos},X=L.line==="";for(g(w,L);L.line!==null;){if(T.ln=L.ln,T.pos=L.pos,L.line===""&&!X)return{ln:L.ln,pos:L.pos};if(R&&L.line!==""&&!_(L.line[L.pos]))return{ln:L.ln,pos:L.pos};ge(L.line[L.pos])&&!R&&(L.pos===L.line.length-1||_(L.line[L.pos+1]))&&(R=!0),g(w,L)}var I=w.getLine(T.ln);T.pos=0;for(var K=I.length-1;K>=0;--K)if(!_(I[K])){T.pos=K;break}return T}function v(w,C,$,M){var I=w.getLine(C),R={line:I,ln:C,pos:$,dir:M},L=R.ln,T=null,X=R.line==="";for(g(w,R);R.line!==null;){if(R.line===""&&!X)return T!==null?{ln:L,pos:T}:{ln:R.ln,pos:R.pos};if(ge(R.line[R.pos])&&T!==null&&!(R.ln===L&&R.pos+1===T))return{ln:L,pos:T};R.line!==""&&!_(R.line[R.pos])&&(X=!1,L=R.ln,T=R.pos),g(w,R)}var I=w.getLine(L);T=0;for(var K=0;K<I.length;++K)if(!_(I[K])){T=K;break}return{ln:L,pos:T}}for(var k={ln:u.line,pos:u.ch};d>0;)p<0?k=v(c,k.ln,k.pos,p):k=y(c,k.ln,k.pos,p),d--;return new e(k.ln,k.pos)}function ch(c,u,d,p){var g=u,y={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/,"<":/[<>]/,">":/[<>]/}[d],v={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{","<":"<",">":"<"}[d],k=c.getLine(g.line).charAt(g.ch),w=k===v?1:0,C=c.scanForBracket(new e(g.line,g.ch+w),-1,void 0,{bracketRegex:y}),$=c.scanForBracket(new e(g.line,g.ch+w),1,void 0,{bracketRegex:y});if(!C||!$)return null;var M=C.pos,R=$.pos;if(M.line==R.line&&M.ch>R.ch||M.line>R.line){var L=M;M=R,R=L}return p?R.ch+=1:M.ch+=1,{start:M,end:R}}function t0(c,u,d,p){var g=Qe(u),y=c.getLine(g.line),v=y.split(""),k,w,C,$,M=v.indexOf(d);if(g.ch<M)g.ch=M;else if(M<g.ch&&v[g.ch]==d){var R=/string/.test(c.getTokenTypeAt(_e(u,0,1))),L=/string/.test(c.getTokenTypeAt(u)),T=R&&!L;T||(w=g.ch,--g.ch)}if(v[g.ch]==d&&!w)k=g.ch+1;else for(C=g.ch;C>-1&&!k;C--)v[C]==d&&(k=C+1);if(k&&!w)for(C=k,$=v.length;C<$&&!w;C++)v[C]==d&&(w=C);return!k||!w?{start:g,end:g}:(p&&(--k,++w),{start:new e(g.line,k),end:new e(g.line,w)})}ne("pcre",!0,"boolean");class i0{constructor(){this.highlightTimeout}getQuery(){return N.query}setQuery(u){N.query=u}getOverlay(){return this.searchOverlay}setOverlay(u){this.searchOverlay=u}isReversed(){return N.isReversed}setReversed(u){N.isReversed=u}getScrollbarAnnotate(){return this.annotate}setScrollbarAnnotate(u){this.annotate=u}}function Dt(c){var u=c.state.vim;return u.searchState_||(u.searchState_=new i0)}function n0(c){return hh(c,"/")}function r0(c){return uh(c,"/")}function hh(c,u){var d=uh(c,u)||[];if(!d.length)return[];var p=[];if(d[0]===0){for(var g=0;g<d.length;g++)typeof d[g]=="number"&&p.push(c.substring(d[g]+1,d[g+1]));return p}}function uh(c,u){u||(u="/");for(var d=!1,p=[],g=0;g<c.length;g++){var y=c.charAt(g);!d&&y==u&&p.push(g),d=!d&&y=="\\"}return p}function s0(c){var u={V:"|(){+?*.[$^",M:"|(){+?*.[",m:"|(){+?",v:"<>"},d={">":"(?<=[\\w])(?=[^\\w]|$)","<":"(?<=[^\\w]|^)(?=[\\w])"},p=u.m,g=c.replace(/\\.|[\[|(){+*?.$^<>]/g,function(v){if(v[0]==="\\"){var k=v[1];return k==="}"||p.indexOf(k)!=-1?k:k in u?(p=u[k],""):k in d?d[k]:v}else return p.indexOf(v)!=-1?d[v]||"\\"+v:v}),y=g.indexOf("\\zs");return y!=-1&&(g="(?<="+g.slice(0,y)+")"+g.slice(y+3)),y=g.indexOf("\\ze"),y!=-1&&(g=g.slice(0,y)+"(?="+g.slice(y+3)+")"),g}var fh={"\\n":`
|
|
49
|
+
`,"\\r":"\r","\\t":" "};function o0(c){for(var u=!1,d=[],p=-1;p<c.length;p++){var g=c.charAt(p)||"",y=c.charAt(p+1)||"";fh[g+y]?(d.push(fh[g+y]),p++):u?(d.push(g),u=!1):g==="\\"?(u=!0,W(y)||y==="$"?d.push("$"):y!=="/"&&y!=="\\"&&d.push("\\")):(g==="$"&&d.push("$"),d.push(g),y==="/"&&d.push("\\"))}return d.join("")}var dh={"\\/":"/","\\\\":"\\","\\n":`
|
|
50
|
+
`,"\\r":"\r","\\t":" ","\\&":"&"};function a0(c){for(var u=new n.StringStream(c),d=[];!u.eol();){for(;u.peek()&&u.peek()!="\\";)d.push(u.next());var p=!1;for(var g in dh)if(u.match(g,!0)){p=!0,d.push(dh[g]);break}p||d.push(u.next())}return d.join("")}function ph(c,u,d){var p=N.registerController.getRegister("/");p.setText(c);var g=r0(c),y,v;if(!g.length)y=c;else{y=c.substring(0,g[0]);var k=c.substring(g[0]);v=k.indexOf("i")!=-1}if(!y)return null;ae("pcre")||(y=s0(y)),d&&(u=/^[^A-Z]*$/.test(y));var w=new RegExp(y,u||v?"im":"m");return w}function _t(c){typeof c=="string"&&(c=document.createElement(c));for(var u=1;u<arguments.length;u++){var d=arguments[u];if(d)if(typeof d!="object"&&(d=document.createTextNode(d)),d.nodeType)c.appendChild(d);else for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(p[0]==="$"?c.style[p.slice(1)]=d[p]:typeof d[p]=="function"?c[p]=d[p]:c.setAttribute(p,d[p]))}return c}function ye(c,u,d){var p=_t("div",{$color:"red",$whiteSpace:"pre",class:"cm-vim-message"},u);c.openNotification?d?(p=_t("div",{},p,_t("div",{},"Press ENTER or type command to continue")),c.state.closeVimNotification&&c.state.closeVimNotification(),c.state.closeVimNotification=c.openNotification(p,{bottom:!0,duration:0})):c.openNotification(p,{bottom:!0,duration:15e3}):alert(p.innerText)}function l0(c,u){return _t("div",{$display:"flex",$flex:1},_t("span",{$fontFamily:"monospace",$whiteSpace:"pre",$flex:1,$display:"flex"},c,_t("input",{type:"text",autocorrect:"off",autocapitalize:"off",spellcheck:"false",$flex:1})),u&&_t("span",{$color:"#888"},u))}function Gr(c,u){if(Ye.length){u.value||(u.value=""),Se=u;return}var d=l0(u.prefix,u.desc);if(c.openDialog)c.openDialog(d,u.onClose,{onKeyDown:u.onKeyDown,onKeyUp:u.onKeyUp,bottom:!0,selectValueOnOpen:!1,value:u.value});else{var p="";typeof u.prefix!="string"&&u.prefix&&(p+=u.prefix.textContent),u.desc&&(p+=" "+u.desc),u.onClose?.(prompt(p,""))}}function c0(c,u){return c instanceof RegExp&&u instanceof RegExp?c.flags==u.flags&&c.source==u.source:!1}function Kn(c,u,d,p){if(u){var g=Dt(c),y=ph(u,!!d,!!p);if(y)return Do(c,y),c0(y,g.getQuery())||g.setQuery(y),y}}function h0(c){if(c.source.charAt(0)=="^")var u=!0;return{token:function(d){if(u&&!d.sol()){d.skipToEnd();return}var p=d.match(c,!1);if(p)return p[0].length==0?(d.next(),"searching"):!d.sol()&&(d.backUp(1),!c.exec(d.next()+p[0]))?(d.next(),null):(d.match(c),"searching");for(;!d.eol()&&(d.next(),!d.match(c,!1)););},query:c}}var Jn=0;function Do(c,u){clearTimeout(Jn);var d=Dt(c);d.highlightTimeout=Jn,Jn=setTimeout(function(){if(c.state.vim){var p=Dt(c);p.highlightTimeout=void 0;var g=p.getOverlay();(!g||u!=g.query)&&(g&&c.removeOverlay(g),g=h0(u),c.addOverlay(g),c.showMatchesOnScrollbar&&(p.getScrollbarAnnotate()&&p.getScrollbarAnnotate().clear(),p.setScrollbarAnnotate(c.showMatchesOnScrollbar(u))),p.setOverlay(g))}},50)}function Oh(c,u,d,p){return c.operation(function(){p===void 0&&(p=1);for(var g=c.getCursor(),y=c.getSearchCursor(d,g),v=0;v<p;v++){var k=y.find(u);if(v==0&&k&&At(y.from(),g)){var w=u?y.from():y.to();k=y.find(u),k&&!k[0]&&At(y.from(),w)&&c.getLine(w.line).length==w.ch&&(k=y.find(u))}if(!k&&(y=c.getSearchCursor(d,u?new e(c.lastLine()):new e(c.firstLine(),0)),!y.find(u)))return}return y.from()})}function u0(c,u,d,p,g){return c.operation(function(){p===void 0&&(p=1);var y=c.getCursor(),v=c.getSearchCursor(d,y),k=v.find(!u);!g.visualMode&&k&&At(v.from(),y)&&v.find(!u);for(var w=0;w<p;w++)if(k=v.find(u),!k&&(v=c.getSearchCursor(d,u?new e(c.lastLine()):new e(c.firstLine(),0)),!v.find(u)))return;var C=v.from(),$=v.to();return C&&$&&[C,$]})}function bn(c){var u=Dt(c);u.highlightTimeout&&(clearTimeout(u.highlightTimeout),u.highlightTimeout=void 0),c.removeOverlay(Dt(c).getOverlay()),u.setOverlay(null),u.getScrollbarAnnotate()&&(u.getScrollbarAnnotate().clear(),u.setScrollbarAnnotate(null))}function f0(c,u,d){return typeof c!="number"&&(c=c.line),u instanceof Array?ve(c,u):typeof d=="number"?c>=u&&c<=d:c==u}function _o(c){var u=c.getScrollInfo(),d=6,p=10,g=c.coordsChar({left:0,top:d+u.top},"local"),y=u.clientHeight-p+u.top,v=c.coordsChar({left:0,top:y},"local");return{top:g.line,bottom:v.line}}function Ur(c,u,d){if(d=="'"||d=="`")return N.jumpList.find(c,-1)||new e(0,0);if(d==".")return gh(c);var p=u.marks[d];return p&&p.find()}function gh(c){if(c.getLastEditEnd)return c.getLastEditEnd();for(var u=c.doc.history.done,d=u.length;d--;)if(u[d].changes)return Qe(u[d].changes[0].to)}class d0{constructor(){this.commandMap_,this.buildCommandMap_()}processCommand(u,d,p){var g=this;u.operation(function(){u.curOp&&(u.curOp.isVimOp=!0),g._processCommand(u,d,p)})}_processCommand(u,d,p){var g=u.state.vim,y=N.registerController.getRegister(":"),v=y.toString(),k=new n.StringStream(d);y.setText(d);var w=p||{};w.input=d;try{this.parseInput_(u,k,w)}catch(M){throw ye(u,M+""),M}g.visualMode&&Ht(u);var C,$;if(!w.commandName)w.line!==void 0&&($="move");else if(C=this.matchCommand_(w.commandName),C){if($=C.name,C.excludeFromCommandHistory&&y.setText(v),this.parseCommandArgs_(k,w,C),C.type=="exToKey"){Qi(u,C.toKeys||"",C);return}else if(C.type=="exToEx"){this.processCommand(u,C.toInput||"");return}}if(!$){ye(u,'Not an editor command ":'+d+'"');return}try{mh[$](u,w),(!C||!C.possiblyAsync)&&w.callback&&w.callback()}catch(M){throw ye(u,M+""),M}}parseInput_(u,d,p){d.eatWhile(":"),d.eat("%")?(p.line=u.firstLine(),p.lineEnd=u.lastLine()):(p.line=this.parseLineSpec_(u,d),p.line!==void 0&&d.eat(",")&&(p.lineEnd=this.parseLineSpec_(u,d))),p.line==null?u.state.vim.visualMode?(p.selectionLine=Ur(u,u.state.vim,"<")?.line,p.selectionLineEnd=Ur(u,u.state.vim,">")?.line):p.selectionLine=u.getCursor().line:(p.selectionLine=p.line,p.selectionLineEnd=p.lineEnd);var g=d.match(/^(\w+|!!|@@|[!#&*<=>@~])/);return g?p.commandName=g[1]:p.commandName=(d.match(/.*/)||[""])[0],p}parseLineSpec_(u,d){var p=d.match(/^(\d+)/);if(p)return parseInt(p[1],10)-1;switch(d.next()){case".":return this.parseLineSpecOffset_(d,u.getCursor().line);case"$":return this.parseLineSpecOffset_(d,u.lastLine());case"'":var g=d.next()||"",y=Ur(u,u.state.vim,g);if(!y)throw new Error("Mark not set");return this.parseLineSpecOffset_(d,y.line);case"-":case"+":return d.backUp(1),this.parseLineSpecOffset_(d,u.getCursor().line);default:d.backUp(1);return}}parseLineSpecOffset_(u,d){var p=u.match(/^([+-])?(\d+)/);if(p){var g=parseInt(p[2],10);p[1]=="-"?d-=g:d+=g}return d}parseCommandArgs_(u,d,p){if(!u.eol()){d.argString=u.match(/.*/)?.[0];var g=p.argDelimiter||/\s+/,y=Eo(d.argString||"").split(g);y.length&&y[0]&&(d.args=y)}}matchCommand_(u){for(var d=u.length;d>0;d--){var p=u.substring(0,d);if(this.commandMap_[p]){var g=this.commandMap_[p];if(g.name.indexOf(u)===0)return g}}}buildCommandMap_(){this.commandMap_={};for(var u=0;u<o.length;u++){var d=o[u],p=d.shortName||d.name;this.commandMap_[p]=d}}map(u,d,p,g){if(u!=":"&&u.charAt(0)==":"){if(p)throw Error("Mode not supported for ex mappings");var y=u.substring(1);d!=":"&&d.charAt(0)==":"?this.commandMap_[y]={name:y,type:"exToEx",toInput:d.substring(1),user:!0}:this.commandMap_[y]={name:y,type:"exToKey",toKeys:d,user:!0}}else{var v={keys:u,type:"keyToKey",toKeys:d,noremap:!!g};p&&(v.context=p),jo(v)}}unmap(u,d){if(u!=":"&&u.charAt(0)==":"){if(d)throw Error("Mode not supported for ex mappings");var p=u.substring(1);if(this.commandMap_[p]&&this.commandMap_[p].user)return delete this.commandMap_[p],!0}else for(var g=u,y=0;y<i.length;y++)if(g==i[y].keys&&i[y].context===d)return i.splice(y,1),g0(g),!0}}var mh={colorscheme:function(c,u){if(!u.args||u.args.length<1){ye(c,c.getOption("theme"));return}c.setOption("theme",u.args[0])},map:function(c,u,d,p){var g=u.args;if(!g||g.length<2){c&&ye(c,"Invalid mapping: "+u.input);return}pt.map(g[0],g[1],d,p)},imap:function(c,u){this.map(c,u,"insert")},nmap:function(c,u){this.map(c,u,"normal")},vmap:function(c,u){this.map(c,u,"visual")},omap:function(c,u){this.map(c,u,"operatorPending")},noremap:function(c,u){this.map(c,u,void 0,!0)},inoremap:function(c,u){this.map(c,u,"insert",!0)},nnoremap:function(c,u){this.map(c,u,"normal",!0)},vnoremap:function(c,u){this.map(c,u,"visual",!0)},onoremap:function(c,u){this.map(c,u,"operatorPending",!0)},unmap:function(c,u,d){var p=u.args;(!p||p.length<1||!pt.unmap(p[0],d))&&c&&ye(c,"No such mapping: "+u.input)},mapclear:function(c,u){xe.mapclear()},imapclear:function(c,u){xe.mapclear("insert")},nmapclear:function(c,u){xe.mapclear("normal")},vmapclear:function(c,u){xe.mapclear("visual")},omapclear:function(c,u){xe.mapclear("operatorPending")},move:function(c,u){Ui.processCommand(c,c.state.vim,{keys:"",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0},repeatOverride:u.line+1})},set:function(c,u){var d=u.args,p=u.setCfg||{};if(!d||d.length<1){c&&ye(c,"Invalid mapping: "+u.input);return}var g=d[0].split("="),y=g.shift()||"",v=g.length>0?g.join("="):void 0,k=!1,w=!1;if(y.charAt(y.length-1)=="?"){if(v)throw Error("Trailing characters: "+u.argString);y=y.substring(0,y.length-1),k=!0}else y.charAt(y.length-1)=="!"&&(y=y.substring(0,y.length-1),w=!0);v===void 0&&y.substring(0,2)=="no"&&(y=y.substring(2),v=!1);var C=me[y]&&me[y].type=="boolean";if(C&&(w?v=!ae(y,c,p):v==null&&(v=!0)),!C&&v===void 0||k){var $=ae(y,c,p);$ instanceof Error?ye(c,$.message):$===!0||$===!1?ye(c," "+($?"":"no")+y):ye(c," "+y+"="+$)}else{var M=J(y,v,c,p);M instanceof Error&&ye(c,M.message)}},setlocal:function(c,u){u.setCfg={scope:"local"},this.set(c,u)},setglobal:function(c,u){u.setCfg={scope:"global"},this.set(c,u)},registers:function(c,u){var d=u.args,p=N.registerController.registers,g=`----------Registers----------
|
|
51
|
+
|
|
52
|
+
`;if(d)for(var k=d.join(""),w=0;w<k.length;w++){var y=k.charAt(w);if(N.registerController.isValidRegister(y)){var C=p[y]||new Gt;g+='"'+y+" "+C.toString()+`
|
|
53
|
+
`}}else for(var y in p){var v=p[y].toString();v.length&&(g+='"'+y+" "+v+`
|
|
54
|
+
`)}ye(c,g,!0)},marks:function(c,u){var d=u.args,p=c.state.vim.marks,g=`-----------Marks-----------
|
|
55
|
+
mark line col
|
|
56
|
+
|
|
57
|
+
`;if(d)for(var k=d.join(""),w=0;w<k.length;w++){var y=k.charAt(w),v=p[y]&&p[y].find();v&&(g+=y+" "+v.line+" "+v.ch+`
|
|
58
|
+
`)}else for(var y in p){var v=p[y]&&p[y].find();v&&(g+=y+" "+v.line+" "+v.ch+`
|
|
59
|
+
`)}ye(c,g,!0)},sort:function(c,u){var d,p,g,y,v;function k(){if(u.argString){var de=new n.StringStream(u.argString);if(de.eat("!")&&(d=!0),de.eol())return;if(!de.eatSpace())return"Invalid arguments";var te=de.match(/([dinuox]+)?\s*(\/.+\/)?\s*/);if(!te||!de.eol())return"Invalid arguments";if(te[1]){p=te[1].indexOf("i")!=-1,g=te[1].indexOf("u")!=-1;var $e=te[1].indexOf("d")!=-1||te[1].indexOf("n")!=-1,Mt=te[1].indexOf("x")!=-1,qe=te[1].indexOf("o")!=-1;if(Number($e)+Number(Mt)+Number(qe)>1)return"Invalid arguments";y=$e&&"decimal"||Mt&&"hex"||qe&&"octal"}te[2]&&(v=new RegExp(te[2].substr(1,te[2].length-2),p?"i":""))}}var w=k();if(w){ye(c,w+": "+u.argString);return}var C=u.line||c.firstLine(),$=u.lineEnd||u.line||c.lastLine();if(C==$)return;var M=new e(C,0),R=new e($,tt(c,$)),L=c.getRange(M,R).split(`
|
|
60
|
+
`),T=y=="decimal"?/(-?)([\d]+)/:y=="hex"?/(-?)(?:0x)?([0-9a-f]+)/i:y=="octal"?/([0-7]+)/:null,X=y=="decimal"?10:y=="hex"?16:y=="octal"?8:void 0,I=[],K=[];if(y||v)for(var V=0;V<L.length;V++){var ie=v?L[V].match(v):null;ie&&ie[0]!=""?I.push(ie):T&&T.exec(L[V])?I.push(L[V]):K.push(L[V])}else K=L;function oe(de,te){if(d){var $e;$e=de,de=te,te=$e}p&&(de=de.toLowerCase(),te=te.toLowerCase());var Mt=T&&T.exec(de),qe=T&&T.exec(te);if(!Mt||!qe)return de<te?-1:1;var Rt=parseInt((Mt[1]+Mt[2]).toLowerCase(),X),Hi=parseInt((qe[1]+qe[2]).toLowerCase(),X);return Rt-Hi}function re(de,te){if(d){var $e;$e=de,de=te,te=$e}return p&&(de[0]=de[0].toLowerCase(),te[0]=te[0].toLowerCase()),de[0]<te[0]?-1:1}if(I.sort(v?re:oe),v)for(var V=0;V<I.length;V++)I[V]=I[V].input;else y||K.sort(oe);if(L=d?I.concat(K):K.concat(I),g){var Ae=L,Re;L=[];for(var V=0;V<Ae.length;V++)Ae[V]!=Re&&L.push(Ae[V]),Re=Ae[V]}c.replaceRange(L.join(`
|
|
61
|
+
`),M,R)},vglobal:function(c,u){this.global(c,u)},normal:function(c,u){var d=!1,p=u.argString;if(p&&p[0]=="!"&&(p=p.slice(1),d=!0),p=p.trimStart(),!p){ye(c,"Argument is required.");return}var g=u.line;if(typeof g=="number")for(var y=isNaN(u.lineEnd)?g:u.lineEnd,v=g;v<=y;v++)c.setCursor(v,0),Qi(c,u.argString.trimStart(),{noremap:d}),c.state.vim.insertMode&&Ci(c,!0);else Qi(c,u.argString.trimStart(),{noremap:d}),c.state.vim.insertMode&&Ci(c,!0)},global:function(c,u){var d=u.argString;if(!d){ye(c,"Regular Expression missing from global");return}var p=u.commandName[0]==="v";d[0]==="!"&&u.commandName[0]==="g"&&(p=!0,d=d.slice(1));var g=u.line!==void 0?u.line:c.firstLine(),y=u.lineEnd||u.line||c.lastLine(),v=n0(d),k=d,w="";if(v&&v.length&&(k=v[0],w=v.slice(1,v.length).join("/")),k)try{Kn(c,k,!0,!0)}catch{ye(c,"Invalid regex: "+k);return}for(var C=Dt(c).getQuery(),$=[],M=g;M<=y;M++){var R=c.getLine(M),L=C.test(R);L!==p&&$.push(w?c.getLineHandle(M):R)}if(!w){ye(c,$.join(`
|
|
62
|
+
`));return}var T=0,X=function(){if(T<$.length){var I=$[T++],K=c.getLineNumber(I);if(K==null){X();return}var V=K+1+w;pt.processCommand(c,V,{callback:X})}else c.releaseLineHandles&&c.releaseLineHandles()};X()},substitute:function(c,u){if(!c.getSearchCursor)throw new Error("Search feature not available. Requires searchcursor.js or any other getSearchCursor implementation.");var d=u.argString,p=d?hh(d,d[0]):[],g="",y="",v,k,w,C=!1,$=!1;if(p&&p.length)g=p[0],ae("pcre")&&g!==""&&(g=new RegExp(g).source),y=p[1],y!==void 0&&(ae("pcre")?y=a0(y.replace(/([^\\])&/g,"$1$$&")):y=o0(y),N.lastSubstituteReplacePart=y),v=p[2]?p[2].split(" "):[];else if(d&&d.length){ye(c,"Substitutions should be of the form :s/pattern/replace/");return}if(v&&(k=v[0],w=parseInt(v[1]),k&&(k.indexOf("c")!=-1&&(C=!0),k.indexOf("g")!=-1&&($=!0),ae("pcre")?g=g+"/"+k:g=g.replace(/\//g,"\\/")+"/"+k)),g)try{Kn(c,g,!0,!0)}catch{ye(c,"Invalid regex: "+g);return}if(y=y||N.lastSubstituteReplacePart,y===void 0){ye(c,"No previous substitute regular expression");return}var M=Dt(c),R=M.getQuery(),L=u.line!==void 0?u.line:c.getCursor().line,T=u.lineEnd||L;L==c.firstLine()&&T==c.lastLine()&&(T=1/0),w&&(L=T,T=L+w-1);var X=ot(c,new e(L,0)),I=c.getSearchCursor(R,X);p0(c,C,$,L,T,I,R,y,u.callback)},startinsert:function(c,u){Qi(c,u.argString=="!"?"A":"i",{})},redo:n.commands.redo,undo:n.commands.undo,write:function(c){n.commands.save?n.commands.save(c):c.save&&c.save()},nohlsearch:function(c){bn(c)},yank:function(c){var u=Qe(c.getCursor()),d=u.line,p=c.getLine(d);N.registerController.pushText("0","yank",p,!0,!0)},delete:function(c,u){var d=u.selectionLine,p=isNaN(u.selectionLineEnd)?d:u.selectionLineEnd;Zo.delete(c,{linewise:!0},[{anchor:new e(d,0),head:new e(p+1,0)}])},join:function(c,u){var d=u.selectionLine,p=isNaN(u.selectionLineEnd)?d:u.selectionLineEnd;c.setCursor(new e(d,0)),mn.joinLines(c,{repeat:p-d},c.state.vim)},delmarks:function(c,u){if(!u.argString||!Eo(u.argString)){ye(c,"Argument required");return}for(var d=c.state.vim,p=new n.StringStream(Eo(u.argString));!p.eol();){p.eatSpace();var g=p.pos;if(!p.match(/[a-zA-Z]/,!1)){ye(c,"Invalid argument: "+u.argString.substring(g));return}var y=p.next();if(p.match("-",!0)){if(!p.match(/[a-zA-Z]/,!1)){ye(c,"Invalid argument: "+u.argString.substring(g));return}var v=y,k=p.next();if(v&&k&&B(v)==B(k)){var w=v.charCodeAt(0),C=k.charCodeAt(0);if(w>=C){ye(c,"Invalid argument: "+u.argString.substring(g));return}for(var $=0;$<=C-w;$++){var M=String.fromCharCode(w+$);delete d.marks[M]}}else{ye(c,"Invalid argument: "+v+"-");return}}else y&&delete d.marks[y]}}},pt=new d0;xe.defineEx("version","ve",c=>{ye(c,"Codemirror-vim version: 6.3.0")});function p0(c,u,d,p,g,y,v,k,w){c.state.vim.exMode=!0;var C=!1,$=0,M,R,L;function T(){c.operation(function(){for(;!C;)X(),K();V()})}function X(){var oe="",re=y.match||y.pos&&y.pos.match;if(re)oe=k.replace(/\$(\d{1,3}|[$&])/g,function(de,te){if(te=="$")return"$";if(te=="&")return re[0];for(var $e=te;parseInt($e)>=re.length&&$e.length>0;)$e=$e.slice(0,$e.length-1);return $e?re[$e]+te.slice($e.length,te.length):de});else{var Ae=c.getRange(y.from(),y.to());oe=Ae.replace(v,k)}var Re=y.to().line;y.replace(oe),R=y.to().line,g+=R-Re,L=R<Re}function I(){var oe=M&&Qe(y.to()),re=y.findNext();return re&&!re[0]&&oe&&At(y.from(),oe)&&(re=y.findNext()),re&&$++,re}function K(){for(;I()&&f0(y.from(),p,g);)if(!(!d&&y.from().line==R&&!L)){c.scrollIntoView(y.from(),30),c.setSelection(y.from(),y.to()),M=y.from(),C=!1;return}C=!0}function V(oe){if(oe&&oe(),c.focus(),M){c.setCursor(M);var re=c.state.vim;re.exMode=!1,re.lastHPos=re.lastHSPos=M.ch}w?w():C&&ye(c,($?"Found "+$+" matches":"No matches found")+" for pattern: "+v+(ae("pcre")?" (set nopcre to use Vim regexps)":""))}function ie(oe,re,Ae){n.e_stop(oe);var Re=Hn(oe);switch(Re){case"y":X(),K();break;case"n":K();break;case"a":var de=w;w=void 0,c.operation(T),w=de;break;case"l":X();case"q":case"<Esc>":case"<C-c>":case"<C-[>":V(Ae);break}return C&&V(Ae),!0}if(K(),C){ye(c,"No matches for "+v+(ae("pcre")?" (set nopcre to use vim regexps)":""));return}if(!u){T(),w&&w();return}Gr(c,{prefix:_t("span","replace with ",_t("strong",k)," (y/n/a/q/l)"),onKeyDown:ie})}function Ci(c,u){var d=c.state.vim,p=N.macroModeState,g=N.registerController.getRegister("."),y=p.isPlaying,v=p.lastInsertModeChanges;y||(c.off("change",yh),d.insertEnd&&d.insertEnd.clear(),d.insertEnd=void 0,n.off(c.getInputField(),"keydown",Sh)),!y&&d.insertModeRepeat&&d.insertModeRepeat>1&&(kh(c,d,d.insertModeRepeat-1,!0),d.lastEditInputState.repeatOverride=d.insertModeRepeat),delete d.insertModeRepeat,d.insertMode=!1,u||c.setCursor(c.getCursor().line,c.getCursor().ch-1),c.setOption("keyMap","vim"),c.setOption("disableInput",!0),c.toggleOverwrite(!1),g.setText(v.changes.join("")),n.signal(c,"vim-mode-change",{mode:"normal"}),p.isRecording&&v0(p)}function jo(c){i.unshift(c),c.keys&&O0(c.keys)}function O0(c){c.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(u){u&&(r[u]||(r[u]=0),r[u]++)})}function g0(c){c.split(/(<(?:[CSMA]-)*\w+>|.)/i).forEach(function(u){r[u]&&r[u]--})}function m0(c,u,d,p,g){var y={keys:c,type:u};y[u]=d,y[u+"Args"]=p;for(var v in g)y[v]=g[v];jo(y)}ne("insertModeEscKeysTimeout",200,"number");function y0(c,u,d,p){var g=N.registerController.getRegister(p);if(p==":"){g.keyBuffer[0]&&pt.processCommand(c,g.keyBuffer[0]),d.isPlaying=!1;return}var y=g.keyBuffer,v=0;d.isPlaying=!0,d.replaySearchQueries=g.searchQueries.slice(0);for(var k=0;k<y.length;k++)for(var w=y[k],C,$,M=/<(?:[CSMA]-)*\w+>|./gi;C=M.exec(w);)if($=C[0],xe.handleKey(c,$,"macro"),u.insertMode){var R=g.insertModeChanges[v++].changes;N.macroModeState.lastInsertModeChanges.changes=R,xh(c,R,1),Ci(c)}d.isPlaying=!1}function b0(c,u){if(!c.isPlaying){var d=c.latestRegister,p=N.registerController.getRegister(d);p&&p.pushText(u)}}function v0(c){if(!c.isPlaying){var u=c.latestRegister,d=N.registerController.getRegister(u);d&&d.pushInsertModeChanges&&d.pushInsertModeChanges(c.lastInsertModeChanges)}}function S0(c,u){if(!c.isPlaying){var d=c.latestRegister,p=N.registerController.getRegister(d);p&&p.pushSearchQuery&&p.pushSearchQuery(u)}}function yh(c,u){var d=N.macroModeState,p=d.lastInsertModeChanges;if(!d.isPlaying)for(var g=c.state.vim;u;){if(p.expectCursorActivityForChange=!0,p.ignoreCount>1)p.ignoreCount--;else if(u.origin=="+input"||u.origin=="paste"||u.origin===void 0){var y=c.listSelections().length;y>1&&(p.ignoreCount=y);var v=u.text.join(`
|
|
63
|
+
`);if(p.maybeReset&&(p.changes=[],p.maybeReset=!1),v)if(c.state.overwrite&&!/\n/.test(v))p.changes.push([v]);else{if(v.length>1){var k=g&&g.insertEnd&&g.insertEnd.find(),w=c.getCursor();if(k&&k.line==w.line){var C=k.ch-w.ch;C>0&&C<v.length&&(p.changes.push([v,C]),v="")}}v&&p.changes.push(v)}}u=u.next}}function bh(c){var u=c.state.vim;if(u.insertMode){var d=N.macroModeState;if(d.isPlaying)return;var p=d.lastInsertModeChanges;p.expectCursorActivityForChange?p.expectCursorActivityForChange=!1:(p.maybeReset=!0,u.insertEnd&&u.insertEnd.clear(),u.insertEnd=c.setBookmark(c.getCursor(),{insertLeft:!0}))}else c.curOp?.isVimOp||vh(c,u)}function vh(c,u){var d=c.getCursor("anchor"),p=c.getCursor("head");if(u.visualMode&&!c.somethingSelected()?Ht(c,!1):!u.visualMode&&!u.insertMode&&c.somethingSelected()&&(u.visualMode=!0,u.visualLine=!1,n.signal(c,"vim-mode-change",{mode:"visual"})),u.visualMode){var g=Ze(p,d)?0:-1,y=Ze(p,d)?-1:0;p=_e(p,0,g),d=_e(d,0,y),u.sel={anchor:d,head:p},fi(c,u,"<",at(p,d)),fi(c,u,">",$i(p,d))}else u.insertMode||(u.lastHPos=c.getCursor().ch)}function Sh(c){var u=N.macroModeState,d=u.lastInsertModeChanges,p=n.keyName?n.keyName(c):c.key;p&&(p.indexOf("Delete")!=-1||p.indexOf("Backspace")!=-1)&&(d.maybeReset&&(d.changes=[],d.maybeReset=!1),d.changes.push(new pn(p,c)))}function kh(c,u,d,p){var g=N.macroModeState;g.isPlaying=!0;var y=u.lastEditActionCommand,v=u.inputState;function k(){y?Ui.processAction(c,u,y):Ui.evalInput(c,u)}function w($){if(g.lastInsertModeChanges.changes.length>0){$=u.lastEditActionCommand?$:1;var M=g.lastInsertModeChanges;xh(c,M.changes,$)}}if(u.inputState=u.lastEditInputState,y&&y.interlaceInsertRepeat)for(var C=0;C<d;C++)k(),w(1);else p||k(),w(d);u.inputState=v,u.insertMode&&!p&&Ci(c),g.isPlaying=!1}function wh(c,u){n.lookupKey(u,"vim-insert",function(p){return typeof p=="string"?n.commands[p](c):p(c),!0})}function xh(c,u,d){var p=c.getCursor("head"),g=N.macroModeState.lastInsertModeChanges.visualBlock;g&&(eh(c,p,g+1),d=c.listSelections().length,c.setCursor(p));for(var y=0;y<d;y++){g&&c.setCursor(_e(p,y,0));for(var v=0;v<u.length;v++){var k=u[v];if(k instanceof pn)wh(c,k.keyName);else if(typeof k=="string")c.replaceSelection(k);else{var w=c.getCursor(),C=_e(w,0,k[0].length-(k[1]||0));c.replaceRange(k[0],w,k[1]?w:C),c.setCursor(C)}}}g&&c.setCursor(_e(p,0,1))}function Vo(c){var u=new c.constructor;return Object.keys(c).forEach(function(d){if(d!="insertEnd"){var p=c[d];Array.isArray(p)?p=p.slice():p&&typeof p=="object"&&p.constructor!=Object&&(p=Vo(p)),u[d]=p}}),c.sel&&(u.sel={head:c.sel.head&&Qe(c.sel.head),anchor:c.sel.anchor&&Qe(c.sel.anchor)}),u}function k0(c,u,d){var y=Pt(c),p=c,g=!1,y=xe.maybeInitVimState_(p),v=y.visualBlock||y.wasInVisualBlock;if(p.state.closeVimNotification){var k=p.state.closeVimNotification;if(p.state.closeVimNotification=null,k(),u=="<CR>")return ze(p),!0}var w=p.isInMultiSelectMode();if(y.wasInVisualBlock&&!w?y.wasInVisualBlock=!1:w&&y.visualBlock&&(y.wasInVisualBlock=!0),u=="<Esc>"&&!y.insertMode&&!y.visualMode&&w&&y.status=="<Esc>")ze(p);else if(v||!w||p.inVirtualSelectionMode)g=xe.handleKey(p,u,d);else{var C=Vo(y),$=y.inputState.changeQueueList||[];p.operation(function(){p.curOp&&(p.curOp.isVimOp=!0);var M=0;p.forEachSelection(function(){p.state.vim.inputState.changeQueue=$[M];var R=p.getCursor("head"),L=p.getCursor("anchor"),T=Ze(R,L)?0:-1,X=Ze(R,L)?-1:0;R=_e(R,0,T),L=_e(L,0,X),p.state.vim.sel.head=R,p.state.vim.sel.anchor=L,g=xe.handleKey(p,u,d),p.virtualSelection&&($[M]=p.state.vim.inputState.changeQueue,p.state.vim=Vo(C)),M++}),p.curOp?.cursorActivity&&!g&&(p.curOp.cursorActivity=!1),p.state.vim=y,y.inputState.changeQueueList=$,y.inputState.changeQueue=null},!0)}return g&&!y.visualMode&&!y.insertMode&&y.visualMode!=p.somethingSelected()&&vh(p,y),g}return Ft(),xe}function wt(n,e){var t=e.ch,i=e.line+1;i<1&&(i=1,t=0),i>n.lines&&(i=n.lines,t=Number.MAX_VALUE);var r=n.line(i);return Math.min(r.from+Math.max(0,t),r.to)}function Lt(n,e){let t=n.lineAt(e);return{line:t.number-1,ch:e-t.from}}class ni{constructor(e,t){this.line=e,this.ch=t}}function Fg(n,e,t){if(n.addEventListener)n.addEventListener(e,t,!1);else{var i=n._handlers||(n._handlers={});i[e]=(i[e]||[]).concat(t)}}function Gg(n,e,t){if(n.removeEventListener)n.removeEventListener(e,t,!1);else{var i=n._handlers,r=i&&i[e];if(r){var s=r.indexOf(t);s>-1&&(i[e]=r.slice(0,s).concat(r.slice(s+1)))}}}function Ug(n,e,...t){var i,r=(i=n._handlers)===null||i===void 0?void 0:i[e];if(r)for(var s=0;s<r.length;++s)r[s](...t)}function Lf(n,...e){if(n)for(var t=0;t<n.length;++t)n[t](...e)}let Ml;try{Ml=new RegExp("[\\w\\p{Alphabetic}\\p{Number}_]","u")}catch{Ml=/[\w]/}function fr(n,e){var t=n.cm6;if(!t.state.readOnly){var i="input.type.compose";if(n.curOp&&(n.curOp.lastChange||(i="input.type.compose.start")),e.annotations)try{e.annotations.some(function(r){r.value=="input"&&(r.value=i)})}catch(r){console.error(r)}else e.userEvent=i;return t.dispatch(e)}}function Zf(n,e){var t;n.curOp&&(n.curOp.$changeStart=void 0),(e?Nr:un)(n.cm6);let i=(t=n.curOp)===null||t===void 0?void 0:t.$changeStart;i!=null&&n.cm6.dispatch({selection:{anchor:i}})}var Ex={Left:n=>vn(n.cm6,{key:"Left"},"editor"),Right:n=>vn(n.cm6,{key:"Right"},"editor"),Up:n=>vn(n.cm6,{key:"Up"},"editor"),Down:n=>vn(n.cm6,{key:"Down"},"editor"),Backspace:n=>vn(n.cm6,{key:"Backspace"},"editor"),Delete:n=>vn(n.cm6,{key:"Delete"},"editor")};class se{openDialog(e,t,i){return Bx(this,e,t,i)}openNotification(e,t){return Xx(this,e,t)}constructor(e){this.state={},this.marks=Object.create(null),this.$mid=0,this.options={},this._handlers={},this.$lastChangeEndOffset=0,this.virtualSelection=null,this.cm6=e,this.onChange=this.onChange.bind(this),this.onSelectionChange=this.onSelectionChange.bind(this)}on(e,t){Fg(this,e,t)}off(e,t){Gg(this,e,t)}signal(e,t,i){Ug(this,e,t,i)}indexFromPos(e){return wt(this.cm6.state.doc,e)}posFromIndex(e){return Lt(this.cm6.state.doc,e)}foldCode(e){let t=this.cm6,i=t.state.selection.ranges,r=this.cm6.state.doc,s=wt(r,e),o=Z.create([Z.range(s,s)],0).ranges;t.state.selection.ranges=o,_p(t),t.state.selection.ranges=i}firstLine(){return 0}lastLine(){return this.cm6.state.doc.lines-1}lineCount(){return this.cm6.state.doc.lines}setCursor(e,t){typeof e=="object"&&(t=e.ch,e=e.line);var i=wt(this.cm6.state.doc,{line:e,ch:t||0});this.cm6.dispatch({selection:{anchor:i}},{scrollIntoView:!this.curOp}),this.curOp&&!this.curOp.isVimOp&&this.onBeforeEndOperation()}getCursor(e){var t=this.cm6.state.selection.main,i=e=="head"||!e?t.head:e=="anchor"?t.anchor:e=="start"?t.from:e=="end"?t.to:null;if(i==null)throw new Error("Invalid cursor type");return this.posFromIndex(i)}listSelections(){var e=this.cm6.state.doc;return this.cm6.state.selection.ranges.map(t=>({anchor:Lt(e,t.anchor),head:Lt(e,t.head)}))}setSelections(e,t){var i=this.cm6.state.doc,r=e.map(s=>{var o=wt(i,s.head),a=wt(i,s.anchor);return o==a?Z.cursor(o,1):Z.range(a,o)});this.cm6.dispatch({selection:Z.create(r,t)})}setSelection(e,t,i){this.setSelections([{anchor:e,head:t}],0),i&&i.origin=="*mouse"&&this.onBeforeEndOperation()}getLine(e){var t=this.cm6.state.doc;return e<0||e>=t.lines?"":this.cm6.state.doc.line(e+1).text}getLineHandle(e){return this.$lineHandleChanges||(this.$lineHandleChanges=[]),{row:e,index:this.indexFromPos(new ni(e,0))}}getLineNumber(e){var t=this.$lineHandleChanges;if(!t)return null;for(var i=e.index,r=0;r<t.length;r++)if(i=t[r].changes.mapPos(i,1,He.TrackAfter),i==null)return null;var s=this.posFromIndex(i);return s.ch==0?s.line:null}releaseLineHandles(){this.$lineHandleChanges=void 0}getRange(e,t){var i=this.cm6.state.doc;return this.cm6.state.sliceDoc(wt(i,e),wt(i,t))}replaceRange(e,t,i,r){i||(i=t);var s=this.cm6.state.doc,o=wt(s,t),a=wt(s,i);fr(this,{changes:{from:o,to:a,insert:e}})}replaceSelection(e){fr(this,this.cm6.state.replaceSelection(e))}replaceSelections(e){var t=this.cm6.state.selection.ranges,i=t.map((r,s)=>({from:r.from,to:r.to,insert:e[s]||""}));fr(this,{changes:i})}getSelection(){return this.getSelections().join(`
|
|
64
|
+
`)}getSelections(){var e=this.cm6;return e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to))}somethingSelected(){return this.cm6.state.selection.ranges.some(e=>!e.empty)}getInputField(){return this.cm6.contentDOM}clipPos(e){var t=this.cm6.state.doc,i=e.ch,r=e.line+1;r<1&&(r=1,i=0),r>t.lines&&(r=t.lines,i=Number.MAX_VALUE);var s=t.line(r);return i=Math.min(Math.max(0,i),s.to-s.from),new ni(r-1,i)}getValue(){return this.cm6.state.doc.toString()}setValue(e){var t=this.cm6;return t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e},selection:Z.range(0,0)})}focus(){return this.cm6.focus()}blur(){return this.cm6.contentDOM.blur()}defaultTextHeight(){return this.cm6.defaultLineHeight}findMatchingBracket(e,t){var i=this.cm6.state,r=wt(i.doc,e),s=mi(i,r+1,-1);return s&&s.end?{to:Lt(i.doc,s.end.from)}:(s=mi(i,r,1),s&&s.end?{to:Lt(i.doc,s.end.from)}:{to:void 0})}scanForBracket(e,t,i,r){return _x(this,e,t,i,r)}indentLine(e,t){t?this.indentMore():this.indentLess()}indentMore(){PO(this.cm6)}indentLess(){TO(this.cm6)}execCommand(e){if(e=="indentAuto")se.commands.indentAuto(this);else if(e=="goLineLeft")hO(this.cm6);else if(e=="goLineRight"){cO(this.cm6);let t=this.cm6.state,i=t.selection.main.head;i<t.doc.length&&t.sliceDoc(i,i+1)!==`
|
|
65
|
+
`&&h1(this.cm6)}else console.log(e+" is not implemented")}setBookmark(e,t){var i=t?.insertLeft?1:-1,r=this.indexFromPos(e),s=new zx(this,r,i);return s}addOverlay({query:e}){let t=new Cx({regexp:!0,search:e.source,caseSensitive:!/i/.test(e.flags)});if(t.valid){t.forVim=!0,this.cm6Query=t;let i=Al.of(t);return this.cm6.dispatch({effects:i}),t}}removeOverlay(e){if(!this.cm6Query)return;this.cm6Query.forVim=!1;let t=Al.of(this.cm6Query);this.cm6.dispatch({effects:t})}getSearchCursor(e,t){var i=this,r=null,s=null,o=!1;t.ch==null&&(t.ch=Number.MAX_VALUE);var a=wt(i.cm6.state.doc,t),l=e.source.replace(/(\\.|{(?:\d+(?:,\d*)?|,\d+)})|[{}]/g,function(b,S){return S||"\\"+b});function h(b,S=0,Q=b.length){return new Bc(b,l,{ignoreCase:e.ignoreCase},S,Q)}function f(b){var S=i.cm6.state.doc;if(b>S.length)return null;let Q=h(S,b).next();return Q.done?null:Q.value}var O=1e4;function m(b,S){var Q=i.cm6.state.doc;for(let P=1;;P++){let A=Math.max(b,S-P*O),E=h(Q,A,S),B=null;for(;!E.next().done;)B=E.value;if(B&&(A==b||B.from>A+10))return B;if(A==b)return null}}return{findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(b){var S=i.cm6.state.doc;if(b){let Q=r?o?r.to-1:r.from:a;r=m(0,Q)}else{let Q=r?o?r.to+1:r.to:a;r=f(Q)}return s=r&&{from:Lt(S,r.from),to:Lt(S,r.to),match:r.match},o=r?r.from==r.to:!1,r&&r.match},from:function(){return s?.from},to:function(){return s?.to},replace:function(b){r&&(fr(i,{changes:{from:r.from,to:r.to,insert:b}}),r.to=r.from+b.length,s&&(s.to=Lt(i.cm6.state.doc,r.to)))},get match(){return s&&s.match}}}findPosV(e,t,i,r){let{cm6:s}=this;const o=s.state.doc;let a=i=="page"?s.dom.clientHeight:0;const l=wt(o,e);let h=Z.cursor(l,1,void 0,r),f=Math.round(Math.abs(t));for(let m=0;m<f;m++)i=="page"?h=s.moveVertically(h,t>0,a):i=="line"&&(h=s.moveVertically(h,t>0));let O=Lt(o,h.head);return(t<0&&h.head==0&&r!=0&&e.line==0&&e.ch!=0||t>0&&h.head==o.length&&O.ch!=r&&e.line==O.line)&&(O.hitSide=!0),O}charCoords(e,t){var i=this.cm6.contentDOM.getBoundingClientRect(),r=wt(this.cm6.state.doc,e),s=this.cm6.coordsAtPos(r),o=-i.top;return{left:(s?.left||0)-i.left,top:(s?.top||0)+o,bottom:(s?.bottom||0)+o}}coordsChar(e,t){var i=this.cm6.contentDOM.getBoundingClientRect(),r=this.cm6.posAtCoords({x:e.left+i.left,y:e.top+i.top})||0;return Lt(this.cm6.state.doc,r)}getScrollInfo(){var e=this.cm6.scrollDOM;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight,width:e.scrollWidth,clientHeight:e.clientHeight,clientWidth:e.clientWidth}}scrollTo(e,t){e!=null&&(this.cm6.scrollDOM.scrollLeft=e),t!=null&&(this.cm6.scrollDOM.scrollTop=t)}scrollIntoView(e,t){if(e){var i=this.indexFromPos(e);this.cm6.dispatch({effects:z.scrollIntoView(i)})}else this.cm6.dispatch({scrollIntoView:!0,userEvent:"scroll"})}getWrapperElement(){return this.cm6.dom}getMode(){return{name:this.getOption("mode")}}setSize(e,t){this.cm6.dom.style.width=e+4+"px",this.cm6.dom.style.height=t+"px",this.refresh()}refresh(){this.cm6.measure()}destroy(){this.removeOverlay()}getLastEditEnd(){return this.posFromIndex(this.$lastChangeEndOffset)}onChange(e){this.$lineHandleChanges&&this.$lineHandleChanges.push(e);for(let i in this.marks)this.marks[i].update(e.changes);this.virtualSelection&&(this.virtualSelection.ranges=this.virtualSelection.ranges.map(i=>i.map(e.changes)));var t=this.curOp=this.curOp||{};e.changes.iterChanges((i,r,s,o,a)=>{(t.$changeStart==null||t.$changeStart>s)&&(t.$changeStart=s),this.$lastChangeEndOffset=o;var l={text:a.toJSON()};t.lastChange?t.lastChange.next=t.lastChange=l:t.lastChange=t.change=l},!0),t.changeHandlers||(t.changeHandlers=this._handlers.change&&this._handlers.change.slice())}onSelectionChange(){var e=this.curOp=this.curOp||{};e.cursorActivityHandlers||(e.cursorActivityHandlers=this._handlers.cursorActivity&&this._handlers.cursorActivity.slice()),this.curOp.cursorActivity=!0}operation(e,t){this.curOp||(this.curOp={$d:0}),this.curOp.$d++;try{var i=e()}finally{this.curOp&&(this.curOp.$d--,this.curOp.$d||this.onBeforeEndOperation())}return i}onBeforeEndOperation(){var e=this.curOp,t=!1;e&&(e.change&&Lf(e.changeHandlers,this,e.change),e&&e.cursorActivity&&(Lf(e.cursorActivityHandlers,this,null),e.isVimOp&&(t=!0)),this.curOp=null),t&&this.scrollIntoView()}moveH(e,t){if(t=="char"){var i=this.getCursor();this.setCursor(i.line,i.ch+e)}}setOption(e,t){switch(e){case"keyMap":this.state.keyMap=t;break;case"textwidth":this.state.textwidth=t;break}}getOption(e){switch(e){case"firstLineNumber":return 1;case"tabSize":return this.cm6.state.tabSize||4;case"readOnly":return this.cm6.state.readOnly;case"indentWithTabs":return this.cm6.state.facet(zi)==" ";case"indentUnit":return this.cm6.state.facet(zi).length||2;case"textwidth":return this.state.textwidth;case"keyMap":return this.state.keyMap||"vim"}}toggleOverwrite(e){this.state.overwrite=e}getTokenTypeAt(e){var t,i=this.indexFromPos(e),r=sc(this.cm6.state,i),s=r?.resolve(i),o=((t=s?.type)===null||t===void 0?void 0:t.name)||"";return/comment/i.test(o)?"comment":/string/i.test(o)?"string":""}overWriteSelection(e){var t=this.cm6.state.doc,i=this.cm6.state.selection,r=i.ranges.map(s=>{if(s.empty){var o=s.to<t.length?t.sliceString(s.from,s.to+1):"";if(o&&!/\n/.test(o))return Z.range(s.from,s.to+1)}return s});this.cm6.dispatch({selection:Z.create(r,i.mainIndex)}),this.replaceSelection(e)}isInMultiSelectMode(){return this.cm6.state.selection.ranges.length>1}virtualSelectionMode(){return!!this.virtualSelection}forEachSelection(e){var t=this.cm6.state.selection;this.virtualSelection=Z.create(t.ranges,t.mainIndex);for(var i=0;i<this.virtualSelection.ranges.length;i++){var r=this.virtualSelection.ranges[i];r&&(this.cm6.dispatch({selection:Z.create([r])}),e(),this.virtualSelection.ranges[i]=this.cm6.state.selection.ranges[0])}this.cm6.dispatch({selection:this.virtualSelection}),this.virtualSelection=null}hardWrap(e){return Wx(this,e)}}se.isMac=typeof navigator<"u"&&/Mac/.test(navigator.platform);se.Pos=ni;se.StringStream=So;se.commands={cursorCharLeft:function(n){yc(n.cm6)},redo:function(n){Zf(n,!1)},undo:function(n){Zf(n,!0)},newlineAndIndent:function(n){vl({state:n.cm6.state,dispatch:e=>fr(n,e)})},indentAuto:function(n){CO(n.cm6)},newlineAndIndentContinueComment:void 0,save:void 0};se.isWordChar=function(n){return Ml.test(n)};se.keys=Ex;se.addClass=function(n,e){};se.rmClass=function(n,e){};se.e_preventDefault=function(n){n.preventDefault()};se.e_stop=function(n){var e,t;(e=n?.stopPropagation)===null||e===void 0||e.call(n),(t=n?.preventDefault)===null||t===void 0||t.call(n)};se.lookupKey=function(e,t,i){var r=se.keys[e];!r&&/^Arrow/.test(e)&&(r=se.keys[e.slice(5)]),r&&i(r)};se.on=Fg;se.off=Gg;se.signal=Ug;se.findMatchingTag=jx;se.findEnclosingTag=Vx;se.keyName=void 0;function Hg(n,e,t){var i=document.createElement("div");return i.appendChild(e),i}function Kg(n,e){n.state.currentNotificationClose&&n.state.currentNotificationClose(),n.state.currentNotificationClose=e}function Xx(n,e,t){Kg(n,a);var i=Hg(n,e,t&&t.bottom),r=!1,s,o=t&&typeof t.duration<"u"?t.duration:5e3;function a(){r||(r=!0,clearTimeout(s),i.remove(),em(n,i))}return i.onclick=function(l){l.preventDefault(),a()},Jg(n,i),o&&(s=setTimeout(a,o)),a}function Jg(n,e){var t=n.state.dialog;n.state.dialog=e,e.style.flex="1",e&&t!==e&&(t&&t.contains(document.activeElement)&&n.focus(),t&&t.parentElement?t.parentElement.replaceChild(e,t):t&&t.remove(),se.signal(n,"dialog"))}function em(n,e){n.state.dialog==e&&(n.state.dialog=null,se.signal(n,"dialog"))}function Bx(n,e,t,i){i||(i={}),Kg(n,void 0);var r=Hg(n,e,i.bottom),s=!1;Jg(n,r);function o(l){if(typeof l=="string")a.value=l;else{if(s)return;s=!0,em(n,r),n.state.dialog||n.focus(),i.onClose&&i.onClose(r)}}var a=r.getElementsByTagName("input")[0];return a&&(i.value&&(a.value=i.value,i.selectValueOnOpen!==!1&&a.select()),i.onInput&&se.on(a,"input",function(l){i.onInput(l,a.value,o)}),i.onKeyUp&&se.on(a,"keyup",function(l){i.onKeyUp(l,a.value,o)}),se.on(a,"keydown",function(l){i&&i.onKeyDown&&i.onKeyDown(l,a.value,o)||(l.keyCode==13&&t&&t(a.value),(l.keyCode==27||i.closeOnEnter!==!1&&l.keyCode==13)&&(a.blur(),se.e_stop(l),o()))}),i.closeOnBlur!==!1&&se.on(a,"blur",function(){setTimeout(function(){document.activeElement!==a&&o()})}),a.focus()),o}var Ix={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function Dx(n){return n&&n.bracketRegex||/[(){}[\]]/}function _x(n,e,t,i,r){for(var s=r&&r.maxScanLineLength||1e4,o=r&&r.maxScanLines||1e3,a=[],l=Dx(r),h=t>0?Math.min(e.line+o,n.lastLine()+1):Math.max(n.firstLine()-1,e.line-o),f=e.line;f!=h;f+=t){var O=n.getLine(f);if(O){var m=t>0?0:O.length-1,b=t>0?O.length:-1;if(!(O.length>s))for(f==e.line&&(m=e.ch-(t<0?1:0));m!=b;m+=t){var S=O.charAt(m);if(l.test(S)){var Q=Ix[S];if(Q&&Q.charAt(1)==">"==t>0)a.push(S);else if(a.length)a.pop();else return{pos:new ni(f,m),ch:S}}}}}return f-t==(t>0?n.lastLine():n.firstLine())?!1:null}function jx(n,e){return null}function Vx(n,e){var t,i,r=n.cm6.state,s=n.indexFromPos(e);if(s<r.doc.length){var o=r.sliceDoc(s,s+1);o=="<"&&s++}for(var a=sc(r,s),l=a?.resolve(s)||null;l;){if(((t=l.firstChild)===null||t===void 0?void 0:t.type.name)=="OpenTag"&&((i=l.lastChild)===null||i===void 0?void 0:i.type.name)=="CloseTag")return{open:Ef(r.doc,l.firstChild),close:Ef(r.doc,l.lastChild)};l=l.parent}}function Ef(n,e){return{from:Lt(n,e.from),to:Lt(n,e.to)}}class zx{constructor(e,t,i){this.cm=e,this.id=e.$mid++,this.offset=t,this.assoc=i,e.marks[this.id]=this}clear(){delete this.cm.marks[this.id]}find(){return this.offset==null?null:this.cm.posFromIndex(this.offset)}update(e){this.offset!=null&&(this.offset=e.mapPos(this.offset,this.assoc,He.TrackDel))}}function Wx(n,e){for(var t,i=e.column||n.getOption("textwidth")||80,r=e.allowMerge!=!1,s=Math.min(e.from,e.to),o=Math.max(e.from,e.to);s<=o;){var a=n.getLine(s);if(a.length>i){var l=S(a,i,5);if(l){var h=(t=/^\s*/.exec(a))===null||t===void 0?void 0:t[0];n.replaceRange(`
|
|
66
|
+
`+h,new ni(s,l.start),new ni(s,l.end))}o++}else if(r&&/\S/.test(a)&&s!=o){var f=n.getLine(s+1);if(f&&/\S/.test(f)){var O=a.replace(/\s+$/,""),m=f.replace(/^\s+/,""),b=O+" "+m,l=S(b,i,5);l&&l.start>O.length||b.length<i?(n.replaceRange(" ",new ni(s,O.length),new ni(s+1,f.length-m.length)),s--,o--):O.length<a.length&&n.replaceRange("",new ni(s,O.length),new ni(s,a.length))}}s++}return s;function S(Q,P,A){if(!(Q.length<P)){var E=Q.slice(0,P),B=Q.slice(P),U=/^(?:(\s+)|(\S+)(\s+))/.exec(B),W=/(?:(\s+)|(\s+)(\S+))$/.exec(E),Y=0,_=0;if(W&&!W[2]&&(Y=P-W[1].length,_=P),U&&!U[2]&&(Y||(Y=P),_=P+U[1].length),Y)return{start:Y,end:_};if(W&&W[2]&&W.index>A)return{start:W.index,end:W.index+W[2].length};if(U&&U[2])return Y=P+U[2].length,{start:Y,end:Y+U[3].length}}}}let Rl=Bb||(function(){let n={cursorBlinkRate:1200};return function(){return n}})();class Nx{constructor(e,t,i,r,s,o,a,l,h,f){this.left=e,this.top=t,this.height=i,this.fontFamily=r,this.fontSize=s,this.fontWeight=o,this.color=a,this.className=l,this.letter=h,this.partial=f}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",e.style.height=this.height+"px",e.style.lineHeight=this.height+"px",e.style.fontFamily=this.fontFamily,e.style.fontSize=this.fontSize,e.style.fontWeight=this.fontWeight,e.style.color=this.partial?"transparent":this.color,e.className=this.className,e.textContent=this.letter}eq(e){return this.left==e.left&&this.top==e.top&&this.height==e.height&&this.fontFamily==e.fontFamily&&this.fontSize==e.fontSize&&this.fontWeight==e.fontWeight&&this.color==e.color&&this.className==e.className&&this.letter==e.letter}}class Yx{constructor(e,t){this.view=e,this.rangePieces=[],this.cursors=[],this.cm=t,this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer cm-vimCursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){let t=Rl(this.cm.cm6.state).cursorBlinkRate;this.cursorLayer.style.animationDuration=t+"ms"}update(e){(e.selectionSet||e.geometryChanged||e.viewportChanged)&&(this.view.requestMeasure(this.measureReq),this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink"),qx(e)&&this.setBlinkRate()}scheduleRedraw(){this.view.requestMeasure(this.measureReq)}readPos(){let{state:e}=this.view,t=[];for(let i of e.selection.ranges){let r=i==e.selection.main,s=Hx(this.cm,this.view,i,r);s&&t.push(s)}return{cursors:t}}drawSel({cursors:e}){if(e.length!=this.cursors.length||e.some((t,i)=>!t.eq(this.cursors[i]))){let t=this.cursorLayer.children;if(t.length!==e.length){this.cursorLayer.textContent="";for(const i of e)this.cursorLayer.appendChild(i.draw())}else e.forEach((i,r)=>i.adjust(t[r]));this.cursors=e}}destroy(){this.cursorLayer.remove()}}function qx(n){return Rl(n.startState)!=Rl(n.state)}const Fx={".cm-vimMode .cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-fat-cursor":{position:"absolute",background:"#ff9696",border:"none",whiteSpace:"pre"},"&:not(.cm-focused) .cm-fat-cursor":{background:"none",outline:"solid 1px #ff9696",color:"transparent !important"}},Gx=wi.highest(z.theme(Fx));function Ux(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Ee.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function Hx(n,e,t,i){var r,s,o,a;let l=t.head,h=!1,f=1,O=n.state.vim;if(O&&(!O.insertMode||n.state.overwrite)){if(h=!0,O.visualBlock&&!i)return null;t.anchor<t.head&&(l<e.state.doc.length&&e.state.sliceDoc(l,l+1))!=`
|
|
67
|
+
`&&l--,n.state.overwrite?f=.2:O.status&&(f=.5)}if(h){let b=l<e.state.doc.length&&e.state.sliceDoc(l,l+1);b&&/[\uDC00-\uDFFF]/.test(b)&&l>1&&(l--,b=e.state.sliceDoc(l,l+1));let S=e.coordsAtPos(l,1);if(!S)return null;let Q=Ux(e),P=e.domAtPos(l),A=P?P.node:e.contentDOM;for(A instanceof Text&&P.offset>=A.data.length&&!((r=A.parentElement)===null||r===void 0)&&r.nextSibling&&(A=(s=A.parentElement)===null||s===void 0?void 0:s.nextSibling,P={node:A,offset:0});P&&P.node instanceof HTMLElement;)A=P.node,P={node:P.node.childNodes[P.offset],offset:0};if(!(A instanceof HTMLElement)){if(!A.parentNode)return null;A=A.parentNode}let E=getComputedStyle(A),B=S.left,U=(a=(o=e).coordsForChar)===null||a===void 0?void 0:a.call(o,l);if(U&&(B=U.left),!b||b==`
|
|
68
|
+
`||b=="\r")b=" ";else if(b==" "){b=" ";var m=e.coordsAtPos(l+1,-1);m&&(B=m.left-(m.left-S.left)/parseInt(E.tabSize))}else/[\uD800-\uDBFF]/.test(b)&&l<e.state.doc.length-1&&(b+=e.state.sliceDoc(l+1,l+2));let W=S.bottom-S.top;return new Nx((B-Q.left)/e.scaleX,(S.top-Q.top+W*(1-f))/e.scaleY,W*f/e.scaleY,E.fontFamily,E.fontSize,E.fontWeight,E.color,i?"cm-fat-cursor cm-cursor-primary":"cm-fat-cursor cm-cursor-secondary",b,f!=1)}else return null}var Kx=typeof navigator<"u"&&/linux/i.test(navigator.platform)&&/ Gecko\/\d+/.exec(navigator.userAgent);const ht=Zx(se),Jx=250,eQ=z.baseTheme({".cm-vimMode .cm-cursorLayer:not(.cm-vimCursorLayer)":{display:"none"},".cm-vim-panel":{padding:"0px 10px",fontFamily:"monospace",minHeight:"1.3em",display:"flex"},".cm-vim-panel input":{border:"none",outline:"none",backgroundColor:"inherit"},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"}}),tQ=et.fromClass(class{constructor(n){this.status="",this.query=null,this.decorations=H.none,this.waitForCopy=!1,this.lastKeydown="",this.useNextTextInput=!1,this.compositionText="",this.view=n;const e=this.cm=new se(n);ht.enterVimMode(this.cm),this.view.cm=this.cm,this.cm.state.vimPlugin=this,this.blockCursor=new Yx(n,e),this.updateClass(),this.cm.on("vim-command-done",()=>{e.state.vim&&(e.state.vim.status=""),this.blockCursor.scheduleRedraw(),this.updateStatus()}),this.cm.on("vim-mode-change",t=>{e.state.vim&&(e.state.vim.mode=t.mode,t.subMode&&(e.state.vim.mode+=" block"),e.state.vim.status="",this.blockCursor.scheduleRedraw(),this.updateClass(),this.updateStatus())}),this.cm.on("dialog",()=>{this.cm.state.statusbar?this.updateStatus():n.dispatch({effects:tm.of(!!this.cm.state.dialog)})}),this.dom=document.createElement("span"),this.spacer=document.createElement("span"),this.spacer.style.flex="1",this.statusButton=document.createElement("span"),this.statusButton.onclick=t=>{ht.handleKey(this.cm,"<Esc>","user"),this.cm.focus()},this.statusButton.style.cssText="cursor: pointer"}update(n){var e;if((n.viewportChanged||n.docChanged)&&this.query&&this.highlight(this.query),n.docChanged&&this.cm.onChange(n),n.selectionSet&&this.cm.onSelectionChange(),n.viewportChanged,this.cm.curOp&&!this.cm.curOp.isVimOp&&this.cm.onBeforeEndOperation(),n.transactions){for(let t of n.transactions)for(let i of t.effects)if(i.is(Al))if(!((e=i.value)===null||e===void 0?void 0:e.forVim))this.highlight(null);else{let s=i.value.create();this.highlight(s)}}this.blockCursor.update(n)}updateClass(){const n=this.cm.state;!n.vim||n.vim.insertMode&&!n.overwrite?this.view.scrollDOM.classList.remove("cm-vimMode"):this.view.scrollDOM.classList.add("cm-vimMode")}updateStatus(){let n=this.cm.state.statusbar,e=this.cm.state.vim;if(!n||!e)return;let t=this.cm.state.dialog;if(t)t.parentElement!=n&&(n.textContent="",n.appendChild(t));else{n.textContent="";var i=(e.mode||"normal").toUpperCase();e.insertModeReturn&&(i+="(C-O)"),this.statusButton.textContent=`--${i}--`,n.appendChild(this.statusButton),n.appendChild(this.spacer)}this.dom.textContent=e.status,n.appendChild(this.dom)}destroy(){ht.leaveVimMode(this.cm),this.updateClass(),this.blockCursor.destroy(),delete this.view.cm}highlight(n){if(this.query=n,!n)return this.decorations=H.none;let{view:e}=this,t=new Bn;for(let i=0,r=e.visibleRanges,s=r.length;i<s;i++){let{from:o,to:a}=r[i];for(;i<s-1&&a>r[i+1].from-2*Jx;)a=r[++i].to;n.highlight(e.state,o,a,(l,h)=>{t.add(l,h,nQ)})}return this.decorations=t.finish()}handleKey(n,e){const t=this.cm;let i=t.state.vim;if(!i)return;const r=ht.vimKeyFromEvent(n,i);if(se.signal(this.cm,"inputEvent",{type:"handleKey",key:r}),!r)return;if(r=="<Esc>"&&!i.insertMode&&!i.visualMode&&this.query){const a=i.searchState_;a&&(t.removeOverlay(a.getOverlay()),a.setOverlay(null))}if(r==="<C-c>"&&!se.isMac&&t.somethingSelected())return this.waitForCopy=!0,!0;i.status=(i.status||"")+r;let o=ht.multiSelectHandleKey(t,r,"user");return i=ht.maybeInitVimState_(t),!o&&i.insertMode&&t.state.overwrite&&(n.key&&n.key.length==1&&!/\n/.test(n.key)?(o=!0,t.overWriteSelection(n.key)):n.key=="Backspace"&&(o=!0,se.commands.cursorCharLeft(t))),o&&(se.signal(this.cm,"vim-keypress",r),n.preventDefault(),n.stopPropagation(),this.blockCursor.scheduleRedraw()),this.updateStatus(),!!o}},{eventHandlers:{copy:function(n,e){this.waitForCopy&&(this.waitForCopy=!1,Promise.resolve().then(()=>{var t=this.cm,i=t.state.vim;i&&(i.insertMode?t.setSelection(t.getCursor(),t.getCursor()):t.operation(()=>{t.curOp&&(t.curOp.isVimOp=!0),ht.handleKey(t,"<Esc>","user")}))}))},compositionstart:function(n,e){this.useNextTextInput=!0,se.signal(this.cm,"inputEvent",n)},compositionupdate:function(n,e){se.signal(this.cm,"inputEvent",n)},compositionend:function(n,e){se.signal(this.cm,"inputEvent",n)},keypress:function(n,e){se.signal(this.cm,"inputEvent",n),this.lastKeydown=="Dead"&&this.handleKey(n,e)},keydown:function(n,e){se.signal(this.cm,"inputEvent",n),this.lastKeydown=n.key,this.lastKeydown=="Unidentified"||this.lastKeydown=="Process"||this.lastKeydown=="Dead"?this.useNextTextInput=!0:(this.useNextTextInput=!1,this.handleKey(n,e))}},provide:()=>[z.inputHandler.of((n,e,t,i)=>{var r,s,o=Gi(n);if(!o)return!1;var a=(r=o.state)===null||r===void 0?void 0:r.vim,l=o.state.vimPlugin;if(a&&!a.insertMode&&!(!((s=o.curOp)===null||s===void 0)&&s.isVimOp)){if(i==="\0\0")return!0;if(se.signal(o,"inputEvent",{type:"text",text:i,from:e,to:t}),i.length==1&&l.useNextTextInput){if(a.expectLiteralNext&&n.composing)return l.compositionText=i,!1;if(l.compositionText){var h=l.compositionText;l.compositionText="";var f=n.state.selection.main.head,O=n.state.sliceDoc(f-h.length,f);if(h===O){var m=o.getCursor();o.replaceRange("",o.posFromIndex(f-h.length),m)}}return l.handleKey({key:i,preventDefault:()=>{},stopPropagation:()=>{}}),iQ(n),!0}}return!1})],decorations:n=>n.decorations});function iQ(n){var e=n.scrollDOM.parentElement;if(e){if(Kx){n.contentDOM.textContent="\0\0",n.contentDOM.dispatchEvent(new CustomEvent("compositionend"));return}var t=n.scrollDOM.nextSibling,i=window.getSelection(),r=i&&{anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset};n.scrollDOM.remove(),e.insertBefore(n.scrollDOM,t);try{r&&i&&(i.setPosition(r.anchorNode,r.anchorOffset),r.focusNode&&i.extend(r.focusNode,r.focusOffset))}catch(s){console.error(s)}n.focus(),n.contentDOM.dispatchEvent(new CustomEvent("compositionend"))}}const nQ=H.mark({class:"cm-searchMatch"}),tm=Oe.define(),rQ=Ct.define({create:()=>!1,update(n,e){for(let t of e.effects)t.is(tm)&&(n=t.value);return n},provide:n=>js.from(n,e=>e?sQ:null)});function sQ(n){let e=document.createElement("div");e.className="cm-vim-panel";let t=n.cm;return t.state.dialog&&e.appendChild(t.state.dialog),{top:!1,dom:e}}function oQ(n){let e=document.createElement("div");e.className="cm-vim-panel";let t=n.cm;return t.state.statusbar=e,t.state.vimPlugin.updateStatus(),{dom:e}}function im(n={}){return[eQ,tQ,Gx,n.status?js.of(oQ):rQ]}function Gi(n){return n.cm||null}function aQ(n){return n.replace(/\r\n?/g,`
|
|
69
|
+
`).replace(/\n/g,"<br>")}function $a(n){return mQ(n.replace(/\r\n?/g,`
|
|
70
|
+
`).replace(/\n/g,"<br>"))}function we(n,e){let t=ce(n).resolveInner(e,1);for(;t;){if(t.name==="Table")return rm(n.doc,t);t=t.parent}return null}function Ic(n,e,t){const i=[];return ce(n).iterate({from:e,to:t,enter(r){if(r.name!=="Table")return;const s=rm(n.doc,r.node);return s&&i.push(s),!1}}),i}function Zi(n,e,t){const i=Po(n),r=t==="before"?e:e+1,s=Math.min(Math.max(1,r),i.length),o=Array.from({length:n.columnCount},()=>"");return i.splice(s,0,o),To(i,n.alignments,s,0)}function Ca(n,e,t){const i=Po(n),r=t==="before"?e:e+1,s=Math.min(Math.max(0,r),n.columnCount);for(const a of i)a.splice(s,0,"");const o=[...n.alignments];return o.splice(s,0,"none"),To(i,o,0,s)}function Co(n,e){const t=Po(n);if(e<0||e>=t.length||e===0&&t.length>1)return null;if(t.splice(e,1),t.length===0)return{text:"",focusRow:0,focusCol:0,focusFrom:0,focusTo:0};const i=Math.min(e,t.length-1),r=Math.min(n.columnCount-1,Math.max(0,0));return To(t,n.alignments,i,r)}function lQ(n,e){if(e<0||e>=n.columnCount)return null;if(n.columnCount===1)return{text:"",focusRow:0,focusCol:0,focusFrom:0,focusTo:0};const t=Po(n);for(const s of t)s.splice(e,1);const i=n.alignments.filter((s,o)=>o!==e),r=Math.min(e,i.length-1);return To(t,i,0,r)}function nm(n,e){const t=n.rows[e];return t?t.cells.every(i=>i.text.trim().length===0):!1}function rm(n,e){const t=vQ(e),i=t.find(h=>h.name==="TableHeader"),r=t.find(h=>h.name==="TableDelimiter"),s=t.filter(h=>h.name==="TableRow");if(!i||!r)return null;const o=Xf(n,i,0,!0);if(!o||o.cells.length===0)return null;const a=fQ(n,r,o.cells.length);if(!a)return null;const l=[o];for(const[h,f]of s.entries()){const O=Xf(n,f,h+1,!1);if(!O||O.cells.length!==o.cells.length)return null;l.push(O)}return{from:e.from,to:e.to,delimiterFrom:r.from,delimiterTo:r.to,columnCount:o.cells.length,alignments:a,rows:l}}function Xf(n,e,t,i){const r=cQ(n,e.from,e.to);if(r.length===0)return null;const s=r.map((o,a)=>uQ(n,t,a,o.from,o.to,i));return{row:t,from:e.from,to:e.to,cells:s,isHeader:i}}function cQ(n,e,t){const i=[],r=hQ(n.sliceString(e,t)).map(o=>e+o);if(r.length===0)return i;if(r.length===1)return i.push({from:r[0]+1,to:t}),i;for(let o=0;o<r.length-1;o+=1)i.push({from:r[o]+1,to:r[o+1]});const s=r[r.length-1];return s+1<t&&i.push({from:s+1,to:t}),i.length===0&&e<t&&i.push({from:e,to:t}),i}function hQ(n){const e=[];let t=0;for(let i=0;i<n.length;i+=1){const r=n[i];if(r==="\\"){i+=1;continue}if(r==="`"){let s=1;for(;i+s<n.length&&n[i+s]==="`";)s+=1;t===0?t=s:t===s&&(t=0),i+=s-1;continue}r==="|"&&t===0&&e.push(i)}return e}function uQ(n,e,t,i,r,s){let o=i,a=r;for(;o<a;){const l=n.sliceString(o,o+1);if(l!==" "&&l!==" ")break;o+=1}for(;a>o;){const l=n.sliceString(a-1,a);if(l!==" "&&l!==" ")break;a-=1}return{row:e,col:t,from:i,to:r,contentFrom:o,contentTo:a,text:n.sliceString(o,a),isHeader:s}}function fQ(n,e,t){const i=n.sliceString(e.from,e.to).trim(),r=i.startsWith("|")?i.slice(1):i,o=(r.endsWith("|")?r.slice(0,-1):r).split("|").map(l=>l.trim());if(o.length!==t)return null;const a=o.map(dQ);return a.every(l=>l!==null)?a:null}function dQ(n){return/^:?-{3,}:?$/.test(n)?n.startsWith(":")&&n.endsWith(":")?"center":n.startsWith(":")?"left":n.endsWith(":")?"right":"none":null}function Po(n){return n.rows.map(e=>e.cells.map(t=>t.text))}function To(n,e,t,i){const r=n.map(h=>{const f=[...h];for(;f.length<e.length;)f.push("");return f.slice(0,e.length)});if(r.length===0)return{text:"",focusRow:0,focusCol:0,focusFrom:0,focusTo:0};const s=pQ(r,e),o=Math.min(Math.max(0,t),s.cellOffsets.length-1),a=Math.min(Math.max(0,i),s.cellOffsets[o].length-1),l=s.cellOffsets[o][a];return{text:s.text,focusRow:o,focusCol:a,focusFrom:l.contentFrom,focusTo:l.contentTo}}function pQ(n,e){const t=[],i=[];let r=0;for(let s=0;s<n.length;s+=1){const o=OQ(n[s],r);if(t.push(o.text),i.push(o.offsets),r+=o.text.length+1,s===0){const a=gQ(e);t.push(a),r+=a.length+1}}return{text:t.join(`
|
|
71
|
+
`),cellOffsets:i}}function OQ(n,e){let t="|";const i=[];for(const r of n){t+=" ";const s=e+t.length;t+=r;const o=e+t.length;t+=" |",i.push({contentFrom:s,contentTo:o})}return{text:t,offsets:i}}function gQ(n){return`| ${n.map(t=>{switch(t){case"left":return":---";case"right":return"---:";case"center":return":---:";default:return"---"}}).join(" | ")} |`}function mQ(n){let e=0,t="";for(;e<n.length;){if(n[e]==="`"){const r=sm(n,e,"`"),s=bQ(n,e+r,"`",r);if(s!==-1){t+=n.slice(e,s+r),e=s+r;continue}}const i=n[e];if(i==="|"&&!yQ(n,e)){t+="\\|",e+=1;continue}t+=i,e+=1}return t}function yQ(n,e){let t=0,i=e-1;for(;i>=0&&n[i]==="\\";)t+=1,i-=1;return t%2===1}function sm(n,e,t){let i=0,r=e;for(;n[r]===t;)i+=1,r+=1;return i}function bQ(n,e,t,i){let r=e;for(;r<n.length;){if(n[r]===t&&sm(n,r,t)===i)return r;r+=1}return-1}function vQ(n){const e=[];for(let t=n.firstChild;t;t=t.nextSibling)e.push(t);return e}function SQ(n){return Nn.parser.parse(n).topNode}const Pa=new WeakMap,kQ={focusCell:null,structureSelection:null,terminalTableSelection:null},Me=Oe.define(),Je=Oe.define(),Ni=Oe.define(),Le=Ct.define({create:()=>kQ,update(n,e){let t={focusCell:n.focusCell?{...n.focusCell,tableFrom:e.changes.mapPos(n.focusCell.tableFrom)}:null,structureSelection:n.structureSelection?{...n.structureSelection,tableFrom:e.changes.mapPos(n.structureSelection.tableFrom)}:null,terminalTableSelection:n.terminalTableSelection?{...n.terminalTableSelection,tableFrom:e.changes.mapPos(n.terminalTableSelection.tableFrom),anchor:e.changes.mapPos(n.terminalTableSelection.anchor)}:null};for(const i of e.effects)i.is(Me)&&(t={...t,focusCell:i.value,terminalTableSelection:i.value?null:t.terminalTableSelection}),i.is(Je)&&(t={...t,structureSelection:i.value,terminalTableSelection:i.value?null:t.terminalTableSelection}),i.is(Ni)&&(t={...t,terminalTableSelection:i.value,focusCell:i.value?null:t.focusCell,structureSelection:i.value?null:t.structureSelection});return t}}),wQ=Ct.define({create(n){return Aa(n)},update(n,e){const t=e.state.field(Le,!1)?.focusCell;return e.docChanged&&t?.editing&&!we(e.state,t.tableFrom)?n.map(e.changes):(e.docChanged||e.selection||e.effects.some(i=>i.is(Me)||i.is(Je)||i.is(Ni)),Aa(e.state))},provide:n=>z.decorations.from(n)}),xQ=z.theme({".cm-structured-table-wrapper":{position:"relative",margin:"0",display:"block",boxSizing:"border-box",width:"100%",maxWidth:"100%",paddingLeft:"1.5rem",paddingRight:"1.8rem",paddingBottom:"1.8rem",overflow:"visible"},".cm-structured-table-wrapper.cm-structured-table-wrapper-selected .cm-structured-table":{boxShadow:"inset 0 0 0 1px rgba(37, 99, 235, 0.5)",backgroundColor:"rgba(219, 234, 254, 0.08)"},".cm-structured-table":{width:"100%",borderCollapse:"collapse",borderSpacing:"0",tableLayout:"fixed",border:"none",backgroundColor:"transparent"},".cm-structured-table-handle, .cm-structured-table-add":{position:"absolute",zIndex:"10",border:"1px solid transparent",background:"transparent",color:"rgba(71, 85, 105, 0.92)",cursor:"pointer",fontSize:"0.72rem",lineHeight:"1",padding:"0.16rem 0.32rem",borderRadius:"999px",boxShadow:"none",opacity:"0",pointerEvents:"none",transition:"opacity 120ms ease, background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease"},".cm-structured-table-handle-visible, .cm-structured-table-add-visible":{opacity:"1",pointerEvents:"auto"},".cm-structured-table-handle-visible:hover, .cm-structured-table-add-visible:hover, .cm-structured-table-handle-visible:focus-visible, .cm-structured-table-add-visible:focus-visible":{borderColor:"rgba(148, 163, 184, 0.32)",background:"rgba(255, 255, 255, 0.96)",boxShadow:"0 4px 10px rgba(15, 23, 42, 0.08)",outline:"none"},".cm-structured-table-col-handle":{transform:"translate(-50%, calc(-100% - 6px))"},".cm-structured-table-row-handle":{transform:"translate(0, -50%) rotate(90deg)",transformOrigin:"center"},".cm-structured-table-header-cell, .cm-structured-table-cell":{borderBottom:"1px solid rgba(148, 163, 184, 0.18)",borderRight:"1px solid rgba(148, 163, 184, 0.12)",padding:"0.26rem 0.45rem",verticalAlign:"top",overflowWrap:"break-word",backgroundColor:"transparent"},".cm-structured-table-body-row:last-child .cm-structured-table-cell":{borderBottom:"none"},".cm-structured-table-header-cell:last-of-type, .cm-structured-table-cell:last-of-type":{borderRight:"none"},".cm-structured-table-header-cell":{fontWeight:"600",backgroundColor:"var(--una-table-header-bg, rgba(15, 23, 42, 0.04))"},".cm-structured-table-cell-content":{minHeight:"1.15rem",whiteSpace:"pre-wrap"},".cm-structured-table-cell-active":{boxShadow:"inset 0 0 0 1px rgba(37, 99, 235, 0.45)",backgroundColor:"rgba(219, 234, 254, 0.18)"},".cm-structured-table-cell-selected":{backgroundColor:"rgba(219, 234, 254, 0.12)"},".cm-structured-table-context-menu":{position:"absolute",zIndex:"30",display:"none",minWidth:"8rem",padding:"0.35rem",borderRadius:"10px",border:"1px solid rgba(148, 163, 184, 0.35)",backgroundColor:"white",boxShadow:"0 12px 32px rgba(15, 23, 42, 0.16)"},".cm-structured-table-context-menu.cm-structured-table-context-menu-visible":{display:"grid",gap:"0.2rem"},".cm-structured-table-context-action":{border:"none",background:"transparent",borderRadius:"6px",textAlign:"left",padding:"0.34rem 0.48rem",cursor:"pointer",fontSize:"0.82rem"},".cm-structured-table-overlay":{position:"absolute",zIndex:"25",resize:"none",margin:"0",padding:"0.26rem 0.45rem",borderRadius:"0",border:"none",outline:"none",appearance:"none",boxSizing:"border-box",boxShadow:"inset 0 0 0 1px rgba(37, 99, 235, 0.52)",font:"inherit",lineHeight:"inherit",overflow:"hidden",display:"none",backgroundColor:"rgba(255, 255, 255, 0.98)"},".cm-structured-table-overlay.cm-structured-table-overlay-visible":{display:"block"},".cm-structured-table-overlay.cm-structured-table-overlay-readonly":{backgroundColor:"transparent",boxShadow:"none",color:"transparent",caretColor:"#0f172a"},".cm-structured-table-side-add":{transform:"translateY(-50%)"},".cm-structured-table-bottom-add":{transform:"translate(-50%, 6px)"},".cm-structured-table-inline-code":{backgroundColor:"rgba(15, 23, 42, 0.08)",borderRadius:"4px",padding:"0.08em 0.28em",fontFamily:"var(--una-code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace)"},".cm-structured-table-link":{color:"#0b57d0",textDecoration:"underline",textUnderlineOffset:"0.18em"},".cm-structured-table-image":{display:"block",maxWidth:"100%",maxHeight:"10rem",borderRadius:"8px",objectFit:"contain"}});class om extends bt{constructor(e,t,i){super(),this.table=e,this.uiState=t,this.activeCellFromSelection=CQ(this.table,i)}eq(e){return this.table.from===e.table.from&&this.table.to===e.table.to&&this.table.rows.length===e.table.rows.length&&this.table.rows.every((t,i)=>t.cells.every((r,s)=>r.text===e.table.rows[i]?.cells[s]?.text))&&this.activeCellFromSelection?.row===e.activeCellFromSelection?.row&&this.activeCellFromSelection?.col===e.activeCellFromSelection?.col&&cm(this.uiState.focusCell,e.uiState.focusCell)&&AQ(this.uiState.structureSelection,e.uiState.structureSelection)&&MQ(this.uiState.terminalTableSelection,e.uiState.terminalTableSelection)}get estimatedHeight(){return jQ(this.table)}toDOM(e){const t=document.createElement("div");t.className="cm-structured-table-wrapper",t.dataset.tableFrom=String(this.table.from),t.contentEditable="false",this.isTableSelected()&&t.classList.add("cm-structured-table-wrapper-selected");const i=document.createElement("table");i.className="cm-structured-table",i.dataset.tableFrom=String(this.table.from),i.tabIndex=-1;const r=document.createElement("tbody");for(const s of this.table.rows)r.appendChild(this.buildDataRow(s));return i.appendChild(r),t.appendChild(i),t.appendChild(this.buildColumnHandles()),t.appendChild(this.buildRowHandles()),t.appendChild(this.buildSideAddButton()),t.appendChild(this.buildBottomAddButton()),this.bindRemeasureOnImageLoad(t,e),t}ignoreEvent(){return!0}coordsAt(e,t,i){const r=this.table.from+t,s=am(this.table,r,i);if(!s)return e.getBoundingClientRect();const o=e.querySelector(`[data-cell-row="${s.cell.row}"][data-cell-col="${s.cell.col}"]`);if(!o)return e.getBoundingClientRect();const a=o.querySelector(".cm-structured-table-cell-content")??o,l=Wt(s.position-s.cell.contentFrom,0,a.textContent?.length??s.cell.text.length);return PQ(a,l,i)??o.getBoundingClientRect()}buildColumnHandles(){const e=document.createDocumentFragment();for(let t=0;t<this.table.columnCount;t+=1){const i=document.createElement("button");i.className="cm-structured-table-handle cm-structured-table-col-handle",i.type="button",i.textContent=":::",i.dataset.tableFrom=String(this.table.from),i.dataset.structureKind="column",i.dataset.structureIndex=String(t),i.dataset.action="select-column",i.dataset.colHandle="true",this.isColumnSelected(t)&&(i.dataset.selected="true"),e.appendChild(i)}return e}buildDataRow(e){const t=document.createElement("tr");t.className=e.isHeader?"cm-structured-table-header-row":"cm-structured-table-body-row";for(const i of e.cells){const r=e.isHeader?document.createElement("th"):document.createElement("td");r.className=e.isHeader?"cm-structured-table-header-cell":"cm-structured-table-cell",r.dataset.tableFrom=String(this.table.from),r.dataset.cellRow=String(i.row),r.dataset.cellCol=String(i.col),r.dataset.cellFrom=String(i.from),r.dataset.cellTo=String(i.to),r.dataset.contentFrom=String(i.contentFrom),r.dataset.contentTo=String(i.contentTo),r.dataset.action="focus-cell";const s=_Q(this.table.alignments[i.col]);r.dataset.align=s,r.style.textAlign=s,i.col===0&&(r.dataset.firstCol="true"),i.col===this.table.columnCount-1&&(r.dataset.lastCol="true"),i.row===0&&(r.dataset.topRow="true"),i.row===this.table.rows.length-1&&(r.dataset.bottomRow="true");const o=this.isFocusedCell(i.row,i.col);o&&r.classList.add("cm-structured-table-cell-active"),(this.isTableSelected()||this.isRowSelected(i.row)||this.isColumnSelected(i.col))&&r.classList.add("cm-structured-table-cell-selected");const a=document.createElement("div");a.className="cm-structured-table-cell-content",o?a.textContent=i.text:a.appendChild(WQ(i.text)),r.appendChild(a),t.appendChild(r)}return t}buildRowHandles(){const e=document.createDocumentFragment();for(const t of this.table.rows){const i=document.createElement("button");i.className="cm-structured-table-handle cm-structured-table-row-handle",i.type="button",i.textContent=":::",i.dataset.tableFrom=String(this.table.from),i.dataset.structureKind="row",i.dataset.structureIndex=String(t.row),i.dataset.action="select-row",i.dataset.rowHandle="true",this.isRowSelected(t.row)&&(i.dataset.selected="true"),e.appendChild(i)}return e}buildSideAddButton(){const e=document.createElement("button");return e.className="cm-structured-table-add cm-structured-table-side-add",e.type="button",e.textContent="+",e.dataset.tableFrom=String(this.table.from),e.dataset.action="append-column",e.dataset.sideAdd="true",e}buildBottomAddButton(){const e=document.createElement("button");return e.className="cm-structured-table-add cm-structured-table-bottom-add",e.type="button",e.textContent="+",e.dataset.tableFrom=String(this.table.from),e.dataset.action="append-row",e.dataset.bottomAdd="true",e}bindRemeasureOnImageLoad(e,t){const i=e.querySelectorAll(".cm-structured-table-image");if(queueMicrotask(()=>{e.isConnected&&t.requestMeasure()}),window.setTimeout(()=>{e.isConnected&&t.requestMeasure()},0),typeof ResizeObserver<"u"){const r=new ResizeObserver(()=>{e.isConnected&&t.requestMeasure()});r.observe(e),Pa.set(e,r)}if(i.length)for(const r of i){if(r.complete)continue;const s=()=>{e.isConnected&&t.requestMeasure()};r.addEventListener("load",s,{once:!0}),r.addEventListener("error",s,{once:!0})}}destroy(e){Pa.get(e)?.disconnect(),Pa.delete(e)}isFocusedCell(e,t){if(this.isTableSelected()||this.uiState.structureSelection?.tableFrom===this.table.from)return!1;if(this.activeCellFromSelection?.row===e&&this.activeCellFromSelection?.col===t)return!0;const r=this.uiState.focusCell;return!!(r&&r.tableFrom===this.table.from&&r.row===e&&r.col===t)}isRowSelected(e){const t=this.uiState.structureSelection;return!!(t&&t.tableFrom===this.table.from&&t.kind==="row"&&t.index===e)}isColumnSelected(e){const t=this.uiState.structureSelection;return!!(t&&t.tableFrom===this.table.from&&t.kind==="column"&&t.index===e)}isTableSelected(){return this.uiState.terminalTableSelection?.tableFrom===this.table.from}}class Dc extends Di{constructor(e){super(),this.lineNumber=e}eq(e){return e instanceof Dc&&e.lineNumber===this.lineNumber}toDOM(){return document.createTextNode(String(this.lineNumber))}}class QQ{constructor(e){this.view=e,this.isComposing=!1,this.pendingVimEditingSync=!1,this.pendingOverlayFocus=!1,this.pendingOverlayRefocusTimer=null,this.pendingSelectionNormalization=!1,this.pendingOutsideClear=!1,this.pendingHoverClearTimer=null,this.menuState=null,this.pendingSelection=null,this.hoveredCell=null,this.lastOverlayCellKey=null,this.mouseDownFocusedCellKey=null,this.fallbackEditingCell=null,this.handleMouseDown=t=>{const i=t.target;if(!(i instanceof HTMLElement)||i===this.overlay||i.closest(".cm-structured-table-overlay"))return;const r=i.closest(".cm-structured-table-context-menu [data-action]");if(r&&(r.dataset.action==="menu-delete"||r.dataset.action==="menu-insert-before"||r.dataset.action==="menu-insert-after")){t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.handleMenuAction(r),this.mouseDownFocusedCellKey=null;return}if(!i.closest(".cm-structured-table-wrapper"))return;const o=i.closest("[data-action]"),a=o?.dataset.action;if(t.button!==0){this.mouseDownFocusedCellKey=null;return}if(a!=="focus-cell"){this.mouseDownFocusedCellKey=null;return}t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.closeMenu(),this.focusCellFromElement(o,t),this.mouseDownFocusedCellKey=Vf(o)},this.handleClick=t=>{const i=t.target;if(!(i instanceof HTMLElement)||i===this.overlay||i.closest(".cm-structured-table-overlay"))return;i.closest(".cm-structured-table-wrapper")&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation());const s=i.closest("[data-action]");if(!s){this.closeMenu(),i.closest(".cm-structured-table-wrapper")||this.scheduleOutsideClear(i);return}const o=s.dataset.action,a=Number(s.dataset.tableFrom);switch(o){case"focus-cell":if(this.closeMenu(),this.mouseDownFocusedCellKey===Vf(s)){this.mouseDownFocusedCellKey=null;return}this.focusCellFromElement(s,t);return;case"select-row":case"select-column":this.closeMenu(),this.selectStructureFromElement(s);return;case"append-row":this.closeMenu(),this.runAppendRow(a);return;case"append-column":this.closeMenu(),this.runAppendColumn(a);return;case"menu-delete":case"menu-insert-before":case"menu-insert-after":this.handleMenuAction(s);return;default:this.closeMenu()}this.mouseDownFocusedCellKey=null},this.handleContextMenu=t=>{const i=t.target;if(!(i instanceof HTMLElement))return;const r=this.resolveContextMenuSelection(i);r&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.view.dispatch({effects:[Je.of(r),Me.of(null)]}),this.menuState={x:t.clientX,y:t.clientY,selection:r},this.syncMenu())},this.handleScroll=()=>{this.syncOverlay(),this.syncMenu(),this.syncHoverAffordances()},this.handleMouseMove=t=>{const i=t.target;if(!(i instanceof HTMLElement))return;if(i.closest("[data-row-handle], [data-col-handle], [data-side-add], [data-bottom-add]")){this.cancelHoverClear();return}const r=i.closest('[data-action="focus-cell"]');if(r){this.cancelHoverClear(),this.hoveredCell={tableFrom:Number(r.dataset.tableFrom),row:Number(r.dataset.cellRow),col:Number(r.dataset.cellCol)},this.syncHoverAffordances();return}i.closest(".cm-structured-table-wrapper")||this.scheduleHoverClear()},this.handleMouseLeave=()=>{this.scheduleHoverClear()},this.handleKeyDown=t=>{if(t.defaultPrevented||t.metaKey||t.ctrlKey||t.altKey||t.target===this.overlay||!Dr(this.view)||to(this.view))return;const i=Ao(this.view);if(!i&&(t.key==="j"||t.key==="k")){if(!XQ(this.view,t.key==="j"?1:-1))return;t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.closeMenu();return}if(!i)return;let r=!1;switch(t.key){case"h":r=ro(this.view,-1);break;case"l":r=ro(this.view,1);break;case"j":r=so(this.view,1);break;case"k":r=so(this.view,-1);break;case"w":r=oo(this.view,!0);break;case"b":r=oo(this.view,!1);break;case"i":case"a":r=IQ(this.view,t.key);break;case"Escape":r=um(this.view);break;case"d":r=Vc(this.view,t.key);break;default:r=!1}r&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),this.closeMenu())},this.overlay=this.createOverlay(),this.menu=this.createMenu(),this.view.dom.appendChild(this.overlay),this.view.dom.appendChild(this.menu),this.bindDomEvents(),this.syncOverlay(),this.syncMenu()}update(e){e.selectionSet&&this.scheduleSelectionNormalization(),this.syncOverlay(),this.syncMenu(),this.syncHoverAffordances()}destroy(){this.view.dom.removeEventListener("mousedown",this.handleMouseDown),this.view.dom.removeEventListener("click",this.handleClick),this.view.dom.removeEventListener("contextmenu",this.handleContextMenu),this.view.dom.removeEventListener("mousemove",this.handleMouseMove),this.view.dom.removeEventListener("mouseleave",this.handleMouseLeave),this.view.dom.removeEventListener("scroll",this.handleScroll,!0),this.view.dom.removeEventListener("keydown",this.handleKeyDown,!0),this.pendingOverlayRefocusTimer!=null&&window.clearTimeout(this.pendingOverlayRefocusTimer),this.pendingHoverClearTimer!=null&&window.clearTimeout(this.pendingHoverClearTimer),this.overlay.remove(),this.menu.remove()}bindDomEvents(){this.view.dom.addEventListener("mousedown",this.handleMouseDown,!0),this.view.dom.addEventListener("click",this.handleClick,!0),this.view.dom.addEventListener("contextmenu",this.handleContextMenu,!0),this.view.dom.addEventListener("mousemove",this.handleMouseMove),this.view.dom.addEventListener("mouseleave",this.handleMouseLeave),this.view.dom.addEventListener("scroll",this.handleScroll,!0),this.view.dom.addEventListener("keydown",this.handleKeyDown,!0)}createOverlay(){const e=document.createElement("textarea");return e.className="cm-structured-table-overlay",e.spellcheck=!1,e.rows=1,e.addEventListener("compositionstart",()=>{this.isComposing=!0}),e.addEventListener("compositionend",()=>{this.isComposing=!1,this.ensureFocusedCellVisibleForEditing(),this.syncTextareaToDocument()}),e.addEventListener("input",()=>{this.ensureFocusedCellVisibleForEditing(),this.syncTextareaToDocument()}),e.addEventListener("keydown",t=>{LQ(this.view,e,t)&&this.closeMenu()}),e.addEventListener("select",()=>{this.syncOverlaySelectionToDocument()}),e.addEventListener("mouseup",()=>{this.syncOverlaySelectionToDocument()}),e.addEventListener("paste",t=>{t.preventDefault(),this.ensureFocusedCellVisibleForEditing();const i=t.clipboardData?.getData("text/plain")??"",r=aQ(i),s=e.selectionStart,o=e.selectionEnd;e.setRangeText(r,s,o,"end"),this.pendingSelection={start:e.selectionStart,end:e.selectionEnd},this.syncTextareaToDocument()}),e}createMenu(){const e=document.createElement("div");return e.className="cm-structured-table-context-menu",e}syncTextareaToDocument(){const e=this.view.state.field(Le).focusCell;if(!e)return;const t=this.resolveEditingCellBinding(e);if(!t)return;const i=$a(this.overlay.value),r=this.pendingSelection?.start??this.overlay.selectionStart,s=this.pendingSelection?.end??this.overlay.selectionEnd;this.pendingSelection=null;const o=$a(this.overlay.value.slice(0,r)),a=$a(this.overlay.value.slice(0,s));this.view.dispatch({changes:{from:t.contentFrom,to:t.contentTo,insert:i},selection:Z.single(t.contentFrom+o.length,t.contentFrom+a.length),effects:Me.of({...e,editing:We(this.view)})}),this.fallbackEditingCell={tableFrom:e.tableFrom,row:e.row,col:e.col,from:t.contentFrom,to:t.contentFrom+i.length,contentFrom:t.contentFrom,contentTo:t.contentFrom+i.length,text:i,isHeader:e.row===0}}syncOverlaySelectionToDocument(){const e=this.view.state.field(Le).focusCell;if(!e)return;const t=this.resolveEditingCellBinding(e);t&&this.view.dispatch({selection:Z.single(t.contentFrom+this.overlay.selectionStart,t.contentFrom+this.overlay.selectionEnd),effects:Me.of({...e,editing:We(this.view)})})}hideOverlay(e=!1){this.overlay.classList.remove("cm-structured-table-overlay-visible"),this.overlay.classList.remove("cm-structured-table-overlay-readonly"),document.activeElement===this.overlay&&this.overlay.blur(),e&&(this.view.focus(),queueMicrotask(()=>{this.view.focus()}),window.setTimeout(()=>{this.view.focus()},0))}overlayOwnsFocus(){return this.view.dom.ownerDocument.activeElement===this.overlay}shouldRestoreEditorFocus(){return this.overlayOwnsFocus()||this.overlay.classList.contains("cm-structured-table-overlay-visible")}syncOverlay(){const t=this.view.state.field(Le).focusCell;if(t&&Dr(this.view)&&t.editing!==to(this.view)){this.scheduleVimEditingSync();return}if(!t||!t.editing){this.hideOverlay(this.shouldRestoreEditorFocus()),this.lastOverlayCellKey=null,this.fallbackEditingCell=null;return}const r=we(this.view.state,t.tableFrom)?.rows[t.row]?.cells[t.col];r&&(this.fallbackEditingCell={tableFrom:t.tableFrom,row:t.row,col:t.col,from:r.from,to:r.to,contentFrom:r.contentFrom,contentTo:r.contentTo,text:r.text,isHeader:r.isHeader});const s=r??this.resolveEditingCellBinding(t);if(!s){this.hideOverlay(this.shouldRestoreEditorFocus()),this.lastOverlayCellKey=null;return}const o=this.findCellElement(t.tableFrom,t.row,t.col);if(!o){this.hideOverlay(this.shouldRestoreEditorFocus());return}const a=o.getBoundingClientRect(),l=this.view.dom.getBoundingClientRect(),h=s.text,f=`${t.tableFrom}:${t.row}:${t.col}:${t.editing}`,O=this.lastOverlayCellKey!==f,m=O||!t.editing;if(!this.isComposing&&m&&this.overlay.value!==h&&(this.overlay.value=h),this.overlay.style.left=`${a.left-l.left}px`,this.overlay.style.top=`${a.top-l.top}px`,this.overlay.style.width=`${a.width}px`,this.overlay.style.height=`${a.height}px`,this.overlay.readOnly=!1,this.overlay.classList.add("cm-structured-table-overlay-visible"),this.overlay.classList.remove("cm-structured-table-overlay-readonly"),this.pendingSelection)this.overlay.setSelectionRange(this.pendingSelection.start,this.pendingSelection.end),this.pendingSelection=null;else if(O){const b=DQ(this.view.state,s);this.overlay.setSelectionRange(b.start,b.end)}this.scheduleOverlayFocus(),this.lastOverlayCellKey=f}ensureFocusedCellVisibleForEditing(){const e=this.view.state.field(Le).focusCell;if(!e?.editing)return;const t=this.findCellElement(e.tableFrom,e.row,e.col);if(t){const i=t.getBoundingClientRect(),r=this.view.dom.getBoundingClientRect();if(i.bottom>=r.top&&i.top<=r.bottom)return}this.view.dispatch({selection:this.view.state.selection,effects:Me.of({...e}),scrollIntoView:!0})}scheduleVimEditingSync(){this.pendingVimEditingSync||(this.pendingVimEditingSync=!0,queueMicrotask(()=>{this.pendingVimEditingSync=!1,_c(this.view)}))}scheduleOverlayFocus(){this.pendingOverlayFocus||(this.pendingOverlayFocus=!0,queueMicrotask(()=>{this.pendingOverlayFocus=!1,this.overlay.classList.contains("cm-structured-table-overlay-visible")&&(this.overlay.focus(),this.pendingOverlayRefocusTimer!=null&&window.clearTimeout(this.pendingOverlayRefocusTimer),this.pendingOverlayRefocusTimer=window.setTimeout(()=>{this.pendingOverlayRefocusTimer=null,this.overlay.classList.contains("cm-structured-table-overlay-visible")&&this.overlay.focus()},0))}))}scheduleSelectionNormalization(){this.pendingSelectionNormalization||(this.pendingSelectionNormalization=!0,queueMicrotask(()=>{this.pendingSelectionNormalization=!1,$Q(this.view)}))}cancelHoverClear(){this.pendingHoverClearTimer!=null&&(window.clearTimeout(this.pendingHoverClearTimer),this.pendingHoverClearTimer=null)}scheduleHoverClear(){this.cancelHoverClear(),this.pendingHoverClearTimer=window.setTimeout(()=>{this.pendingHoverClearTimer=null,this.hoveredCell=null,this.syncHoverAffordances()},140)}syncMenu(){if(!this.menuState){this.menu.className="cm-structured-table-context-menu",this.menu.innerHTML="";return}this.menu.className="cm-structured-table-context-menu cm-structured-table-context-menu-visible",this.menu.style.left=`${this.menuState.x-this.view.dom.getBoundingClientRect().left}px`,this.menu.style.top=`${this.menuState.y-this.view.dom.getBoundingClientRect().top}px`,this.menu.innerHTML="";const e=[{action:"menu-insert-before",label:this.menuState.selection.kind==="row"?"Insert Row Before":"Insert Column Before"},{action:"menu-insert-after",label:this.menuState.selection.kind==="row"?"Insert Row After":"Insert Column After"},{action:"menu-delete",label:this.menuState.selection.kind==="row"?"Delete Row":"Delete Column"}];for(const t of e){const i=document.createElement("button");i.type="button",i.className="cm-structured-table-context-action",i.textContent=t.label,i.dataset.action=t.action,i.dataset.tableFrom=String(this.menuState.selection.tableFrom),i.dataset.structureKind=this.menuState.selection.kind,i.dataset.structureIndex=String(this.menuState.selection.index),this.menu.appendChild(i)}}syncHoverAffordances(){for(const i of this.view.dom.querySelectorAll("[data-row-handle], [data-col-handle]"))i.classList.remove("cm-structured-table-handle-visible"),i.style.top="",i.style.left="";for(const i of this.view.dom.querySelectorAll("[data-side-add], [data-bottom-add]"))i.classList.remove("cm-structured-table-add-visible"),i.style.top="",i.style.left="";const e=this.hoveredCell;if(!e)return;const t=we(this.view.state,e.tableFrom);if(t){if(e.col===0){const i=this.findCellElement(e.tableFrom,e.row,e.col),r=this.view.dom.querySelector(`.cm-structured-table-wrapper[data-table-from="${e.tableFrom}"]`),s=this.view.dom.querySelector(`[data-row-handle="true"][data-table-from="${e.tableFrom}"][data-structure-index="${e.row}"]`);if(s&&i&&r){const o=i.getBoundingClientRect(),a=r.getBoundingClientRect();s.style.left="4px",s.style.top=`${o.top-a.top+o.height/2}px`,s.classList.add("cm-structured-table-handle-visible")}}if(e.row===0){const i=this.findCellElement(e.tableFrom,e.row,e.col),r=this.view.dom.querySelector(`.cm-structured-table-wrapper[data-table-from="${e.tableFrom}"]`),s=this.view.dom.querySelector(`[data-col-handle="true"][data-table-from="${e.tableFrom}"][data-structure-index="${e.col}"]`);if(s&&i&&r){const o=i.getBoundingClientRect(),a=r.getBoundingClientRect();s.style.left=`${o.left-a.left+o.width/2}px`,s.style.top="0px",s.classList.add("cm-structured-table-handle-visible")}}if(e.col===t.columnCount-1){const i=this.view.dom.querySelector(`[data-side-add="true"][data-table-from="${e.tableFrom}"]`),r=this.view.dom.querySelector(`.cm-structured-table-wrapper[data-table-from="${e.tableFrom}"]`),s=this.findCellElement(e.tableFrom,e.row,e.col);if(i&&r&&s){const o=r.getBoundingClientRect(),a=s.getBoundingClientRect();i.style.top=`${a.top-o.top+a.height/2}px`,i.style.left=`${a.right-o.left+6}px`,i.classList.add("cm-structured-table-add-visible")}}if(e.row===t.rows.length-1){const i=this.view.dom.querySelector(`[data-bottom-add="true"][data-table-from="${e.tableFrom}"]`),r=this.view.dom.querySelector(`.cm-structured-table-wrapper[data-table-from="${e.tableFrom}"]`),s=this.findCellElement(e.tableFrom,e.row,e.col);if(i&&r&&s){const o=r.getBoundingClientRect(),a=s.getBoundingClientRect();i.style.left=`${a.left-o.left+a.width/2}px`,i.style.top=`${a.bottom-o.top}px`,i.classList.add("cm-structured-table-add-visible")}}}}focusCellFromElement(e,t){const i=Number(e.dataset.cellRow),r=Number(e.dataset.cellCol),s=Number(e.dataset.tableFrom),o=we(this.view.state,s),a=o?.rows[i]?.cells[r];if(!o||!a)return;this.fallbackEditingCell={tableFrom:s,row:i,col:r,from:a.from,to:a.to,contentFrom:a.contentFrom,contentTo:a.contentTo,text:a.text,isHeader:a.isHeader};const l=We(this.view),h=t?VQ(e,t,a.text.length):0;this.view.dispatch({selection:Z.single(a.contentFrom+h),effects:[Me.of({tableFrom:s,row:i,col:r,editing:l}),Je.of(null)],scrollIntoView:!0}),this.hoveredCell={tableFrom:s,row:i,col:r},this.syncHoverAffordances(),l||(this.view.focus(),this.syncOverlay())}clearFocusedCell(){const e=this.view.state.field(Le);!e.focusCell&&!e.structureSelection&&!e.terminalTableSelection||(this.fallbackEditingCell=null,this.view.dispatch({effects:[Me.of(null),Je.of(null),Ni.of(null)]}))}scheduleOutsideClear(e){this.pendingOutsideClear||(this.pendingOutsideClear=!0,window.setTimeout(()=>{this.pendingOutsideClear=!1,document.activeElement===this.overlay&&this.overlay.blur(),this.clearFocusedCell(),e.closest(".cm-content, .cm-line, .cm-editor, .cm-scroller")&&(this.view.focus(),queueMicrotask(()=>{this.view.focus()}),window.setTimeout(()=>{this.view.focus()},0))},0))}resolveContextMenuSelection(e){const t=e.closest("[data-structure-kind]");if(t)return{tableFrom:Number(t.dataset.tableFrom),kind:t.dataset.structureKind,index:Number(t.dataset.structureIndex)};const i=this.view.state.field(Le).structureSelection;if(!i)return null;const r=e.closest('[data-action="focus-cell"]');if(!r)return null;const s=Number(r.dataset.tableFrom),o=Number(r.dataset.cellRow),a=Number(r.dataset.cellCol);return s!==i.tableFrom?null:i.kind==="row"&&o===i.index||i.kind==="column"&&a===i.index?i:null}selectStructureFromElement(e){const t=e.dataset.structureKind,i=Number(e.dataset.structureIndex),r=Number(e.dataset.tableFrom);this.fallbackEditingCell=null,this.view.dispatch({effects:[Je.of({tableFrom:r,kind:t,index:i}),Me.of(null)]})}runAppendRow(e){const t=we(this.view.state,e);if(!t)return;const i=Zi(t,t.rows.length-1,"after");vi(this.view,t,i,!0)}runAppendColumn(e){const t=we(this.view.state,e);if(!t)return;const i=Ca(t,t.columnCount-1,"after");vi(this.view,t,i,!0)}handleMenuAction(e){const t=e.dataset.action,i=e.dataset.structureKind,r=Number(e.dataset.structureIndex),s=Number(e.dataset.tableFrom),o=we(this.view.state,s);if(!o)return;let a=null;i==="row"?t==="menu-delete"?a=Co(o,r):t==="menu-insert-before"?a=Zi(o,r,"before"):t==="menu-insert-after"&&(a=Zi(o,r,"after")):t==="menu-delete"?a=lQ(o,r):t==="menu-insert-before"?a=Ca(o,r,"before"):t==="menu-insert-after"&&(a=Ca(o,r,"after")),this.closeMenu(),a&&vi(this.view,o,a,!0)}closeMenu(){this.menuState=null,this.syncMenu()}findCellElement(e,t,i){return this.view.dom.querySelector(`[data-table-from="${e}"][data-cell-row="${t}"][data-cell-col="${i}"]`)}resolveEditingCellBinding(e){const i=we(this.view.state,e.tableFrom)?.rows[e.row]?.cells[e.col];if(i)return{tableFrom:e.tableFrom,row:e.row,col:e.col,from:i.from,to:i.to,contentFrom:i.contentFrom,contentTo:i.contentTo,text:i.text,isHeader:i.isHeader};const r=this.fallbackEditingCell;return r&&r.tableFrom===e.tableFrom&&r.row===e.row&&r.col===e.col?r:null}}function $Q(n){const e=n.state.selection.main;if(!e.empty)return!1;const t=e.head,i=we(n.state,t);if(!i||t<i.from||t>i.to)return!1;const r=am(i,t,1);if(!r)return!1;const s=Wt(t,r.cell.contentFrom,r.cell.contentTo),o={tableFrom:i.from,row:r.cell.row,col:r.cell.col,editing:We(n)},a=n.state.field(Le).focusCell,l=s!==t,h=!cm(a,o);return!l&&!h?!1:(n.dispatch({selection:Z.single(s),effects:[Me.of(o),Je.of(null)]}),!0)}function am(n,e,t){for(const s of n.rows){if(e>=s.from&&e<=s.to){const o=lm(s,e,t);if(o)return{cell:o,position:Wt(e,o.contentFrom,o.contentTo)}}for(const o of s.cells){if(e>=o.contentFrom&&e<=o.contentTo)return{cell:o,position:e};if(e>o.from&&e<o.to)return{cell:o,position:t<0?o.contentFrom:t>0?o.contentTo:Wt(e,o.contentFrom,o.contentTo)}}}if(e<=n.from){const s=n.rows[0]?.cells[0];return s?{cell:s,position:s.contentFrom}:null}const i=n.rows[n.rows.length-1],r=i?.cells[i.cells.length-1];return r?{cell:r,position:r.contentTo}:null}function CQ(n,e){for(const t of n.rows){if(e>=t.from&&e<=t.to){const i=lm(t,e,1);if(i)return{row:t.row,col:i.col}}for(const i of t.cells)if(e>=i.from&&e<=i.to)return{row:t.row,col:i.col}}return null}function lm(n,e,t){if(!n.cells.length)return null;if(e<=n.cells[0].from)return n.cells[0];for(let i=0;i<n.cells.length;i+=1){const r=n.cells[i];if(e>=r.from&&e<=r.to)return r;const s=n.cells[i+1];if(s&&e>r.to&&e<s.from)return t<0?r:s}return n.cells[n.cells.length-1]}function PQ(n,e,t){const i=document.createRange(),r=TQ(n,e,t);if(!r)return n.getBoundingClientRect();i.setStart(r.node,r.offset),i.setEnd(r.node,r.offset);const o=i.getClientRects()[0]??i.getBoundingClientRect();if(!o)return n.getBoundingClientRect();if(o.width||o.height)return o;const a=n.getBoundingClientRect();return new DOMRect(o.left||a.left,o.top||a.top,1,o.height||a.height)}function TQ(n,e,t){const i=[],r=document.createTreeWalker(n,NodeFilter.SHOW_TEXT);let s=r.nextNode();for(;s;)s.nodeType===Node.TEXT_NODE&&i.push(s),s=r.nextNode();if(!i.length)return{node:n,offset:t<0?0:n.childNodes.length};let o=e;for(const l of i){const h=l.textContent?.length??0;if(o<=h)return{node:l,offset:Wt(o,0,h)};o-=h}const a=i[i.length-1];return{node:a,offset:a.textContent?.length??0}}function cm(n,e){return n?.tableFrom===e?.tableFrom&&n?.row===e?.row&&n?.col===e?.col&&n?.editing===e?.editing}function AQ(n,e){return n?.tableFrom===e?.tableFrom&&n?.kind===e?.kind&&n?.index===e?.index}function MQ(n,e){return n?.tableFrom===e?.tableFrom&&n?.anchor===e?.anchor}function We(n){const e=Gi(n);return e?!!e.state.vim?.insertMode:!0}function _c(n){const t=n.state.field(Le).focusCell;if(!t||!Dr(n))return!1;const i=to(n);return t.editing===i?!1:(n.dispatch({effects:Me.of({...t,editing:i})}),!0)}function to(n){const e=Gi(n);return!!e?.state.vim&&!!e?.state.vim?.insertMode}function Dr(n){return!!Gi(n)?.state.vim}function Ie(n,e,t,i=!0,r="end"){const o=n.state.field(Le).focusCell;if(!o)return!1;const a=we(n.state,o.tableFrom),l=a?.rows[e]?.cells[t];if(!a||!l)return!1;const h=r==="start"?l.contentFrom:r==="end"?l.contentTo:l.contentFrom+Wt(r,0,l.contentTo-l.contentFrom);return n.dispatch({selection:Z.single(h),effects:[Me.of({tableFrom:o.tableFrom,row:e,col:t,editing:i}),Je.of(null)],scrollIntoView:!0}),!0}function io(n,e,t,i=n.state.selection.main.head){if(!n.state.selection.main.empty)return!1;const o=n.state.doc.lineAt(i).number+e;if(o<1||o>n.state.doc.lines)return!1;const a=n.state.doc.line(o),l=hm(n.state,a.from,a.to);if(!l)return!1;const h=e>0?0:l.rows.length-1,f=l.rows[h]?.cells[0];return f?(n.dispatch({selection:Z.single(f.contentFrom),effects:[Me.of({tableFrom:l.from,row:h,col:0,editing:t}),Je.of(null)],scrollIntoView:!0}),!0):!1}function hm(n,e,t){if(e>t)return null;const i=new Set([e,Math.min(t,e+1),t,Math.max(e,t-1)]);for(const r of i){const s=we(n,r);if(s)return s}return Ic(n,e,t)[0]??null}function jc(n){const e=n.state.field(Le);return e.focusCell?(n.dispatch({effects:Me.of({...e.focusCell,editing:!1})}),!0):!1}function vi(n,e,t,i){const r=e.from;let s=e.to,o=e.from;t.text||(n.state.doc.sliceString(s,s+1)===`
|
|
72
|
+
`&&(s+=1),o=r);const a=o+t.focusTo,l=o+t.focusFrom;return n.dispatch({changes:{from:r,to:s,insert:t.text},selection:Z.single(a,l),effects:[Me.of(t.text?{tableFrom:e.from,row:t.focusRow,col:t.focusCol,editing:i}:null),Je.of(null)],scrollIntoView:!0}),!0}function RQ(n,e,t){const i=n.doc.length;if(t==="end"){for(let r=Math.min(i,e.to+1);r<=i;r+=1){const s=we(n,r);if(!s||s.from!==e.from)return r}return i}for(let r=Math.max(0,e.from-1);r>=0;r-=1){const s=we(n,r);if(!s||s.from!==e.from)return r}return 0}function no(n,e,t){const i=RQ(n.state,e,t);return n.dispatch({selection:Z.single(i),effects:[Me.of(null),Je.of(null)],scrollIntoView:!0}),n.focus(),queueMicrotask(()=>{n.focus()}),window.setTimeout(()=>{n.focus()},0),!0}function gs(n,e){const i=n.state.field(Le).focusCell;if(!i)return!1;const r=we(n.state,i.tableFrom);return r?e==="left"?i.col===0?!1:Ie(n,i.row,i.col-1,!0,"end"):e==="right"?i.col>=r.columnCount-1?!1:Ie(n,i.row,i.col+1,!0,"start"):e==="up"?i.row===0?no(n,r,"start"):Ie(n,i.row-1,i.col,!0,"end"):i.row>=r.rows.length-1?no(n,r,"end"):Ie(n,i.row+1,i.col,!0,"end"):!1}function LQ(n,e,t){const r=n.state.field(Le).focusCell;if(!r)return!1;if((t.metaKey||t.ctrlKey)&&!t.altKey){const o=t.key.toLowerCase();if(o==="z")return t.preventDefault(),t.shiftKey?un(n):Nr(n);if(o==="y"&&!t.shiftKey)return t.preventDefault(),un(n)}const s=we(n.state,r.tableFrom);if(!s)return!1;if(Dr(n)&&!r.editing&&!to(n))switch(t.key){case"h":return t.preventDefault(),ro(n,-1);case"l":return t.preventDefault(),ro(n,1);case"j":return t.preventDefault(),so(n,1);case"k":return t.preventDefault(),so(n,-1);case"w":return t.preventDefault(),oo(n,!0);case"b":return t.preventDefault(),oo(n,!1);case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"ArrowDown":return t.preventDefault(),dr(n,t.key);case"i":case"a":case"d":return t.preventDefault(),Vc(n,t.key);default:return!1}switch(t.key){case"Escape":return t.preventDefault(),Dr(n)?um(n):(jc(n),n.focus(),!0);case"Tab":return t.preventDefault(),t.shiftKey?r.col>0?Ie(n,r.row,r.col-1,!0,"end"):!1:r.col<s.columnCount-1?Ie(n,r.row,r.col+1,!0,"start"):r.row<s.rows.length-1?Ie(n,r.row+1,0,!0,"start"):vi(n,s,Zi(s,r.row,"after"),!0);case"Enter":if(t.preventDefault(),t.shiftKey)return r.row===0?!1:Ie(n,r.row-1,r.col,!0,"end");if(r.row>=s.rows.length-1){const o=Zi(s,r.row,"after");return vi(n,s,{...o,focusCol:r.col},!0)}return Ie(n,r.row+1,r.col,!0,"end");case"ArrowLeft":return e.selectionStart===0&&e.selectionEnd===0?(t.preventDefault(),gs(n,"left")):!1;case"ArrowRight":return e.selectionStart===e.value.length&&e.selectionEnd===e.value.length?(t.preventDefault(),gs(n,"right")):!1;case"ArrowUp":return t.preventDefault(),gs(n,"up");case"ArrowDown":return t.preventDefault(),gs(n,"down");case"Backspace":if(e.selectionStart===0&&e.selectionEnd===0&&r.col===0&&r.row===s.rows.length-1&&nm(s,r.row)){t.preventDefault();const o=Co(s,r.row);return o?vi(n,s,o,!0):!1}return!1;default:return!1}}function dr(n,e){const i=n.state.field(Le).focusCell;if(!i)return e==="ArrowUp"?io(n,-1,We(n)):e==="ArrowDown"?io(n,1,We(n)):!1;const r=we(n.state,i.tableFrom);if(!r)return!1;switch(e){case"ArrowLeft":return i.editing?i.col>0?Ie(n,i.row,i.col-1,We(n),"end"):!1:Ll(n,-1,!1);case"ArrowRight":return i.editing?i.col<r.columnCount-1?Ie(n,i.row,i.col+1,We(n),"start"):!1:Ll(n,1,!1);case"ArrowUp":return i.row===0?no(n,r,"start"):Ie(n,i.row-1,i.col,We(n),"end");case"ArrowDown":return i.row>=r.rows.length-1?no(n,r,"end"):Ie(n,i.row+1,i.col,We(n),"end");default:return!1}}function Bf(n,e=!1){const i=n.state.field(Le).focusCell;if(!i)return!1;const r=we(n.state,i.tableFrom);return r?e?i.row===0?!0:Ie(n,i.row-1,i.col,We(n),"end"):i.row>=r.rows.length-1?vi(n,r,Zi(r,i.row,"after"),We(n)):Ie(n,i.row+1,i.col,We(n),"end"):!1}function If(n,e=!1){const i=n.state.field(Le).focusCell;if(!i)return!1;const r=we(n.state,i.tableFrom);if(!r)return!1;if(e)return i.col===0?!1:Ie(n,i.row,i.col-1,We(n),"end");if(i.col<r.columnCount-1)return Ie(n,i.row,i.col+1,We(n),"start");if(i.row<r.rows.length-1)return Ie(n,i.row+1,0,We(n),"start");const s=Zi(r,i.row,"after");return vi(n,r,s,We(n))}function ZQ(n){const t=n.state.field(Le).focusCell;if(!t)return!1;const i=we(n.state,t.tableFrom);if(!i)return!1;if(t.col===0&&t.row===i.rows.length-1&&nm(i,t.row)){const r=Co(i,t.row);return r?vi(n,i,r,We(n)):!1}return!1}function EQ(n){const e=n.state.field(Le).terminalTableSelection;if(e)return JQ(n,e);const t=HQ(n.state);return t?(n.dispatch({selection:Z.single(t.anchor),effects:Ni.of({tableFrom:t.table.from,anchor:t.anchor}),scrollIntoView:!0,userEvent:"delete.backward"}),!0):!1}function ro(n,e){return Ll(n,e,!1)}function Ll(n,e,t){const i=Ao(n);if(!i)return!1;const r=we(n.state,i.tableFrom),s=r?.rows[i.row]?.cells[i.col];if(!r||!s)return!1;const o=fm(n.state,s),a=s.contentTo-s.contentFrom;return e<0?o>0?Df(n,i,s.contentFrom+o-1,t):i.col>0?Ie(n,i.row,i.col-1,t,"end"):!1:o<a?Df(n,i,s.contentFrom+o+1,t):i.col<r.columnCount-1?Ie(n,i.row,i.col+1,t,"start"):!1}function so(n,e){const t=Ao(n);if(!t)return!1;const i=we(n.state,t.tableFrom),r=i?.rows[t.row]?.cells[t.col];if(!i||!r)return!1;const s=t.row+e;return s<0||s>=i.rows.length?!1:Ie(n,s,t.col,!1,fm(n.state,r))}function XQ(n,e){const t=n.state.selection.main;if(!t.empty)return!1;const i=n.state.doc.lineAt(t.head),r=i.number+e;if(r<1||r>n.state.doc.lines)return!1;const s=BQ(n,t.head-i.from);if(io(n,e,!1,t.head))return _f(n,s),!0;const o=n.state.doc.line(r),a=Math.min(o.to,o.from+s);return n.dispatch({selection:Z.single(a),effects:[Me.of(null),Je.of(null)],scrollIntoView:!0}),_f(n,s),!0}function oo(n,e){const t=Ao(n);if(!t)return!1;const i=we(n.state,t.tableFrom),r=i?.rows[t.row]?.cells[t.col];if(!i||!r)return!1;const s=Math.max(0,n.state.selection.main.head-r.contentFrom),o=zQ(r.text,s,e);return n.dispatch({selection:Z.single(r.contentFrom+o),effects:Me.of({...t,editing:!1})}),!0}function Df(n,e,t,i){return n.dispatch({selection:Z.single(t),effects:Me.of({...e,editing:i})}),!0}function Vc(n,e){const t=Gi(n);return t?(ht.handleKey(t,e,"structured-table"),_c(n),!0):!1}function BQ(n,e){const i=Gi(n)?.state.vim?.lastHPos;return typeof i=="number"&&i>=0?i:e}function _f(n,e){const t=Gi(n);t?.state.vim&&(t.state.vim.lastHPos=e)}function IQ(n,e){return Vc(n,e)}function um(n){const e=Gi(n);return e?.state.vim?(ht.exitInsertMode(e),_c(n),n.focus(),!0):jc(n)}function DQ(n,e){return{start:Zl(n.selection.main.from,e),end:Zl(n.selection.main.to,e)}}function fm(n,e){return Zl(n.selection.main.head,e)}function Zl(n,e){return Wt(n-e.contentFrom,0,e.contentTo-e.contentFrom)}function Wt(n,e,t){return Math.min(Math.max(n,e),t)}function _Q(n){switch(n){case"center":return"center";case"right":return"right";default:return"left"}}function jQ(n){let r=0;for(const s of n.rows){const o=s.cells.some(a=>/!\[[^\]]*]\((\S+?)(?:\s+["'][^"']*["'])?\)/.test(a.text));r+=o?96:30}return r}function VQ(n,e,t){const i=n.querySelector(".cm-structured-table-cell-content")??n,r=document,s=r.caretPositionFromPoint?.(e.clientX,e.clientY),o=r.caretRangeFromPoint?.(e.clientX,e.clientY),a=(s&&jf(i,s.offsetNode,s.offset))??(o&&jf(i,o.startContainer,o.startOffset));if(a!=null)return Wt(a,0,t);const l=n.getBoundingClientRect();return l.width&&e.clientX>=l.left+l.width/2?t:0}function jf(n,e,t){if(n!==e&&!n.contains(e))return null;let i=0;function r(o){if(o.nodeType===Node.TEXT_NODE)return o.textContent?.length??0;let a=0;for(const l of o.childNodes)a+=r(l);return a}function s(o){if(o===e){if(o.nodeType===Node.TEXT_NODE)return i+=Wt(t,0,o.textContent?.length??0),!0;const a=Wt(t,0,o.childNodes.length);for(let l=0;l<a;l+=1)i+=r(o.childNodes[l]);return!0}if(o.nodeType===Node.TEXT_NODE)return i+=o.textContent?.length??0,!1;for(const a of o.childNodes)if(s(a))return!0;return!1}return s(n)?i:null}function Vf(n){return`${n.dataset.tableFrom??""}:${n.dataset.cellRow??""}:${n.dataset.cellCol??""}`}function Ao(n){const e=n.state.field(Le).focusCell;if(e){const s=we(n.state,e.tableFrom)?.rows[e.row]?.cells[e.col],o=n.state.selection.main.head;if(s&&o>=s.from&&o<=s.to)return e}const t=n.state.selection.main.head,i=we(n.state,t);if(!i)return null;for(const r of i.rows)for(const s of r.cells)if(t>=s.from&&t<=s.to)return{tableFrom:i.from,row:r.row,col:s.col,editing:!1};return null}function zQ(n,e,t){const i=s=>/[\p{L}\p{N}_]/u.test(s);if(t){let s=e;for(;s<n.length&&i(n[s]);)s+=1;for(;s<n.length&&!i(n[s]);)s+=1;return s}let r=Math.max(0,e-1);for(;r>0&&!i(n[r]);)r-=1;for(;r>0&&i(n[r-1]);)r-=1;return r}function WQ(n){const e=document.createDocumentFragment(),t=SQ(n),i=t.firstChild??t;return Ps(e,i,n,new Set),e}function Ps(n,e,t,i){let r=e.from;for(let s=e.firstChild;s;s=s.nextSibling)s.from>r&&n.appendChild(document.createTextNode(t.slice(r,s.from))),NQ(n,s,t,i),r=s.to;r<e.to&&n.appendChild(document.createTextNode(t.slice(r,e.to)))}function NQ(n,e,t,i){if(!i.has(e.name))switch(e.name){case"Paragraph":case"Document":Ps(n,e,t,i);return;case"StrongEmphasis":{const r=document.createElement("strong");Ps(r,e,t,new Set([...i,"EmphasisMark"])),n.appendChild(r);return}case"Emphasis":{const r=document.createElement("em");Ps(r,e,t,new Set([...i,"EmphasisMark"])),n.appendChild(r);return}case"InlineCode":{const r=document.createElement("code");r.className="cm-structured-table-inline-code",r.textContent=YQ(t.slice(e.from,e.to)),n.appendChild(r);return}case"Link":{const r=t.slice(e.from,e.to).match(/^\[(?<label>.*)\]\((?<href>\S+?)\)$/);if(!r?.groups?.href){n.appendChild(document.createTextNode(t.slice(e.from,e.to)));return}const s=document.createElement("a");s.className="cm-structured-table-link",s.href=r.groups.href,s.textContent=r.groups.label??r.groups.href,s.target="_blank",s.rel="noreferrer noopener",n.appendChild(s);return}case"Image":{const r=t.slice(e.from,e.to).match(/^!\[(?<alt>[^\]]*)\]\((?<src>\S+?)(?:\s+["'][^"']*["'])?\)$/);if(!r?.groups?.src){n.appendChild(document.createTextNode(t.slice(e.from,e.to)));return}const s=document.createElement("img");s.className="cm-structured-table-image",s.src=r.groups.src,s.alt=r.groups.alt??"",s.loading="lazy",n.appendChild(s);return}case"HTMLTag":{const r=t.slice(e.from,e.to);if(r==="<br>"||r==="<br/>"){n.appendChild(document.createElement("br"));return}n.appendChild(document.createTextNode(r));return}case"LinkMark":case"EmphasisMark":case"URL":case"CodeMark":return;default:n.appendChild(document.createTextNode(t.slice(e.from,e.to)))}}function YQ(n){const e=n.match(/^(`+)([\s\S]*)(\1)$/);return e?e[2]:n.replace(/^`|`$/g,"")}function dm(n){let e=0,t=-1,i=-1,r="";return n.changes.iterChanges((s,o,a,l,h)=>{e+=1,t=s,i=o,r=h.toString()}),e!==1?null:{from:t,to:i,insert:r}}function Ta(n,e){const t=Wt(e,0,n.doc.length),i=new Set([t,Math.max(0,t-1),Math.min(n.doc.length,t+1)]);for(const r of i){const s=we(n,r);if(s)return s}return Ic(n,Math.max(0,t-1),Math.min(n.doc.length,t+1))[0]??null}function qQ(n){const e=[],t=n.annotation(Te.addToHistory);t!=null&&e.push(Te.addToHistory.of(t));const i=n.annotation(Te.remote);return i!=null&&e.push(Te.remote.of(i)),e.length?e:void 0}function pm(n,e={}){const t=[...n.effects,...Array.isArray(e.effects)?e.effects:e.effects?[e.effects]:[]],i=n.annotation(Te.userEvent);return{changes:e.changes??n.changes,selection:e.selection??n.selection,effects:t.length?t:void 0,annotations:e.annotations??qQ(n),userEvent:e.userEvent??i,scrollIntoView:e.scrollIntoView??n.scrollIntoView,sequential:e.sequential}}function FQ(n){if(!n.docChanged||!n.isUserEvent("input.type"))return null;const e=dm(n);if(!e||e.from!==e.to||e.insert.length!==1||Ta(n.startState,e.from))return null;const i=n.newSelection.main.head,r=Ta(n.state,i)??Ta(n.state,e.from+e.insert.length);if(!r)return null;const s=r.rows.length===1,o=r.to===n.newDoc.length;if(!s&&!o)return null;const a=[pm(n)];if(s){const l=Zi(r,0,"after");return a.push({sequential:!0,changes:{from:r.from,to:r.to,insert:o?`${l.text}
|
|
73
|
+
`:l.text},selection:Z.single(r.from+l.focusFrom,r.from+l.focusTo),effects:[Me.of({tableFrom:r.from,row:l.focusRow,col:l.focusCol,editing:!0}),Je.of(null)],scrollIntoView:!0}),a}return o?(a.push({sequential:!0,changes:{from:n.newDoc.length,insert:`
|
|
74
|
+
`}}),a):null}function GQ(n){if(!n.docChanged)return null;const e=n.startState.field(Le,!1)?.focusCell;if(!e)return null;const t=we(n.startState,e.tableFrom),i=t?.rows[e.row]?.cells[e.col];if(!t||!i)return null;const r=dm(n);if(!r||r.insert.length>0)return null;const s=n.startState.doc.lineAt(i.contentFrom),o=s.from,a=s.to<n.startState.doc.length?s.to+1:n.startState.doc.length;if(r.from!==o||r.to!==a)return null;const l=Co(t,e.row);return l?[{changes:{from:t.from,to:t.to,insert:l.text},selection:Z.single(t.from+l.focusTo,t.from+l.focusFrom),effects:[Me.of({tableFrom:t.from,row:l.focusRow,col:l.focusCol,editing:!1}),Je.of(null)],scrollIntoView:!0}]:[{selection:Z.single(i.contentTo),effects:[Me.of({...e,editing:!1}),Je.of(null)],scrollIntoView:!0}]}function UQ(n){return n.effects.some(e=>e.is(Ni)||e.is(Me)||e.is(Je))?!1:n.docChanged||n.selection!==void 0||n.isUserEvent("select")}function HQ(n){const e=n.selection.main;if(!e.empty)return null;const t=n.doc.lineAt(e.head);if(t.number!==n.doc.lines||t.length>0||e.head!==t.from||t.number<=1)return null;const i=n.doc.line(t.number-1),r=hm(n,i.from,i.to);return r?{table:r,anchor:t.from}:null}function KQ(n,e){const t=n.doc.lineAt(e.from);return t.number<=1?0:n.doc.line(t.number-1).to}function JQ(n,e){const t=we(n.state,e.tableFrom);if(!t)return n.dispatch({effects:Ni.of(null)}),!0;const r=n.state.doc.lineAt(e.anchor).to;return n.dispatch({changes:{from:t.from,to:r,insert:""},selection:Z.single(KQ(n.state,t)),effects:[Ni.of(null),Me.of(null),Je.of(null)],scrollIntoView:!0,userEvent:"delete.backward"}),!0}const e$=he.transactionFilter.of(n=>{if(n.startState.field(Le,!1)?.terminalTableSelection&&UQ(n))return pm(n,{effects:[Ni.of(null)]});const t=FQ(n);if(t)return t;const i=GQ(n);return i||n});function t$(){return[xQ,Le,wQ,Qp.of((n,e)=>{if(!(e instanceof om))return null;const t=n.state.doc.lineAt(e.table.from).number;return new Dc(t)}),e$,wi.highest(Li.of([{key:"ArrowLeft",run:n=>dr(n,"ArrowLeft")},{key:"ArrowRight",run:n=>dr(n,"ArrowRight")},{key:"ArrowUp",run:n=>dr(n,"ArrowUp")},{key:"ArrowDown",run:n=>dr(n,"ArrowDown")},{key:"Enter",run:n=>Bf(n,!1)},{key:"Shift-Enter",run:n=>Bf(n,!0)},{key:"Tab",run:n=>If(n,!1)},{key:"Shift-Tab",run:n=>If(n,!0)},{key:"Backspace",run:n=>EQ(n)||ZQ(n)},{key:"Escape",run:n=>jc(n)}])),et.fromClass(QQ)]}function i$(n){return n instanceof HTMLElement&&!!n.closest(".cm-structured-table-overlay")}function Aa(n){const e=Ic(n,0,n.doc.length).map(t=>H.replace({block:!0,widget:new om(t,n.field(Le),n.selection.main.head)}).range(t.from,t.to));return H.set(e,!0)}const El=Oe.define();let zf=!1;function n$(){if(!zf){zf=!0;try{ht.defineMotion("hybridMoveByLines",(n,e,t,i)=>{const r=n.cm6;if(!r)return e;const s=t.forward?1:-1,o=t.repeat||1,a=n.indexFromPos(e);if(o===1&&io(r,s,!1,a))return n.posFromIndex(r.state.selection.main.head);const h=r.state.doc.lineAt(a).number+s*o;if(h<1)return n.posFromIndex(0);if(h>r.state.doc.lines)return n.posFromIndex(r.state.doc.length);const f=r.state.doc.line(h);let O=i.lastHPos;(O===void 0||O<0)&&(O=e.ch);const m=Math.min(f.to,f.from+O);return n.posFromIndex(m)}),ht.mapCommand("j","motion","hybridMoveByLines",{forward:!0,linewise:!0},{}),ht.mapCommand("k","motion","hybridMoveByLines",{forward:!1,linewise:!0},{}),ht.mapCommand("<Down>","motion","hybridMoveByLines",{forward:!0,linewise:!0},{}),ht.mapCommand("<Up>","motion","hybridMoveByLines",{forward:!1,linewise:!0},{})}catch{}}}const r$=new Set(["ATXHeading1","ATXHeading2","ATXHeading3","ATXHeading4","ATXHeading5","ATXHeading6","SetextHeading1","SetextHeading2","Emphasis","StrongEmphasis","Link","InlineCode","Image","Blockquote"]);function Wf(n){return n.startsWith("ATXHeading")||n.startsWith("SetextHeading")}function s$(n){return[["1",n.heading1],["2",n.heading2],["3",n.heading3],["4",n.heading4],["5",n.heading5],["6",n.heading6]].reduce((t,[i,r])=>(t[`.cm-line.cm-heading-line-${i}`]={lineHeight:r.lineHeight},t[`.cm-heading-line-${i} .tok-heading`]={fontSize:r.fontSize,fontWeight:r.fontWeight,lineHeight:r.lineHeight},t[`.cm-heading-line-${i} .tok-meta`]={color:n.syntaxMark.color},t),{})}function Ts(n,e){return{[n]:e,[`${n} span`]:{...e}}}const o$=z.theme({...Ts(".cm-una-code-font",{fontFamily:"var(--una-code-font-family, ui-monospace, SFMono-Regular, Menlo, monospace)"}),".cm-hybrid-list-marker":{display:"inline-flex",alignItems:"center",justifyContent:"center",marginRight:"0.22em",userSelect:"none",verticalAlign:"baseline"},".cm-hybrid-list-marker-ordered":{justifyContent:"flex-end",minWidth:"2ch"},".cm-hybrid-list-marker-task":{minWidth:"1.4em"},".cm-hybrid-task-checkbox":{width:"0.95em",height:"0.95em",margin:"0",pointerEvents:"none",flex:"0 0 auto",position:"relative",top:"0.08em"},".cm-hybrid-image":{display:"inline-flex",alignItems:"center",maxWidth:"100%",verticalAlign:"middle"},".cm-hybrid-image-inline-preview":{display:"block",width:"fit-content",maxWidth:"100%",paddingTop:"0.35rem"},".cm-hybrid-image-element":{display:"block",maxWidth:"100%",maxHeight:"14rem",borderRadius:"8px",objectFit:"contain",boxShadow:"0 2px 8px rgba(15, 23, 42, 0.12)"},"&.cm-focused .cm-hybrid-image-element":{outline:"none"},".cm-hybrid-image-status":{display:"none",padding:"0.4rem 0.55rem",borderRadius:"8px",border:"1px solid rgba(148, 163, 184, 0.35)",backgroundColor:"rgba(148, 163, 184, 0.08)",color:"#64748b",fontSize:"0.875em",lineHeight:"1.35"},".cm-hybrid-image-broken .cm-hybrid-image-element":{display:"none"},".cm-hybrid-image-broken .cm-hybrid-image-status":{display:"inline-flex",alignItems:"center"}});function Om(n){return z.theme({...s$(n),...Ts(".cm-hybrid-emphasis",{fontStyle:n.emphasis.fontStyle}),...Ts(".cm-hybrid-strong",{fontWeight:n.strong.fontWeight}),...Ts(".cm-hybrid-link",{color:n.link.color,textDecoration:n.link.textDecoration,textUnderlineOffset:n.link.textUnderlineOffset}),".cm-hybrid-inline-code":{backgroundColor:n.inlineCode.backgroundColor,borderRadius:n.inlineCode.borderRadius,padding:n.inlineCode.padding},".cm-line.cm-hybrid-blockquote-line":{borderLeft:`3px solid ${n.blockquote.borderColor}`,backgroundColor:n.blockquote.backgroundColor,paddingLeft:n.blockquote.paddingLeft,fontStyle:n.blockquote.fontStyle},".cm-hybrid-list-marker":{color:n.listMarker.color},".cm-hybrid-task-checkbox":{accentColor:n.taskCheckbox.accentColor}})}const Ma=H.replace({}),a$=H.mark({class:"cm-hybrid-emphasis"}),l$=H.mark({class:"cm-hybrid-strong"}),c$=H.mark({class:"cm-hybrid-link"}),h$=H.mark({class:"cm-una-code-font cm-hybrid-inline-code"}),u$=new Set(["href"]),f$=new Set(["LinkMark","EmphasisMark","CodeMark"]);class Nf extends bt{constructor(e,t,i,r,s,o){super(),this.source=e,this.alt=t,this.mode=i,this.className=r,this.dataset=s,this.style=o}eq(e){return this.source===e.source&&this.alt===e.alt&&this.mode===e.mode&&this.className===e.className&&Ff(this.dataset,e.dataset)&&Ff(this.style,e.style)}toDOM(){const e=document.createElement("span");e.className="cm-hybrid-image",this.mode==="inline-preview"&&e.classList.add("cm-hybrid-image-inline-preview"),e.contentEditable="false";const t=document.createElement("img");t.className="cm-hybrid-image-element",t.src=this.source,t.alt=this.alt,t.loading="lazy",S$(t,this.className),k$(t,this.dataset),w$(t,this.style);const i=document.createElement("span");return i.className="cm-hybrid-image-status",i.textContent="图片无法获取",i.setAttribute("aria-live","polite"),t.addEventListener("error",()=>{e.classList.add("cm-hybrid-image-broken"),i.textContent=this.source?"图片地址错误或无法获取":"图片无法获取"}),t.addEventListener("load",()=>{e.classList.remove("cm-hybrid-image-broken")}),e.appendChild(t),e.appendChild(i),e}ignoreEvent(){return!1}}class d$ extends bt{constructor(e){super(),this.data=e}eq(e){return this.data.kind===e.data.kind&&this.data.label===e.data.label&&this.data.isChecked===e.data.isChecked}toDOM(){const e=document.createElement("span");if(e.className=`cm-hybrid-list-marker cm-hybrid-list-marker-${this.data.kind}`,e.contentEditable="false",e.setAttribute("aria-hidden","true"),this.data.kind==="task"){const t=document.createElement("input");return t.className="cm-hybrid-task-checkbox",t.type="checkbox",t.checked=!!this.data.isChecked,t.tabIndex=-1,t.setAttribute("aria-hidden","true"),e.appendChild(t),e}return e.textContent=this.data.label,this.data.kind==="ordered"&&(e.style.minWidth=`${Math.max(2,this.data.label.length)}ch`),e}ignoreEvent(){return!1}}function ms(n,e,t,i){let r=n;for(;r;){if(r.name==="ListItem"&&r.from<=e.from&&r.to>=e.to){const s=`${r.name}:${r.from}:${r.to}`;i.has(s)||(i.add(s),t.push({from:r.from,to:r.to,name:r.name}));return}r=r.parent}}function ys(n,e,t,i){let r=n;for(;r;){if(r.from<=e.from&&r.to>=e.to&&r$.has(r.name)){const s=`${r.name}:${r.from}:${r.to}`;i.has(s)||(i.add(s),t.push({from:r.from,to:r.to,name:r.name}))}r=r.parent}}function Yf(n){const e=n.state.selection.main;if(!n.hasFocus&&e.from===0&&e.to===0)return[];const t=[],i=new Set,r=ce(n.state).resolveInner(e.from,-1),s=ce(n.state).resolveInner(e.from,1);if(ms(r,e,t,i),ms(s,e,t,i),ys(r,e,t,i),ys(s,e,t,i),e.to!==e.from){const o=ce(n.state).resolveInner(e.to,-1),a=ce(n.state).resolveInner(e.to,1);ms(o,e,t,i),ms(a,e,t,i),ys(o,e,t,i),ys(a,e,t,i)}return t}function p$(n,e){return n.length!==e.length?!1:n.every((t,i)=>{const r=e[i];return t.from===r.from&&t.to===r.to&&t.name===r.name})}function O$(n,e){return e.some(t=>n.from>=t.from&&n.to<=t.to)}function g$(n,e=160){const t=n.visibleRanges.map(r=>({from:Math.max(0,r.from-e),to:Math.min(n.state.doc.length,r.to+e)}));if(t.length<=1)return t;const i=[t[0]];for(let r=1;r<t.length;r+=1){const s=t[r],o=i[i.length-1];if(s.from<=o.to){o.to=Math.max(o.to,s.to);continue}i.push(s)}return i}function m$(n){const e=n.startsWith("ATXHeading")?n.slice(10):n.slice(13);return e?H.mark({class:`cm-hybrid-heading-${e}`}):null}function y$(n){const e=n.startsWith("ATXHeading")?n.slice(10):n.slice(13);return e?H.line({class:`cm-heading-line-${e}`}):null}function Xl(n,e,t,i,r){const s=e.state.doc.lineAt(t),o=e.state.doc.lineAt(Math.max(t,i-1));for(let a=s.number;a<=o.number;a+=1){const l=e.state.doc.line(a);n.push(H.line({class:r}).range(l.from))}}function b$(n){const e=n.match(/^!\[(?<alt>[^\]]*)\]\((?<source>\S+?)(?:\s+(?<title>["'][^"']*["']))?\)$/);return e?.groups?.source?{alt:e.groups.alt??"",source:e.groups.source,title:gm(e.groups.title)}:null}function v$(n,e){const t=n.state.doc.lineAt(e.from),i=n.state.doc.sliceString(e.from,t.to),r=i.match(/^(?<marker>(?:[-+*])|(?:\d+[.)]))(?<spacing>[ \t]+)/);if(!r?.groups?.marker||!r.groups.spacing)return null;const s=r.groups.marker,o=e.from+r[0].length,l=i.slice(r[0].length).match(/^\[(?<state>[ xX])\](?<spacing>[ \t]+|$)/);return l?.groups?.state?{from:e.from,to:o+l[0].length,kind:"task",label:l.groups.state,isChecked:l.groups.state.toLowerCase()==="x"}:/^[-+*]$/.test(s)?{from:e.from,to:o,kind:"bullet",label:"•"}:{from:e.from,to:o,kind:"ordered",label:s}}function qf(n,e,t){const i=[];for(const r of g$(n))ce(n.state).iterate({from:r.from,to:r.to,enter(s){const o=O$(s,e);if(Wf(s.name)){const a=y$(s.name);a&&i.push(a.range(n.state.doc.lineAt(s.from).from))}if(!(s.name==="Emphasis"&&(i.push(a$.range(s.from,s.to)),o))&&!(s.name==="StrongEmphasis"&&(i.push(l$.range(s.from,s.to)),o))){if(s.name==="Link"){const a=$$(n,s);if(!t?.link||!a)i.push(c$.range(s.from,s.to));else{const l=P$(a,t.link);i.push(T$(l).range(s.from,s.to))}return void 0}if(!(s.name==="InlineCode"&&(i.push(h$.range(s.from,s.to)),o))){if(s.name==="Image"){const a=b$(n.state.doc.sliceString(s.from,s.to));if(a){const l={src:a.source,alt:a.alt,title:a.title,raw:n.state.doc.sliceString(s.from,s.to),position:{from:s.from,to:s.to}},h=C$(l,t?.image);o?i.push(H.widget({widget:new Nf(h.src,a.alt,"inline-preview",h.className,h.dataset,h.style),side:1}).range(s.to)):i.push(H.replace({widget:new Nf(h.src,a.alt,"replace",h.className,h.dataset,h.style)}).range(s.from,s.to))}return!1}if(!o){if(s.name==="ListItem"){const a=v$(n,s);a&&i.push(H.replace({widget:new d$(a)}).range(a.from,a.to));return}if(Wf(s.name)){const a=m$(s.name);a&&i.push(a.range(s.from,s.to));return}if(s.name==="HeaderMark"||s.name==="QuoteMark"){let a=s.to;const h=n.state.doc.sliceString(s.to,Math.min(s.to+10,n.state.doc.length)).match(/^[ \t]+/),f=s.name==="HeaderMark"&&n.state.doc.sliceString(s.from,s.from+1)==="#",O=s.name==="QuoteMark";(f||O)&&h&&(a+=h[0].length),i.push(Ma.range(s.from,a));return}if(s.name==="LinkMark"||s.name==="URL"||s.name==="EmphasisMark"){i.push(Ma.range(s.from,s.to));return}if(s.name==="CodeMark"&&s.node.parent?.name==="InlineCode"){i.push(Ma.range(s.from,s.to));return}if(s.name==="Blockquote"){Xl(i,n,s.from,s.to,"cm-hybrid-blockquote-line");return}s.name==="FencedCode"&&Xl(i,n,s.from,s.to,"cm-una-code-font")}}}}});return H.set(i,!0)}function gm(n){if(n){if(n.length>=2){const e=n[0],t=n[n.length-1];if(e==='"'&&t==='"'||e==="'"&&t==="'")return n.slice(1,-1)}return n}}function Mo(n){return(n.startsWith("data-")?n.slice(5):n).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase()}function S$(n,e){if(e)for(const t of e.split(/\s+/))t&&n.classList.add(t)}function k$(n,e){if(e)for(const[t,i]of Object.entries(e))n.setAttribute(`data-${Mo(t)}`,i)}function w$(n,e){if(e)for(const[t,i]of Object.entries(e))n.style.setProperty(Mo(t),i)}function Ff(n,e){if(n===e)return!0;if(!n||!e)return!n&&!e;const t=Object.entries(n).sort(([r],[s])=>r.localeCompare(s)),i=Object.entries(e).sort(([r],[s])=>r.localeCompare(s));return t.length!==i.length?!1:t.every(([r,s],o)=>r===i[o][0]&&s===i[o][1])}function x$(n){return n&&Object.entries(n).map(([t,i])=>`${Mo(t)}: ${i}`).join("; ")||void 0}function Q$(n,e,t){const i=[];ce(n.state).iterate({from:e,to:t,enter(o){o.from<e||o.to>t||f$.has(o.name)&&i.push({from:o.from,to:o.to})}}),i.sort((o,a)=>o.from-a.from||o.to-a.to);let r=e,s="";for(const o of i)o.from>r&&(s+=n.state.doc.sliceString(r,o.from)),r=Math.max(r,o.to);return r<t&&(s+=n.state.doc.sliceString(r,t)),s}function $$(n,e){let t=e.node.firstChild,i=null,r,s=null,o=null;for(;t;){if(t.name==="LinkMark"){const l=n.state.doc.sliceString(t.from,t.to);l==="["?s=t.to:l==="]"&&(o=t.from)}else t.name==="URL"?i=n.state.doc.sliceString(t.from,t.to):t.name==="LinkTitle"&&(r=gm(n.state.doc.sliceString(t.from,t.to)));t=t.nextSibling}if(!i)return null;const a=s!=null&&o!=null&&o>=s?Q$(n,s,o):"";return{href:i,text:a,title:r,raw:n.state.doc.sliceString(e.from,e.to),position:{from:e.from,to:e.to}}}function C$(n,e){const t={src:n.src};if(!e)return t;try{const i=e(n);return i?{src:i.src??n.src,className:i.className,dataset:i.dataset,style:i.style}:t}catch(i){return console.warn("Image render hook failed.",i),t}}function P$(n,e){const t={href:n.href};if(!e)return t;try{const i=e(n);return i?{href:i.href??n.href,className:i.className,dataset:i.dataset,style:i.style}:t}catch(i){return console.warn("Link render hook failed.",i),t}}function T$(n){const e={"data-href":n.href};for(const[i,r]of Object.entries(n.dataset??{})){const s=Mo(i);u$.has(s)||(e[`data-${s}`]=r)}const t=x$(n.style);return t&&(e.style=t),H.mark({tagName:"span",class:["cm-hybrid-link",n.className].filter(Boolean).join(" "),attributes:e})}let pr=null;function Gf(n,e){const t=n.state.selection.main;if(!t.empty)return!1;const i=n.state.doc.lineAt(t.head),r=i.number+e;if(r<1||r>n.state.doc.lines)return pr=null,!1;const s=n.state.doc.line(r),o=t.head-i.from;pr===null&&(pr=o);const a=Math.min(s.to,s.from+pr);return n.dispatch({selection:{anchor:a},userEvent:"select.livepreview-vertical",scrollIntoView:!0}),!0}const A$=et.fromClass(class{update(n){n.selectionSet&&!n.transactions.some(e=>e.isUserEvent("select.livepreview-vertical"))&&(pr=null)}});function M$(n){return et.fromClass(class{constructor(e){this.activeScopes=Yf(e),this.decorations=qf(e,this.activeScopes,n)}update(e){const t=Yf(e.view),i=!p$(this.activeScopes,t),r=e.transactions.some(s=>s.effects.some(o=>o.is(El)));if(e.docChanged||e.viewportChanged||e.focusChanged||i||r){this.activeScopes=t,this.decorations=qf(e.view,t,n);return}this.activeScopes=t}},{decorations:e=>e.decorations})}function mm(n){return[t$(),A$,wi.highest(Li.of([{key:"ArrowDown",run:e=>Gf(e,1)},{key:"ArrowUp",run:e=>Gf(e,-1)}])),M$(n)]}const R$=H.mark({class:"cm-una-code-font"});class L${constructor(e){this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){const t=[],i=ce(e.state);for(const{from:r,to:s}of e.visibleRanges)i.iterate({from:r,to:s,enter:o=>{o.name==="InlineCode"&&t.push(R$.range(o.from,o.to)),o.name==="FencedCode"&&Xl(t,e,o.from,o.to,"cm-una-code-font")}});return H.set(t,!0)}}function ym(){return[et.fromClass(L$,{decorations:n=>n.decorations})]}var Bl={};function zc(n,e){for(var t=0;t<e.length;t++)Bl[e[t]]=n}var bm=["true","false"],vm=["if","then","do","else","elif","while","until","for","in","esac","fi","fin","fil","done","exit","set","unset","export","function"],Sm=["ab","awk","bash","beep","cat","cc","cd","chown","chmod","chroot","clear","cp","curl","cut","diff","echo","find","gawk","gcc","get","git","grep","hg","kill","killall","ln","ls","make","mkdir","openssl","mv","nc","nl","node","npm","ping","ps","restart","rm","rmdir","sed","service","sh","shopt","shred","source","sort","sleep","ssh","start","stop","su","sudo","svn","tee","telnet","top","touch","vi","vim","wall","wc","wget","who","write","yes","zsh"];zc("atom",bm);zc("keyword",vm);zc("builtin",Sm);function Z$(n,e){if(n.eatSpace())return null;var t=n.sol(),i=n.next();if(i==="\\")return n.next(),null;if(i==="'"||i==='"'||i==="`")return e.tokens.unshift(Ro(i,i==="`"?"quote":"string")),Yn(n,e);if(i==="#")return t&&n.eat("!")?(n.skipToEnd(),"meta"):(n.skipToEnd(),"comment");if(i==="$")return e.tokens.unshift(km),Yn(n,e);if(i==="+"||i==="=")return"operator";if(i==="-")return n.eat("-"),n.eatWhile(/\w/),"attribute";if(i=="<"){if(n.match("<<"))return"operator";var r=n.match(/^<-?\s*(?:['"]([^'"]*)['"]|([^'"\s]*))/);if(r)return e.tokens.unshift(X$(r[1]||r[2])),"string.special"}if(/\d/.test(i)&&(n.eatWhile(/\d/),n.eol()||!/\w/.test(n.peek())))return"number";n.eatWhile(/[\w-]/);var s=n.current();return n.peek()==="="&&/\w+/.test(s)?"def":Bl.hasOwnProperty(s)?Bl[s]:null}function Ro(n,e){var t=n=="("?")":n=="{"?"}":n;return function(i,r){for(var s,o=!1;(s=i.next())!=null;){if(s===t&&!o){r.tokens.shift();break}else if(s==="$"&&!o&&n!=="'"&&i.peek()!=t){o=!0,i.backUp(1),r.tokens.unshift(km);break}else{if(!o&&n!==t&&s===n)return r.tokens.unshift(Ro(n,e)),Yn(i,r);if(!o&&/['"]/.test(s)&&!/['"]/.test(n)){r.tokens.unshift(E$(s,"string")),i.backUp(1);break}}o=!o&&s==="\\"}return e}}function E$(n,e){return function(t,i){return i.tokens[0]=Ro(n,e),t.next(),Yn(t,i)}}var km=function(n,e){e.tokens.length>1&&n.eat("$");var t=n.next();return/['"({]/.test(t)?(e.tokens[0]=Ro(t,t=="("?"quote":t=="{"?"def":"string"),Yn(n,e)):(/\d/.test(t)||n.eatWhile(/\w/),e.tokens.shift(),"def")};function X$(n){return function(e,t){return e.sol()&&e.string==n&&t.tokens.shift(),e.skipToEnd(),"string.special"}}function Yn(n,e){return(e.tokens[0]||Z$)(n,e)}const Ra={name:"shell",startState:function(){return{tokens:[]}},token:function(n,e){return Yn(n,e)},languageData:{autocomplete:bm.concat(vm,Sm),closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}},B$={javascript:()=>en(),js:()=>en(),typescript:()=>en({typescript:!0}),ts:()=>en({typescript:!0}),jsx:()=>en({jsx:!0}),tsx:()=>en({jsx:!0,typescript:!0}),css:()=>yg(),html:()=>Lc(),shell:()=>new ut(Rn.define(Ra)),bash:()=>new ut(Rn.define(Ra)),sh:()=>new ut(Rn.define(Ra))},I$={python:async()=>{const{python:n}=await Promise.resolve().then(()=>require("./index-BcqI91QM.cjs"));return n()},py:async()=>{const{python:n}=await Promise.resolve().then(()=>require("./index-BcqI91QM.cjs"));return n()},php:async()=>{const{php:n}=await Promise.resolve().then(()=>require("./index-CI8bJb1S.cjs"));return n()},java:async()=>{const{java:n}=await Promise.resolve().then(()=>require("./index-C85rY6gs.cjs"));return n()},go:async()=>{const{StreamLanguage:n}=await Promise.resolve().then(()=>rr),{go:e}=await Promise.resolve().then(()=>require("./go-BgtlNyKc.cjs"));return new ut(n.define(e))},rust:async()=>{const{StreamLanguage:n}=await Promise.resolve().then(()=>rr),{rust:e}=await Promise.resolve().then(()=>require("./rust-Dt_Syouh.cjs"));return new ut(n.define(e))},c:async()=>{const{StreamLanguage:n}=await Promise.resolve().then(()=>rr),{c:e}=await Promise.resolve().then(()=>require("./clike-BKuxyWF6.cjs"));return new ut(n.define(e))},cpp:async()=>{const{StreamLanguage:n}=await Promise.resolve().then(()=>rr),{cpp:e}=await Promise.resolve().then(()=>require("./clike-BKuxyWF6.cjs"));return new ut(n.define(e))},"c++":async()=>{const{StreamLanguage:n}=await Promise.resolve().then(()=>rr),{cpp:e}=await Promise.resolve().then(()=>require("./clike-BKuxyWF6.cjs"));return new ut(n.define(e))}},D$={javascript:"JavaScript",js:"JavaScript",typescript:"TypeScript",ts:"TypeScript",jsx:"JSX",tsx:"TSX",css:"CSS",html:"HTML",shell:"Shell",bash:"Shell",sh:"Shell",python:"Python",py:"Python",php:"PHP",java:"Java",go:"Go",rust:"Rust",c:"C",cpp:"C++","c++":"C++"},_$={javascript:"javascript",js:"javascript",typescript:"typescript",ts:"typescript",jsx:"jsx",tsx:"tsx",css:"css",html:"html",shell:"shell",bash:"shell",sh:"shell",python:"python",py:"python",php:"php",java:"java",go:"go",rust:"rust",c:"c",cpp:"cpp","c++":"cpp"};function j$(n){const e=n.trim().toLowerCase();if(e)return _$[e]??e}function V$(n){const e=n.trim().toLowerCase();if(e)return D$[e]}function z$(){const n=[];for(const[e,t]of Object.entries(B$))n.push(hn.of({name:e,support:t()}));for(const[e,t]of Object.entries(I$))n.push(hn.of({name:e,load:t}));return n}class W${constructor(e,t){this.showLineNumbers=t,this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){const t=[],i=ce(e.state);for(const{from:r,to:s}of e.visibleRanges)i.iterate({from:r,to:s,enter:o=>{if(o.name==="FencedCode"){const a=e.state.doc.lineAt(o.from),l=e.state.doc.lineAt(o.to);let h=1;for(let f=a.number;f<=l.number;f++){const O=e.state.doc.line(f),m=O.text.trim(),b=f===a.number,S=f===l.number&&/^(?:```|~~~)/.test(m);if(b||S){t.push(H.line({class:"cm-code-block-fence"}).range(O.from));continue}const Q={};this.showLineNumbers&&(Q["data-code-line-number"]=String(h)),t.push(H.line({class:"cm-code-block-line",attributes:Q}).range(O.from)),h++}}}});return H.set(t,!0)}}function wm(n){return[et.fromClass(class{constructor(e){this.plugin=new W$(e,n)}update(e){this.plugin.update(e)}get decorations(){return this.plugin.decorations}},{decorations:e=>e.decorations}),z.baseTheme({".cm-line.cm-code-block-line[data-code-line-number]::before":{content:"attr(data-code-line-number)",display:"inline-block",minWidth:"2.5em",paddingRight:"0.5em",marginRight:"0.5em",textAlign:"right",color:"rgba(128, 128, 128, 0.6)",userSelect:"none",fontSize:"0.9em",lineHeight:"inherit",fontVariantNumeric:"tabular-nums",fontFeatureSettings:'"tnum"',fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",borderRight:"1px solid rgba(128, 128, 128, 0.2)"}})]}const N$=new Map([[1,"cm-code-block-live-gutter-1"],[2,"cm-code-block-live-gutter-2"],[3,"cm-code-block-live-gutter-3"],[4,"cm-code-block-live-gutter-4"],[5,"cm-code-block-live-gutter-5"],[6,"cm-code-block-live-gutter-6"]]),Uf=`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M28 10v18H10V10h18m0-2H10a2 2 0 0 0-2 2v18a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2Z'/%3E%3Cpath d='M4 18H2V4a2 2 0 0 1 2-2h14v2H4Z'/%3E%3Cpath fill='none' d='M0 0h32v32H0z'/%3E%3C/svg%3E")`;async function Y$(n){try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)return await navigator.clipboard.writeText(n),!0}catch{}if(typeof document>"u"||typeof document.execCommand!="function")return!1;const e=document.createElement("textarea"),t=document.activeElement instanceof HTMLElement?document.activeElement:null;e.value=n,e.setAttribute("readonly","true"),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.opacity="0",document.body.appendChild(e),e.focus(),e.select();try{return document.execCommand("copy")}finally{e.remove(),t?.focus({preventScroll:!0})}}function xm(n,e){n.focus(),n.dispatch({selection:{anchor:e},scrollIntoView:!0})}function q$(n){const t=n.trim().match(/^(?:`{3,}|~{3,})(?<rest>.*)$/);return t?.groups?.rest&&(t.groups.rest.trim().split(/\s+/,1)[0]?.trim()??"")||null}function F$(n){const e=[],t=new Set,i=ce(n.state);for(const{from:r,to:s}of n.visibleRanges)i.iterate({from:r,to:s,enter:o=>{if(o.name!=="FencedCode")return;const a=`${o.from}:${o.to}`;if(t.has(a))return!1;t.add(a);const l=n.state.doc.lineAt(o.from),h=n.state.doc.lineAt(o.to),f=l.to<h.from?l.to+1:l.to,O=h.from,m=Math.max(0,h.number-l.number-1),b=q$(l.text),S=b!=null?j$(b)??b:null,Q=S!=null?V$(S)??null:null;return e.push({from:o.from,to:o.to,openingFrom:l.from,openingTo:l.to,closingFrom:h.from,closingTo:h.to,bodyFrom:f,bodyTo:O,bodyLineCount:m,rawLanguage:b,displayLabel:Q}),!1}});return e}function G$(n,e){return n.hasFocus?n.state.selection.ranges.some(t=>t.empty?t.from>=e.from&&t.from<=e.to:t.from<=e.to&&t.to>=e.from):!1}function U$(n,e){if(e.bodyLineCount===0||e.bodyFrom>e.bodyTo)return"";const t=n.state.doc.lineAt(e.closingFrom-1);return n.state.doc.sliceString(e.bodyFrom,t.to)}function H$(n){const e=Math.max(1,String(Math.max(1,n)).length),t=Math.min(6,e);return N$.get(t)??"cm-code-block-live-gutter-6"}class K$ extends bt{constructor(e,t){super(),this.text=e,this.gutterClass=t}eq(e){return this.text===e.text&&this.gutterClass===e.gutterClass}toDOM(){const e=document.createElement("span");return e.className=`cm-code-block-live-leading-slot ${this.gutterClass}`,e.textContent=this.text||" ",e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!0}}class J$ extends bt{constructor(e,t,i){super(),this.openingFrom=e,this.displayLabel=t,this.bodyText=i}eq(e){return this.openingFrom===e.openingFrom&&this.displayLabel===e.displayLabel&&this.bodyText===e.bodyText}toDOM(e){const t=document.createElement("span");if(t.className="cm-code-block-header-row",t.contentEditable="false",t.addEventListener("mousedown",r=>{const s=r.target;s instanceof HTMLElement&&s.closest(".cm-code-block-copy-button")||(r.preventDefault(),r.stopPropagation(),xm(e,this.openingFrom))}),this.displayLabel){const r=document.createElement("span");r.className="cm-code-block-language-label",r.textContent=this.displayLabel,t.appendChild(r)}const i=document.createElement("button");return i.type="button",i.className="cm-code-block-copy-button",i.setAttribute("aria-label","Copy code block"),i.title="Copy code block",i.addEventListener("mousedown",r=>{r.preventDefault(),r.stopPropagation()}),i.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),Y$(this.bodyText)}),t.appendChild(i),t}ignoreEvent(){return!0}}class eC extends bt{constructor(e){super(),this.closingFrom=e}eq(e){return this.closingFrom===e.closingFrom}toDOM(e){const t=document.createElement("span");return t.className="cm-code-block-end-cap",t.textContent=" ",t.contentEditable="false",t.setAttribute("aria-hidden","true"),t.addEventListener("mousedown",i=>{i.preventDefault(),i.stopPropagation(),xm(e,this.closingFrom)}),t}ignoreEvent(){return!0}}class tC{constructor(e,t){this.options=t,this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged||e.selectionSet||e.focusChanged||e.geometryChanged)&&(this.decorations=this.buildDecorations(e.view))}buildDecorations(e){const t=[];for(const i of F$(e)){const r=G$(e,i),s=U$(e,i),o=H$(i.bodyLineCount),a=["cm-code-block-live-shell",r?"cm-code-block-live-active":"cm-code-block-live-inactive"],l=[],h=e.state.doc.lineAt(i.openingFrom),f=e.state.doc.lineAt(i.closingFrom);l.push({from:h.from,to:h.to,className:["cm-code-block-live-begin",...a].join(" "),slotText:"",shouldReplaceHeader:!r,shouldReplaceEnd:!1});for(let O=h.number+1,m=1;O<f.number;O+=1,m+=1){const b=e.state.doc.line(O);l.push({from:b.from,to:b.to,className:["cm-code-block-live-body",...a].join(" "),slotText:this.options.showLineNumbers?String(m):"",shouldReplaceHeader:!1,shouldReplaceEnd:!1})}l.push({from:f.from,to:f.to,className:["cm-code-block-live-end",...a].join(" "),slotText:"",shouldReplaceHeader:!1,shouldReplaceEnd:!r});for(const O of l){const m=[O.className];this.options.showLineNumbers&&(m.push("cm-code-block-live-with-slot",o),t.push(H.widget({widget:new K$(O.slotText,o),side:-1}).range(O.from))),t.push(H.line({class:m.join(" ")}).range(O.from)),O.shouldReplaceHeader&&t.push(H.replace({widget:new J$(i.openingFrom,i.displayLabel,s)}).range(O.from,O.to)),O.shouldReplaceEnd&&t.push(H.replace({widget:new eC(i.closingFrom)}).range(O.from,O.to))}}return H.set(t,!0)}}const iC=z.baseTheme({".cm-line.cm-code-block-live-shell":{position:"relative",boxSizing:"border-box",width:"100%",maxWidth:"100%",paddingLeft:"calc(var(--cm-code-block-live-content-padding, 0.75rem) + var(--cm-code-block-live-gutter-width, 0px) + var(--cm-code-block-live-gutter-gap, 0.5rem))",paddingRight:"var(--cm-code-block-live-content-padding, 0.75rem)"},".cm-line.cm-code-block-live-begin":{paddingTop:"0.12rem",paddingBottom:"0.12rem",minHeight:"1.6em"},".cm-line.cm-code-block-live-end":{paddingBottom:"0.16rem"},".cm-code-block-live-leading-slot":{position:"absolute",left:"0",top:"0",bottom:"0",display:"inline-flex",alignItems:"flex-start",justifyContent:"flex-end",fontVariantNumeric:"tabular-nums",fontFeatureSettings:'"tnum"',fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"0.9em",lineHeight:"inherit",boxSizing:"border-box",paddingLeft:"var(--cm-code-block-live-content-padding, 0.75rem)",paddingRight:"0.32rem",userSelect:"none",pointerEvents:"none"},".cm-code-block-header-row":{position:"absolute",right:"var(--cm-code-block-live-content-padding, 0.75rem)",top:"50%",transform:"translateY(-50%)",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",gap:"0.35rem",maxWidth:"calc(100% - var(--cm-code-block-live-content-padding, 0.75rem) * 2 - var(--cm-code-block-live-gutter-width, 0px) - var(--cm-code-block-live-gutter-gap, 0.5rem))",whiteSpace:"nowrap",pointerEvents:"auto"},".cm-code-block-language-label":{flex:"0 1 auto",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"0.72em",letterSpacing:"0.01em",opacity:"0.78"},".cm-code-block-copy-button":{border:"none",background:"transparent",padding:"0",width:"1.15rem",height:"1.15rem",borderRadius:"4px",cursor:"pointer",lineHeight:"1",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},".cm-code-block-copy-button::before":{content:'""',display:"inline-block",width:"14px",height:"14px",backgroundColor:"currentColor",WebkitMaskImage:Uf,maskImage:Uf,WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskSize:"14px 14px",maskSize:"14px 14px"},".cm-code-block-copy-button:focus-visible":{outline:"2px solid currentColor",outlineOffset:"1px"},".cm-code-block-end-cap":{display:"inline-block",width:"100%",visibility:"hidden",userSelect:"none"},".cm-line.cm-code-block-live-begin .cm-code-block-live-leading-slot":{borderTopLeftRadius:"8px"},".cm-line.cm-code-block-live-end .cm-code-block-live-leading-slot":{borderBottomLeftRadius:"8px"},".cm-line.cm-code-block-live-shell.cm-code-block-line[data-code-line-number]::before":{content:"none",display:"none"},".cm-line.cm-code-block-live-gutter-1":{"--cm-code-block-live-gutter-width":"1.5rem"},".cm-line.cm-code-block-live-gutter-2":{"--cm-code-block-live-gutter-width":"2rem"},".cm-line.cm-code-block-live-gutter-3":{"--cm-code-block-live-gutter-width":"2.5rem"},".cm-line.cm-code-block-live-gutter-4":{"--cm-code-block-live-gutter-width":"3rem"},".cm-line.cm-code-block-live-gutter-5":{"--cm-code-block-live-gutter-width":"3.5rem"},".cm-line.cm-code-block-live-gutter-6":{"--cm-code-block-live-gutter-width":"4rem"},".cm-code-block-live-leading-slot.cm-code-block-live-gutter-1":{width:"calc(var(--cm-code-block-live-content-padding, 0.75rem) + 1.5rem)"},".cm-code-block-live-leading-slot.cm-code-block-live-gutter-2":{width:"calc(var(--cm-code-block-live-content-padding, 0.75rem) + 2rem)"},".cm-code-block-live-leading-slot.cm-code-block-live-gutter-3":{width:"calc(var(--cm-code-block-live-content-padding, 0.75rem) + 2.5rem)"},".cm-code-block-live-leading-slot.cm-code-block-live-gutter-4":{width:"calc(var(--cm-code-block-live-content-padding, 0.75rem) + 3rem)"},".cm-code-block-live-leading-slot.cm-code-block-live-gutter-5":{width:"calc(var(--cm-code-block-live-content-padding, 0.75rem) + 3.5rem)"},".cm-code-block-live-leading-slot.cm-code-block-live-gutter-6":{width:"calc(var(--cm-code-block-live-content-padding, 0.75rem) + 4rem)"}});function Qm(n){return[et.fromClass(class{constructor(e){this.plugin=new tC(e,n)}update(e){this.plugin.update(e)}get decorations(){return this.plugin.decorations}},{decorations:e=>e.decorations}),iC]}function $m(n){const{colors:e}=n,t=e.background.toLowerCase()==="#ffffff",i=n.type==="light"&&t?"#f6f8fa":e.background,r=n.type==="dark"?"rgba(148, 163, 184, 0.16)":"rgba(15, 23, 42, 0.1)",s=n.type==="dark"?"rgba(255, 255, 255, 0.035)":"rgba(15, 23, 42, 0.045)",o=n.type==="dark"?"rgba(148, 163, 184, 0.12)":"rgba(15, 23, 42, 0.08)";return[vo(pv),z.theme({".cm-line.cm-code-block-line, .cm-line.cm-code-block-fence":{backgroundColor:e.background,color:e.foreground},".cm-line.cm-code-block-live-shell":{backgroundColor:i,color:e.foreground,boxShadow:`inset 1px 0 0 ${r}, inset -1px 0 0 ${r}`},".cm-line.cm-code-block-live-begin":{borderTopLeftRadius:"8px",borderTopRightRadius:"8px",boxShadow:`inset 0 1px 0 ${r}, inset 1px 0 0 ${r}, inset -1px 0 0 ${r}`},".cm-line.cm-code-block-live-end":{borderBottomLeftRadius:"8px",borderBottomRightRadius:"8px",boxShadow:`inset 0 -1px 0 ${r}, inset 1px 0 0 ${r}, inset -1px 0 0 ${r}`},".cm-line.cm-code-block-fence":{color:e.lineNumber},".cm-code-block-live-leading-slot, .cm-code-block-language-label, .cm-code-block-copy-button":{color:e.lineNumber},".cm-line.cm-code-block-live-shell .cm-code-block-live-leading-slot":{backgroundColor:s,boxShadow:`inset -1px 0 0 ${o}`},".cm-code-block-copy-button:hover":{backgroundColor:e.selection},".cm-code-block-copy-button:focus-visible":{backgroundColor:e.selection},".cm-line.cm-code-block-line .cm-selectionBackground, .cm-line.cm-code-block-fence .cm-selectionBackground":{backgroundColor:e.selection},".cm-line.cm-code-block-live-shell .cm-selectionBackground":{backgroundColor:e.selection},".cm-line.cm-code-block-line[data-code-line-number]::before":{color:e.lineNumber},".cm-line.cm-code-block-live-shell.cm-code-block-line[data-code-line-number]::before":{display:"none"},".cm-line.cm-code-block-line .tok-keyword":{color:e.keyword},".cm-line.cm-code-block-line .tok-variableName.tok-definition":{color:e.function},".cm-line.cm-code-block-line .tok-string, .cm-line.cm-code-block-line .tok-string2":{color:e.string},".cm-line.cm-code-block-line .tok-number":{color:e.number},".cm-line.cm-code-block-line .tok-comment":{color:e.comment,fontStyle:"italic"},".cm-line.cm-code-block-line .tok-operator":{color:e.operator},".cm-line.cm-code-block-line .tok-variableName":{color:e.variable},".cm-line.cm-code-block-line .tok-typeName":{color:e.type},".cm-line.cm-code-block-line .tok-propertyName":{color:e.property||e.variable},".cm-line.cm-code-block-line .tok-attributeName":{color:e.attribute||e.variable},".cm-line.cm-code-block-line .tok-tagName":{color:e.tag||e.keyword},".cm-line.cm-code-block-line .tok-variableName.tok-constant":{color:e.constant||e.number}})]}let Hf=!1,Wc=new WeakMap;function Cm(){if(!Hf){Hf=!0;try{n$(),ht.defineEx("write","w",n=>{const e=n?.cm6;e&&Wc.get(e)?.()})}catch{}}}function nC(n,e){Wc.set(n,e)}function rC(n){Wc.delete(n)}const sC=z.theme({"&":{height:"100%"},".cm-scroller":{height:"100%"},".cm-content":{minHeight:"100%",maxWidth:"var(--una-content-max-width, 720px)",marginLeft:"auto",marginRight:"auto",padding:"10px 12px"},".cm-gutters":{minHeight:"100%",flexShrink:"0",backgroundColor:"transparent",borderRight:"none"},".cm-lineNumbers .cm-gutterElement":{display:"flex",alignItems:"flex-start",justifyContent:"flex-end",boxSizing:"border-box",padding:"0 16px 0 4px",fontSize:"0.92em",lineHeight:"inherit",fontVariantNumeric:"tabular-nums",fontFeatureSettings:'"tnum"',fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"rgba(59, 130, 246, 0.3) !important"},".cm-activeLine":{backgroundColor:"rgba(255, 255, 255, 0.03)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"#e2e8f0"}}),oC=z.theme({"&":{fontFamily:"var(--una-font-family, sans-serif)",fontSize:"var(--una-font-size, 14px)"},"& .cm-scroller":{fontFamily:"inherit"}});function aC(){return{theme:new Fe,hybrid:new Fe,codeDecoration:new Fe,vim:new Fe,lineNumbers:new Fe,placeholder:new Fe,readOnly:new Fe,editable:new Fe,lineWrap:new Fe,codeTheme:new Fe,codeBlockDecorator:new Fe,codeBlockLivePreview:new Fe,contentTheme:new Fe}}function lC(n){return{applyExternalValue(e,t){const i=e.state.doc.toString();if(t!==i){n.isApplyingExternalUpdate=!0;try{e.dispatch({changes:{from:0,to:i.length,insert:t}})}finally{n.isApplyingExternalUpdate=!1}}}}}function cC(){const n={isApplyingExternalUpdate:!1};return{editorView:ue.ref(),compartments:aC(),syncState:n,documentSyncStrategy:lC(n)}}function En(n){const e=n.disabled===!0,t=n.readonly===!0;return{isDisabled:e,isReadonly:t,isReadOnly:e||t,isEditable:!e}}function hC(n){if(!n)return[];const e=[];for(let t=0;t<n.files.length;t+=1){const i=n.files[t];i.type.startsWith("image/")&&e.push(i)}return e}function Kf(n,e,t,i){const r=hC(t);return r.length?(i.preventDefault(),En(n.props).isDisabled||n.callbacks.onFileInput({source:e,files:r}),!0):!1}function uC(n,e){const{props:t,appearance:i,callbacks:r}=n,{compartments:s,syncState:o}=e,a=i.value,l=En(t);return[e1(),Li.of(c1),Li.of(eS),wi.highest(Li.of([{key:"Mod-s",preventDefault:!0,run:()=>(r.onSave(),!0)}])),Sx({base:Nn,codeLanguages:z$()}),vo(Np,{fallback:!0}),s.vim.of(t.vimMode?im({status:!1}):[]),sC,oC,o$,s.contentTheme.of(Om(a.editorTheme.content)),s.codeBlockDecorator.of(wm(t.codeLineNumbers||!1)),s.codeBlockLivePreview.of(t.livePreview?Qm({showLineNumbers:t.codeLineNumbers||!1}):[]),s.hybrid.of(t.livePreview?mm(t.renderHooks):[]),s.codeDecoration.of(t.livePreview?[]:ym()),s.theme.of(a.editorTheme.chrome),s.codeTheme.of($m(a.codeTheme)),s.lineNumbers.of(t.lineNumbers!==!1?$p():[]),s.lineWrap.of(t.lineWrap!==!1?z.lineWrapping:[]),s.placeholder.of(t.placeholder?wp(t.placeholder):[]),z.updateListener.of(h=>{if(h.docChanged&&!o.isApplyingExternalUpdate){const f=h.state.doc.toString();r.onModelValueChange(f),r.onChange(f)}}),z.domEventHandlers({focus:()=>{r.onFocus()},blur:h=>{i$(h.relatedTarget)||r.onBlur()},drop:h=>Kf(n,"drop",h.dataTransfer,h),paste:h=>Kf(n,"paste",h.clipboardData,h)}),s.readOnly.of(he.readOnly.of(l.isReadOnly)),s.editable.of(z.editable.of(l.isEditable))]}function fC(n,e,t){if(!n.value)return;e.props.vimMode&&Cm();const i=new z({state:he.create({doc:e.props.modelValue,extensions:uC(e,t)}),parent:n.value});t.editorView.value=i,nC(i,e.callbacks.onSave)}function dC(n){const e=n.editorView.value;e&&(rC(e),e.destroy(),n.editorView.value=void 0)}function pC(n,e){ue.watch(()=>n.props.modelValue,t=>{const i=e.editorView.value;i&&e.documentSyncStrategy.applyExternalValue(i,t)})}function OC(n,e){ue.watch(n.appearance,(t,i)=>{const r=e.editorView.value;if(!r)return;const s=!i||t.contentThemeSignature!==i.contentThemeSignature,o=!i||t.codeThemeSignature!==i.codeThemeSignature,a=!i||t.layoutSignature!==i.layoutSignature,l=[];s&&l.push(e.compartments.theme.reconfigure(t.editorTheme.chrome),e.compartments.contentTheme.reconfigure(Om(t.editorTheme.content))),o&&l.push(e.compartments.codeTheme.reconfigure($m(t.codeTheme))),(s||o||a)&&l.push(El.of(null)),l.length&&r.dispatch({effects:l});const h=t.fontFamily!==i?.fontFamily||t.codeFontFamily!==i?.codeFontFamily;a&&h&&typeof document<"u"&&"fonts"in document&&document.fonts.ready.then(()=>{e.editorView.value?.dispatch({effects:El.of(null)})})},{flush:"post"})}function gC(n,e){ue.watch(()=>[n.props.codeLineNumbers,n.props.livePreview],([t,i])=>{const r=e.editorView.value;r&&r.dispatch({effects:[e.compartments.codeBlockDecorator.reconfigure(wm(t||!1)),e.compartments.codeBlockLivePreview.reconfigure(i?Qm({showLineNumbers:t||!1}):[])]})}),ue.watch(()=>[n.props.livePreview,n.props.renderHooks],([t,i])=>{const r=e.editorView.value;r&&r.dispatch({effects:[e.compartments.hybrid.reconfigure(t?mm(i):[]),e.compartments.codeDecoration.reconfigure(t?[]:ym())]})}),ue.watch(()=>n.props.lineNumbers,t=>{const i=e.editorView.value;i&&i.dispatch({effects:e.compartments.lineNumbers.reconfigure(t!==!1?$p():[])})}),ue.watch(()=>n.props.lineWrap,t=>{const i=e.editorView.value;i&&i.dispatch({effects:e.compartments.lineWrap.reconfigure(t!==!1?z.lineWrapping:[])})}),ue.watch(()=>n.props.placeholder,t=>{const i=e.editorView.value;i&&i.dispatch({effects:e.compartments.placeholder.reconfigure(t?wp(t):[])})}),ue.watch(()=>[n.props.disabled,n.props.readonly],([t,i])=>{const r=e.editorView.value;if(!r)return;const s=En({disabled:t,readonly:i});r.dispatch({effects:[e.compartments.readOnly.reconfigure(he.readOnly.of(s.isReadOnly)),e.compartments.editable.reconfigure(z.editable.of(s.isEditable))]})})}function mC(n,e){ue.watch(()=>n.props.vimMode,t=>{const i=e.editorView.value;i&&(t&&Cm(),i.dispatch({effects:e.compartments.vim.reconfigure(t?im({status:!1}):[])}))})}function yC(n,e){const t=cC(),{props:i}=e;ue.onMounted(()=>{fC(n,e,t)}),pC(e,t),OC(e,t),gC(e,t),mC(e,t),ue.onBeforeUnmount(()=>{dC(t)});const r=()=>{t.editorView.value?.focus()},s=()=>{if(!t.editorView.value)return"";const m=t.editorView.value.state,b=m.selection.main;return m.doc.sliceString(b.from,b.to)},o=()=>t.editorView.value,a=m=>{if(!t.editorView.value||En(i).isReadOnly)return;const b=t.editorView.value,S=b.state.selection.main;b.dispatch({changes:{from:S.from,to:S.to,insert:m},selection:{anchor:S.from+m.length},scrollIntoView:!0})},l=()=>{if(!t.editorView.value)return[];const m=t.editorView.value.state,b=ce(m),S=[];return b.iterate({enter:Q=>{if(Q.name.startsWith("ATXHeading")){const P=Q.name.match(/\d$/),A=P?parseInt(P[0],10):1,B=m.doc.sliceString(Q.from,Q.to).replace(/^#+\s*/,"").trim(),U=m.doc.lineAt(Q.from).number;S.push({text:B,level:A,line:U})}}}),S},h=m=>{if(!t.editorView.value)return;const b=t.editorView.value.state.doc;m<1&&(m=1),m>b.lines&&(m=b.lines);const S=b.line(m),Q=t.editorView.value,P=Q.hasFocus,A=Q.lineBlockAt(S.from),E=Q.scrollDOM,B=A.top-5;E.scrollTop=Math.max(0,B),P&&Q.dispatch({selection:{anchor:S.from}})},f=()=>!t.editorView.value||En(i).isReadOnly?!1:Nr(t.editorView.value),O=()=>!t.editorView.value||En(i).isReadOnly?!1:un(t.editorView.value);return{editorView:t.editorView,focus:r,getSelection:s,getEditorView:o,insertText:a,getHeadings:l,scrollToLine:h,undoHistory:f,redoHistory:O}}function bC(n,e){const t=ue.ref(!1),i=ue.ref(null),r=async(l="browser")=>{if(n.value){if(l==="browser")i.value!=="browser"?(n.value.classList.add("una-editor-fullscreen-browser"),t.value=!0,i.value="browser",e?.()):(n.value.classList.remove("una-editor-fullscreen-browser"),t.value=!1,i.value=null);else if(l==="screen")if(document.fullscreenElement)await document.exitFullscreen(),t.value=!1,i.value=null;else try{await n.value.requestFullscreen(),t.value=!0,i.value="screen"}catch(h){console.error("Failed to enter fullscreen:",h)}}},s=async()=>{n.value&&(i.value==="browser"?n.value.classList.remove("una-editor-fullscreen-browser"):i.value==="screen"&&document.fullscreenElement&&await document.exitFullscreen(),t.value=!1,i.value=null)},o=()=>{!document.fullscreenElement&&i.value==="screen"&&(t.value=!1,i.value=null)},a=l=>{l.key==="Escape"&&i.value==="browser"&&s()};return ue.onMounted(()=>{document.addEventListener("fullscreenchange",o),document.addEventListener("keydown",a)}),ue.onBeforeUnmount(()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("keydown",a)}),{isFullscreen:t,fullscreenMode:i,toggleFullscreen:r,exitFullscreen:s}}const Il={"one-dark":{name:"One Dark",type:"dark",colors:{background:"#282c34",foreground:"#abb2bf",selection:"#3e4451",lineNumber:"#636d83",keyword:"#c678dd",function:"#61afef",string:"#98c379",number:"#d19a66",comment:"#5c6370",operator:"#56b6c2",variable:"#e06c75",type:"#e5c07b",constant:"#d19a66",property:"#e06c75",tag:"#e06c75",attribute:"#d19a66",regexp:"#98c379",escape:"#56b6c2"}},dracula:{name:"Dracula",type:"dark",colors:{background:"#282a36",foreground:"#f8f8f2",selection:"#44475a",lineNumber:"#6272a4",keyword:"#ff79c6",function:"#50fa7b",string:"#f1fa8c",number:"#bd93f9",comment:"#6272a4",operator:"#ff79c6",variable:"#f8f8f2",type:"#8be9fd",constant:"#bd93f9",property:"#f8f8f2",tag:"#ff79c6",attribute:"#50fa7b",regexp:"#f1fa8c",escape:"#ff79c6"}},monokai:{name:"Monokai",type:"dark",colors:{background:"#272822",foreground:"#f8f8f2",selection:"#49483e",lineNumber:"#90908a",keyword:"#f92672",function:"#a6e22e",string:"#e6db74",number:"#ae81ff",comment:"#75715e",operator:"#f92672",variable:"#f8f8f2",type:"#66d9ef",constant:"#ae81ff",property:"#f8f8f2",tag:"#f92672",attribute:"#a6e22e",regexp:"#e6db74",escape:"#f92672"}},"solarized-dark":{name:"Solarized Dark",type:"dark",colors:{background:"#002b36",foreground:"#839496",selection:"#073642",lineNumber:"#586e75",keyword:"#859900",function:"#268bd2",string:"#2aa198",number:"#d33682",comment:"#586e75",operator:"#859900",variable:"#b58900",type:"#cb4b16",constant:"#d33682",property:"#b58900",tag:"#268bd2",attribute:"#859900",regexp:"#2aa198",escape:"#cb4b16"}},nord:{name:"Nord",type:"dark",colors:{background:"#2e3440",foreground:"#d8dee9",selection:"#434c5e",lineNumber:"#4c566a",keyword:"#81a1c1",function:"#88c0d0",string:"#a3be8c",number:"#b48ead",comment:"#616e88",operator:"#81a1c1",variable:"#d8dee9",type:"#8fbcbb",constant:"#b48ead",property:"#d8dee9",tag:"#81a1c1",attribute:"#8fbcbb",regexp:"#a3be8c",escape:"#88c0d0"}},"tokyo-night":{name:"Tokyo Night",type:"dark",colors:{background:"#1a1b26",foreground:"#a9b1d6",selection:"#283457",lineNumber:"#565f89",keyword:"#bb9af7",function:"#7aa2f7",string:"#9ece6a",number:"#ff9e64",comment:"#565f89",operator:"#89ddff",variable:"#f7768e",type:"#2ac3de",constant:"#ff9e64",property:"#f7768e",tag:"#bb9af7",attribute:"#7aa2f7",regexp:"#9ece6a",escape:"#89ddff"}},"github-light":{name:"GitHub Light",type:"light",colors:{background:"#ffffff",foreground:"#24292e",selection:"#c8e1ff",lineNumber:"#959da5",keyword:"#d73a49",function:"#6f42c1",string:"#032f62",number:"#005cc5",comment:"#6a737d",operator:"#d73a49",variable:"#24292e",type:"#005cc5",constant:"#005cc5",property:"#24292e",tag:"#22863a",attribute:"#6f42c1",regexp:"#032f62",escape:"#d73a49"}},"solarized-light":{name:"Solarized Light",type:"light",colors:{background:"#fdf6e3",foreground:"#657b83",selection:"#eee8d5",lineNumber:"#93a1a1",keyword:"#859900",function:"#268bd2",string:"#2aa198",number:"#d33682",comment:"#93a1a1",operator:"#859900",variable:"#b58900",type:"#cb4b16",constant:"#d33682",property:"#b58900",tag:"#268bd2",attribute:"#859900",regexp:"#2aa198",escape:"#cb4b16"}},"atom-one-light":{name:"Atom One Light",type:"light",colors:{background:"#fafafa",foreground:"#383a42",selection:"#e5e5e6",lineNumber:"#9d9d9f",keyword:"#a626a4",function:"#4078f2",string:"#50a14f",number:"#986801",comment:"#a0a1a7",operator:"#0184bc",variable:"#e45649",type:"#c18401",constant:"#986801",property:"#e45649",tag:"#a626a4",attribute:"#4078f2",regexp:"#50a14f",escape:"#0184bc"}}};function vC(n){return Il[n]}function Jf(n){return n==="dark"?Il["solarized-dark"]:Il["github-light"]}const SC="#e5c07b",ed="#e06c75",kC="#56b6c2",wC="#ffffff",As="#abb2bf",Dl="#7d8799",xC="#61afef",QC="#98c379",td="#d19a66",$C="#c678dd",CC="#21252b",id="#2c313a",nd="#282c34",La="#353a42",PC="#3E4451",rd="#528bff",TC=z.theme({"&":{color:As,backgroundColor:nd},".cm-content":{caretColor:rd},".cm-cursor, .cm-dropCursor":{borderLeftColor:rd},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:PC},".cm-panels":{backgroundColor:CC,color:As},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:nd,color:Dl,border:"none"},".cm-activeLineGutter":{backgroundColor:id},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:La},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:La,borderBottomColor:La},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:id,color:As}}},{dark:!0}),AC=Fn.define([{tag:x.keyword,color:$C},{tag:[x.name,x.deleted,x.character,x.propertyName,x.macroName],color:ed},{tag:[x.function(x.variableName),x.labelName],color:xC},{tag:[x.color,x.constant(x.name),x.standard(x.name)],color:td},{tag:[x.definition(x.name),x.separator],color:As},{tag:[x.typeName,x.className,x.number,x.changed,x.annotation,x.modifier,x.self,x.namespace],color:SC},{tag:[x.operator,x.operatorKeyword,x.url,x.escape,x.regexp,x.link,x.special(x.string)],color:kC},{tag:[x.meta,x.comment],color:Dl},{tag:x.strong,fontWeight:"bold"},{tag:x.emphasis,fontStyle:"italic"},{tag:x.strikethrough,textDecoration:"line-through"},{tag:x.link,color:Dl,textDecoration:"underline"},{tag:x.heading,fontWeight:"bold",color:ed},{tag:[x.atom,x.bool,x.special(x.variableName)],color:td},{tag:[x.processingInstruction,x.string,x.inserted],color:QC},{tag:x.invalid,color:wC}]),MC=[TC,vo(AC)],Pm={name:"Light",type:"light",content:{heading1:{fontSize:"1.875em",fontWeight:"700",lineHeight:"1.25"},heading2:{fontSize:"1.5em",fontWeight:"700",lineHeight:"1.3"},heading3:{fontSize:"1.25em",fontWeight:"700",lineHeight:"1.35"},heading4:{fontSize:"1em",fontWeight:"700",lineHeight:"1.4"},heading5:{fontSize:"1em",fontWeight:"700",lineHeight:"1.4"},heading6:{fontSize:"1em",fontWeight:"700",lineHeight:"1.4"},link:{color:"#0b57d0",textDecoration:"underline",textUnderlineOffset:"0.18em"},emphasis:{fontStyle:"italic"},strong:{fontWeight:"700"},inlineCode:{backgroundColor:"rgba(15, 23, 42, 0.08)",borderRadius:"4px",padding:"0.1em 0.3em"},blockquote:{borderColor:"rgba(100, 116, 139, 0.5)",backgroundColor:"rgba(148, 163, 184, 0.08)",paddingLeft:"0.75rem",fontStyle:"italic"},syntaxMark:{color:"#6b7280"},listMarker:{color:"rgba(100, 116, 139, 0.9)"},taskCheckbox:{accentColor:"#14b8a6"}},table:{headerBackground:"rgba(15, 23, 42, 0.04)"}},Tm={name:"Dark",type:"dark",content:{heading1:{fontSize:"1.875em",fontWeight:"700",lineHeight:"1.25"},heading2:{fontSize:"1.5em",fontWeight:"700",lineHeight:"1.3"},heading3:{fontSize:"1.25em",fontWeight:"700",lineHeight:"1.35"},heading4:{fontSize:"1em",fontWeight:"700",lineHeight:"1.4"},heading5:{fontSize:"1em",fontWeight:"700",lineHeight:"1.4"},heading6:{fontSize:"1em",fontWeight:"700",lineHeight:"1.4"},link:{color:"#8ab4f8",textDecoration:"underline",textUnderlineOffset:"0.18em"},emphasis:{fontStyle:"italic"},strong:{fontWeight:"700"},inlineCode:{backgroundColor:"rgba(148, 163, 184, 0.18)",borderRadius:"4px",padding:"0.1em 0.3em"},blockquote:{borderColor:"rgba(148, 163, 184, 0.38)",backgroundColor:"rgba(148, 163, 184, 0.12)",paddingLeft:"0.75rem",fontStyle:"italic"},syntaxMark:{color:"#9aa5ce"},listMarker:{color:"rgba(148, 163, 184, 0.9)"},taskCheckbox:{accentColor:"#2dd4bf"}},table:{headerBackground:"rgba(148, 163, 184, 0.12)"}},RC=[],sd={light:RC,dark:MC};function od(n,e){return{heading1:{...n.heading1,...e?.heading1},heading2:{...n.heading2,...e?.heading2},heading3:{...n.heading3,...e?.heading3},heading4:{...n.heading4,...e?.heading4},heading5:{...n.heading5,...e?.heading5},heading6:{...n.heading6,...e?.heading6},link:{...n.link,...e?.link},emphasis:{...n.emphasis,...e?.emphasis},strong:{...n.strong,...e?.strong},inlineCode:{...n.inlineCode,...e?.inlineCode},blockquote:{...n.blockquote,...e?.blockquote},syntaxMark:{...n.syntaxMark,...e?.syntaxMark},listMarker:{...n.listMarker,...e?.listMarker},taskCheckbox:{...n.taskCheckbox,...e?.taskCheckbox}}}function ad(n,e){return{...n,...e}}function bs(n){return n==="dark"?Tm:Pm}function LC(n){if(n==="dark"||n==="light"||!n){const t=n??"light";return{name:bs(t).name??(t==="dark"?"Dark":"Light"),type:t,chrome:sd[t],content:od(bs(t).content),table:ad(bs(t).table)}}const e=bs(n.type);return{name:n.name??e.name??(n.type==="dark"?"Dark":"Light"),type:n.type,chrome:sd[n.type],content:od(e.content,n.content),table:ad(e.table,n.table)}}function ZC(n,e){if(!n||n==="auto")return Jf(e);const t=vC(n);return t||(console.warn(`Unknown code theme: ${n}, falling back to default`),Jf(e))}function EC(n){const e={"--una-content-max-width":`${n.contentMaxWidth}px`,"--una-editor-surface":n.editorTheme.type==="dark"?"#282c34":"#ffffff","--una-table-header-bg":n.editorTheme.table.headerBackground};return n.fontFamily&&(e["--una-font-family"]=n.fontFamily),n.codeFontFamily&&(e["--una-code-font-family"]=n.codeFontFamily),n.fontSize!==void 0&&(e["--una-font-size"]=`${n.fontSize}px`),e}function XC(n){const e=LC(n.theme),t=ZC(n.codeTheme,e.type),i=n.contentMaxWidth??720;return{editorTheme:e,codeTheme:t,fontFamily:n.fontFamily,codeFontFamily:n.codeFontFamily,fontSize:n.fontSize,contentMaxWidth:i,contentThemeSignature:JSON.stringify({type:e.type,content:e.content}),codeThemeSignature:JSON.stringify({name:t.name,type:t.type,colors:t.colors}),layoutSignature:JSON.stringify({fontFamily:n.fontFamily??null,codeFontFamily:n.codeFontFamily??null,fontSize:n.fontSize??null,contentMaxWidth:i}),containerStyle:EC({editorTheme:e,fontFamily:n.fontFamily,codeFontFamily:n.codeFontFamily,fontSize:n.fontSize,contentMaxWidth:i})}}const ao={placeholder:"请输入内容...",fullscreen:"全屏",exitFullscreen:"退出全屏",browserFullscreenTip:'浏览器全屏已开启。点击"退出全屏"按钮或按 ESC 键退出。'},Nc={placeholder:"Enter content...",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",browserFullscreenTip:'Browser fullscreen is active. Click "Exit Fullscreen" button or press ESC to exit.'},BC={key:0,class:"una-editor-fullscreen-tip"},IC=ue.defineComponent({inheritAttrs:!1,__name:"UnaEditor",props:{modelValue:{default:""},lineNumbers:{type:Boolean,default:!0},lineWrap:{type:Boolean,default:!0},livePreview:{type:Boolean,default:!1},renderHooks:{},vimMode:{type:Boolean,default:!1},locale:{default:"zh-CN"},placeholder:{},disabled:{type:Boolean},readonly:{type:Boolean},theme:{default:"light"},fontFamily:{},codeFontFamily:{},fontSize:{},contentMaxWidth:{default:720},codeTheme:{default:"auto"},codeLineNumbers:{type:Boolean,default:!1}},emits:["update:modelValue","change","save","focus","blur","drop"],setup(n,{expose:e,emit:t}){const i=n,r=t,s=ue.useAttrs(),o=ue.ref(),a=ue.ref(!1),l=ue.computed(()=>typeof i.locale=="string"?i.locale==="en-US"?Nc:ao:i.locale||ao),h=ue.computed(()=>XC({theme:i.theme,codeTheme:i.codeTheme,fontFamily:i.fontFamily,codeFontFamily:i.codeFontFamily,fontSize:i.fontSize,contentMaxWidth:i.contentMaxWidth})),f=ue.computed(()=>h.value.containerStyle),O=()=>{a.value=!0,setTimeout(()=>{a.value=!1},3e3)},m={onModelValueChange:_=>{r("update:modelValue",_)},onChange:_=>{r("change",_)},onSave:()=>{r("save")},onFocus:()=>{r("focus")},onBlur:()=>{r("blur")},onFileInput:({files:_})=>{r("drop",_)}},{focus:b,getSelection:S,getEditorView:Q,insertText:P,getHeadings:A,scrollToLine:E,undoHistory:B,redoHistory:U}=yC(o,{props:i,appearance:h,callbacks:m}),{toggleFullscreen:W,exitFullscreen:Y}=bC(o,O);return e({focus:b,getSelection:S,toggleFullscreen:W,exitFullscreen:Y,getEditorView:Q,insertText:P,getHeadings:A,scrollToLine:E,undoHistory:B,redoHistory:U}),(_,ge)=>(ue.openBlock(),ue.createElementBlock("div",ue.mergeProps({ref_key:"editorContainer",ref:o,class:"una-editor",style:f.value},ue.unref(s)),[ue.createVNode(ue.Transition,{name:"fade"},{default:ue.withCtx(()=>[a.value?(ue.openBlock(),ue.createElementBlock("div",BC,ue.toDisplayString(l.value.browserFullscreenTip),1)):ue.createCommentVNode("",!0)]),_:1})],16))}}),DC=(n,e)=>{const t=n.__vccOpts||n;for(const[i,r]of e)t[i]=r;return t},_C=DC(IC,[["__scopeId","data-v-21c526bf"]]),jC={"zh-CN":ao,"en-US":Nc},VC="zh-CN";function zC(n){return n}const WC="0.4.0";exports.ContextTracker=Cc;exports.ExternalTokenizer=vt;exports.LRLanguage=ji;exports.LRParser=fn;exports.LanguageSupport=ut;exports.NodeWeakMap=nc;exports.UnaEditor=_C;exports.completeFromList=AO;exports.continuedIndent=Mn;exports.darkEditorTheme=Tm;exports.defaultLocale=VC;exports.defineLocale=zC;exports.delimitedIndent=ac;exports.enUS=Nc;exports.flatIndent=lc;exports.foldInside=yo;exports.foldNodeProp=qi;exports.html=Lc;exports.ifNotIn=MO;exports.indentNodeProp=Yi;exports.lightEditorTheme=Pm;exports.locales=jC;exports.parseMixed=rc;exports.snippetCompletion=lt;exports.styleTags=dn;exports.syntaxTree=ce;exports.tags=x;exports.version=WC;exports.zhCN=ao;
|