wip
This commit is contained in:
1 parent
7eaa8c0da2
commit
c149ed0a9f
15 files changed
+157
-77
No files matched your search
@@ -1,37 +1,38 @@
|
||||
var Vs=[],Bc=[];(()=>{let O="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<O.length;e++)(e%2?Bc:Vs).push(t=t+O[e])})();function Nm(O){if(O<768)return!1;for(let e=0,t=Vs.length;;){let i=e+t>>1;if(O<Vs[i])t=i;else if(O>=Bc[i])e=i+1;else return!0;if(e==t)return!1}}function Mc(O){return O>=127462&&O<=127487}var Dc=8205;function Nc(O,e,t=!0,i=!0){return(t?Fc:Fm)(O,e,i)}function Fc(O,e,t){if(e==O.length)return e;e&&Hc(O.charCodeAt(e))&&Kc(O.charCodeAt(e-1))&&e--;let i=Rs(O,e);for(e+=Ic(i);e<O.length;){let r=Rs(O,e);if(i==Dc||r==Dc||t&&Nm(r))e+=Ic(r),i=r;else if(Mc(r)){let n=0,s=e-2;for(;s>=0&&Mc(Rs(O,s));)n++,s-=2;if(n%2==0)break;e+=2}else break}return e}function Fm(O,e,t){for(;e>0;){let i=Fc(O,e-2,t);if(i<e)return i;e--}return 0}function Rs(O,e){let t=O.charCodeAt(e);if(!Kc(t)||e+1==O.length)return t;let i=O.charCodeAt(e+1);return Hc(i)?(t-55296<<10)+(i-56320)+65536:t}function Hc(O){return O>=56320&&O<57344}function Kc(O){return O>=55296&&O<56320}function Ic(O){return O<65536?1:2}var G=class O{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]=CO(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),WO.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]=CO(this,e,t);let i=[];return this.decompose(e,t,i,0),WO.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 hO(this),n=new hO(e);for(let s=t,a=t;;){if(r.next(s),n.next(s),s=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(a+=r.value.length,r.done||a>=i)return!0}}iter(e=1){return new hO(this,e)}iterRange(e,t=this.length){return new _r(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 zr(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]?O.empty:e.length<=32?new Le(e):WO.from(Le.split(e,[]))}},Le=class O extends G{constructor(e,t=Hm(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 n=0;;n++){let s=this.text[n],a=r+s.length;if((t?i:a)>=e)return new _s(r,a,i,s);r=a+1,i++}}decompose(e,t,i,r){let n=e<=0&&t>=this.length?this:new O(Jc(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let s=i.pop(),a=qr(n.text,s.text.slice(),0,n.length);if(a.length<=32)i.push(new O(a,s.length+n.length));else{let o=a.length>>1;i.push(new O(a.slice(0,o)),new O(a.slice(o)))}}else i.push(n)}replace(e,t,i){if(!(i instanceof O))return super.replace(e,t,i);[e,t]=CO(this,e,t);let r=qr(this.text,qr(i.text,Jc(this.text,0,e)),t),n=this.length+i.length-(t-e);return r.length<=32?new O(r,n):WO.from(O.split(r,[]),n)}sliceString(e,t=this.length,i=`
|
||||
`){[e,t]=CO(this,e,t);let r="";for(let n=0,s=0;n<=t&&s<this.text.length;s++){let a=this.text[s],o=n+a.length;n>e&&s&&(r+=i),e<o&&t>n&&(r+=a.slice(Math.max(0,e-n),t-n)),n=o+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 n of e)i.push(n),r+=n.length+1,i.length==32&&(t.push(new O(i,r)),i=[],r=-1);return r>-1&&t.push(new O(i,r)),t}},WO=class O extends G{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 n=0;;n++){let s=this.children[n],a=r+s.length,o=i+s.lines-1;if((t?o:a)>=e)return s.lineInner(e,t,i,r);r=a+1,i=o+1}}decompose(e,t,i,r){for(let n=0,s=0;s<=t&&n<this.children.length;n++){let a=this.children[n],o=s+a.length;if(e<=o&&t>=s){let l=r&((s<=e?1:0)|(o>=t?2:0));s>=e&&o<=t&&!l?i.push(a):a.decompose(e-s,t-s,i,l)}s=o+1}}replace(e,t,i){if([e,t]=CO(this,e,t),i.lines<this.lines)for(let r=0,n=0;r<this.children.length;r++){let s=this.children[r],a=n+s.length;if(e>=n&&t<=a){let o=s.replace(e-n,t-n,i),l=this.lines-s.lines+o.lines;if(o.lines<l>>4&&o.lines>l>>6){let c=this.children.slice();return c[r]=o,new O(c,this.length-(t-e)+i.length)}return super.replace(n,a,o)}n=a+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
||||
`){[e,t]=CO(this,e,t);let r="";for(let n=0,s=0;n<this.children.length&&s<=t;n++){let a=this.children[n],o=s+a.length;s>e&&n&&(r+=i),e<o&&t>s&&(r+=a.sliceString(e-s,t-s,i)),s=o+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof O))return 0;let i=0,[r,n,s,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,n+=t){if(r==s||n==a)return i;let o=this.children[r],l=e.children[n];if(o!=l)return i+o.scanIdentical(l,t);i+=o.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let $ of e)i+=$.lines;if(i<32){let $=[];for(let u of e)u.flatten($);return new Le($,t)}let r=Math.max(32,i>>5),n=r<<1,s=r>>1,a=[],o=0,l=-1,c=[];function h($){let u;if($.lines>n&&$ instanceof O)for(let d of $.children)h(d);else $.lines>s&&(o>s||!o)?(f(),a.push($)):$ instanceof Le&&o&&(u=c[c.length-1])instanceof Le&&$.lines+u.lines<=32?(o+=$.lines,l+=$.length+1,c[c.length-1]=new Le(u.text.concat($.text),u.length+1+$.length)):(o+$.lines>r&&f(),o+=$.lines,l+=$.length+1,c.push($))}function f(){o!=0&&(a.push(c.length==1?c[0]:O.from(c,l)),l=-1,o=c.length=0)}for(let $ of e)h($);return f(),a.length==1?a[0]:new O(a,t)}};G.empty=new Le([""],0);function Hm(O){let e=-1;for(let t of O)e+=t.length+1;return e}function qr(O,e,t=0,i=1e9){for(let r=0,n=0,s=!0;n<O.length&&r<=i;n++){let a=O[n],o=r+a.length;o>=t&&(o>i&&(a=a.slice(0,i-r)),r<t&&(a=a.slice(t-r)),s?(e[e.length-1]+=a,s=!1):e.push(a)),r=o+1}return e}function Jc(O,e,t){return qr(O,[""],e,t)}var hO=class{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 Le?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],n=this.offsets[i],s=n>>1,a=r instanceof Le?r.text.length:r.children.length;if(s==(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((n&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
||||
`,this;e--}else if(r instanceof Le){let o=r.text[s+(t<0?-1:0)];if(this.offsets[i]+=t,o.length>Math.max(0,e))return this.value=e==0?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=r.children[s+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof Le?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},_r=class{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new hO(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!=""}},zr=class{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"&&(G.prototype[Symbol.iterator]=function(){return this.iter()},hO.prototype[Symbol.iterator]=_r.prototype[Symbol.iterator]=zr.prototype[Symbol.iterator]=function(){return this});var _s=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 CO(O,e,t){return e=Math.max(0,Math.min(O.length,e)),[e,Math.max(e,Math.min(O.length,t))]}function ue(O,e,t=!0,i=!0){return Nc(O,e,t,i)}function Km(O){return O>=56320&&O<57344}function Jm(O){return O>=55296&&O<56320}function Se(O,e){let t=O.charCodeAt(e);if(!Jm(t)||e+1==O.length)return t;let i=O.charCodeAt(e+1);return Km(i)?(t-55296<<10)+(i-56320)+65536:t}function Xi(O){return O<=65535?String.fromCharCode(O):(O-=65536,String.fromCharCode((O>>10)+55296,(O&1023)+56320))}function De(O){return O<65536?1:2}var zs=/\r\n?|\n/,pe=(function(O){return O[O.Simple=0]="Simple",O[O.TrackDel=1]="TrackDel",O[O.TrackBefore=2]="TrackBefore",O[O.TrackAfter=3]="TrackAfter",O})(pe||(pe={})),Zt=class O{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 n=this.sections[t++],s=this.sections[t++];s<0?(e(i,r,n),r+=n):r+=s,i+=n}}iterChangedRanges(e,t=!1){Ws(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 O(e)}composeDesc(e){return this.empty?e:e.empty?this:rh(this,e)}mapDesc(e,t=!1){return e.empty?this:Us(this,e,t)}mapPos(e,t=-1,i=pe.Simple){let r=0,n=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],o=this.sections[s++],l=r+a;if(o<0){if(l>e)return n+(e-r);n+=a}else{if(i!=pe.Simple&&l>=e&&(i==pe.TrackDel&&r<e&&l>e||i==pe.TrackBefore&&r<e||i==pe.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==r||t<0?n:n+o;n+=o}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return n}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let n=this.sections[i++],s=this.sections[i++],a=r+n;if(s>=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 O(e)}static create(e){return new O(e)}},Ye=class O extends Zt{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 Ws(this,(t,i,r,n,s)=>e=e.replace(r,r+(i-t),s),!1),e}mapDesc(e,t=!1){return Us(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,n=0;r<t.length;r+=2){let s=t[r],a=t[r+1];if(a>=0){t[r]=a,t[r+1]=s;let o=r>>1;for(;i.length<o;)i.push(G.empty);i.push(s?e.slice(n,n+s):G.empty)}n+=s}return new O(t,i)}compose(e){return this.empty?e:e.empty?this:rh(this,e,!0)}map(e,t=!1){return e.empty?this:Us(this,e,t,!0)}iterChanges(e,t=!1){Ws(this,e,t)}get desc(){return Zt
Line truncated
|
||||
`}get readOnly(){return this.facet(hh)}phrase(e,...t){for(let i of this.facet(O.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 n=+(r||1);return!n||n>t.length?i:t[n-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let n of this.facet(sh))for(let s of n(this,t,i))Object.prototype.hasOwnProperty.call(s,e)&&r.push(s[e]);return r}charCategorizer(e){return og(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),n=this.charCategorizer(e),s=e-i,a=e-i;for(;s>0;){let o=ue(t,s,!1);if(n(t.slice(o,s))!=K.Word)break;s=o}for(;a<r;){let o=ue(t,a);if(n(t.slice(a,o))!=K.Word)break;a=o}return s==a?null:P.range(s+i,a+i)}};M.allowMultipleSelections=Cs;M.tabSize=Y.define({combine:O=>O.length?O[0]:4});M.lineSeparator=ah;M.readOnly=hh;M.phrases=Y.define({compare(O,e){let t=Object.keys(O),i=Object.keys(e);return t.length==i.length&&t.every(r=>O[r]==e[r])}});M.languageData=sh;M.changeFilter=oh;M.transactionFilter=lh;M.transactionExtender=ch;GO.reconfigure=q.define();function xe(O,e,t={}){let i={};for(let r of O)for(let n of Object.keys(r)){let s=r[n],a=i[n];if(a===void 0)i[n]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(t,n))i[n]=t[n](a,s);else throw new Error("Config merge conflict for field "+n)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var ot=class{eq(e){return this==e}range(e,t=e){return Pi.create(e,t,this)}};ot.prototype.startSide=ot.prototype.endSide=0;ot.prototype.point=!1;ot.prototype.mapMode=pe.TrackDel;var Pi=class O{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new O(e,t,i)}};function Ms(O,e){return O.from-e.from||O.value.startSide-e.value.startSide}var Ds=class O{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 n=i?this.to:this.from;for(let s=r,a=n.length;;){if(s==a)return s;let o=s+a>>1,l=n[o]-e||(i?this.value[o].endSide:this.value[o].startSide)-t;if(o==s)return l>=0?s:a;l>=0?a=o:s=o+1}}between(e,t,i,r){for(let n=this.findIndex(t,-1e9,!0),s=this.findIndex(i,1e9,!1,n);n<s;n++)if(r(this.from[n]+e,this.to[n]+e,this.value[n])===!1)return!1}map(e,t){let i=[],r=[],n=[],s=-1,a=-1;for(let o=0;o<this.value.length;o++){let l=this.value[o],c=this.from[o]+e,h=this.to[o]+e,f,$;if(c==h){let u=t.mapPos(c,l.startSide,l.mapMode);if(u==null||(f=$=u,l.startSide!=l.endSide&&($=t.mapPos(c,l.endSide),$<f)))continue}else if(f=t.mapPos(c,l.startSide),$=t.mapPos(h,l.endSide),f>$||f==$&&l.startSide>0&&l.endSide<=0)continue;($-f||l.endSide-l.startSide)<0||(s<0&&(s=f),l.point&&(a=Math.max(a,$-f)),i.push(l),r.push(f-s),n.push($-s))}return{mapped:i.length?new O(r,n,i,a):null,pos:s}}},N=class O{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 O(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:n=this.length}=e,s=e.filter;if(t.length==0&&!s)return this;if(i&&(t=t.slice().sort(Ms)),this.isEmpty)return t.length?O.of(t):this;let a=new Cr(this,null,-1).goto(0),o=0,l=[],c=new Me;for(;a.value||o<t.length;)if(o<t.length&&(a.from-t[o].from||a.startSide-t[o].value.startSide)>=0){let h=t[o++];c.addInner(h.from,h.to,h.value)||l.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(o==t.length||this.chunkEnd(a.chunkIndex)<t[o].from)&&(!s||r>this.chunkEnd(a.chunkIndex)||n<this.chunkPos[a.chunkIndex])&&c.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||r>a.to||n<a.from||s(a.from,a.to,a.value))&&(c.addInner(a.from,a.to,a.value)||l.push(Pi.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?O.empty:this.nextLayer.update({add:l,filter:s,filterFrom:r,filterTo:n}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],r=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],o=this.chunk[s],l=e.touchesRange(a,a+o.length);if(l===!1)r=Math.max(r,o.maxPoint),t.push(o),i.push(e.mapPos(a));else if(l===!0){let{mapped:c,pos:h}=o.map(a,e);c&&(r=Math.max(r,c.maxPoint),t.push(c),i.push(h))}}let n=this.nextLayer.map(e);return t.length==0?n:new O(i,t,n||O.empty,r)}between(e,t,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let n=this.chunkPos[r],s=this.chunk[r];if(t>=n&&e<=n+s.length&&s.between(n,e-n,t-n,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Si.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Si.from(e).goto(t)}static compare(e,t,i,r,n=-1){let s=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=n),a=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=n),o=th(s,a,i),l=new cO
Line truncated
|
||||
`)}static newName(){let e=uh[$h]||1;return uh[$h]=e+1,"\u037C"+e.toString(36)}static mount(e,t,i){let r=e[Fs],n=i&&i.nonce;r?n&&r.setNonce(n):r=new Hs(e,n),r.mount(Array.isArray(t)?t:[t],e)}},dh=new Map,Hs=class{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let n=dh.get(i);if(n)return e[Fs]=n;this.sheet=new r.CSSStyleSheet,dh.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Fs]=this}mount(e,t){let i=this.sheet,r=0,n=0;for(let s=0;s<e.length;s++){let a=e[s],o=this.modules.indexOf(a);if(o<n&&o>-1&&(this.modules.splice(o,1),n--,o=-1),o==-1){if(this.modules.splice(n++,0,a),i)for(let l=0;l<a.rules.length;l++)i.insertRule(a.rules[l],r++)}else{for(;n<o;)r+=this.modules[n++].rules.length;r+=a.rules.length,n++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let s="";for(let o=0;o<this.modules.length;o++)s+=this.modules[o].getRules()+`
|
||||
`;this.styleTag.textContent=s;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 vt={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:"'"},EO={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},cg=typeof navigator<"u"&&/Mac/.test(navigator.platform),hg=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(de=0;de<10;de++)vt[48+de]=vt[96+de]=String(de);var de;for(de=1;de<=24;de++)vt[de+111]="F"+de;var de;for(de=65;de<=90;de++)vt[de]=String.fromCharCode(de+32),EO[de]=String.fromCharCode(de);var de;for(Er in vt)EO.hasOwnProperty(Er)||(EO[Er]=vt[Er]);var Er;function ph(O){var e=cg&&O.metaKey&&O.shiftKey&&!O.ctrlKey&&!O.altKey||hg&&O.shiftKey&&O.key&&O.key.length==1||O.key=="Unidentified",t=!e&&O.key||(O.shiftKey?EO:vt)[O.keyCode]||O.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function B(){var O=arguments[0];typeof O=="string"&&(O=document.createElement(O));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];typeof r=="string"?O.setAttribute(i,r):r!=null&&(O[i]=r)}e++}for(;e<arguments.length;e++)mh(O,arguments[e]);return O}function mh(O,e){if(typeof e=="string")O.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)O.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)mh(O,e[t]);else throw new RangeError("Unsupported child node: "+e)}function _i(O){let e;return O.nodeType==11?e=O.getSelection?O:O.ownerDocument:e=O,e.getSelection()}function na(O,e){return e?O==e||O.contains(e.nodeType!=1?e.parentNode:e):!1}function Kr(O,e){if(!e.anchorNode)return!1;try{return na(O,e.anchorNode)}catch{return!1}}function zi(O){return O.nodeType==3?uO(O,0,O.nodeValue.length).getClientRects():O.nodeType==1?O.getClientRects():[]}function ki(O,e,t,i){return t?gh(O,e,t,i,-1)||gh(O,e,t,i,1):!1}function $O(O){for(var e=0;;e++)if(O=O.previousSibling,!O)return e}function sn(O){return O.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(O.nodeName)}function gh(O,e,t,i,r){for(;;){if(O==t&&e==i)return!0;if(e==(r<0?0:Pt(O))){if(O.nodeName=="DIV")return!1;let n=O.parentNode;if(!n||n.nodeType!=1)return!1;e=$O(O)+(r<0?0:1),O=n}else if(O.nodeType==1){if(O=O.childNodes[e+(r<0?-1:0)],O.nodeType==1&&O.contentEditable=="false")return!1;e=r<0?Pt(O):0}else return!1}}function Pt(O){return O.nodeType==3?O.nodeValue.length:O.childNodes.length}function Sn(O,e){let t=e?O.left:O.right;return{left:t,right:t,top:O.top,bottom:O.bottom}}function fg(O){let e=O.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:O.innerWidth,top:0,bottom:O.innerHeight}}function of(O,e){let t=e.width/O.offsetWidth,i=e.height/O.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-O.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-O.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function Qg(O,e,t,i,r,n,s,a){let o=O.ownerDocument,l=o.defaultView||window;for(let c=O,h=!1;c&&!h;)if(c.nodeType==1){let f,$=c==o.body,u=1,d=1;if($)f=fg(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let g=c.getBoundingClientRect();({scaleX:u,scaleY:d}=of(c,g)),f={left:g.left,right:g.left+c.clientWidth*u,top:g.top,bottom:g.top+c.clientHeight*d}}let p=0,m=0;if(r=="nearest")e.top<f.top?(m=e.top-(f.top+s),t>0&&e.bottom>f.bottom+m&&(m=e.bottom-f.bottom+s)):e.bottom>f.bottom&&(m=e.bottom-f.bottom+s,t<0&&e.top-m<f.top&&(m=e.top-(f.top+s)));else{let g=e.bottom-e.top,X=f.bottom-f.top;m=(r=="center"&&g<=X?e.top+g/2-X/2:r=="start"||r=="center"&&t<0?e.top-s:e.bottom-X+s)-f.top}if(i=="nearest"?e.left<f.left?(p=e.left-(f.left+n),t>0&&e.right>f.right+p&&(p=e.right-f.right+n)):e.right>f.right&&(p=e.right-f.right+n,t<0&&e.left<f.left+p&&(p=e.left-(f.left+n))):p=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==a?e.left-n:e.right-(f.right-f.left)+n)-f.left,p||m)if($)l.scrollBy(p,m);else{let g=0,X=0;if(m){let T=c.sLine truncated
|
||||
`,r=O.state.doc.line(r.number+(t?1:-1)),n=O.bidiSpans(r),l=O.visualLineSide(r,!t)}if(o){if(!o(c))return a}else{if(!i)return l;o=i(c)}a=l}}function Dg(O,e,t){let i=O.state.charCategorizer(e),r=i(t);return n=>{let s=i(n);return r==K.Space&&(r=s),r==s}}function Ig(O,e,t,i){let r=e.head,n=t?1:-1;if(r==(t?O.state.doc.length:0))return P.cursor(r,e.assoc);let s=e.goalColumn,a,o=O.contentDOM.getBoundingClientRect(),l=O.coordsAtPos(r,e.assoc||-1),c=O.documentTop;if(l)s==null&&(s=l.left-o.left),a=n<0?l.top:l.bottom;else{let $=O.viewState.lineBlockAt(r);s==null&&(s=Math.min(o.right-o.left,O.defaultCharacterWidth*(r-$.from))),a=(n<0?$.top:$.bottom)+c}let h=o.left+s,f=i??O.viewState.heightOracle.textHeight>>1;for(let $=0;;$+=10){let u=a+(f+$)*n,d=Ef(O,{x:h,y:u},!1,n);if(u<o.top||u>o.bottom||(n<0?d<r:d>r)){let p=O.docView.coordsForChar(d),m=!p||u<p.top?-1:1;return P.cursor(d,m,void 0,s)}}}function en(O,e,t){for(;;){let i=0;for(let r of O)r.between(e-1,e+1,(n,s,a)=>{if(e>n&&e<s){let o=i||t||(e-n<s-e?-1:1);e=o<0?n:s,i=o}});if(!i)return e}}function Af(O,e){let t=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],n=null;if(r.empty){let s=en(O,r.from,0);s!=r.from&&(n=P.cursor(s,-1))}else{let s=en(O,r.from,-1),a=en(O,r.to,1);(s!=r.from||a!=r.to)&&(n=P.range(r.from==r.anchor?s:a,r.from==r.head?s:a))}n&&(t||(t=e.ranges.slice()),t[i]=n)}return t?P.create(t,e.mainIndex):e}function ea(O,e,t){let i=en(O.state.facet(Tn).map(r=>r(O)),t.from,e.head>t.from?-1:1);return i==t.from?t:P.cursor(i,i<t.from?1:-1)}var bi="\uFFFF",ma=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(M.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=bi}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let n=this.text.length;this.readNode(r);let s=r.nextSibling;if(s==t)break;let a=re.get(r),o=re.get(s);(a&&o?a.breakAfter:(a?a.breakAfter:sn(r))||sn(s)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>n)&&this.lineBreak(),r=s}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 n=-1,s=1,a;if(this.lineSeparator?(n=t.indexOf(this.lineSeparator,i),s=this.lineSeparator.length):(a=r.exec(t))&&(n=a.index,s=a[0].length),this.append(t.slice(i,n<0?t.length:n)),n<0)break;if(this.lineBreak(),s>1)for(let o of this.points)o.node==e&&o.pos>this.text.length&&(o.pos-=s-1);i=n+s}}readNode(e){if(e.cmIgnore)return;let t=re.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+(Bg(e,i.node,i.offset)?t:0))}};function Bg(O,e,t){for(;;){if(!e||t<Pt(e))return!1;if(e==O)return!0;t=$O(e)+1,e=e.parentNode}}var hn=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},ga=class{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:n,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let a=n||s?[]:Hg(e),o=new ma(a,e.state);o.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=o.text,this.newSel=Kg(a,this.bounds.from)}else{let a=e.observer.selectionRange,o=n&&n.node==a.focusNode&&n.offset==a.focusOffset||!na(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),l=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!na(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((Z.ios||Z.chrome)&&e.state.selection.main.empty&&o!=l&&(c.from>0||c.to<e.state.doc.length)){let h=Math.min(o,l),f=Math.max(o,l),$=c.from-h,u=c.to-f;($==0||$==1||h==0)&&(u==0||u==-1||f==e.state.doc.length)&&(o=0,l=e.state.doc.length)}this.newSel=P.single(l,o)}}};function Lf(O,e){let t,{newSel:i}=e,r=O.state.selection.main,n=O.inputState.lastKeyTime>Date.now()-100?O.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,o=r.from,l=null;(n===8||Z.android&&e.text.length<a-s)&&(o=r.to,l="end");let c=Fg(O.state.doc.sliceString(s,a,bi),e.text,o-s,l);c&&(Z.chrome&&n==13&&c.toB==c.from+2&&e.text.slice(c.from,c.toB)==bi+bi&&c.toB--,t={from:s+c.from,to:s+c.toA,insert:G.of(e.text.slice(c.from,c.toB).split(bi))})}else i&&(!O.hasFocus&&O.state.facet(Rt)||i.main.eq(r))&&(i=null);if(!t&&!i)return!1;if(!t&&e.typeOver&&!r.empty&&i&&i.main.empty?t={from:r.from,to:r.to,insert:O.state.doc.slice(r.from,r.to)}:(Z.mac||Z.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\.Line truncated
|
||||
`&&O.lineWrapping&&(i&&(i=P.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:G.of([" "])}),t)return Ka(O,t,i,n);if(i&&!i.main.eq(r)){let s=!1,a="select";return O.inputState.lastSelectionTime>Date.now()-50&&(O.inputState.lastSelectionOrigin=="select"&&(s=!0),a=O.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=Af(O.state.facet(Tn).map(o=>o(O)),i))),O.dispatch({selection:i,scrollIntoView:s,userEvent:a}),!0}else return!1}function Ka(O,e,t,i=-1){if(Z.ios&&O.inputState.flushIOSKey(e))return!0;let r=O.state.selection.main;if(Z.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&O.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&BO(O.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)&&BO(O.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&BO(O.contentDOM,"Delete",46)))return!0;let n=e.insert.toString();O.inputState.composing>=0&&O.inputState.composing++;let s,a=()=>s||(s=Ng(O,e,t));return O.state.facet(vf).some(o=>o(O,e.from,e.to,n,a))||O.dispatch(a()),!0}function Ng(O,e,t){let i,r=O.state,n=r.selection.main;if(e.from>=n.from&&e.to<=n.to&&e.to-e.from>=(n.to-n.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&O.inputState.composing<0){let a=n.from<e.from?r.sliceDoc(n.from,e.from):"",o=n.to>e.to?r.sliceDoc(e.to,n.to):"";i=r.replaceSelection(O.state.toText(a+e.insert.sliceString(0,void 0,O.state.lineBreak)+o))}else{let a=r.changes(e),o=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&O.inputState.composing>=0&&e.to<=n.to&&e.to>=n.to-10){let l=O.state.sliceDoc(e.from,e.to),c,h=t&&Gf(O,t.main.head);if(h){let u=e.insert.length-(e.to-e.from);c={from:h.from,to:h.to-u}}else c=O.state.doc.lineAt(n.head);let f=n.to-e.to,$=n.to-n.from;i=r.changeByRange(u=>{if(u.from==n.from&&u.to==n.to)return{changes:a,range:o||u.map(a)};let d=u.to-f,p=d-l.length;if(u.to-u.from!=$||O.state.sliceDoc(p,d)!=l||u.to>=c.from&&u.from<=c.to)return{range:u};let m=r.changes({from:p,to:d,insert:e.insert}),g=u.to-n.to;return{changes:m,range:o?P.range(Math.max(0,o.anchor+g),Math.max(0,o.head+g)):u.map(m)}})}else i={changes:a,selection:o&&r.selection.replaceRange(o)}}let s="input.type";return(O.composing||O.inputState.compositionPendingChange&&O.inputState.compositionEndedAt>Date.now()-50)&&(O.inputState.compositionPendingChange=!1,s+=".compose",O.inputState.compositionFirstChange&&(s+=".start",O.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:s,scrollIntoView:!0})}function Fg(O,e,t,i){let r=Math.min(O.length,e.length),n=0;for(;n<r&&O.charCodeAt(n)==e.charCodeAt(n);)n++;if(n==r&&O.length==e.length)return null;let s=O.length,a=e.length;for(;s>0&&a>0&&O.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(i=="end"){let o=Math.max(0,n-Math.min(s,a));t-=s+o-n}if(s<n&&O.length<e.length){let o=t<=n&&t>=s?n-t:0;n-=o,a=n+(a-s),s=n}else if(a<n){let o=t<=n&&t>=a?n-t:0;n-=o,s=n+(s-a),a=n}return{from:n,toA:s,toB:a}}function Hg(O){let e=[];if(O.root.activeElement!=O.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:n}=O.observer.selectionRange;return t&&(e.push(new hn(t,i)),(r!=t||n!=i)&&e.push(new hn(r,n))),e}function Kg(O,e){if(O.length==0)return null;let t=O[0].pos,i=O.length==2?O[1].pos:t;return t>-1&&i>-1?P.single(t+e,i+e):null}var Pa=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=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.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Z.safari&&e.contentDOM.addEventListener("input",()=>null),Z.gecko&&QP(e.contentDOM.ownerDocument)}handleEvent(e){!nP(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=Jg(e),i=this.handlers,r=this.view.contentDOM;for(let n in t)if(n!="scroll"){let s=!t[n].handlers.length,a=i[n];a&&s!=!a.handlers.length&&(r.removeEventListener(n,this.handleEvent),a=null),a||r.addEventListener(n,this.handleEvent,{passive:s})}for(let n in i)n!="scroll"&&!t[n]&&r.removeEventListener(n,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tab
Line truncated
|
||||
`))};if(l.from==this.from&&n<this.from?l.from=n:l.to==this.to&&n>this.to&&(l.to=n),l.from==l.to&&!l.insert.length){let c=P.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));c.main.eq(r)||e.dispatch({selection:c,userEvent:"select"});return}if((Z.mac||Z.android)&&l.from==s-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(l={from:a,to:o,insert:G.of([i.text.replace("."," ")])}),this.pendingContextChange=l,!e.state.readOnly){let c=this.to-this.from+(l.to-l.from+l.insert.length);Ka(e,l,P.single(this.toEditorPos(i.selectionStart,c),this.toEditorPos(i.selectionEnd,c)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=i=>{let r=[],n=null;for(let s=this.toEditorPos(i.rangeStart),a=this.toEditorPos(i.rangeEnd);s<a;s++){let o=e.coordsForChar(s);n=o&&new DOMRect(o.left,o.top,o.right-o.left,o.bottom-o.top)||n||new DOMRect,r.push(n)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let n of i.getTextFormats()){let s=n.underlineStyle,a=n.underlineThickness;if(s!="None"&&a!="None"){let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);if(o<l){let c=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;r.push(v.mark({attributes:{style:c}}).range(o,l))}}}e.dispatch({effects:zf.of(v.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=_i(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((n,s,a,o,l)=>{if(i)return;let c=l.length-(s-n);if(r&&s>=r.to)if(r.from==n&&r.to==s&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(n+=t,s+=t,s<=this.from)this.from+=c,this.to+=c;else if(n<this.to){if(n<this.from||s>this.to||this.to-this.from+l.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(n),this.toContextPos(s),l.toString()),this.to+=c}t+=c}),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])}},b=class O{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.measureRequest
Line truncated
|
||||
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Ua),UP={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},Oa=null;function jP(){var O;if(Oa==null&&typeof document<"u"&&document.body){let e=document.body.style;Oa=((O=e.tabSize)!==null&&O!==void 0?O:e.MozTabSize)!=null}return Oa||!1}var rn=Y.define({combine(O){let e=xe(O,{render:null,specialChars:WP,addSpecialChars:null});return(e.replaceTabs=!jP())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Ua)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Ua)),e}});function hQ(O={}){return[rn.of(O),CP()]}var Jh=null;function CP(){return Jh||(Jh=fe.fromClass(class{constructor(O){this.view=O,this.decorations=v.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(O.state.facet(rn)),this.decorations=this.decorator.createDeco(O)}makeDecorator(O){return new Wa({regexp:O.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,n=Se(e[0],0);if(n==9){let s=r.lineAt(i),a=t.state.tabSize,o=Ze(s.text,a,i-s.from);return v.replace({widget:new Ca((a-o%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[n]||(this.decorationCache[n]=v.replace({widget:new ja(O,n)}))},boundary:O.replaceTabs?void 0:/[^]/})}update(O){let e=O.state.facet(rn);O.startState.facet(rn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(O.view)):this.decorations=this.decorator.updateDeco(O,this.decorations)}},{decorations:O=>O.decorations}))}var GP="\u2022";function EP(O){return O>=32?GP:O==10?"\u2424":String.fromCharCode(9216+O)}var ja=class extends We{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=EP(this.code),i=e.state.phrase("Control character")+" "+(UP[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let n=document.createElement("span");return n.textContent=t,n.title=i,n.setAttribute("aria-label",i),n.className="cm-specialChar",n}ignoreEvent(){return!1}},Ca=class extends We{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function fQ(){return LP}var AP=v.line({class:"cm-activeLine"}),LP=fe.fromClass(class{constructor(O){this.decorations=this.getDeco(O)}update(O){(O.docChanged||O.selectionSet)&&(this.decorations=this.getDeco(O.view))}getDeco(O){let e=-1,t=[];for(let i of O.state.selection.ranges){let r=O.lineBlockAt(i.head);r.from>e&&(t.push(AP.range(r.from)),e=r.from)}return v.set(t)}},{decorations:O=>O.decorations});var Ga=2e3;function MP(O,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),n=[];if(e.off>Ga||t.off>Ga||e.col<0||t.col<0){let s=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let o=i;o<=r;o++){let l=O.doc.line(o);l.length<=a&&n.push(P.range(l.from+s,l.to+a))}}else{let s=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let o=i;o<=r;o++){let l=O.doc.line(o),c=Gr(l.text,s,O.tabSize,!0);if(c<0)n.push(P.cursor(l.to));else{let h=Gr(l.text,a,O.tabSize);n.push(P.range(l.from+c,l.from+h))}}}return n}function DP(O,e){let t=O.coordsAtPos(O.viewport.from);return t?Math.round(Math.abs((t.left-e)/O.defaultCharacterWidth)):-1}function ef(O,e){let t=O.posAtCoords({x:e.clientX,y:e.clientY},!1),i=O.state.doc.lineAt(t),r=t-i.from,n=r>Ga?-1:r==i.length?DP(O,e.clientX):Ze(i.text,O.state.tabSize,t-i.from);return{line:i.number,col:n,off:r}}function IP(O,e){let t=ef(O,e),i=O.state.selection;return t?{update(r){if(r.docChanged){let n=r.changes.mapPos(r.startState.doc.line(t.line).from),s=r.state.doc.lineAt(n);t={line:s.number,col:t.col,off:Math.min(t.off,s.length)},i=i.map(r.changes)}},get(r,n,s){let a=ef(O,r);if(!a)return i;let o=MP(O.state,t,a);return o.length?s?P.create(o.concat(i.ranges)):P.create(o):i}}:null}function QQ(O){let e=O?.eventFilter||(t=>t.altKey&&t.button==0);return b.mouseSelectionStyle.of((t,i)=>e(i)?IP(t,i):null)}var BP={Alt:[18,O=>!!O.altKey],Control:[17,O=>!!O.ctrlKey],Shift:[16,O=>!!O.shiftKey],Meta:[91,O=>!!O.metaKey]},NP={style:"cursor: crosshair"};function $Q(O={}){let[e,t]=BP[O.key||"Alt"],i=fe.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,b.contentAttributes.o
Line truncated
|
||||
`: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}create(){return this.regexp?new Eo(this):new Go(this)}getCursor(e,t=0,i){let r=e.doc?e:M.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?Oi(this,r,t,i):ti(this,r,t,i)}},Jn=class{constructor(e){this.spec=e}};function ti(O,e,t,i){return new sO(e.doc,O.unquoted,t,i,O.caseSensitive?void 0:r=>r.toLowerCase(),O.wholeWord?ST(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function ST(O,e){return(t,i,r,n)=>((n>t||n+r.length<i)&&(n=Math.max(0,t-2),r=O.sliceString(n,Math.min(O.length,i+2))),(e(es(r,t-n))!=K.Word||e(ts(r,t-n))!=K.Word)&&(e(ts(r,i-n))!=K.Word||e(es(r,i-n))!=K.Word))}var Go=class extends Jn{constructor(e){super(e)}nextMatch(e,t,i){let r=ti(this.spec,e,i,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=ti(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==i?null:r.value}prevMatchInRange(e,t,i){for(let r=i;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),s=ti(this.spec,e,n,r),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(n==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=ti(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 n=ti(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!n.next().done;)r(n.value.from,n.value.to)}};function Oi(O,e,t,i){return new Bn(e.doc,O.search,{ignoreCase:!O.caseSensitive,test:O.wholeWord?XT(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function es(O,e){return O.slice(ue(O,e,!1),e)}function ts(O,e){return O.slice(e,ue(O,e))}function XT(O){return(e,t,i)=>!i[0].length||(O(es(i.input,i.index))!=K.Word||O(ts(i.input,i.index))!=K.Word)&&(O(ts(i.input,i.index+i[0].length))!=K.Word||O(es(i.input,i.index+i[0].length))!=K.Word)}var Eo=class extends Jn{nextMatch(e,t,i){let r=Oi(this.spec,e,i,e.doc.length).next();return r.done&&(r=Oi(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let n=Math.max(t,i-r*1e4),s=Oi(this.spec,e,n,i),a=null;for(;!s.next().done;)a=s.value;if(a&&(n==t||a.from>n+10))return a;if(n==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 n=+i.slice(0,r);if(n>0&&n<e.match.length)return e.match[n]+i.slice(r)}return t})}matchAll(e,t){let i=Oi(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 n=Oi(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!n.next().done;)r(n.value.from,n.value.to)}},ar=q.define(),Do=q.define(),nO=ce.define({create(O){return new sr(Ao(O).create(),null)},update(O,e){for(let t of e.effects)t.is(ar)?O=new sr(t.value.create(),O.panel):t.is(Do)&&(O=new sr(O.query,t.value?Io:null));return O},provide:O=>pO.from(O,e=>e.panel)});var sr=class{constructor(e,t){this.query=e,this.panel=t}},TT=v.mark({class:"cm-searchMatch"}),yT=v.mark({class:"cm-searchMatch cm-searchMatch-selected"}),bT=fe.fromClass(class{constructor(O){this.view=O,this.decorations=this.highlight(O.state.field(nO))}update(O){let e=O.state.field(nO);(e!=O.startState.field(nO)||O.docChanged||O.selectionSet||O.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:O,panel:e}){if(!e||!O.spec.valid)return v.none;let{view:t}=this,i=new Me;for(let r=0,n=t.visibleRanges,s=n.length;r<s;r++){let{from:a,to:o}=n[r];for(;r<s-1&&o>n[r+1].from-500;)o=n[++r].to;O.highlight(t.state,a,o,(l,c)=>{let h=t.state.selection.ranges.some(f=>f.from==l&&f.to==c);i.add(l,c,h?yT:TT)})}return i.finish()}},{decorations:O=>O.decorations});function or(O){return e=>{let t=e.state.field(nO,!1);return t&&t.query.spec.valid?O(e,t):iu(e)}}var Os=or((O,{query:e})=>{let{to:t}=O.state.selection.main,i=e.nextMatch(O.state,t,t);if(!i)return!1;let r=P.single(i.from,i.to),n=O.state.facet(ii);return O.dispatch({selection:r,effects:[Bo(O,i),n.scrollToMatch(r.main,O)],userEvent:"select.search"}),Ou(O),!0}),is=or((O,{query:e})=>{let{state:t}=O,{from:i}=t.selection.main,r=e.prevMatch(t,i,i);if(!r)return!1;let n=P.single(r.from,r.to),s=O.state.facet(ii);return O.dispatch({selection:n,effects:[Bo(O,r),s.scrollToMatch(n.main,O)],userEvent:"select.search"}),Ou(O),!0}),xT=or((O,{query:e})=>{let t=e.matchAll(O.state,1e3);return!t||!t.length?!1:(O.dispatch({selection:P.create(t.map(i=>P.range(i.from,i.to)))
Line truncated
|
||||
var Gs=[],ch=[];(()=>{let O="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<O.length;e++)(e%2?ch:Gs).push(t=t+O[e])})();function vg(O){if(O<768)return!1;for(let e=0,t=Gs.length;;){let i=e+t>>1;if(O<Gs[i])t=i;else if(O>=ch[i])e=i+1;else return!0;if(e==t)return!1}}function ah(O){return O>=127462&&O<=127487}var oh=8205;function hh(O,e,t=!0,i=!0){return(t?fh:Zg)(O,e,i)}function fh(O,e,t){if(e==O.length)return e;e&&dh(O.charCodeAt(e))&&Qh(O.charCodeAt(e-1))&&e--;let i=Cs(O,e);for(e+=lh(i);e<O.length;){let r=Cs(O,e);if(i==oh||r==oh||t&&vg(r))e+=lh(r),i=r;else if(ah(r)){let n=0,s=e-2;for(;s>=0&&ah(Cs(O,s));)n++,s-=2;if(n%2==0)break;e+=2}else break}return e}function Zg(O,e,t){for(;e>0;){let i=fh(O,e-2,t);if(i<e)return i;e--}return 0}function Cs(O,e){let t=O.charCodeAt(e);if(!Qh(t)||e+1==O.length)return t;let i=O.charCodeAt(e+1);return dh(i)?(t-55296<<10)+(i-56320)+65536:t}function dh(O){return O>=56320&&O<57344}function Qh(O){return O>=55296&&O<56320}function lh(O){return O<65536?1:2}var G=class O{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]=DO(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),AO.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]=DO(this,e,t);let i=[];return this.decompose(e,t,i,0),AO.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 QO(this),n=new QO(e);for(let s=t,a=t;;){if(r.next(s),n.next(s),s=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(a+=r.value.length,r.done||a>=i)return!0}}iter(e=1){return new QO(this,e)}iterRange(e,t=this.length){return new Er(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 Ar(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]?O.empty:e.length<=32?new Le(e):AO.from(Le.split(e,[]))}},Le=class O extends G{constructor(e,t=Rg(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 n=0;;n++){let s=this.text[n],a=r+s.length;if((t?i:a)>=e)return new As(r,a,i,s);r=a+1,i++}}decompose(e,t,i,r){let n=e<=0&&t>=this.length?this:new O(uh(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let s=i.pop(),a=Gr(n.text,s.text.slice(),0,n.length);if(a.length<=32)i.push(new O(a,s.length+n.length));else{let o=a.length>>1;i.push(new O(a.slice(0,o)),new O(a.slice(o)))}}else i.push(n)}replace(e,t,i){if(!(i instanceof O))return super.replace(e,t,i);[e,t]=DO(this,e,t);let r=Gr(this.text,Gr(i.text,uh(this.text,0,e)),t),n=this.length+i.length-(t-e);return r.length<=32?new O(r,n):AO.from(O.split(r,[]),n)}sliceString(e,t=this.length,i=`
|
||||
`){[e,t]=DO(this,e,t);let r="";for(let n=0,s=0;n<=t&&s<this.text.length;s++){let a=this.text[s],o=n+a.length;n>e&&s&&(r+=i),e<o&&t>n&&(r+=a.slice(Math.max(0,e-n),t-n)),n=o+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 n of e)i.push(n),r+=n.length+1,i.length==32&&(t.push(new O(i,r)),i=[],r=-1);return r>-1&&t.push(new O(i,r)),t}},AO=class O extends G{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 n=0;;n++){let s=this.children[n],a=r+s.length,o=i+s.lines-1;if((t?o:a)>=e)return s.lineInner(e,t,i,r);r=a+1,i=o+1}}decompose(e,t,i,r){for(let n=0,s=0;s<=t&&n<this.children.length;n++){let a=this.children[n],o=s+a.length;if(e<=o&&t>=s){let l=r&((s<=e?1:0)|(o>=t?2:0));s>=e&&o<=t&&!l?i.push(a):a.decompose(e-s,t-s,i,l)}s=o+1}}replace(e,t,i){if([e,t]=DO(this,e,t),i.lines<this.lines)for(let r=0,n=0;r<this.children.length;r++){let s=this.children[r],a=n+s.length;if(e>=n&&t<=a){let o=s.replace(e-n,t-n,i),l=this.lines-s.lines+o.lines;if(o.lines<l>>4&&o.lines>l>>6){let c=this.children.slice();return c[r]=o,new O(c,this.length-(t-e)+i.length)}return super.replace(n,a,o)}n=a+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
||||
`){[e,t]=DO(this,e,t);let r="";for(let n=0,s=0;n<this.children.length&&s<=t;n++){let a=this.children[n],o=s+a.length;s>e&&n&&(r+=i),e<o&&t>s&&(r+=a.sliceString(e-s,t-s,i)),s=o+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof O))return 0;let i=0,[r,n,s,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,n+=t){if(r==s||n==a)return i;let o=this.children[r],l=e.children[n];if(o!=l)return i+o.scanIdentical(l,t);i+=o.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let Q of e)i+=Q.lines;if(i<32){let Q=[];for(let u of e)u.flatten(Q);return new Le(Q,t)}let r=Math.max(32,i>>5),n=r<<1,s=r>>1,a=[],o=0,l=-1,c=[];function h(Q){let u;if(Q.lines>n&&Q instanceof O)for(let $ of Q.children)h($);else Q.lines>s&&(o>s||!o)?(f(),a.push(Q)):Q instanceof Le&&o&&(u=c[c.length-1])instanceof Le&&Q.lines+u.lines<=32?(o+=Q.lines,l+=Q.length+1,c[c.length-1]=new Le(u.text.concat(Q.text),u.length+1+Q.length)):(o+Q.lines>r&&f(),o+=Q.lines,l+=Q.length+1,c.push(Q))}function f(){o!=0&&(a.push(c.length==1?c[0]:O.from(c,l)),l=-1,o=c.length=0)}for(let Q of e)h(Q);return f(),a.length==1?a[0]:new O(a,t)}};G.empty=new Le([""],0);function Rg(O){let e=-1;for(let t of O)e+=t.length+1;return e}function Gr(O,e,t=0,i=1e9){for(let r=0,n=0,s=!0;n<O.length&&r<=i;n++){let a=O[n],o=r+a.length;o>=t&&(o>i&&(a=a.slice(0,i-r)),r<t&&(a=a.slice(t-r)),s?(e[e.length-1]+=a,s=!1):e.push(a)),r=o+1}return e}function uh(O,e,t){return Gr(O,[""],e,t)}var QO=class{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 Le?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],n=this.offsets[i],s=n>>1,a=r instanceof Le?r.text.length:r.children.length;if(s==(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((n&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
||||
`,this;e--}else if(r instanceof Le){let o=r.text[s+(t<0?-1:0)];if(this.offsets[i]+=t,o.length>Math.max(0,e))return this.value=e==0?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=r.children[s+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof Le?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Er=class{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new QO(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!=""}},Ar=class{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"&&(G.prototype[Symbol.iterator]=function(){return this.iter()},QO.prototype[Symbol.iterator]=Er.prototype[Symbol.iterator]=Ar.prototype[Symbol.iterator]=function(){return this});var As=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 DO(O,e,t){return e=Math.max(0,Math.min(O.length,e)),[e,Math.max(e,Math.min(O.length,t))]}function ue(O,e,t=!0,i=!0){return hh(O,e,t,i)}function _g(O){return O>=56320&&O<57344}function Vg(O){return O>=55296&&O<56320}function Se(O,e){let t=O.charCodeAt(e);if(!Vg(t)||e+1==O.length)return t;let i=O.charCodeAt(e+1);return _g(i)?(t-55296<<10)+(i-56320)+65536:t}function ki(O){return O<=65535?String.fromCharCode(O):(O-=65536,String.fromCharCode((O>>10)+55296,(O&1023)+56320))}function De(O){return O<65536?1:2}var Ls=/\r\n?|\n/,pe=(function(O){return O[O.Simple=0]="Simple",O[O.TrackDel=1]="TrackDel",O[O.TrackBefore=2]="TrackBefore",O[O.TrackAfter=3]="TrackAfter",O})(pe||(pe={})),Zt=class O{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 n=this.sections[t++],s=this.sections[t++];s<0?(e(i,r,n),r+=n):r+=s,i+=n}}iterChangedRanges(e,t=!1){Ms(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 O(e)}composeDesc(e){return this.empty?e:e.empty?this:Ph(this,e)}mapDesc(e,t=!1){return e.empty?this:Ds(this,e,t)}mapPos(e,t=-1,i=pe.Simple){let r=0,n=0;for(let s=0;s<this.sections.length;){let a=this.sections[s++],o=this.sections[s++],l=r+a;if(o<0){if(l>e)return n+(e-r);n+=a}else{if(i!=pe.Simple&&l>=e&&(i==pe.TrackDel&&r<e&&l>e||i==pe.TrackBefore&&r<e||i==pe.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==r||t<0?n:n+o;n+=o}r=l}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return n}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let n=this.sections[i++],s=this.sections[i++],a=r+n;if(s>=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 O(e)}static create(e){return new O(e)}},Ye=class O extends Zt{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 Ms(this,(t,i,r,n,s)=>e=e.replace(r,r+(i-t),s),!1),e}mapDesc(e,t=!1){return Ds(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,n=0;r<t.length;r+=2){let s=t[r],a=t[r+1];if(a>=0){t[r]=a,t[r+1]=s;let o=r>>1;for(;i.length<o;)i.push(G.empty);i.push(s?e.slice(n,n+s):G.empty)}n+=s}return new O(t,i)}compose(e){return this.empty?e:e.empty?this:Ph(this,e,!0)}map(e,t=!1){return e.empty?this:Ds(this,e,t,!0)}iterChanges(e,t=!1){Ms(this,e,t)}get desc(){return Zt
Line truncated
|
||||
`}get readOnly(){return this.facet(wh)}phrase(e,...t){for(let i of this.facet(O.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 n=+(r||1);return!n||n>t.length?i:t[n-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let n of this.facet(Xh))for(let s of n(this,t,i))Object.prototype.hasOwnProperty.call(s,e)&&r.push(s[e]);return r}charCategorizer(e){return Ag(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),n=this.charCategorizer(e),s=e-i,a=e-i;for(;s>0;){let o=ue(t,s,!1);if(n(t.slice(o,s))!=J.Word)break;s=o}for(;a<r;){let o=ue(t,a);if(n(t.slice(a,o))!=J.Word)break;a=o}return s==a?null:P.range(s+i,a+i)}};M.allowMultipleSelections=Bs;M.tabSize=Y.define({combine:O=>O.length?O[0]:4});M.lineSeparator=Th;M.readOnly=wh;M.phrases=Y.define({compare(O,e){let t=Object.keys(O),i=Object.keys(e);return t.length==i.length&&t.every(r=>O[r]==e[r])}});M.languageData=Xh;M.changeFilter=yh;M.transactionFilter=bh;M.transactionExtender=xh;IO.reconfigure=V.define();function xe(O,e,t={}){let i={};for(let r of O)for(let n of Object.keys(r)){let s=r[n],a=i[n];if(a===void 0)i[n]=s;else if(!(a===s||s===void 0))if(Object.hasOwnProperty.call(t,n))i[n]=t[n](a,s);else throw new Error("Config merge conflict for field "+n)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}var ot=class{eq(e){return this==e}range(e,t=e){return xi.create(e,t,this)}};ot.prototype.startSide=ot.prototype.endSide=0;ot.prototype.point=!1;ot.prototype.mapMode=pe.TrackDel;var xi=class O{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new O(e,t,i)}};function Js(O,e){return O.from-e.from||O.value.startSide-e.value.startSide}var ea=class O{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 n=i?this.to:this.from;for(let s=r,a=n.length;;){if(s==a)return s;let o=s+a>>1,l=n[o]-e||(i?this.value[o].endSide:this.value[o].startSide)-t;if(o==s)return l>=0?s:a;l>=0?a=o:s=o+1}}between(e,t,i,r){for(let n=this.findIndex(t,-1e9,!0),s=this.findIndex(i,1e9,!1,n);n<s;n++)if(r(this.from[n]+e,this.to[n]+e,this.value[n])===!1)return!1}map(e,t){let i=[],r=[],n=[],s=-1,a=-1;for(let o=0;o<this.value.length;o++){let l=this.value[o],c=this.from[o]+e,h=this.to[o]+e,f,Q;if(c==h){let u=t.mapPos(c,l.startSide,l.mapMode);if(u==null||(f=Q=u,l.startSide!=l.endSide&&(Q=t.mapPos(c,l.endSide),Q<f)))continue}else if(f=t.mapPos(c,l.startSide),Q=t.mapPos(h,l.endSide),f>Q||f==Q&&l.startSide>0&&l.endSide<=0)continue;(Q-f||l.endSide-l.startSide)<0||(s<0&&(s=f),l.point&&(a=Math.max(a,Q-f)),i.push(l),r.push(f-s),n.push(Q-s))}return{mapped:i.length?new O(r,n,i,a):null,pos:s}}},F=class O{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 O(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:n=this.length}=e,s=e.filter;if(t.length==0&&!s)return this;if(i&&(t=t.slice().sort(Js)),this.isEmpty)return t.length?O.of(t):this;let a=new Ir(this,null,-1).goto(0),o=0,l=[],c=new Me;for(;a.value||o<t.length;)if(o<t.length&&(a.from-t[o].from||a.startSide-t[o].value.startSide)>=0){let h=t[o++];c.addInner(h.from,h.to,h.value)||l.push(h)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(o==t.length||this.chunkEnd(a.chunkIndex)<t[o].from)&&(!s||r>this.chunkEnd(a.chunkIndex)||n<this.chunkPos[a.chunkIndex])&&c.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!s||r>a.to||n<a.from||s(a.from,a.to,a.value))&&(c.addInner(a.from,a.to,a.value)||l.push(xi.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?O.empty:this.nextLayer.update({add:l,filter:s,filterFrom:r,filterTo:n}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],r=-1;for(let s=0;s<this.chunk.length;s++){let a=this.chunkPos[s],o=this.chunk[s],l=e.touchesRange(a,a+o.length);if(l===!1)r=Math.max(r,o.maxPoint),t.push(o),i.push(e.mapPos(a));else if(l===!0){let{mapped:c,pos:h}=o.map(a,e);c&&(r=Math.max(r,c.maxPoint),t.push(c),i.push(h))}}let n=this.nextLayer.map(e);return t.length==0?n:new O(i,t,n||O.empty,r)}between(e,t,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let n=this.chunkPos[r],s=this.chunk[r];if(t>=n&&e<=n+s.length&&s.between(n,e-n,t-n,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return wi.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return wi.from(e).goto(t)}static compare(e,t,i,r,n=-1){let s=e.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=n),a=t.filter(h=>h.maxPoint>0||!h.isEmpty&&h.maxPoint>=n),o=ph(s,a,i),l=new dO
Line truncated
|
||||
`)}static newName(){let e=Zh[vh]||1;return Zh[vh]=e+1,"\u037C"+e.toString(36)}static mount(e,t,i){let r=e[ra],n=i&&i.nonce;r?n&&r.setNonce(n):r=new na(e,n),r.mount(Array.isArray(t)?t:[t],e)}},Rh=new Map,na=class{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let n=Rh.get(i);if(n)return e[ra]=n;this.sheet=new r.CSSStyleSheet,Rh.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[ra]=this}mount(e,t){let i=this.sheet,r=0,n=0;for(let s=0;s<e.length;s++){let a=e[s],o=this.modules.indexOf(a);if(o<n&&o>-1&&(this.modules.splice(o,1),n--,o=-1),o==-1){if(this.modules.splice(n++,0,a),i)for(let l=0;l<a.rules.length;l++)i.insertRule(a.rules[l],r++)}else{for(;n<o;)r+=this.modules[n++].rules.length;r+=a.rules.length,n++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let s="";for(let o=0;o<this.modules.length;o++)s+=this.modules[o].getRules()+`
|
||||
`;this.styleTag.textContent=s;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 Rt={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:"'"},BO={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Mg=typeof navigator<"u"&&/Mac/.test(navigator.platform),Dg=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for($e=0;$e<10;$e++)Rt[48+$e]=Rt[96+$e]=String($e);var $e;for($e=1;$e<=24;$e++)Rt[$e+111]="F"+$e;var $e;for($e=65;$e<=90;$e++)Rt[$e]=String.fromCharCode($e+32),BO[$e]=String.fromCharCode($e);var $e;for(Nr in Rt)BO.hasOwnProperty(Nr)||(BO[Nr]=Rt[Nr]);var Nr;function _h(O){var e=Mg&&O.metaKey&&O.shiftKey&&!O.ctrlKey&&!O.altKey||Dg&&O.shiftKey&&O.key&&O.key.length==1||O.key=="Unidentified",t=!e&&O.key||(O.shiftKey?BO:Rt)[O.keyCode]||O.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function B(){var O=arguments[0];typeof O=="string"&&(O=document.createElement(O));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];typeof r=="string"?O.setAttribute(i,r):r!=null&&(O[i]=r)}e++}for(;e<arguments.length;e++)Vh(O,arguments[e]);return O}function Vh(O,e){if(typeof e=="string")O.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)O.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)Vh(O,e[t]);else throw new RangeError("Unsupported child node: "+e)}function Gi(O){let e;return O.nodeType==11?e=O.getSelection?O:O.ownerDocument:e=O,e.getSelection()}function da(O,e){return e?O==e||O.contains(e.nodeType!=1?e.parentNode:e):!1}function sn(O,e){if(!e.anchorNode)return!1;try{return da(O,e.anchorNode)}catch{return!1}}function Ei(O){return O.nodeType==3?mO(O,0,O.nodeValue.length).getClientRects():O.nodeType==1?O.getClientRects():[]}function Vi(O,e,t,i){return t?qh(O,e,t,i,-1)||qh(O,e,t,i,1):!1}function pO(O){for(var e=0;;e++)if(O=O.previousSibling,!O)return e}function dn(O){return O.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(O.nodeName)}function qh(O,e,t,i,r){for(;;){if(O==t&&e==i)return!0;if(e==(r<0?0:Pt(O))){if(O.nodeName=="DIV")return!1;let n=O.parentNode;if(!n||n.nodeType!=1)return!1;e=pO(O)+(r<0?0:1),O=n}else if(O.nodeType==1){if(O=O.childNodes[e+(r<0?-1:0)],O.nodeType==1&&O.contentEditable=="false")return!1;e=r<0?Pt(O):0}else return!1}}function Pt(O){return O.nodeType==3?O.nodeValue.length:O.childNodes.length}function kn(O,e){let t=e?O.left:O.right;return{left:t,right:t,top:O.top,bottom:O.bottom}}function Ig(O){let e=O.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:O.innerWidth,top:0,bottom:O.innerHeight}}function yf(O,e){let t=e.width/O.offsetWidth,i=e.height/O.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-O.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-O.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function Bg(O,e,t,i,r,n,s,a){let o=O.ownerDocument,l=o.defaultView||window;for(let c=O,h=!1;c&&!h;)if(c.nodeType==1){let f,Q=c==o.body,u=1,$=1;if(Q)f=Ig(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(h=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let g=c.getBoundingClientRect();({scaleX:u,scaleY:$}=yf(c,g)),f={left:g.left,right:g.left+c.clientWidth*u,top:g.top,bottom:g.top+c.clientHeight*$}}let p=0,m=0;if(r=="nearest")e.top<f.top?(m=e.top-(f.top+s),t>0&&e.bottom>f.bottom+m&&(m=e.bottom-f.bottom+s)):e.bottom>f.bottom&&(m=e.bottom-f.bottom+s,t<0&&e.top-m<f.top&&(m=e.top-(f.top+s)));else{let g=e.bottom-e.top,X=f.bottom-f.top;m=(r=="center"&&g<=X?e.top+g/2-X/2:r=="start"||r=="center"&&t<0?e.top-s:e.bottom-X+s)-f.top}if(i=="nearest"?e.left<f.left?(p=e.left-(f.left+n),t>0&&e.right>f.right+p&&(p=e.right-f.right+n)):e.right>f.right&&(p=e.right-f.right+n,t<0&&e.left<f.left+p&&(p=e.left-(f.left+n))):p=(i=="center"?e.left+(e.right-e.left)/2-(f.right-f.left)/2:i=="start"==a?e.left-n:e.right-(f.right-f.left)+n)-f.left,p||m)if(Q)l.scrollBy(p,m);else{let g=0,X=0;if(m){let T=c.sLine truncated
|
||||
`,r=O.state.doc.line(r.number+(t?1:-1)),n=O.bidiSpans(r),l=O.visualLineSide(r,!t)}if(o){if(!o(c))return a}else{if(!i)return l;o=i(c)}a=l}}function wP(O,e,t){let i=O.state.charCategorizer(e),r=i(t);return n=>{let s=i(n);return r==J.Space&&(r=s),r==s}}function kP(O,e,t,i){let r=e.head,n=t?1:-1;if(r==(t?O.state.doc.length:0))return P.cursor(r,e.assoc);let s=e.goalColumn,a,o=O.contentDOM.getBoundingClientRect(),l=O.coordsAtPos(r,e.assoc||-1),c=O.documentTop;if(l)s==null&&(s=l.left-o.left),a=n<0?l.top:l.bottom;else{let Q=O.viewState.lineBlockAt(r);s==null&&(s=Math.min(o.right-o.left,O.defaultCharacterWidth*(r-Q.from))),a=(n<0?Q.top:Q.bottom)+c}let h=o.left+s,f=i??O.viewState.heightOracle.textHeight>>1;for(let Q=0;;Q+=10){let u=a+(f+Q)*n,$=rd(O,{x:h,y:u},!1,n);if(u<o.top||u>o.bottom||(n<0?$<r:$>r)){let p=O.docView.coordsForChar($),m=!p||u<p.top?-1:1;return P.cursor($,m,void 0,s)}}}function on(O,e,t){for(;;){let i=0;for(let r of O)r.between(e-1,e+1,(n,s,a)=>{if(e>n&&e<s){let o=i||t||(e-n<s-e?-1:1);e=o<0?n:s,i=o}});if(!i)return e}}function nd(O,e){let t=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],n=null;if(r.empty){let s=on(O,r.from,0);s!=r.from&&(n=P.cursor(s,-1))}else{let s=on(O,r.from,-1),a=on(O,r.to,1);(s!=r.from||a!=r.to)&&(n=P.range(r.from==r.anchor?s:a,r.from==r.head?s:a))}n&&(t||(t=e.ranges.slice()),t[i]=n)}return t?P.create(t,e.mainIndex):e}function oa(O,e,t){let i=on(O.state.facet(vn).map(r=>r(O)),t.from,e.head>t.from?-1:1);return i==t.from?t:P.cursor(i,i<t.from?1:-1)}var Zi="\uFFFF",xa=class{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(M.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Zi}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let n=this.text.length;this.readNode(r);let s=r.nextSibling;if(s==t)break;let a=oe.get(r),o=oe.get(s);(a&&o?a.breakAfter:(a?a.breakAfter:dn(r))||dn(s)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>n)&&this.lineBreak(),r=s}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 n=-1,s=1,a;if(this.lineSeparator?(n=t.indexOf(this.lineSeparator,i),s=this.lineSeparator.length):(a=r.exec(t))&&(n=a.index,s=a[0].length),this.append(t.slice(i,n<0?t.length:n)),n<0)break;if(this.lineBreak(),s>1)for(let o of this.points)o.node==e&&o.pos>this.text.length&&(o.pos-=s-1);i=n+s}}readNode(e){if(e.cmIgnore)return;let t=oe.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+(YP(e,i.node,i.offset)?t:0))}};function YP(O,e,t){for(;;){if(!e||t<Pt(e))return!1;if(e==O)return!0;t=pO(e)+1,e=e.parentNode}}var mn=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},wa=class{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:n,impreciseAnchor:s}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let a=n||s?[]:RP(e),o=new xa(a,e.state);o.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=o.text,this.newSel=_P(a,this.bounds.from)}else{let a=e.observer.selectionRange,o=n&&n.node==a.focusNode&&n.offset==a.focusOffset||!da(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),l=s&&s.node==a.anchorNode&&s.offset==a.anchorOffset||!da(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((v.ios||v.chrome)&&e.state.selection.main.empty&&o!=l&&(c.from>0||c.to<e.state.doc.length)){let h=Math.min(o,l),f=Math.max(o,l),Q=c.from-h,u=c.to-f;(Q==0||Q==1||h==0)&&(u==0||u==-1||f==e.state.doc.length)&&(o=0,l=e.state.doc.length)}this.newSel=P.single(l,o)}}};function sd(O,e){let t,{newSel:i}=e,r=O.state.selection.main,n=O.inputState.lastKeyTime>Date.now()-100?O.inputState.lastKeyCode:-1;if(e.bounds){let{from:s,to:a}=e.bounds,o=r.from,l=null;(n===8||v.android&&e.text.length<a-s)&&(o=r.to,l="end");let c=ZP(O.state.doc.sliceString(s,a,Zi),e.text,o-s,l);c&&(v.chrome&&n==13&&c.toB==c.from+2&&e.text.slice(c.from,c.toB)==Zi+Zi&&c.toB--,t={from:s+c.from,to:s+c.toA,insert:G.of(e.text.slice(c.from,c.toB).split(Zi))})}else i&&(!O.hasFocus&&O.state.facet(_t)||i.main.eq(r))&&(i=null);if(!t&&!i)return!1;if(!t&&e.typeOver&&!r.empty&&i&&i.main.empty?t={from:r.from,to:r.to,insert:O.state.doc.slice(r.from,r.to)}:(v.mac||v.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\.Line truncated
|
||||
`&&O.lineWrapping&&(i&&(i=P.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:G.of([" "])}),t)return so(O,t,i,n);if(i&&!i.main.eq(r)){let s=!1,a="select";return O.inputState.lastSelectionTime>Date.now()-50&&(O.inputState.lastSelectionOrigin=="select"&&(s=!0),a=O.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=nd(O.state.facet(vn).map(o=>o(O)),i))),O.dispatch({selection:i,scrollIntoView:s,userEvent:a}),!0}else return!1}function so(O,e,t,i=-1){if(v.ios&&O.inputState.flushIOSKey(e))return!0;let r=O.state.selection.main;if(v.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&O.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&ei(O.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)&&ei(O.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&ei(O.contentDOM,"Delete",46)))return!0;let n=e.insert.toString();O.inputState.composing>=0&&O.inputState.composing++;let s,a=()=>s||(s=vP(O,e,t));return O.state.facet(If).some(o=>o(O,e.from,e.to,n,a))||O.dispatch(a()),!0}function vP(O,e,t){let i,r=O.state,n=r.selection.main;if(e.from>=n.from&&e.to<=n.to&&e.to-e.from>=(n.to-n.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&O.inputState.composing<0){let a=n.from<e.from?r.sliceDoc(n.from,e.from):"",o=n.to>e.to?r.sliceDoc(e.to,n.to):"";i=r.replaceSelection(O.state.toText(a+e.insert.sliceString(0,void 0,O.state.lineBreak)+o))}else{let a=r.changes(e),o=t&&t.main.to<=a.newLength?t.main:void 0;if(r.selection.ranges.length>1&&O.inputState.composing>=0&&e.to<=n.to&&e.to>=n.to-10){let l=O.state.sliceDoc(e.from,e.to),c,h=t&&id(O,t.main.head);if(h){let u=e.insert.length-(e.to-e.from);c={from:h.from,to:h.to-u}}else c=O.state.doc.lineAt(n.head);let f=n.to-e.to,Q=n.to-n.from;i=r.changeByRange(u=>{if(u.from==n.from&&u.to==n.to)return{changes:a,range:o||u.map(a)};let $=u.to-f,p=$-l.length;if(u.to-u.from!=Q||O.state.sliceDoc(p,$)!=l||u.to>=c.from&&u.from<=c.to)return{range:u};let m=r.changes({from:p,to:$,insert:e.insert}),g=u.to-n.to;return{changes:m,range:o?P.range(Math.max(0,o.anchor+g),Math.max(0,o.head+g)):u.map(m)}})}else i={changes:a,selection:o&&r.selection.replaceRange(o)}}let s="input.type";return(O.composing||O.inputState.compositionPendingChange&&O.inputState.compositionEndedAt>Date.now()-50)&&(O.inputState.compositionPendingChange=!1,s+=".compose",O.inputState.compositionFirstChange&&(s+=".start",O.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:s,scrollIntoView:!0})}function ZP(O,e,t,i){let r=Math.min(O.length,e.length),n=0;for(;n<r&&O.charCodeAt(n)==e.charCodeAt(n);)n++;if(n==r&&O.length==e.length)return null;let s=O.length,a=e.length;for(;s>0&&a>0&&O.charCodeAt(s-1)==e.charCodeAt(a-1);)s--,a--;if(i=="end"){let o=Math.max(0,n-Math.min(s,a));t-=s+o-n}if(s<n&&O.length<e.length){let o=t<=n&&t>=s?n-t:0;n-=o,a=n+(a-s),s=n}else if(a<n){let o=t<=n&&t>=a?n-t:0;n-=o,s=n+(s-a),a=n}return{from:n,toA:s,toB:a}}function RP(O){let e=[];if(O.root.activeElement!=O.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:n}=O.observer.selectionRange;return t&&(e.push(new mn(t,i)),(r!=t||n!=i)&&e.push(new mn(r,n))),e}function _P(O,e){if(O.length==0)return null;let t=O[0].pos,i=O.length==2?O[1].pos:t;return t>-1&&i>-1?P.single(t+e,i+e):null}var ka=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=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.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,v.safari&&e.contentDOM.addEventListener("input",()=>null),v.gecko&&BP(e.contentDOM.ownerDocument)}handleEvent(e){!CP(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=VP(e),i=this.handlers,r=this.view.contentDOM;for(let n in t)if(n!="scroll"){let s=!t[n].handlers.length,a=i[n];a&&s!=!a.handlers.length&&(r.removeEventListener(n,this.handleEvent),a=null),a||r.addEventListener(n,this.handleEvent,{passive:s})}for(let n in i)n!="scroll"&&!t[n]&&r.removeEventListener(n,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tab
Line truncated
|
||||
`))};if(l.from==this.from&&n<this.from?l.from=n:l.to==this.to&&n>this.to&&(l.to=n),l.from==l.to&&!l.insert.length){let c=P.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));c.main.eq(r)||e.dispatch({selection:c,userEvent:"select"});return}if((v.mac||v.android)&&l.from==s-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(l={from:a,to:o,insert:G.of([i.text.replace("."," ")])}),this.pendingContextChange=l,!e.state.readOnly){let c=this.to-this.from+(l.to-l.from+l.insert.length);so(e,l,P.single(this.toEditorPos(i.selectionStart,c),this.toEditorPos(i.selectionEnd,c)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=i=>{let r=[],n=null;for(let s=this.toEditorPos(i.rangeStart),a=this.toEditorPos(i.rangeEnd);s<a;s++){let o=e.coordsForChar(s);n=o&&new DOMRect(o.left,o.top,o.right-o.left,o.bottom-o.top)||n||new DOMRect,r.push(n)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let n of i.getTextFormats()){let s=n.underlineStyle,a=n.underlineThickness;if(s!="None"&&a!="None"){let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);if(o<l){let c=`text-decoration: underline ${s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;r.push(Z.mark({attributes:{style:c}}).range(o,l))}}}e.dispatch({effects:Kf.of(Z.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=Gi(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((n,s,a,o,l)=>{if(i)return;let c=l.length-(s-n);if(r&&s>=r.to)if(r.from==n&&r.to==s&&r.insert.eq(l)){r=this.pendingContextChange=null,t+=c,this.to+=c;return}else r=null,this.revertPending(e.state);if(n+=t,s+=t,s<=this.from)this.from+=c,this.to+=c;else if(n<this.to){if(n<this.from||s>this.to||this.to-this.from+l.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(n),this.toContextPos(s),l.toString()),this.to+=c}t+=c}),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])}},b=class O{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.measureRequest
Line truncated
|
||||
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Da),gS={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},ca=null;function PS(){var O;if(ca==null&&typeof document<"u"&&document.body){let e=document.body.style;ca=((O=e.tabSize)!==null&&O!==void 0?O:e.MozTabSize)!=null}return ca||!1}var hn=Y.define({combine(O){let e=xe(O,{render:null,specialChars:mS,addSpecialChars:null});return(e.replaceTabs=!PS())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Da)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Da)),e}});function wd(O={}){return[hn.of(O),SS()]}var $f=null;function SS(){return $f||($f=fe.fromClass(class{constructor(O){this.view=O,this.decorations=Z.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(O.state.facet(hn)),this.decorations=this.decorator.createDeco(O)}makeDecorator(O){return new Ma({regexp:O.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,n=Se(e[0],0);if(n==9){let s=r.lineAt(i),a=t.state.tabSize,o=ve(s.text,a,i-s.from);return Z.replace({widget:new Ba((a-o%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[n]||(this.decorationCache[n]=Z.replace({widget:new Ia(O,n)}))},boundary:O.replaceTabs?void 0:/[^]/})}update(O){let e=O.state.facet(hn);O.startState.facet(hn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(O.view)):this.decorations=this.decorator.updateDeco(O,this.decorations)}},{decorations:O=>O.decorations}))}var XS="\u2022";function TS(O){return O>=32?XS:O==10?"\u2424":String.fromCharCode(9216+O)}var Ia=class extends We{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=TS(this.code),i=e.state.phrase("Control character")+" "+(gS[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let n=document.createElement("span");return n.textContent=t,n.title=i,n.setAttribute("aria-label",i),n.className="cm-specialChar",n}ignoreEvent(){return!1}},Ba=class extends We{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function kd(){return bS}var yS=Z.line({class:"cm-activeLine"}),bS=fe.fromClass(class{constructor(O){this.decorations=this.getDeco(O)}update(O){(O.docChanged||O.selectionSet)&&(this.decorations=this.getDeco(O.view))}getDeco(O){let e=-1,t=[];for(let i of O.state.selection.ranges){let r=O.lineBlockAt(i.head);r.from>e&&(t.push(yS.range(r.from)),e=r.from)}return Z.set(t)}},{decorations:O=>O.decorations});var Na=2e3;function xS(O,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),n=[];if(e.off>Na||t.off>Na||e.col<0||t.col<0){let s=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let o=i;o<=r;o++){let l=O.doc.line(o);l.length<=a&&n.push(P.range(l.from+s,l.to+a))}}else{let s=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let o=i;o<=r;o++){let l=O.doc.line(o),c=Br(l.text,s,O.tabSize,!0);if(c<0)n.push(P.cursor(l.to));else{let h=Br(l.text,a,O.tabSize);n.push(P.range(l.from+c,l.from+h))}}}return n}function wS(O,e){let t=O.coordsAtPos(O.viewport.from);return t?Math.round(Math.abs((t.left-e)/O.defaultCharacterWidth)):-1}function pf(O,e){let t=O.posAtCoords({x:e.clientX,y:e.clientY},!1),i=O.state.doc.lineAt(t),r=t-i.from,n=r>Na?-1:r==i.length?wS(O,e.clientX):ve(i.text,O.state.tabSize,t-i.from);return{line:i.number,col:n,off:r}}function kS(O,e){let t=pf(O,e),i=O.state.selection;return t?{update(r){if(r.docChanged){let n=r.changes.mapPos(r.startState.doc.line(t.line).from),s=r.state.doc.lineAt(n);t={line:s.number,col:t.col,off:Math.min(t.off,s.length)},i=i.map(r.changes)}},get(r,n,s){let a=pf(O,r);if(!a)return i;let o=xS(O.state,t,a);return o.length?s?P.create(o.concat(i.ranges)):P.create(o):i}}:null}function Yd(O){let e=O?.eventFilter||(t=>t.altKey&&t.button==0);return b.mouseSelectionStyle.of((t,i)=>e(i)?kS(t,i):null)}var YS={Alt:[18,O=>!!O.altKey],Control:[17,O=>!!O.ctrlKey],Shift:[16,O=>!!O.shiftKey],Meta:[91,O=>!!O.metaKey]},vS={style:"cursor: crosshair"};function vd(O={}){let[e,t]=YS[O.key||"Alt"],i=fe.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,b.contentAttributes.o
Line truncated
|
||||
`: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}create(){return this.regexp?new Fo(this):new No(this)}getCursor(e,t=0,i){let r=e.doc?e:M.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?oi(this,r,t,i):ai(this,r,t,i)}},ss=class{constructor(e){this.spec=e}};function ai(O,e,t,i){return new oO(e.doc,O.unquoted,t,i,O.caseSensitive?void 0:r=>r.toLowerCase(),O.wholeWord?OT(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function OT(O,e){return(t,i,r,n)=>((n>t||n+r.length<i)&&(n=Math.max(0,t-2),r=O.sliceString(n,Math.min(O.length,i+2))),(e(as(r,t-n))!=J.Word||e(os(r,t-n))!=J.Word)&&(e(os(r,i-n))!=J.Word||e(as(r,i-n))!=J.Word))}var No=class extends ss{constructor(e){super(e)}nextMatch(e,t,i){let r=ai(this.spec,e,i,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=ai(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==i?null:r.value}prevMatchInRange(e,t,i){for(let r=i;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),s=ai(this.spec,e,n,r),a=null;for(;!s.nextOverlapping().done;)a=s.value;if(a)return a;if(n==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=ai(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 n=ai(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!n.next().done;)r(n.value.from,n.value.to)}};function oi(O,e,t,i){return new ts(e.doc,O.search,{ignoreCase:!O.caseSensitive,test:O.wholeWord?iT(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function as(O,e){return O.slice(ue(O,e,!1),e)}function os(O,e){return O.slice(e,ue(O,e))}function iT(O){return(e,t,i)=>!i[0].length||(O(as(i.input,i.index))!=J.Word||O(os(i.input,i.index))!=J.Word)&&(O(os(i.input,i.index+i[0].length))!=J.Word||O(as(i.input,i.index+i[0].length))!=J.Word)}var Fo=class extends ss{nextMatch(e,t,i){let r=oi(this.spec,e,i,e.doc.length).next();return r.done&&(r=oi(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let n=Math.max(t,i-r*1e4),s=oi(this.spec,e,n,i),a=null;for(;!s.next().done;)a=s.value;if(a&&(n==t||a.from>n+10))return a;if(n==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 n=+i.slice(0,r);if(n>0&&n<e.match.length)return e.match[n]+i.slice(r)}return t})}matchAll(e,t){let i=oi(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 n=oi(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!n.next().done;)r(n.value.from,n.value.to)}},dr=V.define(),el=V.define(),aO=he.define({create(O){return new fr(Ho(O).create(),null)},update(O,e){for(let t of e.effects)t.is(dr)?O=new fr(t.value.create(),O.panel):t.is(el)&&(O=new fr(O.query,t.value?tl:null));return O},provide:O=>PO.from(O,e=>e.panel)});var fr=class{constructor(e,t){this.query=e,this.panel=t}},rT=Z.mark({class:"cm-searchMatch"}),nT=Z.mark({class:"cm-searchMatch cm-searchMatch-selected"}),sT=fe.fromClass(class{constructor(O){this.view=O,this.decorations=this.highlight(O.state.field(aO))}update(O){let e=O.state.field(aO);(e!=O.startState.field(aO)||O.docChanged||O.selectionSet||O.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:O,panel:e}){if(!e||!O.spec.valid)return Z.none;let{view:t}=this,i=new Me;for(let r=0,n=t.visibleRanges,s=n.length;r<s;r++){let{from:a,to:o}=n[r];for(;r<s-1&&o>n[r+1].from-500;)o=n[++r].to;O.highlight(t.state,a,o,(l,c)=>{let h=t.state.selection.ranges.some(f=>f.from==l&&f.to==c);i.add(l,c,h?nT:rT)})}return i.finish()}},{decorations:O=>O.decorations});function Qr(O){return e=>{let t=e.state.field(aO,!1);return t&&t.query.spec.valid?O(e,t):gu(e)}}var ls=Qr((O,{query:e})=>{let{to:t}=O.state.selection.main,i=e.nextMatch(O.state,t,t);if(!i)return!1;let r=P.single(i.from,i.to),n=O.state.facet(li);return O.dispatch({selection:r,effects:[Ol(O,i),n.scrollToMatch(r.main,O)],userEvent:"select.search"}),mu(O),!0}),cs=Qr((O,{query:e})=>{let{state:t}=O,{from:i}=t.selection.main,r=e.prevMatch(t,i,i);if(!r)return!1;let n=P.single(r.from,r.to),s=O.state.facet(li);return O.dispatch({selection:n,effects:[Ol(O,r),s.scrollToMatch(n.main,O)],userEvent:"select.search"}),mu(O),!0}),aT=Qr((O,{query:e})=>{let t=e.matchAll(O.state,1e3);return!t||!t.length?!1:(O.dispatch({selection:P.create(t.map(i=>P.range(i.from,i.to)))
Line truncated
|
||||
\${}
|
||||
}`,{label:"select",detail:"statement",type:"keyword"}),z("case ${}:\n${}",{label:"case",type:"keyword"}),z("switch ${} {\n ${}\n}",{label:"switch",detail:"statement",type:"keyword"}),z("switch ${}.(${type}) {\n ${}\n}",{label:"switch",detail:"type statement",type:"keyword"}),z("if ${} {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),z(`if \${} {
|
||||
}`,{label:"select",detail:"statement",type:"keyword"}),U("case ${}:\n${}",{label:"case",type:"keyword"}),U("switch ${} {\n ${}\n}",{label:"switch",detail:"statement",type:"keyword"}),U("switch ${}.(${type}) {\n ${}\n}",{label:"switch",detail:"type statement",type:"keyword"}),U("if ${} {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),U(`if \${} {
|
||||
\${}
|
||||
} else {
|
||||
\${}
|
||||
}`,{label:"if",detail:"/ else block",type:"keyword"}),z('import ${name} "${module}"\n${}',{label:"import",detail:"declaration",type:"keyword"})],cd=new Tt,fd=new Set(["SourceFile","Block","FunctionDecl","MethodDecl","FunctionLiteral","ForStatement","SwitchStatement","TypeSwitchStatement","IfStatement"]);function li(O,e){return(t,i)=>{e:for(let r=t.node.firstChild,n=0,s=null;;){for(;!r;){if(!n)break e;n--,r=s.nextSibling,s=s.parent}e&&r.name==e||r.name=="SpecList"?(n++,s=r,r=r.firstChild):(r.name=="DefName"&&i(r,O),r=r.nextSibling)}return!0}}var dy={FunctionDecl:li("function"),VarDecl:li("var","VarSpec"),ConstDecl:li("constant","ConstSpec"),TypeDecl:li("type","TypeSpec"),ImportDecl:li("constant","ImportSpec"),Parameter:li("var"),__proto__:null};function Qd(O,e){let t=cd.get(e);if(t)return t;let i=[],r=!0;function n(s,a){let o=O.sliceString(s.from,s.to);i.push({label:o,type:a})}return e.cursor(A.IncludeAnonymous).iterate(s=>{if(r)r=!1;else if(s.name){let a=dy[s.name];if(a&&a(s,n)||fd.has(s.name))return!1}else if(s.to-s.from>8192){for(let a of Qd(O,s.node))i.push(a);return!1}}),cd.set(e,i),i}var hd=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,$d=["String","LineComment","BlockComment","DefName","LabelName","FieldName",".","?."],py=O=>{let e=j(O.state).resolveInner(O.pos,-1);if($d.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&hd.test(O.state.sliceDoc(e.from,e.to));if(!t&&!O.explicit)return null;let i=[];for(let r=e;r;r=r.parent)fd.has(r.name)&&(i=i.concat(Qd(O.state.doc,r)));return{options:i,from:t?e.from:O.pos,validFor:hd}},vl=oe.define({name:"go",parser:ld.configure({props:[le.add({IfStatement:he({except:/^\s*({|else\b)/}),LabeledStatement:iO,"SwitchBlock SelectBlock":O=>{let e=O.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return O.baseIndent+(t||i?0:O.unit)},Block:ye({closing:"}"}),BlockComment:()=>null,Statement:he({except:/^{/})}),ne.add({"Block SwitchBlock SelectBlock LiteralValue InterfaceType StructType SpecList":me,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case\b|default\b|\})$/}}),my=O=>({label:O,type:"keyword"}),gy="interface struct chan map package go return break continue goto fallthrough else defer range true false nil".split(" ").map(my);function ud(){let O=uy.concat(gy);return new Oe(vl,[vl.data.of({autocomplete:si($d,kO(O))}),vl.data.of({autocomplete:py})])}var Py=54,Sy=1,Xy=55,Ty=2,yy=56,by=3,dd=4,xy=5,ds=6,yd=7,bd=8,xd=9,wd=10,wy=11,ky=12,Yy=13,Rl=57,Zy=14,pd=58,kd=20,vy=22,Yd=23,Ry=24,ql=26,Zd=27,Vy=28,qy=31,_y=34,zy=36,Wy=37,Uy=0,jy=1,Cy={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},Gy={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},md={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 Ey(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function vd(O){return O==9||O==10||O==13||O==32}var gd=null,Pd=null,Sd=0;function _l(O,e){let t=O.pos+e;if(Sd==t&&Pd==O)return gd;let i=O.peek(e);for(;vd(i);)i=O.peek(++e);let r="";for(;Ey(i);)r+=String.fromCharCode(i),i=O.peek(++e);return Pd=O,Sd=t,gd=r?r.toLowerCase():i==Ay||i==Ly?void 0:null}var Rd=60,ps=62,zl=47,Ay=63,Ly=33,My=45;function Xd(O,e){this.name=O,this.parent=e}var Dy=[ds,wd,yd,bd,xd],Iy=new Ge({start:null,shift(O,e,t,i){return Dy.indexOf(e)>-1?new Xd(_l(i,1)||"",O):O},reduce(O,e){return e==kd&&O?O.parent:O},reuse(O,e,t,i){let r=e.type.id;return r==ds||r==zy?new Xd(_l(i,1)||"",O):O},strict:!1}),By=new W((O,e)=>{if(O.next!=Rd){O.next<0&&e.context&&O.acceptToken(Rl);return}O.advance();let t=O.next==zl;t&&O.advance();let i=_l(O,0);if(i===void 0)return;if(!i)return O.acceptToken(t?Zy:ds);let r=e.context?e.context.name:null;if(t){if(i==r)return O.acceptToken(wy);if(r&&Gy[r])return O.acceptToken(Rl,-2);if(e.dialectEnabled(Uy))return O.acceptToken(ky);for(let n=e.context;n;n=n.parent)if(n.name==i)return;O.acceptToken(Yy)}else{if(i=="script")return O.acceptToken(yd);if(i=="style")return O.acceptToken(bd);if(i=="textarea")return O.acceptToken(xd);if(Cy.hasOwnProperty(i))return O.acceptToken(wd);r&&md[r]&&md[r][i]?O.acceptToken(Rl,-1):O.acceptToken(ds)}},{contextual:!0}),Ny=new W(O=>{for(let e=0,t=0;;t++){if(O.next<0){t&&O.acceptToken(pd);break}if(O.next==My)e++;else if(O.next==ps&&e>=2){t>=3&&O.acceptToken(pd,-2);break}else e=0;O.advance()}});function Fy(O){for(;O;O=O
Line truncated
|
||||
}`,{label:"if",detail:"/ else block",type:"keyword"}),U('import ${name} "${module}"\n${}',{label:"import",detail:"declaration",type:"keyword"})],x$=new Tt,k$=new Set(["SourceFile","Block","FunctionDecl","MethodDecl","FunctionLiteral","ForStatement","SwitchStatement","TypeSwitchStatement","IfStatement"]);function Qi(O,e){return(t,i)=>{e:for(let r=t.node.firstChild,n=0,s=null;;){for(;!r;){if(!n)break e;n--,r=s.nextSibling,s=s.parent}e&&r.name==e||r.name=="SpecList"?(n++,s=r,r=r.firstChild):(r.name=="DefName"&&i(r,O),r=r.nextSibling)}return!0}}var H0={FunctionDecl:Qi("function"),VarDecl:Qi("var","VarSpec"),ConstDecl:Qi("constant","ConstSpec"),TypeDecl:Qi("type","TypeSpec"),ImportDecl:Qi("constant","ImportSpec"),Parameter:Qi("var"),__proto__:null};function Y$(O,e){let t=x$.get(e);if(t)return t;let i=[],r=!0;function n(s,a){let o=O.sliceString(s.from,s.to);i.push({label:o,type:a})}return e.cursor(A.IncludeAnonymous).iterate(s=>{if(r)r=!1;else if(s.name){let a=H0[s.name];if(a&&a(s,n)||k$.has(s.name))return!1}else if(s.to-s.from>8192){for(let a of Y$(O,s.node))i.push(a);return!1}}),x$.set(e,i),i}var w$=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,v$=["String","LineComment","BlockComment","DefName","LabelName","FieldName",".","?."],K0=O=>{let e=W(O.state).resolveInner(O.pos,-1);if(v$.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&w$.test(O.state.sliceDoc(e.from,e.to));if(!t&&!O.explicit)return null;let i=[];for(let r=e;r;r=r.parent)k$.has(r.name)&&(i=i.concat(Y$(O.state.doc,r)));return{options:i,from:t?e.from:O.pos,validFor:w$}},jl=ne.define({name:"go",parser:b$.configure({props:[se.add({IfStatement:le({except:/^\s*({|else\b)/}),LabeledStatement:nO,"SwitchBlock SelectBlock":O=>{let e=O.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return O.baseIndent+(t||i?0:O.unit)},Block:ye({closing:"}"}),BlockComment:()=>null,Statement:le({except:/^{/})}),te.add({"Block SwitchBlock SelectBlock LiteralValue InterfaceType StructType SpecList":me,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case\b|default\b|\})$/}}),J0=O=>({label:O,type:"keyword"}),eb="interface struct chan map package go return break continue goto fallthrough else defer range true false nil".split(" ").map(J0);function Z$(){let O=F0.concat(eb);return new K(jl,[jl.data.of({autocomplete:lO(v$,zt(O))}),jl.data.of({autocomplete:K0})])}var tb=54,Ob=1,ib=55,rb=2,nb=56,sb=3,R$=4,ab=5,Ts=6,C$=7,G$=8,E$=9,A$=10,ob=11,lb=12,cb=13,Cl=57,hb=14,_$=58,L$=20,fb=22,M$=23,db=24,El=26,D$=27,Qb=28,ub=31,$b=34,pb=36,mb=37,gb=0,Pb=1,Sb={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},Xb={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},V$={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 Tb(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function I$(O){return O==9||O==10||O==13||O==32}var q$=null,z$=null,W$=0;function Al(O,e){let t=O.pos+e;if(W$==t&&z$==O)return q$;let i=O.peek(e);for(;I$(i);)i=O.peek(++e);let r="";for(;Tb(i);)r+=String.fromCharCode(i),i=O.peek(++e);return z$=O,W$=t,q$=r?r.toLowerCase():i==yb||i==bb?void 0:null}var B$=60,ys=62,Ll=47,yb=63,bb=33,xb=45;function U$(O,e){this.name=O,this.parent=e}var wb=[Ts,A$,C$,G$,E$],kb=new Ge({start:null,shift(O,e,t,i){return wb.indexOf(e)>-1?new U$(Al(i,1)||"",O):O},reduce(O,e){return e==L$&&O?O.parent:O},reuse(O,e,t,i){let r=e.type.id;return r==Ts||r==pb?new U$(Al(i,1)||"",O):O},strict:!1}),Yb=new z((O,e)=>{if(O.next!=B$){O.next<0&&e.context&&O.acceptToken(Cl);return}O.advance();let t=O.next==Ll;t&&O.advance();let i=Al(O,0);if(i===void 0)return;if(!i)return O.acceptToken(t?hb:Ts);let r=e.context?e.context.name:null;if(t){if(i==r)return O.acceptToken(ob);if(r&&Xb[r])return O.acceptToken(Cl,-2);if(e.dialectEnabled(gb))return O.acceptToken(lb);for(let n=e.context;n;n=n.parent)if(n.name==i)return;O.acceptToken(cb)}else{if(i=="script")return O.acceptToken(C$);if(i=="style")return O.acceptToken(G$);if(i=="textarea")return O.acceptToken(E$);if(Sb.hasOwnProperty(i))return O.acceptToken(A$);r&&V$[r]&&V$[r][i]?O.acceptToken(Cl,-1):O.acceptToken(Ts)}},{contextual:!0}),vb=new z(O=>{for(let e=0,t=0;;t++){if(O.next<0){t&&O.acceptToken(_$);break}if(O.next==xb)e++;else if(O.next==ys&&e>=2){t>=3&&O.acceptToken(_$,-2);break}else e=0;O.advance()}});function Zb(O){for(;O;O=O.
Line truncated
|
||||
\${}
|
||||
} catch (\${error}) {
|
||||
\${}
|
||||
}`,{label:"try",detail:"/ catch block",type:"keyword"}),z("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),z(`if (\${}) {
|
||||
}`,{label:"try",detail:"/ catch block",type:"keyword"}),U("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),U(`if (\${}) {
|
||||
\${}
|
||||
} else {
|
||||
\${}
|
||||
}`,{label:"if",detail:"/ else block",type:"keyword"}),z(`class \${name} {
|
||||
}`,{label:"if",detail:"/ else block",type:"keyword"}),U(`class \${name} {
|
||||
constructor(\${params}) {
|
||||
\${}
|
||||
}
|
||||
}`,{label:"class",detail:"definition",type:"keyword"}),z('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),z('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Rb=Gd.concat([z("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),z("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),z("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Ud=new Tt,Ed=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function mr(O){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,O),!0}}var Vb=["FunctionDeclaration"],qb={FunctionDeclaration:mr("function"),ClassDeclaration:mr("class"),ClassExpression:()=>!0,EnumDeclaration:mr("constant"),TypeAliasDeclaration:mr("type"),NamespaceDeclaration:mr("namespace"),VariableDefinition(O,e){O.matchContext(Vb)||e(O,"variable")},TypeDefinition(O,e){e(O,"type")},__proto__:null};function Ad(O,e){let t=Ud.get(e);if(t)return t;let i=[],r=!0;function n(s,a){let o=O.sliceString(s.from,s.to);i.push({label:o,type:a})}return e.cursor(A.IncludeAnonymous).iterate(s=>{if(r)r=!1;else if(s.name){let a=qb[s.name];if(a&&a(s,n)||Ed.has(s.name))return!1}else if(s.to-s.from>8192){for(let a of Ad(O,s.node))i.push(a);return!1}}),Ud.set(e,i),i}var jd=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Ld=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function _b(O){let e=j(O.state).resolveInner(O.pos,-1);if(Ld.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&jd.test(O.state.sliceDoc(e.from,e.to));if(!t&&!O.explicit)return null;let i=[];for(let r=e;r;r=r.parent)Ed.has(r.name)&&(i=i.concat(Ad(O.state.doc,r)));return{options:i,from:t?e.from:O.pos,validFor:jd}}var Qt=oe.define({name:"javascript",parser:Wd.configure({props:[le.add({IfStatement:he({except:/^\s*({|else\b)/}),TryStatement:he({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:iO,SwitchBody:O=>{let e=O.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return O.baseIndent+(t?0:i?1:2)*O.unit},Block:ye({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":he({except:/^\s*{/}),JSXElement(O){let e=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},JSXEscape(O){let e=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),ne.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":me,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Md={test:O=>/^JSX/.test(O.name),facet:Ji({commentTokens:{block:{open:"{/*",close:"*/}"}}})},El=Qt.configure({dialect:"ts"},"typescript"),Al=Qt.configure({dialect:"jsx",props:[zn.add(O=>O.isTop?[Md]:void 0)]}),Ll=Qt.configure({dialect:"jsx ts",props:[zn.add(O=>O.isTop?[Md]:void 0)]},"typescript"),Dd=O=>({label:O,type:"keyword"}),Id="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(Dd),zb=Id.concat(["declare","implements","private","protected","public"].map(Dd));function ms(O={}){let e=O.jsx?O.typescript?Ll:Al:O.typescript?El:Qt,t=O.typescript?Rb.concat(zb):Gd.concat(Id);return new Oe(e,[Qt.data.of({autocomplete:si(Ld,kO(t))}),Qt.data.of({autocomplete:_b}),O.jsx?jb:[]])}function Wb(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function Cd(O,e,t=O.length){for(let i=e?.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return O.sliceString(i.from,Math.min(i.to,t));return""}var Ub=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),jb=b.inputHandler.of((O,e,t,i,r)=>{if((Ub?O.composing:O.compositionStarted)||O.state.readOnly||e!=t||i!=">"&&i!="/"||!Qt.isActiveAt(O.state,e,-1))return!1;let n=r(),{state:s}=n,a=s.changeByRange(o=>{var l;let{head:c}=o,h=j(s).resolveInner(c-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(s.doc.sliceString(c-1,c)!=i||h.name=="JSXAttributeValue"&&h.to>c)){if(i==">"&&h.name=="JSXFragmentTag")return{range:o,changes:{from:c,insert:"</>"}};if(i=="/"&&h.name=="JSXStartCloseTag"){let $=h.parent,u=$.parent;if(u&&$.from==c-2&&((f=Cd(s.doc,u.firstChild,c))||((l=u.firstChild)===null||l===void 0
Line truncated
|
||||
`+t.scrub(),n=this.advance(r);return n>-1&&n<r.length?this.complete(e,i,n):!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,L(y.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(Wp(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(L(y.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(_p(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=zp(e,t,this.start);if(r){let n=Nl(e,r.to-this.start);n>0&&(this.nextStage(r),i=n)}}return i||(i=Nl(e,this.pos)),i>0&&i<e.length?i:-1}else return Nl(e,this.pos)}}};function Nl(O,e){for(;e<O.length;e++){let t=O.charCodeAt(e);if(t==10)break;if(!at(t))return-1}return e}var Oc=class{nextLine(e,t,i){let r=t.depth<e.stack.length?-1:xp(t),n=t.next;if(r<0)return!1;let s=L(y.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(i,L(n==61?y.SetextHeading1:y.SetextHeading2,i.start,e.prevLineEnd(),[...e.parser.parseInline(i.content,i.start),s])),!0}finish(){return!1}},Zp={LinkReference(O,e){return e.content.charCodeAt(0)==91?new tc(e):null},SetextHeading(){return new Oc}},Kb=[(O,e)=>bp(e)>=0,(O,e)=>Xp(e)>=0,(O,e)=>Tp(e)>=0,(O,e)=>hc(e,O,!0)>=0,(O,e)=>fc(e,O,!0)>=0,(O,e)=>cc(e,O,!0)>=0,(O,e)=>Yp(e,O,!0)>=0],Jb={text:"",end:0},ic=class{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.line=new Kl,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=Xs.create(y.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=i.length?new oc(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 n=e.markers[i++];this.addNode(n.type,n.from,n.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 Hl(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+=`
|
||||
`+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=Up(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=Jb;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 n=this.ranges[r].from,s=this.lineChunkAt(n);t.end=n+s.length,t.text=t.text.slice(0,this.ranges[r-1].to-i)+s,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],n=this.parser.skipContextMarkup[r.type];if(!n)throw new Error("Unhandled block context "+y[r.type]);if(!n(r,this,e))break;e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),i;if(this.input.lineChunks)i=t==`
|
||||
}`,{label:"class",detail:"definition",type:"keyword"}),U('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),U('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],dx=ip.concat([U("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),U("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),U("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),ep=new Tt,rp=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function yr(O){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,O),!0}}var Qx=["FunctionDeclaration"],ux={FunctionDeclaration:yr("function"),ClassDeclaration:yr("class"),ClassExpression:()=>!0,EnumDeclaration:yr("constant"),TypeAliasDeclaration:yr("type"),NamespaceDeclaration:yr("namespace"),VariableDefinition(O,e){O.matchContext(Qx)||e(O,"variable")},TypeDefinition(O,e){e(O,"type")},__proto__:null};function np(O,e){let t=ep.get(e);if(t)return t;let i=[],r=!0;function n(s,a){let o=O.sliceString(s.from,s.to);i.push({label:o,type:a})}return e.cursor(A.IncludeAnonymous).iterate(s=>{if(r)r=!1;else if(s.name){let a=ux[s.name];if(a&&a(s,n)||rp.has(s.name))return!1}else if(s.to-s.from>8192){for(let a of np(O,s.node))i.push(a);return!1}}),ep.set(e,i),i}var tp=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,sp=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function $x(O){let e=W(O.state).resolveInner(O.pos,-1);if(sp.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&tp.test(O.state.sliceDoc(e.from,e.to));if(!t&&!O.explicit)return null;let i=[];for(let r=e;r;r=r.parent)rp.has(r.name)&&(i=i.concat(np(O.state.doc,r)));return{options:i,from:t?e.from:O.pos,validFor:tp}}var dt=ne.define({name:"javascript",parser:J$.configure({props:[se.add({IfStatement:le({except:/^\s*({|else\b)/}),TryStatement:le({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:nO,SwitchBody:O=>{let e=O.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return O.baseIndent+(t?0:i?1:2)*O.unit},Block:ye({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":le({except:/^\s*{/}),JSXElement(O){let e=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},JSXEscape(O){let e=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(e?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),te.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":me,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),ap={test:O=>/^JSX/.test(O.name),facet:nr({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Fl=dt.configure({dialect:"ts"},"typescript"),Hl=dt.configure({dialect:"jsx",props:[An.add(O=>O.isTop?[ap]:void 0)]}),Kl=dt.configure({dialect:"jsx ts",props:[An.add(O=>O.isTop?[ap]:void 0)]},"typescript"),op=O=>({label:O,type:"keyword"}),lp="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(op),px=lp.concat(["declare","implements","private","protected","public"].map(op));function bs(O={}){let e=O.jsx?O.typescript?Kl:Hl:O.typescript?Fl:dt,t=O.typescript?dx.concat(px):ip.concat(lp);return new K(e,[dt.data.of({autocomplete:lO(sp,zt(t))}),dt.data.of({autocomplete:$x}),O.jsx?Px:[]])}function mx(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function Op(O,e,t=O.length){for(let i=e?.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return O.sliceString(i.from,Math.min(i.to,t));return""}var gx=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Px=b.inputHandler.of((O,e,t,i,r)=>{if((gx?O.composing:O.compositionStarted)||O.state.readOnly||e!=t||i!=">"&&i!="/"||!dt.isActiveAt(O.state,e,-1))return!1;let n=r(),{state:s}=n,a=s.changeByRange(o=>{var l;let{head:c}=o,h=W(s).resolveInner(c-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(s.doc.sliceString(c-1,c)!=i||h.name=="JSXAttributeValue"&&h.to>c)){if(i==">"&&h.name=="JSXFragmentTag")return{range:o,changes:{from:c,insert:"</>"}};if(i=="/"&&h.name=="JSXStartCloseTag"){let Q=h.parent,u=Q.parent;if(u&&Q.from==c-2&&((f=Op(s.doc,u.firstChild,c))||((l=u.firstChild)===null||l===void 0?
Line truncated
|
||||
`+t.scrub(),n=this.advance(r);return n>-1&&n<r.length?this.complete(e,i,n):!1}finish(e,t){return(this.stage==2||this.stage==3)&&wr(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,i){return e.addLeafElement(t,L(y.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(Jp(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(L(y.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(Hp(e,wr(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=wr(e,this.pos),i=0;if(t>this.pos){let r=Kp(e,t,this.start);if(r){let n=ic(e,r.to-this.start);n>0&&(this.nextStage(r),i=n)}}return i||(i=ic(e,this.pos)),i>0&&i<e.length?i:-1}else return ic(e,this.pos)}}};function ic(O,e){for(;e<O.length;e++){let t=O.charCodeAt(e);if(t==10)break;if(!at(t))return-1}return e}var cc=class{nextLine(e,t,i){let r=t.depth<e.stack.length?-1:Ep(t),n=t.next;if(r<0)return!1;let s=L(y.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(i,L(n==61?y.SetextHeading1:y.SetextHeading2,i.start,e.prevLineEnd(),[...e.parser.parseInline(i.content,i.start),s])),!0}finish(){return!1}},Dp={LinkReference(O,e){return e.content.charCodeAt(0)==91?new lc(e):null},SetextHeading(){return new cc}},_x=[(O,e)=>Gp(e)>=0,(O,e)=>Up(e)>=0,(O,e)=>jp(e)>=0,(O,e)=>gc(e,O,!0)>=0,(O,e)=>Pc(e,O,!0)>=0,(O,e)=>mc(e,O,!0)>=0,(O,e)=>Mp(e,O,!0)>=0],Vx={text:"",end:0},hc=class{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.line=new sc,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=Ys.create(y.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=i.length?new $c(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 n=e.markers[i++];this.addNode(n.type,n.from,n.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 nc(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+=`
|
||||
`+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=em(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=Vx;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 n=this.ranges[r].from,s=this.lineChunkAt(n);t.end=n+s.length,t.text=t.text.slice(0,this.ranges[r-1].to-i)+s,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],n=this.parser.skipContextMarkup[r.type];if(!n)throw new Error("Unhandled block context "+y[r.type]);if(!n(r,this,e))break;e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),i;if(this.input.lineChunks)i=t==`
|
||||
`?"":t;else{let r=t.indexOf(`
|
||||
`);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=Xs.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 D(this.parser.nodeSet.types[e],$i,$i,(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(ac(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?vp(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=ac(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(y.Paragraph,e.content.length),e.start)}elt(e,t,i,r){return typeof e=="string"?L(this.parser.getNodeType(e),t,i,r):new ys(e,t)}get buffer(){return new Ts(this.parser.nodeSet)}};function vp(O,e,t,i,r){let n=O[e].to,s=[],a=[],o=t.from+i;function l(c,h){for(;h?c>=n:c>n;){let f=O[e+1].from-n;i+=f,c+=f,e++,n=O[e].to}}for(let c=t.firstChild;c;c=c.nextSibling){l(c.from+i,!0);let h=c.from+i,f,$=r.get(c.tree);$?f=$:c.to+i>n?(f=vp(O,e,c,i,r),l(c.to+i,!1)):f=c.toTree(),s.push(f),a.push(h-o)}return l(t.to+i,!1),new D(t.type,s,a,t.to+i-o,t.tree?t.tree.propValues:void 0)}var Tr=class O extends Ht{constructor(e,t,i,r,n,s,a,o,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=n,this.skipContextMarkup=s,this.inlineParsers=a,this.inlineNames=o,this.wrappers=l,this.nodeTypes=Object.create(null);for(let c of e.types)this.nodeTypes[c.name]=c.id}createParse(e,t,i){let r=new ic(this,e,t,i);for(let n of this.wrappers)r=n(r,e,t,i);return r}configure(e){let t=rc(e);if(!t)return this;let{nodeSet:i,skipContextMarkup:r}=this,n=this.blockParsers.slice(),s=this.leafBlockParsers.slice(),a=this.blockNames.slice(),o=this.inlineParsers.slice(),l=this.inlineNames.slice(),c=this.endLeafBlock.slice(),h=this.wrappers;if(Pr(t.defineNodes)){r=Object.assign({},r);let f=i.types.slice(),$;for(let u of t.defineNodes){let{name:d,block:p,composite:m,style:g}=typeof u=="string"?{name:u}:u;if(f.some(S=>S.name==d))continue;m&&(r[f.length]=(S,x,w)=>m(x,w,S.value));let X=f.length,T=m?["Block","BlockContext"]:p?X>=y.ATXHeading1&&X<=y.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(Qe.define({id:X,name:d,props:T&&[[V.group,T]]})),g&&($||($={}),Array.isArray(g)||g instanceof Ne?$[d]=g:Object.assign($,g))}i=new Nt(f),$&&(i=i.extend(H($)))}if(Pr(t.props)&&(i=i.extend(...t.props)),Pr(t.remove))for(let f of t.remove){let $=this.blockNames.indexOf(f),u=this.inlineNames.indexOf(f);$>-1&&(n[$]=s[$]=void 0),u>-1&&(o[u]=void 0)}if(Pr(t.parseBlock))for(let f of t.parseBlock){let $=a.indexOf(f.name);if($>-1)n[$]=f.parse,s[$]=f.leaf;else{let u=f.before?Ss(a,f.before):f.after?Ss(a,f.after)+1:a.length-1;n.splice(u,0,f.parse),s.splice(u,0,f.leaf),a.splice(u,0,f.name)}f.endLeaf&&c.push(f.endLeaf)}if(Pr(t.parseInline))for(let f of t.parseInline){let $=l.indexOf(f.name);if($>-1)o[$]=f.parse;else{let u=f.before?Ss(l,f.before):f.after?Ss(l,f.after)+1:l.length-1;o.splice(u,0,f.parse),l.splice(u,0,f.name)}}return t.wrap&&(h=h.concat(t.wrap)),new O(i,n,s,a,c,r,o,l,h)}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 sc(this,e,t);e:for(let r=t;r<i.end;){let n=i.char(r);for(let s of this.inlineParsers)if(s){let a=s(i,n,r);if(a>=0){r=a;continue e}}r++}return i.resolveMarkers(0)}};function Pr(O){return O!=null&&O.length>0}function rc(O){if(!Array.isArray(O))return O;if(O.length==0)return null;let e=rc(O[0]);if(O.length==1)return e;let t=rc(O.slice(1));if(!t||!e)return e||t;let i=(s,a)=>(s||$i).concat(a||$i),r=e.wrap,n=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?n?(s,a,o,l)=>r(n(s,a,o,l),a,o,l):r:n}}function Ss(O,e){let t=O.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}var Rp=[Qe.none];for(let O=1,e;e=y[O];O++)Rp[O]=Qe.define({id:O,name:e,props:O>=y.Escape?[]:[[V.group,O in Sp?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});var $i=[],Ts=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,i,r=0){return t
Line truncated
|
||||
`;)n--;this.fragmentEnd=n?n-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(V.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),n=e.absoluteLineStart,s=n,a=e.block.children.length,o=s,l=a;for(;;){if(t.to-i>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let c=Up(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,c);else{let h=new D(e.parser.nodeSet.types[y.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,c)}if(t.type.is("Block")&&(tx.indexOf(t.type.id)<0?(s=t.to-i,a=e.block.children.length):(s=o,a=l,o=t.to-i,l=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return s-n}};function Up(O,e){let t=O;for(let i=1;i<e.length;i++){let r=e[i-1].to,n=e[i].from;r<O&&(t-=n-r)}return t}var Ox=H({"Blockquote/...":Q.quote,HorizontalRule:Q.contentSeparator,"ATXHeading1/... SetextHeading1/...":Q.heading1,"ATXHeading2/... SetextHeading2/...":Q.heading2,"ATXHeading3/...":Q.heading3,"ATXHeading4/...":Q.heading4,"ATXHeading5/...":Q.heading5,"ATXHeading6/...":Q.heading6,"Comment CommentBlock":Q.comment,Escape:Q.escape,Entity:Q.character,"Emphasis/...":Q.emphasis,"StrongEmphasis/...":Q.strong,"Link/... Image/...":Q.link,"OrderedList/... BulletList/...":Q.list,"BlockQuote/...":Q.quote,"InlineCode CodeText":Q.monospace,"URL Autolink":Q.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":Q.processingInstruction,"CodeInfo LinkLabel":Q.labelName,LinkTitle:Q.string,Paragraph:Q.content}),jp=new Tr(new Nt(Rp).extend(Ox),Object.keys(Ps).map(O=>Ps[O]),Object.keys(Ps).map(O=>Zp[O]),Object.keys(Ps),Kb,Sp,Object.keys(Fl).map(O=>Fl[O]),Object.keys(Fl),[]);function ix(O,e,t){let i=[];for(let r=O.firstChild,n=e;;r=r.nextSibling){let s=r?r.from:t;if(s>n&&i.push({from:n,to:s}),!r)break;n=r.to}return i}function Cp(O){let{codeParser:e,htmlParser:t}=O;return{wrap:SO((r,n)=>{let s=r.type.id;if(e&&(s==y.CodeBlock||s==y.FencedCode)){let a="";if(s==y.FencedCode){let l=r.node.getChild(y.CodeInfo);l&&(a=n.read(l.from,l.to))}let o=e(a);if(o)return{parser:o,overlay:l=>l.type.id==y.CodeText}}else if(t&&(s==y.HTMLBlock||s==y.HTMLTag||s==y.CommentBlock))return{parser:t,overlay:ix(r.node,r.from,r.to)};return null})}}var rx={resolve:"Strikethrough",mark:"StrikethroughMark"},nx={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":Q.strikethrough}},{name:"StrikethroughMark",style:Q.processingInstruction}],parseInline:[{name:"Strikethrough",parse(O,e,t){if(e!=126||O.char(t+1)!=126||O.char(t+2)==126)return-1;let i=O.slice(t-1,t),r=O.slice(t+2,t+3),n=/\s|^$/.test(i),s=/\s|^$/.test(r),a=yr.test(i),o=yr.test(r);return O.addDelimiter(rx,t,t+2,!s&&(!o||n||a),!n&&(!a||s||o))},after:"Emphasis"}]};function Xr(O,e,t=0,i,r=0){let n=0,s=!0,a=-1,o=-1,l=!1,c=()=>{i.push(O.elt("TableCell",r+a,r+o,O.parser.parseInline(e.slice(a,o),r+a)))};for(let h=t;h<e.length;h++){let f=e.charCodeAt(h);f==124&&!l?((!s||a>-1)&&n++,s=!1,i&&(a>-1&&c(),i.push(O.elt("TableDelimiter",h+r,h+r+1))),a=o=-1):(l||f!=32&&f!=9)&&(a<0&&(a=h),o=h+1),l=!l&&f==92}return a>-1&&(n++,i&&c()),n}function $p(O,e){for(let t=e;t<O.length;t++){let i=O.charCodeAt(t);if(i==124)return!0;i==92&&t++}return!1}var Gp=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,bs=class{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)&&Gp.test(r=t.text.slice(t.pos))){let n=[];Xr(e,i.content,0,n,i.start)==Xr(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",i.start,i.start+i.content.length,n),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let r=[];Xr(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}},sx={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":Q.heading}},"TableRow",{name:"TableCell",style:Q.content},{name:"TableDelimiter",style:Q.processingInstruction}],parseBlock:[{name:"Table",leaf(O,e){return $p(e.content,0)?new bs:null},endLeaf(O,e,t){if(t.parsers.some(r=>r instanceof bs)||!$p(e.text,e.basePos))return!1;let i=O.peekLine();return Gp.test(i)&&Xr(O,e.text,e.basePos)==Xr(O,i,e.basePos)},before:"SetextHeading"}]},lc=class{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}},ax={defineNodes:[{name:"Task",block:!0,style:Q.list},{name:"TaskMarker",style:Q.atom}],parseBlock:[{name:"TaskList",leaf(O,e){retu
Line truncated
|
||||
`);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=Ys.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 D(this.parser.nodeSet.types[e],gi,gi,(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(uc(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?Ip(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=uc(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(y.Paragraph,e.content.length),e.start)}elt(e,t,i,r){return typeof e=="string"?L(this.parser.getNodeType(e),t,i,r):new Zs(e,t)}get buffer(){return new vs(this.parser.nodeSet)}};function Ip(O,e,t,i,r){let n=O[e].to,s=[],a=[],o=t.from+i;function l(c,h){for(;h?c>=n:c>n;){let f=O[e+1].from-n;i+=f,c+=f,e++,n=O[e].to}}for(let c=t.firstChild;c;c=c.nextSibling){l(c.from+i,!0);let h=c.from+i,f,Q=r.get(c.tree);Q?f=Q:c.to+i>n?(f=Ip(O,e,c,i,r),l(c.to+i,!1)):f=c.toTree(),s.push(f),a.push(h-o)}return l(t.to+i,!1),new D(t.type,s,a,t.to+i-o,t.tree?t.tree.propValues:void 0)}var Yr=class O extends Jt{constructor(e,t,i,r,n,s,a,o,l){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=i,this.blockNames=r,this.endLeafBlock=n,this.skipContextMarkup=s,this.inlineParsers=a,this.inlineNames=o,this.wrappers=l,this.nodeTypes=Object.create(null);for(let c of e.types)this.nodeTypes[c.name]=c.id}createParse(e,t,i){let r=new hc(this,e,t,i);for(let n of this.wrappers)r=n(r,e,t,i);return r}configure(e){let t=fc(e);if(!t)return this;let{nodeSet:i,skipContextMarkup:r}=this,n=this.blockParsers.slice(),s=this.leafBlockParsers.slice(),a=this.blockNames.slice(),o=this.inlineParsers.slice(),l=this.inlineNames.slice(),c=this.endLeafBlock.slice(),h=this.wrappers;if(xr(t.defineNodes)){r=Object.assign({},r);let f=i.types.slice(),Q;for(let u of t.defineNodes){let{name:$,block:p,composite:m,style:g}=typeof u=="string"?{name:u}:u;if(f.some(S=>S.name==$))continue;m&&(r[f.length]=(S,x,w)=>m(x,w,S.value));let X=f.length,T=m?["Block","BlockContext"]:p?X>=y.ATXHeading1&&X<=y.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(de.define({id:X,name:$,props:T&&[[_.group,T]]})),g&&(Q||(Q={}),Array.isArray(g)||g instanceof Ne?Q[$]=g:Object.assign(Q,g))}i=new Ht(f),Q&&(i=i.extend(N(Q)))}if(xr(t.props)&&(i=i.extend(...t.props)),xr(t.remove))for(let f of t.remove){let Q=this.blockNames.indexOf(f),u=this.inlineNames.indexOf(f);Q>-1&&(n[Q]=s[Q]=void 0),u>-1&&(o[u]=void 0)}if(xr(t.parseBlock))for(let f of t.parseBlock){let Q=a.indexOf(f.name);if(Q>-1)n[Q]=f.parse,s[Q]=f.leaf;else{let u=f.before?ks(a,f.before):f.after?ks(a,f.after)+1:a.length-1;n.splice(u,0,f.parse),s.splice(u,0,f.leaf),a.splice(u,0,f.name)}f.endLeaf&&c.push(f.endLeaf)}if(xr(t.parseInline))for(let f of t.parseInline){let Q=l.indexOf(f.name);if(Q>-1)o[Q]=f.parse;else{let u=f.before?ks(l,f.before):f.after?ks(l,f.after)+1:l.length-1;o.splice(u,0,f.parse),l.splice(u,0,f.name)}}return t.wrap&&(h=h.concat(t.wrap)),new O(i,n,s,a,c,r,o,l,h)}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 Qc(this,e,t);e:for(let r=t;r<i.end;){let n=i.char(r);for(let s of this.inlineParsers)if(s){let a=s(i,n,r);if(a>=0){r=a;continue e}}r++}return i.resolveMarkers(0)}};function xr(O){return O!=null&&O.length>0}function fc(O){if(!Array.isArray(O))return O;if(O.length==0)return null;let e=fc(O[0]);if(O.length==1)return e;let t=fc(O.slice(1));if(!t||!e)return e||t;let i=(s,a)=>(s||gi).concat(a||gi),r=e.wrap,n=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?n?(s,a,o,l)=>r(n(s,a,o,l),a,o,l):r:n}}function ks(O,e){let t=O.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}var Bp=[de.none];for(let O=1,e;e=y[O];O++)Bp[O]=de.define({id:O,name:e,props:O>=y.Escape?[]:[[_.group,O in Wp?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});var gi=[],vs=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,i,r=0){return t
Line truncated
|
||||
`;)n--;this.fragmentEnd=n?n-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(_.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0),n=e.absoluteLineStart,s=n,a=e.block.children.length,o=s,l=a;for(;;){if(t.to-i>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let c=em(t.from-i,e.ranges);if(t.to-i<=e.ranges[e.rangeI].to)e.addNode(t.tree,c);else{let h=new D(e.parser.nodeSet.types[y.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,c)}if(t.type.is("Block")&&(zx.indexOf(t.type.id)<0?(s=t.to-i,a=e.block.children.length):(s=o,a=l,o=t.to-i,l=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return s-n}};function em(O,e){let t=O;for(let i=1;i<e.length;i++){let r=e[i-1].to,n=e[i].from;r<O&&(t-=n-r)}return t}var Wx=N({"Blockquote/...":d.quote,HorizontalRule:d.contentSeparator,"ATXHeading1/... SetextHeading1/...":d.heading1,"ATXHeading2/... SetextHeading2/...":d.heading2,"ATXHeading3/...":d.heading3,"ATXHeading4/...":d.heading4,"ATXHeading5/...":d.heading5,"ATXHeading6/...":d.heading6,"Comment CommentBlock":d.comment,Escape:d.escape,Entity:d.character,"Emphasis/...":d.emphasis,"StrongEmphasis/...":d.strong,"Link/... Image/...":d.link,"OrderedList/... BulletList/...":d.list,"BlockQuote/...":d.quote,"InlineCode CodeText":d.monospace,"URL Autolink":d.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":d.processingInstruction,"CodeInfo LinkLabel":d.labelName,LinkTitle:d.string,Paragraph:d.content}),tm=new Yr(new Ht(Bp).extend(Wx),Object.keys(ws).map(O=>ws[O]),Object.keys(ws).map(O=>Dp[O]),Object.keys(ws),_x,Wp,Object.keys(rc).map(O=>rc[O]),Object.keys(rc),[]);function Ux(O,e,t){let i=[];for(let r=O.firstChild,n=e;;r=r.nextSibling){let s=r?r.from:t;if(s>n&&i.push({from:n,to:s}),!r)break;n=r.to}return i}function Om(O){let{codeParser:e,htmlParser:t}=O;return{wrap:yO((r,n)=>{let s=r.type.id;if(e&&(s==y.CodeBlock||s==y.FencedCode)){let a="";if(s==y.FencedCode){let l=r.node.getChild(y.CodeInfo);l&&(a=n.read(l.from,l.to))}let o=e(a);if(o)return{parser:o,overlay:l=>l.type.id==y.CodeText}}else if(t&&(s==y.HTMLBlock||s==y.HTMLTag||s==y.CommentBlock))return{parser:t,overlay:Ux(r.node,r.from,r.to)};return null})}}var jx={resolve:"Strikethrough",mark:"StrikethroughMark"},Cx={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":d.strikethrough}},{name:"StrikethroughMark",style:d.processingInstruction}],parseInline:[{name:"Strikethrough",parse(O,e,t){if(e!=126||O.char(t+1)!=126||O.char(t+2)==126)return-1;let i=O.slice(t-1,t),r=O.slice(t+2,t+3),n=/\s|^$/.test(i),s=/\s|^$/.test(r),a=vr.test(i),o=vr.test(r);return O.addDelimiter(jx,t,t+2,!s&&(!o||n||a),!n&&(!a||s||o))},after:"Emphasis"}]};function kr(O,e,t=0,i,r=0){let n=0,s=!0,a=-1,o=-1,l=!1,c=()=>{i.push(O.elt("TableCell",r+a,r+o,O.parser.parseInline(e.slice(a,o),r+a)))};for(let h=t;h<e.length;h++){let f=e.charCodeAt(h);f==124&&!l?((!s||a>-1)&&n++,s=!1,i&&(a>-1&&c(),i.push(O.elt("TableDelimiter",h+r,h+r+1))),a=o=-1):(l||f!=32&&f!=9)&&(a<0&&(a=h),o=h+1),l=!l&&f==92}return a>-1&&(n++,i&&c()),n}function vp(O,e){for(let t=e;t<O.length;t++){let i=O.charCodeAt(t);if(i==124)return!0;i==92&&t++}return!1}var im=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,Rs=class{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)&&im.test(r=t.text.slice(t.pos))){let n=[];kr(e,i.content,0,n,i.start)==kr(e,r,t.pos)&&(this.rows=[e.elt("TableHeader",i.start,i.start+i.content.length,n),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}},Gx={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":d.heading}},"TableRow",{name:"TableCell",style:d.content},{name:"TableDelimiter",style:d.processingInstruction}],parseBlock:[{name:"Table",leaf(O,e){return vp(e.content,0)?new Rs:null},endLeaf(O,e,t){if(t.parsers.some(r=>r instanceof Rs)||!vp(e.text,e.basePos))return!1;let i=O.peekLine();return im.test(i)&&kr(O,e.text,e.basePos)==kr(O,i,e.basePos)},before:"SetextHeading"}]},pc=class{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}},Ex={defineNodes:[{name:"Task",block:!0,style:d.list},{name:"TaskMarker",style:d.atom}],parseBlock:[{name:"TaskList",leaf(O,e){retu
Line truncated
|
||||
|
||||
`,{label:"if",detail:"block",type:"keyword"}),z("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),z("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),z("import ${module}",{label:"import",detail:"statement",type:"keyword"}),z("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],sY=si(xm,kO(rY.concat(nY)));function xc(O){let{node:e,pos:t}=O,i=O.lineIndent(t,-1),r=null;for(;;){let n=e.childBefore(t);if(n)if(n.name=="Comment")t=n.from;else if(n.name=="Body"||n.name=="MatchBody")O.baseIndentFor(n)+O.unit<=i&&(r=n),e=n;else if(n.name=="MatchClause")e=n;else if(n.type.is("Statement"))e=n;else break;else break}return r}function wc(O,e){let t=O.baseIndentFor(e),i=O.lineAt(O.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&O.node.to<r+100&&!/\S/.test(O.state.sliceDoc(r,O.node.to))&&O.lineIndent(O.pos,-1)<=t||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(O.textAfter)&&O.lineIndent(O.pos,-1)>t?null:t+O.unit}var kc=oe.define({name:"python",parser:Sm.configure({props:[le.add({Body:O=>{var e;let t=/^\s*(#|$)/.test(O.textAfter)&&xc(O)||O.node;return(e=wc(O,t))!==null&&e!==void 0?e:O.continue()},MatchBody:O=>{var e;let t=xc(O);return(e=wc(O,t||O.node))!==null&&e!==void 0?e:O.continue()},IfStatement:O=>/^\s*(else:|elif )/.test(O.textAfter)?O.baseIndent:O.continue(),"ForStatement WhileStatement":O=>/^\s*else:/.test(O.textAfter)?O.baseIndent:O.continue(),TryStatement:O=>/^\s*(except[ :]|finally:|else:)/.test(O.textAfter)?O.baseIndent:O.continue(),MatchStatement:O=>/^\s*case /.test(O.textAfter)?O.baseIndent+O.unit:O.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":ye({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":ye({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":ye({closing:"]"}),MemberExpression:O=>O.baseIndent+O.unit,"String FormatString":()=>null,Script:O=>{var e;let t=xc(O);return(e=t&&wc(O,t))!==null&&e!==void 0?e:O.continue()}}),ne.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":me,Body:(O,e)=>({from:O.from+1,to:O.to-(O.to==e.doc.length?0:1)}),"String FormatString":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function wm(){return new Oe(kc,[kc.data.of({autocomplete:iY}),kc.data.of({autocomplete:sY})])}var Yc=1,aY=2,oY=3,lY=4,cY=5,hY=36,fY=37,QY=38,$Y=11,uY=13;function dY(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}function pY(O){return O==9||O==10||O==13||O==32}var km=null,Ym=null,Zm=0;function Zc(O,e){let t=O.pos+e;if(Ym==O&&Zm==t)return km;for(;pY(O.peek(e));)e++;let i="";for(;;){let r=O.peek(e);if(!dY(r))break;i+=String.fromCharCode(r),e++}return Ym=O,Zm=t,km=i||null}function vm(O,e){this.name=O,this.parent=e}var mY=new Ge({start:null,shift(O,e,t,i){return e==Yc?new vm(Zc(i,1)||"",O):O},reduce(O,e){return e==$Y&&O?O.parent:O},reuse(O,e,t,i){let r=e.type.id;return r==Yc||r==uY?new vm(Zc(i,1)||"",O):O},strict:!1}),gY=new W((O,e)=>{if(O.next==60){if(O.advance(),O.next==47){O.advance();let t=Zc(O,0);if(!t)return O.acceptToken(cY);if(e.context&&t==e.context.name)return O.acceptToken(aY);for(let i=e.context;i;i=i.parent)if(i.name==t)return O.acceptToken(oY,-2);O.acceptToken(lY)}else if(O.next!=33&&O.next!=63)return O.acceptToken(Yc)}},{contextual:!0});function vc(O,e){return new W(t=>{let i=0,r=e.charCodeAt(0);e:for(;!(t.next<0);t.advance(),i++)if(t.next==r){for(let n=1;n<e.length;n++)if(t.peek(n)!=e.charCodeAt(n))continue e;break}i&&t.acceptToken(O)})}var PY=vc(hY,"-->"),SY=vc(fY,"?>"),XY=vc(QY,"]]>"),TY=H({Text:Q.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":Q.angleBracket,TagName:Q.tagName,"MismatchedCloseTag/TagName":[Q.tagName,Q.invalid],AttributeName:Q.attributeName,AttributeValue:Q.attributeValue,Is:Q.definitionOperator,"EntityReference CharacterReference":Q.character,Comment:Q.blockComment,ProcessingInst:Q.processingInstruction,DoctypeDecl:Q.documentMeta,Cdata:Q.special(Q.string)}),Rm=se.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,
Line truncated
|
||||
`,{label:"if",detail:"block",type:"keyword"}),U("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),U("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),U("import ${module}",{label:"import",detail:"statement",type:"keyword"}),U("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],GY=lO(Em,zt(jY.concat(CY)));function Vc(O){let{node:e,pos:t}=O,i=O.lineIndent(t,-1),r=null;for(;;){let n=e.childBefore(t);if(n)if(n.name=="Comment")t=n.from;else if(n.name=="Body"||n.name=="MatchBody")O.baseIndentFor(n)+O.unit<=i&&(r=n),e=n;else if(n.name=="MatchClause")e=n;else if(n.type.is("Statement"))e=n;else break;else break}return r}function qc(O,e){let t=O.baseIndentFor(e),i=O.lineAt(O.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&O.node.to<r+100&&!/\S/.test(O.state.sliceDoc(r,O.node.to))&&O.lineIndent(O.pos,-1)<=t||/^\s*(else:|elif |except |finally:|case\s+[^=:]+:)/.test(O.textAfter)&&O.lineIndent(O.pos,-1)>t?null:t+O.unit}var zc=ne.define({name:"python",parser:Wm.configure({props:[se.add({Body:O=>{var e;let t=/^\s*(#|$)/.test(O.textAfter)&&Vc(O)||O.node;return(e=qc(O,t))!==null&&e!==void 0?e:O.continue()},MatchBody:O=>{var e;let t=Vc(O);return(e=qc(O,t||O.node))!==null&&e!==void 0?e:O.continue()},IfStatement:O=>/^\s*(else:|elif )/.test(O.textAfter)?O.baseIndent:O.continue(),"ForStatement WhileStatement":O=>/^\s*else:/.test(O.textAfter)?O.baseIndent:O.continue(),TryStatement:O=>/^\s*(except[ :]|finally:|else:)/.test(O.textAfter)?O.baseIndent:O.continue(),MatchStatement:O=>/^\s*case /.test(O.textAfter)?O.baseIndent+O.unit:O.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":ye({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":ye({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":ye({closing:"]"}),MemberExpression:O=>O.baseIndent+O.unit,"String FormatString":()=>null,Script:O=>{var e;let t=Vc(O);return(e=t&&qc(O,t))!==null&&e!==void 0?e:O.continue()}}),te.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":me,Body:(O,e)=>({from:O.from+1,to:O.to-(O.to==e.doc.length?0:1)}),"String FormatString":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function Am(){return new K(zc,[zc.data.of({autocomplete:UY}),zc.data.of({autocomplete:GY})])}var EY=36,Lm=1,AY=2,Pi=3,Wc=4,LY=5,MY=6,DY=7,IY=8,BY=9,NY=10,FY=11,HY=12,KY=13,JY=14,ev=15,tv=16,Ov=17,Mm=18,iv=19,Jm=20,eg=21,Dm=22,rv=23,nv=24;function jc(O){return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57}function sv(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function WO(O,e,t){for(let i=!1;;){if(O.next<0)return;if(O.next==e&&!i){O.advance();return}i=t&&!i&&O.next==92,O.advance()}}function av(O,e){e:for(;;){if(O.next<0)return;if(O.next==36){O.advance();for(let t=0;t<e.length;t++){if(O.next!=e.charCodeAt(t))continue e;O.advance()}if(O.next==36){O.advance();return}}else O.advance()}}function ov(O,e){let t="[{<(".indexOf(String.fromCharCode(e)),i=t<0?e:"]}>)".charCodeAt(t);for(;;){if(O.next<0)return;if(O.next==i&&O.peek(1)==39){O.advance(2);return}O.advance()}}function Cc(O,e){for(;!(O.next!=95&&!jc(O.next));)e!=null&&(e+=String.fromCharCode(O.next)),O.advance();return e}function lv(O){if(O.next==39||O.next==34||O.next==96){let e=O.next;O.advance(),WO(O,e,!1)}else Cc(O)}function Im(O,e){for(;O.next==48||O.next==49;)O.advance();e&&O.next==e&&O.advance()}function Bm(O,e){for(;;){if(O.next==46){if(e)break;e=!0}else if(O.next<48||O.next>57)break;O.advance()}if(O.next==69||O.next==101)for(O.advance(),(O.next==43||O.next==45)&&O.advance();O.next>=48&&O.next<=57;)O.advance()}function Nm(O){for(;!(O.next<0||O.next==10);)O.advance()}function zO(O,e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)==O)return!0;return!1}var Uc=` \r
|
||||
`;function tg(O,e,t){let i=Object.create(null);i.true=i.false=LY,i.null=i.unknown=MY;for(let r of O.split(" "))r&&(i[r]=Jm);for(let r of e.split(" "))r&&(i[r]=eg);for(let r of(t||"").split(" "))r&&(i[r]=nv);return i}var UO="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",jO="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",Gc={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,plsqlQuotingMechanism:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',caseInsensitiveIdentifiers:!1,words:tg(jO,UO)};function cv(O,e,t,i){let r={};for(let n in Gc)r[n]=(O.hasOwnProperty(n)?O:Gc)[n];return e&&(r.words=tg(e,t||"",i)),r}function Og(O){return new z(e=>{var t;let{next:i}=e;if(e.advance(),zO(i,Uc)){for(;zO(e.next,Uc);)e.advance();e.acceptToken(EY)}else if(i==36&&O.doubleDollarQuotedStrings){let r=Cc(e,"");e.next==36&&(e.advance(),av(e,r),e.acceptToken(Pi))}else if(i==39||i==34&&O.doubleQuotedStrings)WO(e,i,O.backslashEscapes),e.acceptToken(Pi);else if(i==35&&O.hashComments||i==47&&e.next==47&&O.slashComments)Nm(e),e.acceptToken(Lm);else if(i==45&&e.next==45&&(!O.spaceAfterDashes||e.peek(1)==32))Nm(e),e.acceptToken(Lm);else if(i==47&&e.next==42){e.advance();for(let r=1;;){let n=e.next;if(e.next<0)break;if(e.advance(),n==42&&e.next==47){if(r--,e.advance(),!r)break}else n==47&&e.next==42&&(r++,e.advance())}e.acceptToken(AY)}else if((i==101||i==69)&&e.next==39)e.advance(),WO(e,39,!0),e.acceptToken(Pi);else if((i==110||i==78)&&e.next==39&&O.charSetCasts)e.advance(),WO(e,39,O.backslashEscapes),e.acceptToken(Pi);else if(i==95&&O.charSetCasts)for(let r=0;;r++){if(e.next==39&&r>1){e.advance(),WO(e,39,O.backslashEscapes),e.acceptToken(Pi);break}if(!jc(e.next))break;e.advance()}else if(O.plsqlQuotingMechanism&&(i==113||i==81)&&e.next==39&&e.peek(1)>0&&!zO(e.peek(1),Uc)){let r=e.peek(1);e.advance(2),ov(e,r),e.acceptToken(Pi)}else if(zO(i,O.identifierQuotes)){let r=i==91?93:i;WO(e,r,!1),e.acceptToken(iv)}else if(i==40)e.acceptToken(DY);else if(i==41)e.acceptToken(IY);else if(i==123)e.acceptToken(BY);else if(i==125)e.acceptToken(NY);else if(i==91)e.acceptToken(FY);else if(i==93)e.acceptToken(HY);else if(i==59)e.acceptToken(KY);else if(O.unquotedBitLiterals&&i==48&&e.next==98)e.advance(),Im(e),e.acceptToken(Dm);else if((i==98||i==66)&&(e.next==39||e.next==34)){let r=e.next;e.advance(),O.treatBitsAsBytes?(WO(e,r,O.backslashEscapes),e.acceptToken(rv)):(Im(e,r),e.acceptToken(Dm))}else if(i==48&&(e.next==120||e.next==88)||(i==120||i==88)&&e.next==39){let r=e.next==39;for(e.advance();sv(e.next);)e.advance();r&&e.next==39&&e.advance(),e.acceptToken(Wc)}else if(i==46&&e.next>=48&&e.next<=57)Bm(e,!0),e.acceptToken(Wc);else if(i==46)e.acceptToken(JY);else if(i>=48&&i<=57)Bm(e,!1),e.acceptToken(Wc);else if(zO(i,O.operatorChars)){for(;zO(e.next,O.operatorChars);)e.advance();e.acceptToken(ev
Line truncated
|
||||
Reference in new issue
Block a user