mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-05-16 21:27:36 +08:00
38 lines
920 KiB
JavaScript
38 lines
920 KiB
JavaScript
|
|
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 _
|
||
|
|
`){[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?"
|
||
|
|
`}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,filter
|
||
|
|
`)}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
|
||
|
|
`,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||
|
||
|
|
`&&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("
|
||
|
|
`))};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
|
||
|
|
-\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
|
||
|
|
`: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?S1(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function S1(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?X1(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 X1(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}},T1=v.mark({class:"cm-searchMatch"}),y1=v.mark({class:"cm-searchMatch cm-searchMatch-selected"}),b1=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.stat
|
||
|
|
\${}
|
||
|
|
}`,{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 \${} {
|
||
|
|
\${}
|
||
|
|
} 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)
|
||
|
|
\${}
|
||
|
|
} catch (\${error}) {
|
||
|
|
\${}
|
||
|
|
}`,{label:"try",detail:"/ catch block",type:"keyword"}),z("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),z(`if (\${}) {
|
||
|
|
\${}
|
||
|
|
} else {
|
||
|
|
\${}
|
||
|
|
}`,{label:"if",detail:"/ else block",type:"keyword"}),z(`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.p
|
||
|
|
`+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==`
|
||
|
|
`?"":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.resolv
|
||
|
|
`;)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 t
|
||
|
|
|
||
|
|
`,{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.inval
|