hosp_2025/public/js/filament/forms/components/code-editor.js

39 lines
956 KiB
JavaScript
Raw Permalink Normal View History

2025-12-11 15:10:26 -04:00
var As=[],hh=[];(()=>{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?hh:As).push(t=t+O[e])})();function _g(O){if(O<768)return!1;for(let e=0,t=As.length;;){let i=e+t>>1;if(O<As[i])t=i;else if(O>=hh[i])e=i+1;else return!0;if(e==t)return!1}}function oh(O){return O>=127462&&O<=127487}var lh=8205;function fh(O,e,t=!0,i=!0){return(t?dh:Vg)(O,e,i)}function dh(O,e,t){if(e==O.length)return e;e&&uh(O.charCodeAt(e))&&Qh(O.charCodeAt(e-1))&&e--;let i=Es(O,e);for(e+=ch(i);e<O.length;){let r=Es(O,e);if(i==lh||r==lh||t&&_g(r))e+=ch(r),i=r;else if(oh(r)){let n=0,s=e-2;for(;s>=0&&oh(Es(O,s));)n++,s-=2;if(n%2==0)break;e+=2}else break}return e}function Vg(O,e,t){for(;e>0;){let i=dh(O,e-2,t);if(i<e)return i;e--}return 0}function Es(O,e){let t=O.charCodeAt(e);if(!Qh(t)||e+1==O.length)return t;let i=O.charCodeAt(e+1);return uh(i)?(t-55296<<10)+(i-56320)+65536:t}function uh(O){return O>=56320&&O<57344}function Qh(O){return O>=55296&&O<56320}function ch(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]=NO(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),DO.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]=NO(this,e,t);let i=[];return this.decompose(e,t,i,0),DO.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 uO(this),n=new uO(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 uO(this,e)}iterRange(e,t=this.length){return new Lr(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 Mr(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):DO.from(Le.split(e,[]))}},Le=class O extends G{constructor(e,t=qg(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 M
`){[e,t]=NO(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}},DO=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]=NO(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]=NO(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 u of e)i+=u.lines;if(i<32){let u=[];for(let Q of e)Q.flatten(u);return new Le(u,t)}let r=Math.max(32,i>>5),n=r<<1,s=r>>1,a=[],o=0,l=-1,c=[];function h(u){let Q;if(u.lines>n&&u instanceof O)for(let $ of u.children)h($);else u.lines>s&&(o>s||!o)?(f(),a.push(u)):u instanceof Le&&o&&(Q=c[c.length-1])instanceof Le&&u.lines+Q.lines<=32?(o+=u.lines,l+=u.length+1,c[c.length-1]=new Le(Q.text.concat(u.text),Q.length+1+u.length)):(o+u.lines>r&&f(),o+=u.lines,l+=u.length+1,c.push(u))}function f(){o!=0&&(a.push(c.length==1?c[0]:O.from(c,l)),l=-1,o=c.length=0)}for(let u of e)h(u);return f(),a.length==1?a[0]:new O(a,t)}};G.empty=new Le([""],0);function qg(O){let e=-1;for(let t of O)e+=t.length+1;return e}function Ar(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 $h(O,e,t){return Ar(O,[""],e,t)}var uO=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)}},Lr=class{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new uO(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!=""}},Mr=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()},uO.prototype[Symbol.iterator]=Lr.prototype[Symbol.iterator]=Mr.prototype[Symbol.iterator]=function(){return this});var Ms=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 NO(O,e,t){return e=Math.max(0,Math.min(O.length,e)),[e,Math.max(e,Math.min(O.length,t))]}function Qe(O,e,t=!0,i=!0){return fh(O,e,t,i)}function zg(O){return O>=56320&&O<57344}function Wg(O){return O>=55296&&O<56320}function Se(O,e){let t=O.charCodeAt(e);if(!Wg(t)||e+1==O.length)return t;let i=O.charCodeAt(e+1);return zg(i)?(t-55296<<10)+(i-56320)+65536:t}function vi(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 Ds=/\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){Is(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:Sh(this,e)}mapDesc(e,t=!1){return e.empty?this:Bs(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(kh)}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(Th))for(let s of n(this,t,i))Object.prototype.hasOwnProperty.call(s,e)&&r.push(s[e]);return r}charCategorizer(e){return Dg(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=Qe(t,s,!1);if(n(t.slice(o,s))!=J.Word)break;s=o}for(;a<r;){let o=Qe(t,a);if(n(t.slice(a,o))!=J.Word)break;a=o}return s==a?null:S.range(s+i,a+i)}};M.allowMultipleSelections=Fs;M.tabSize=v.define({combine:O=>O.length?O[0]:4});M.lineSeparator=yh;M.readOnly=kh;M.phrases=v.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=Th;M.changeFilter=bh;M.transactionFilter=xh;M.transactionExtender=wh;FO.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 wi.create(e,t,this)}};ot.prototype.startSide=ot.prototype.endSide=0;ot.prototype.point=!1;ot.prototype.mapMode=pe.TrackDel;var wi=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 ta(O,e){return O.from-e.from||O.value.startSide-e.value.startSide}var Oa=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,u;if(c==h){let Q=t.mapPos(c,l.startSide,l.mapMode);if(Q==null||(f=u=Q,l.startSide!=l.endSide&&(u=t.mapPos(c,l.endSide),u<f)))continue}else if(f=t.mapPos(c,l.startSide),u=t.mapPos(h,l.endSide),f>u||f==u&&l.startSide>0&&l.endSide<=0)continue;(u-f||l.endSide-l.startSide)<0||(s<0&&(s=f),l.point&&(a=Math.max(a,u-f)),i.push(l),r.push(f-s),n.push(u-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(ta)),this.isEmpty)return t.length?O.of(t):this;let a=new Nr(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(wi.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=Rh[Zh]||1;return Rh[Zh]=e+1,"\u037C"+e.toString(36)}static mount(e,t,i){let r=e[sa],n=i&&i.nonce;r?n&&r.setNonce(n):r=new aa(e,n),r.mount(Array.isArray(t)?t:[t],e)}},_h=new Map,aa=class{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let n=_h.get(i);if(n)return e[sa]=n;this.sheet=new r.CSSStyleSheet,_h.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[sa]=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:"'"},HO={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Bg=typeof navigator<"u"&&/Mac/.test(navigator.platform),Ng=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),HO[$e]=String.fromCharCode($e);var $e;for(Hr in Rt)HO.hasOwnProperty(Hr)||(HO[Hr]=Rt[Hr]);var Hr;function Vh(O){var e=Bg&&O.metaKey&&O.shiftKey&&!O.ctrlKey&&!O.altKey||Ng&&O.shiftKey&&O.key&&O.key.length==1||O.key=="Unidentified",t=!e&&O.key||(O.shiftKey?HO: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++)qh(O,arguments[e]);return O}function qh(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++)qh(O,e[t]);else throw new RangeError("Unsupported child node: "+e)}var Ze=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Qa=typeof document<"u"?document:{documentElement:{style:{}}},$a=/Edge\/(\d+)/.exec(Ze.userAgent),bf=/MSIE \d/.test(Ze.userAgent),pa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ze.userAgent),Yn=!!(bf||pa||$a),zh=!Yn&&/gecko\/(\d+)/i.test(Ze.userAgent),oa=!Yn&&/Chrome\/(\d+)/.exec(Ze.userAgent),Wh="webkitFontSmoothing"in Qa.documentElement.style,ma=!Yn&&/Apple Computer/.test(Ze.vendor),Uh=ma&&(/Mobile\/\w+/.test(Ze.userAgent)||Ze.maxTouchPoints>2),Y={mac:Uh||/Mac/.test(Ze.platform),windows:/Win/.test(Ze.platform),linux:/Linux|X11/.test(Ze.platform),ie:Yn,ie_version:bf?Qa.documentMode||6:pa?+pa[1]:$a?+$a[1]:0,gecko:zh,gecko_version:zh?+(/Firefox\/(\d+)/.exec(Ze.userAgent)||[0,0])[1]:0,chrome:!!oa,chrome_version:oa?+oa[1]:0,ios:Uh,android:/Android\b/.test(Ze.userAgent),webkit:Wh,webkit_version:Wh?+(/\bAppleWebKit\/(\d+)/.exec(Ze.userAgent)||[0,0])[1]:0,safari:ma,safari_version:ma?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Ze.userAgent)||[0,0])[1]:0,tabSize:Qa.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Ei(O){let e;return O.nodeType==11?e=O.getSelection?O:O.ownerDocument:e=O,e.getSelection()}function ga(O,e){return e?O==e||O.contains(e.nodeType!=1?e.parentNode:e):!1}function ln(O,e){if(!e.anchorNode)return!1;try{return ga(O,e.anchorNode)}catch{return!1}}function Ai(O){return O.nodeType==3?gO(O,0,O.nodeValue.length).getClientRects():O.nodeType==1?O.getClientRects():[]}function Vi(O,e,t,i){return t?jh(O,e,t,i,-1)||jh(O,e,t,i,1):!1}function mO(O){for(var e=0;;e++)if(O=O.previousSibling,!O)return e}function Qn(O){return O.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(O.nodeName)}function jh(O,e,t,i,r){f
`,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 YP(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 ZP(O,e,t,i){let r=e.head,n=t?1:-1;if(r==(t?O.state.doc.length:0))return S.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 u=O.viewState.lineBlockAt(r);s==null&&(s=Math.min(o.right-o.left,O.defaultCharacterWidth*(r-u.from))),a=(n<0?u.top:u.bottom)+c}let h=o.left+s,f=i??O.viewState.heightOracle.textHeight>>1;for(let u=0;;u+=10){let Q=a+(f+u)*n,$=rd(O,{x:h,y:Q},!1,n);if(Q<o.top||Q>o.bottom||(n<0?$<r:$>r)){let p=O.docView.coordsForChar($),m=!p||Q<p.top?-1:1;return S.cursor($,m,void 0,s)}}}function Ui(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 sd(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=Ui(O,r.from,0);s!=r.from&&(n=S.cursor(s,-1))}else{let s=Ui(O,r.from,-1),a=Ui(O,r.to,1);(s!=r.from||a!=r.to)&&(n=S.range(r.from==r.anchor?s:a,r.from==r.head?s:a))}n&&(t||(t=e.ranges.slice()),t[i]=n)}return t?S.create(t,e.mainIndex):e}function ca(O,e,t){let i=Ui(O.state.facet(Hi).map(r=>r(O)),t.from,e.head>t.from?-1:1);return i==t.from?t:S.cursor(i,i<t.from?1:-1)}var Zi="\uFFFF",va=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=ne.get(r),o=ne.get(s);(a&&o?a.breakAfter:(a?a.breakAfter:Qn(r))||Qn(s)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>n)&&!_P(s,t)&&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=ne.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+(RP(e,i.node,i.offset)?t:0))}};function RP(O,e,t){for(;;){if(!e||t<St(e))return!1;if(e==O)return!0;t=mO(e)+1,e=e.parentNode}}function _P(O,e){let t;for(;!(O==e||!O);O=O.nextSibling){let i=ne.get(O);if(!(i?.isWidget||O.cmIgnore))return!1;i&&(t||(t=[])).push(i)}if(t)for(let i of t){let r=i.overrideDOMText;if(r?.length)return!1}return!0}var Pn=class{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}},Ya=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?[]:qP(e),o=new va(a,e.state);o.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=o.text,this.newSel=zP(a,this.bounds.from)}else{let a=e.observer.selectionRange,o=n&&n.node==a.focusNode&&n.offset==a.focusOffset||!ga(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),l=s&&s.node==a.anchorNode
`&&O.lineWrapping&&(i&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:G.of([" "])}),t)return lo(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=sd(O.state.facet(Hi).map(o=>o(O)),i))),O.dispatch({selection:i,scrollIntoView:s,userEvent:a}),!0}else return!1}function lo(O,e,t,i=-1){if(Y.ios&&O.inputState.flushIOSKey(e))return!0;let r=O.state.selection.main;if(Y.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&&Oi(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)&&Oi(O.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Oi(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,s=-1;if(e.from==e.to&&e.from<n.from||e.from>n.to){let o=e.from<n.from?-1:1,l=o<0?n.from:n.to,c=Ui(r.facet(Hi).map(h=>h(O)),l,o);e.from==c&&(s=c)}if(s>-1)i={changes:e,selection:S.cursor(e.from+e.insert.length,-1)};else 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 o=n.from<e.from?r.sliceDoc(n.from,e.from):"",l=n.to>e.to?r.sliceDoc(e.to,n.to):"";i=r.replaceSelection(O.state.toText(o+e.insert.sliceString(0,void 0,O.state.lineBreak)+l))}else{let o=r.changes(e),l=t&&t.main.to<=o.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(O.inputState.composing>=0||O.inputState.compositionPendingChange)&&e.to<=n.to+10&&e.to>=n.to-10){let c=O.state.sliceDoc(e.from,e.to),h,f=t&&id(O,t.main.head);if(f){let Q=e.insert.length-(e.to-e.from);h={from:f.from,to:f.to-Q}}else h=O.state.doc.lineAt(n.head);let u=n.to-e.to;i=r.changeByRange(Q=>{if(Q.from==n.from&&Q.to==n.to)return{changes:o,range:l||Q.map(o)};let $=Q.to-u,p=$-c.length;if(O.state.sliceDoc(p,$)!=c||$>=h.from&&p<=h.to)return{range:Q};let m=r.changes({from:p,to:$,insert:e.insert}),g=Q.to-n.to;return{changes:m,range:l?S.range(Math.max(0,l.anchor+g),Math.max(0,l.head+g)):Q.map(m)}})}else i={changes:o,selection:l&&r.selection.replaceRange(l)}}let a="input.type";return(O.composing||O.inputState.compositionPendingChange&&O.inputState.compositionEndedAt>Date.now()-50)&&(O.inputState.compositionPendingChange=!1,a+=".compose",O.inputState.compositionFirstChange&&(a+=".start",O.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:a,scrollIntoView:!0})}function od(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 qP(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 Pn(t,i)),(r!=t||n!=i)&&e.push(new Pn(r,n))),e}function zP(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?S.single(t+e,i+e):null}var Za=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.co
`))};if((Y.mac||Y.android)&&h.from==s-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:o,insert:G.of([i.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let f=this.to-this.from+(h.to-h.from+h.insert.length);lo(e,h,S.single(this.toEditorPos(i.selectionStart,f),this.toEditorPos(i.selectionEnd,f)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],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(!/none/i.test(s)&&!/none/i.test(a)){let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);if(o<l){let c=`text-decoration: underline ${/^[a-z]/.test(s)?s+" ":s=="Dashed"?"dashed ":s=="Squiggle"?"wavy ":""}${/thin/i.test(a)?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=Ei(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
-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Na),XS={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"},fa=null;function TS(){var O;if(fa==null&&typeof document<"u"&&document.body){let e=document.body.style;fa=((O=e.tabSize)!==null&&O!==void 0?O:e.MozTabSize)!=null}return fa||!1}var dn=v.define({combine(O){let e=xe(O,{render:null,specialChars:SS,addSpecialChars:null});return(e.replaceTabs=!TS())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Na)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Na)),e}});function vd(O={}){return[dn.of(O),yS()]}var pf=null;function yS(){return pf||(pf=fe.fromClass(class{constructor(O){this.view=O,this.decorations=Z.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(O.state.facet(dn)),this.decorations=this.decorator.createDeco(O)}makeDecorator(O){return new Ba({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=Ye(s.text,a,i-s.from);return Z.replace({widget:new Ha((a-o%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[n]||(this.decorationCache[n]=Z.replace({widget:new Fa(O,n)}))},boundary:O.replaceTabs?void 0:/[^]/})}update(O){let e=O.state.facet(dn);O.startState.facet(dn)!=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 bS="\u2022";function xS(O){return O>=32?bS:O==10?"\u2424":String.fromCharCode(9216+O)}var Fa=class extends Ue{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=xS(this.code),i=e.state.phrase("Control character")+" "+(XS[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}},Ha=class extends Ue{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 Yd(){return kS}var wS=Z.line({class:"cm-activeLine"}),kS=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(wS.range(r.from)),e=r.from)}return Z.set(t)}},{decorations:O=>O.decorations});var Ka=2e3;function vS(O,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),n=[];if(e.off>Ka||t.off>Ka||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(S.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=Fr(l.text,s,O.tabSize,!0);if(c<0)n.push(S.cursor(l.to));else{let h=Fr(l.text,a,O.tabSize);n.push(S.range(l.from+c,l.from+h))}}}return n}function YS(O,e){let t=O.coordsAtPos(O.viewport.from);return t?Math.round(Math.abs((t.left-e)/O.defaultCharacterWidth)):-1}function mf(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>Ka?-1:r==i.length?YS(O,e.clientX):Ye(i.text,O.state.tabSize,t-i.from);return{line:i.number,col:n,off:r}}function ZS(O,e){let t=mf(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 Jo(this):new Ko(this)}getCursor(e,t=0,i){let r=e.doc?e:M.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?ci(this,r,t,i):li(this,r,t,i)}},as=class{constructor(e){this.spec=e}};function li(O,e,t,i){return new oO(e.doc,O.unquoted,t,i,O.caseSensitive?void 0:r=>r.toLowerCase(),O.wholeWord?aT(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function aT(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(os(r,t-n))!=J.Word||e(ls(r,t-n))!=J.Word)&&(e(ls(r,i-n))!=J.Word||e(os(r,i-n))!=J.Word))}var Ko=class extends as{constructor(e){super(e)}nextMatch(e,t,i){let r=li(this.spec,e,i,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=li(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=li(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=li(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=li(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 ci(O,e,t,i){return new Os(e.doc,O.search,{ignoreCase:!O.caseSensitive,test:O.wholeWord?oT(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function os(O,e){return O.slice(Qe(O,e,!1),e)}function ls(O,e){return O.slice(e,Qe(O,e))}function oT(O){return(e,t,i)=>!i[0].length||(O(os(i.input,i.index))!=J.Word||O(ls(i.input,i.index))!=J.Word)&&(O(ls(i.input,i.index+i[0].length))!=J.Word||O(os(i.input,i.index+i[0].length))!=J.Word)}var Jo=class extends as{nextMatch(e,t,i){let r=ci(this.spec,e,i,e.doc.length).next();return r.done&&(r=ci(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=ci(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=ci(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=ci(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)}},ur=V.define(),il=V.define(),aO=he.define({create(O){return new dr(el(O).create(),null)},update(O,e){for(let t of e.effects)t.is(ur)?O=new dr(t.value.create(),O.panel):t.is(il)&&(O=new dr(O.query,t.value?rl:null));return O},provide:O=>SO.from(O,e=>e.panel)});var dr=class{constructor(e,t){this.query=e,this.panel=t}},lT=Z.mark({class:"cm-searchMatch"}),cT=Z.mark({class:"cm-searchMatch cm-searchMatch-selected"}),hT=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.stat
\${}
}`,{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"}),U('import ${name} "${module}"\n${}',{label:"import",detail:"declaration",type:"keyword"})],Y$=new yt,R$=new Set(["SourceFile","Block","FunctionDecl","MethodDecl","FunctionLiteral","ForStatement","SwitchStatement","TypeSwitchStatement","IfStatement"]);function $i(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 Ob={FunctionDecl:$i("function"),VarDecl:$i("var","VarSpec"),ConstDecl:$i("constant","ConstSpec"),TypeDecl:$i("type","TypeSpec"),ImportDecl:$i("constant","ImportSpec"),Parameter:$i("var"),__proto__:null};function _$(O,e){let t=Y$.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=Ob[s.name];if(a&&a(s,n)||R$.has(s.name))return!1}else if(s.to-s.from>8192){for(let a of _$(O,s.node))i.push(a);return!1}}),Y$.set(e,i),i}var Z$=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,V$=["String","LineComment","BlockComment","DefName","LabelName","FieldName",".","?."],ib=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&&Z$.test(O.state.sliceDoc(e.from,e.to));if(!t&&!O.explicit)return null;let i=[];for(let r=e;r;r=r.parent)R$.has(r.name)&&(i=i.concat(_$(O.state.doc,r)));return{options:i,from:t?e.from:O.pos,validFor:Z$}},El=se.define({name:"go",parser:v$.configure({props:[ae.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|\})$/}}),rb=O=>({label:O,type:"keyword"}),nb="interface struct chan map package go return break continue goto fallthrough else defer range true false nil".split(" ").map(rb);function q$(){let O=tb.concat(nb);return new K(El,[El.data.of({autocomplete:lO(V$,zt(O))}),El.data.of({autocomplete:ib})])}var sb=55,ab=1,ob=56,lb=2,cb=57,hb=3,z$=4,fb=5,Il=6,L$=7,M$=8,D$=9,I$=10,db=11,ub=12,Qb=13,Al=58,$b=14,pb=15,W$=59,B$=21,mb=23,N$=24,gb=25,Ml=27,F$=28,Pb=29,Sb=32,Xb=35,Tb=37,yb=38,bb=0,xb=1,wb={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},kb={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},U$={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 vb(O){return O==45||O==46||O==58||O>=65&&O<=90||O==95||O>=97&&O<=122||O>=161}var j$=null,C$=null,G$=0;function Dl(O,e){let t=O.pos+e;if(G$==t&&C$==O)return j$;let i=O.peek(e),r="";for(;vb(i);)r+=String.fromCharCode(i),i=O.peek(++e);return C$=O,G$=t,j$=r?r.toLowerCase():i==Yb||i==Zb?void 0:null}var H$=60,ys=62,Bl=47,Yb=63,Zb=33,Rb=45;function E$(O,e){this.name=O,this.parent=e}var _b=[Il,I$,L$,M$,D$],Vb=new Ee({start:null,shift(O,e,t,i){return _b.indexOf(e)>-1?new E$(Dl(i,1)||"",O):O},reduce(O,e){return e==B$&&O?O.parent:O},reuse(O,e,t,i){let r=e.type.id;return r==Il||r==Tb?new E$(Dl(i,1)||"",O):O},strict:!1}),qb=new z((O,e)=>{if(O.next!=H$){O.next<0&&e.contex
\${}
} catch (\${error}) {
\${}
}`,{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"}),U(`class \${name} {
constructor(\${params}) {
\${}
}
}`,{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"})],gx=sp.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"})]),ip=new yt,ap=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function br(O){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,O),!0}}var Px=["FunctionDeclaration"],Sx={FunctionDeclaration:br("function"),ClassDeclaration:br("class"),ClassExpression:()=>!0,EnumDeclaration:br("constant"),TypeAliasDeclaration:br("type"),NamespaceDeclaration:br("namespace"),VariableDefinition(O,e){O.matchContext(Px)||e(O,"variable")},TypeDefinition(O,e){e(O,"type")},__proto__:null};function op(O,e){let t=ip.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=Sx[s.name];if(a&&a(s,n)||ap.has(s.name))return!1}else if(s.to-s.from>8192){for(let a of op(O,s.node))i.push(a);return!1}}),ip.set(e,i),i}var rp=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,lp=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function Xx(O){let e=W(O.state).resolveInner(O.pos,-1);if(lp.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&rp.test(O.state.sliceDoc(e.from,e.to));if(!t&&!O.explicit)return null;let i=[];for(let r=e;r;r=r.parent)ap.has(r.name)&&(i=i.concat(op(O.state.doc,r)));return{options:i,from:t?e.from:O.pos,validFor:rp}}var ut=se.define({name:"javascript",parser:Op.configure({props:[ae.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:"$"}}),cp={test:O=>/^JSX/.test(O.name),facet:sr({commentTokens:{block:{open:"{/*",close:"*/}"}}})},ec=ut.configure({dialect:"ts"},"typescript"),tc=ut.configure({dialect:"jsx",props:[Ln.add(O=>O.isTop?[cp]:void 0)]}),Oc=ut.configure({dialect:"jsx ts",props:[Ln.add(O=>O.isTop?[cp]:void 0)]},"typescript"),hp=O=>({label:O,type:"keyword"}),fp="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(hp),Tx=fp.concat(["declare","implements","private","protected","public"].map(hp));function bs(O={}){let e=O.jsx?O.typescript?Oc:tc:O.typescript?ec:ut,t=O.typescript?gx.concat(Tx):sp.concat(fp);return new K(e,[ut.data.of({autocomplete:lO(lp,zt(t))}),ut.data.of({autocomplete:Xx}),O.jsx?xx:[]])}function yx(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.pa
`+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)&&kr(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,i){return e.addLeafElement(t,L(b.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(Om(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(L(b.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(em(e,kr(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=kr(e,this.pos),i=0;if(t>this.pos){let r=tm(e,t,this.start);if(r){let n=ac(e,r.to-this.start);n>0&&(this.nextStage(r),i=n)}}return i||(i=ac(e,this.pos)),i>0&&i<e.length?i:-1}else return ac(e,this.pos)}}};function ac(O,e){for(;e<O.length;e++){let t=O.charCodeAt(e);if(t==10)break;if(!at(t))return-1}return e}var uc=class{nextLine(e,t,i){let r=t.depth<e.stack.length?-1:Mp(t),n=t.next;if(r<0)return!1;let s=L(b.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(i,L(n==61?b.SetextHeading1:b.SetextHeading2,i.start,e.prevLineEnd(),[...e.parser.parseInline(i.content,i.start),s])),!0}finish(){return!1}},Np={LinkReference(O,e){return e.content.charCodeAt(0)==91?new dc(e):null},SetextHeading(){return new uc}},jx=[(O,e)=>Lp(e)>=0,(O,e)=>Gp(e)>=0,(O,e)=>Ep(e)>=0,(O,e)=>Sc(e,O,!0)>=0,(O,e)=>Xc(e,O,!0)>=0,(O,e)=>Pc(e,O,!0)>=0,(O,e)=>Bp(e,O,!0)>=0],Cx={text:"",end:0},Qc=class{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.line=new cc,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=vs.create(b.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=i.length?new mc(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 lc(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=im(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=Cx;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 "+b[r.type]);let s=this.line.markers.length;if(!n(r,this,e)){this.line.markers.length>s&&(r.end=this.line.markers[this.line.markers.length-1].to);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=vs.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],Pi,Pi,(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(pc(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?Fp(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=pc(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(b.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 Ys(this.parser.nodeSet)}};function Fp(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,u=r.get(c.tree);u?f=u:c.to+i>n?(f=Fp(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 Qc(this,e,t,i);for(let n of this.wrappers)r=n(r,e,t,i);return r}configure(e){let t=$c(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(wr(t.defineNodes)){r=Object.assign({},r);let f=i.types.slice(),u;for(let Q of t.defineNodes){let{name:$,block:p,composite:m,style:g}=typeof Q=="string"?{name:Q}:Q;if(f.some(X=>X.name==$))continue;m&&(r[f.length]=(X,x,w)=>m(x,w,X.value));let P=f.length,T=m?["Block","BlockContext"]:p?P>=b.ATXHeading1&&P<=b.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;f.push(de.define({id:P,name:$,props:T&&[[_.group,T]]})),g&&(u||(u={}),Array.isArray(g)||g instanceof Ne?u[$]=g:Object.assign(u,g))}i=new Ht(f),u&&(i=i.extend(N(u)))}if(wr(t.props)&&(i=i.extend(...t.props)),wr(t.remove))for(let f of t.remove){let u=this.blockNames.indexOf(f),Q=this.inlineNames.indexOf(f);u>-1&&(n[u]=s[u]=void 0),Q>-1&&(o[Q]=void 0)}if(wr(t.parseBlock))for(let f of t.parseBlock){let u=a.indexOf(f.name);if(u>-1)n[u]=f.parse,s[u]=f.leaf;else{let Q=f.before?ks(a,f.before):f.after?ks(a,f.after)+1:a.length-1;n.splice(Q,0,f.parse),s.splice(Q,0,f.leaf),a.splice(Q,0,f.name)}f.endLeaf&&c.push(f.endLeaf)}if(wr(t.parseInline))for(let f of t.parseInline){let u=l.indexOf(f.name);if(u>-1)o[u]=f.parse;else{let Q=f.before?ks(l,f.before):f.after?ks(l,f.after)+1:l.length-1;o.splice(Q,0,f.parse),l.splice(Q,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 Rr(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(_.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=im(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[b.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(h,t.tree),e.addNode(h,c)}if(t.type.is("Block")&&(Ex.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 im(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 Ax=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}),rm=new Yr(new Ht(Hp).extend(Ax),Object.keys(ws).map(O=>ws[O]),Object.keys(ws).map(O=>Np[O]),Object.keys(ws),jx,Cp,Object.keys(oc).map(O=>oc[O]),Object.keys(oc),[]);function Lx(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 nm(O){let{codeParser:e,htmlParser:t}=O;return{wrap:bO((r,n)=>{let s=r.type.id;if(e&&(s==b.CodeBlock||s==b.FencedCode)){let a="";if(s==b.FencedCode){let l=r.node.getChild(b.CodeInfo);l&&(a=n.read(l.from,l.to))}let o=e(a);if(o)return{parser:o,overlay:l=>l.type.id==b.CodeText}}else if(t&&(s==b.HTMLBlock||s==b.HTMLTag||s==b.CommentBlock))return{parser:t,overlay:Lx(r.node,r.from,r.to)};return null})}}var Mx={resolve:"Strikethrough",mark:"StrikethroughMark"},Dx={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=Zr.test(i),o=Zr.test(r);return O.addDelimiter(Mx,t,t+2,!s&&(!o||n||a),!n&&(!a||s||o))},after:"Emphasis"}]};function vr(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 sm=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,_s=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)&&sm.test(r=t.text.slice(t.pos))){let n=[];vr(e,i.content,0,n,i.start)==vr(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=[];vr(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"}),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"})],Fv=lO(Mm,zt(Bv.concat(Nv)));function qc(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 zc(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 Wc=se.define({name:"python",parser:Cm.configure({props:[ae.add({Body:O=>{var e;let t=/^\s*(#|$)/.test(O.textAfter)&&qc(O)||O.node;return(e=zc(O,t))!==null&&e!==void 0?e:O.continue()},MatchBody:O=>{var e;let t=qc(O);return(e=zc(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=qc(O);return(e=t&&zc(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 Dm(){return new K(Wc,[Wc.data.of({autocomplete:Iv}),Wc.data.of({autocomplete:Fv})])}var Hv=36,Im=1,Kv=2,Si=3,Uc=4,Jv=5,eY=6,tY=7,OY=8,iY=9,rY=10,nY=11,sY=12,aY=13,oY=14,lY=15,cY=16,hY=17,Bm=18,fY=19,Og=20,ig=21,Nm=22,dY=23,uY=24;function Cc(O){return O>=65&&O<=90||O>=97&&O<=122||O>=48&&O<=57}function QY(O){return O>=48&&O<=57||O>=97&&O<=102||O>=65&&O<=70}function CO(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 $Y(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 pY(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 Gc(O,e){for(;!(O.next!=95&&!Cc(O.next));)e!=null&&(e+=String.fromCharCode(O.next)),O.advance();return e}function mY(O){if(O.next==39||O.next==34||O.next==96){let e=O.next;O.advance(),CO(O,e,!1)}else Gc(O)}function Fm(O,e){for(;O.next==48||O.next==49;)O.advance();e&&O.next==e&&O.advance()}function Hm(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 Km(O){for(;!(O.next<0||O.next==10);)O.advance()}function jO(O,e){for(let t=0;t<e.length;t++)if
`;function rg(O,e,t){let i=Object.create(null);i.true=i.false=Jv,i.null=i.unknown=eY;for(let r of O.split(" "))r&&(i[r]=Og);for(let r of e.split(" "))r&&(i[r]=ig);for(let r of(t||"").split(" "))r&&(i[r]=uY);return i}var GO="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 ",EO="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 ",Ec={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:rg(EO,GO)};function gY(O,e,t,i){let r={};for(let n in Ec)r[n]=(O.hasOwnProperty(n)?O:Ec)[n];return e&&(r.words=rg(e,t||"",i)),r}function ng(O){return new z(e=>{var t;let{next:i}=e;if(e.advance(),jO(i,jc)){for(;jO(e.next,jc);)e.advance();e.acceptToken(Hv)}else if(i==36&&O.doubleDollarQuotedStrings){let r=Gc(e,"");e.next==36&&(e.advance(),$Y(e,r),e.acceptToken(Si))}else if(i==39||i==34&&O.doubleQuotedStrings)CO(e,i,O.backslashEscapes),e.acceptToken(Si);else if(i==35&&O.hashComments||i==47&&e.next==47&&O.slashComments)Km(e),e.acceptToken(Im);else if(i==45&&e.next==45&&(!O.spaceAfterDashes||e.peek(1)==32))Km(e),e.acceptToken(Im);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(Kv)}else if((i==101||i==69)&&e.next==39)e.advance(),CO(e,39,!0),e.acceptToken(Si);else if((i==110||i==78)&&e.next==39&&O.charSetCasts)e.advance(),CO(e,39,O.backslashEscapes),e.acceptToken(Si);else if(i==95&&O.charSetCasts)for(let r=0;;r++){if(e.next==39&&r>1){e.advance(),CO(e,39,O.backslashEscapes),e.acceptToken(Si);break}if(!Cc(e.next))break;e.advance()}else if(O.plsqlQuotingMechanism&&(i==113||i==81)&&e.next==39&&e.peek(1)>0&&!jO(e.peek(1),jc)){let r=e.peek(1);e.advance(2),pY(e,r),e.acceptToken(Si)}else if(jO(i,O.identifierQuotes)){let r=i==91?93:i;CO(e,r,!1),e.ac