/** * name: vite-plugin-vue-preview * version: v1.2.4 * description: a vite plugin for vue preview in markdown * author: liting * homepage: https://vite-plugin-vue-preview.netlify.app */ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const M=require("vue"),jn=require("vue/compiler-sfc");function Sy(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const qu=Sy(jn),ky="```vue preview",by="```";function wy(n,e){var s,r,o;n=n.match(new RegExp("(?<=(```vue preview))(.)*(?=(```))","gims"))[0].trim();const t=encodeURIComponent(n);let i="";return(s=e==null?void 0:e.props)!=null&&s.previewBodyStyle&&(i+=` previewBodyStyle="${encodeURIComponent(JSON.stringify(e.props.previewBodyStyle))}"`),(r=e==null?void 0:e.props)!=null&&r.previewAppStyle&&(i+=` previewAppStyle="${encodeURIComponent(JSON.stringify(e.props.previewAppStyle))}"`),(o=e==null?void 0:e.props)!=null&&o.importMap&&(i+=` importMap="${encodeURIComponent(JSON.stringify(e.props.importMap))}"`),n.trim()?` `:` `}function zd(n){return{name:"vite-plugin-vue-preview",transform(e,t){if(!t.endsWith(".md")||!/```vue preview/i.test(e))return e;let i,s;for(;/```vue preview/.test(e);){i=e.indexOf(ky),s=e.indexOf(by,i+1);const r=e.slice(i,s+3);e=e.replace(r,wy(r,n))}return e}}}const Gd=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t};class Ce{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){let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),dn.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),dn.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),s=new Vs(this),r=new Vs(e);for(let o=t,a=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(a+=s.value.length,s.done||a>=i)return!0}}iter(e=1){return new Vs(this,e)}iterRange(e,t=this.length){return new Hd(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Jd(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]?Ce.empty:e.length<=32?new Ke(e):dn.from(Ke.split(e,[]))}}class Ke extends Ce{constructor(e,t=xy(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],a=s+o.length;if((t?i:a)>=e)return new vy(s,a,i,o);s=a+1,i++}}decompose(e,t,i,s){let r=e<=0&&t>=this.length?this:new Ke(Vu(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=i.pop(),a=to(r.text,o.text.slice(),0,r.length);if(a.length<=32)i.push(new Ke(a,o.length+r.length));else{let c=a.length>>1;i.push(new Ke(a.slice(0,c)),new Ke(a.slice(c)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof Ke))return super.replace(e,t,i);let s=to(this.text,to(i.text,Vu(this.text,0,e)),t),r=this.length+i.length-(t-e);return s.length<=32?new Ke(s,r):dn.from(Ke.split(s,[]),r)}sliceString(e,t=this.length,i=` `){let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=i),er&&(s+=a.slice(Math.max(0,e-r),t-r)),r=c+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new Ke(i,s)),i=[],s=-1);return s>-1&&t.push(new Ke(i,s)),t}}class dn extends Ce{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,s){for(let r=0;;r++){let o=this.children[r],a=s+o.length,c=i+o.lines-1;if((t?c:a)>=e)return o.lineInner(e,t,i,s);s=a+1,i=c+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r=o){let h=s&((o<=e?1:0)|(c>=t?2:0));o>=e&&c<=t&&!h?i.push(a):a.decompose(e-o,t-o,i,h)}o=c+1}}replace(e,t,i){if(i.lines=r&&t<=a){let c=o.replace(e-r,t-r,i),h=this.lines-o.lines+c.lines;if(c.lines>5-1&&c.lines>h>>5+1){let u=this.children.slice();return u[s]=c,new dn(u,this.length-(t-e)+i.length)}return super.replace(r,a,c)}r=a+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` `){let s="";for(let r=0,o=0;re&&r&&(s+=i),eo&&(s+=a.sliceString(e-o,t-o,i)),o=c+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof dn))return 0;let i=0,[s,r,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==a)return i;let c=this.children[s],h=e.children[r];if(c!=h)return i+c.scanIdentical(h,t);i+=c.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let m of e)i+=m.lines;if(i<32){let m=[];for(let O of e)O.flatten(m);return new Ke(m,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,a=[],c=0,h=-1,u=[];function f(m){let O;if(m.lines>r&&m instanceof dn)for(let k of m.children)f(k);else m.lines>o&&(c>o||!c)?(p(),a.push(m)):m instanceof Ke&&c&&(O=u[u.length-1])instanceof Ke&&m.lines+O.lines<=32?(c+=m.lines,h+=m.length+1,u[u.length-1]=new Ke(O.text.concat(m.text),O.length+1+m.length)):(c+m.lines>s&&p(),c+=m.lines,h+=m.length+1,u.push(m))}function p(){c!=0&&(a.push(u.length==1?u[0]:dn.from(u,h)),h=-1,c=u.length=0)}for(let m of e)f(m);return p(),a.length==1?a[0]:new dn(a,t)}}Ce.empty=new Ke([""],0);function xy(n){let e=-1;for(let t of n)e+=t.length+1;return e}function to(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r=t&&(c>i&&(a=a.slice(0,i-s)),s0?1:(e instanceof Ke?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,a=s instanceof Ke?s.text.length:s.children.length;if(o==(t>0?a:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` `,this;e--}else if(s instanceof Ke){let c=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,c.length>Math.max(0,e))return this.value=e==0?c:t>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=s.children[o+(t<0?-1:0)];e>c.length?(e-=c.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(c),this.offsets.push(t>0?1:(c instanceof Ke?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Hd{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Vs(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:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Jd{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Ce.prototype[Symbol.iterator]=function(){return this.iter()},Vs.prototype[Symbol.iterator]=Hd.prototype[Symbol.iterator]=Jd.prototype[Symbol.iterator]=function(){return this});class vy{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}let zi="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(n=>n?parseInt(n,36):1);for(let n=1;nn)return zi[e-1]<=n;return!1}function Lu(n){return n>=127462&&n<=127487}const Wu=8205;function bt(n,e,t=!0,i=!0){return(t?Kd:Py)(n,e,i)}function Kd(n,e,t){if(e==n.length)return e;e&&ep(n.charCodeAt(e))&&tp(n.charCodeAt(e-1))&&e--;let i=ft(n,e);for(e+=Vt(i);e=0&&Lu(ft(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Py(n,e,t){for(;e>0;){let i=Kd(n,e-2,t);if(i=56320&&n<57344}function tp(n){return n>=55296&&n<56320}function ft(n,e){let t=n.charCodeAt(e);if(!tp(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return ep(i)?(t-55296<<10)+(i-56320)+65536:t}function Ph(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Vt(n){return n<65536?1:2}const rc=/\r\n?|\n/;var pt=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(pt||(pt={}));class Sn{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=a}else{if(i!=pt.Simple&&h>=e&&(i==pt.TrackDel&&se||i==pt.TrackBefore&&se))return null;if(h>e||h==e&&t<0&&!a)return e==s||t<0?r:r+c;r+=c}s=h}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i=0&&s<=t&&a>=e)return st?"cover":!0;s=a}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Sn(e)}static create(e){return new Sn(e)}}class it extends Sn{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return oc(this,(t,i,s,r,o)=>e=e.replace(s,s+(i-t),o),!1),e}mapDesc(e,t=!1){return ac(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let s=0,r=0;s=0){t[s]=a,t[s+1]=o;let c=s>>1;for(;i.length0&&Fn(i,t,r.text),r.forward(u),a+=u}let h=e[o++];for(;a>1].toJSON()))}return e}static of(e,t,i){let s=[],r=[],o=0,a=null;function c(u=!1){if(!u&&!s.length)return;op||f<0||p>t)throw new RangeError(`Invalid change range ${f} to ${p} (in doc of length ${t})`);let O=m?typeof m=="string"?Ce.of(m.split(i||rc)):m:Ce.empty,k=O.length;if(f==p&&k==0)return;fo&&yt(s,f-o,-1),yt(s,p-f,k),Fn(r,s,O),o=p}}return h(e),c(!a),a}static empty(e){return new it(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let s=0;sa&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==n[s+1]?n[s]+=e:e==0&&n[s]==0?n[s+1]+=t:i?(n[s]+=e,n[s+1]+=t):n.push(e,t)}function Fn(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)a=n.sections[o++],c=n.sections[o++];e(s,h,r,u,f),s=h,r=u}}}function ac(n,e,t,i=!1){let s=[],r=i?[]:null,o=new Bs(n),a=new Bs(e);for(let c=-1;;)if(o.ins==-1&&a.ins==-1){let h=Math.min(o.len,a.len);yt(s,h,-1),o.forward(h),a.forward(h)}else if(a.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(a.len=0&&c=0){let h=0,u=o.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);h+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.lenc||o.ins>=0&&o.len>c)&&(a||i.length>h),r.forward2(c),o.forward(c)}}}}class Bs{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?Ce.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?Ce.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class yi{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&16?this.to:this.from}get head(){return this.flags&16?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&4?-1:this.flags&8?1:0}get bidiLevel(){let e=this.flags&3;return e==3?null:e}get goalColumn(){let e=this.flags>>5;return e==33554431?void 0:e}map(e,t=-1){let i,s;return this.empty?i=s=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),i==this.from&&s==this.to?this:new yi(i,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return q.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return q.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return q.range(e.anchor,e.head)}static create(e,t,i){return new yi(e,t,i)}}class q{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:q.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new q(e.ranges.map(t=>yi.fromJSON(t)),e.main)}static single(e,t=e){return new q([q.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,s=0;se?4:0)|r)}static normalized(e,t=0){let i=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(i);for(let s=1;sr.head?q.range(c,a):q.range(a,c))}}return new q(e,t)}}function ip(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let _h=0;class ee{constructor(e,t,i,s,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=s,this.id=_h++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}static define(e={}){return new ee(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:$h),!!e.static,e.enables)}of(e){return new no([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new no(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new no(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function $h(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class no{constructor(e,t,i,s){this.dependencies=e,this.facet=t,this.type=i,this.value=s,this.id=_h++}dynamicSlot(e){var t;let i=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,a=this.type==2,c=!1,h=!1,u=[];for(let f of this.dependencies)f=="doc"?c=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||u.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,p){if(c&&p.docChanged||h&&(p.docChanged||p.selection)||lc(f,u)){let m=i(f);if(a?!ju(m,f.values[o],s):!s(m,f.values[o]))return f.values[o]=m,1}return 0},reconfigure:(f,p)=>{let m,O=p.config.address[r];if(O!=null){let k=ko(p,O);if(this.dependencies.every(y=>y instanceof ee?p.facet(y)===f.facet(y):y instanceof ct?p.field(y,!1)==f.field(y,!1):!0)||(a?ju(m=i(f),k,s):s(m=i(f),k)))return f.values[o]=k,0}else m=i(f);return f.values[o]=m,1}}}}function ju(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[c.id]),s=t.map(c=>c.type),r=i.filter(c=>!(c&1)),o=n[e.id]>>1;function a(c){let h=[];for(let u=0;ui===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Uu).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,s)=>{let r=i.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,s)=>s.config.address[this.id]!=null?(i.values[t]=s.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Uu.of({field:this,create:e})]}get extension(){return this}}const pi={lowest:4,low:3,default:2,high:1,highest:0};function xs(n){return e=>new sp(e,n)}const Ti={highest:xs(pi.highest),high:xs(pi.high),default:xs(pi.default),low:xs(pi.low),lowest:xs(pi.lowest)};class sp{constructor(e,t){this.inner=e,this.prec=t}}class is{of(e){return new cc(this,e)}reconfigure(e){return is.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class cc{constructor(e,t){this.compartment=e,this.inner=t}}class So{constructor(e,t,i,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let s=[],r=Object.create(null),o=new Map;for(let p of $y(e,t,o))p instanceof ct?s.push(p):(r[p.facet.id]||(r[p.facet.id]=[])).push(p);let a=Object.create(null),c=[],h=[];for(let p of s)a[p.id]=h.length<<1,h.push(m=>p.slot(m));let u=i==null?void 0:i.config.facets;for(let p in r){let m=r[p],O=m[0].facet,k=u&&u[p]||[];if(m.every(y=>y.type==0))if(a[O.id]=c.length<<1|1,$h(k,m))c.push(i.facet(O));else{let y=O.combine(m.map(S=>S.value));c.push(i&&O.compare(y,i.facet(O))?i.facet(O):y)}else{for(let y of m)y.type==0?(a[y.id]=c.length<<1|1,c.push(y.value)):(a[y.id]=h.length<<1,h.push(S=>y.dynamicSlot(S)));a[O.id]=h.length<<1,h.push(y=>_y(y,O,m))}}let f=h.map(p=>p(a));return new So(e,o,f,a,c,r)}}function $y(n,e,t){let i=[[],[],[],[],[]],s=new Map;function r(o,a){let c=s.get(o);if(c!=null){if(c<=a)return;let h=i[c].indexOf(o);h>-1&&i[c].splice(h,1),o instanceof cc&&t.delete(o.compartment)}if(s.set(o,a),Array.isArray(o))for(let h of o)r(h,a);else if(o instanceof cc){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,a)}else if(o instanceof sp)r(o.inner,o.prec);else if(o instanceof ct)i[a].push(o),o.provides&&r(o.provides,a);else if(o instanceof no)i[a].push(o),o.facet.extensions&&r(o.facet.extensions,pi.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,a)}}return r(n,pi.default),i.reduce((o,a)=>o.concat(a))}function Ls(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let s=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|s}function ko(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const rp=ee.define(),op=ee.define({combine:n=>n.some(e=>e),static:!0}),ap=ee.define({combine:n=>n.length?n[0]:void 0,static:!0}),lp=ee.define(),cp=ee.define(),hp=ee.define(),up=ee.define({combine:n=>n.length?n[0]:!1});class Nn{constructor(e,t){this.type=e,this.value=t}static define(){return new Ty}}class Ty{of(e){return new Nn(this,e)}}class Cy{constructor(e){this.map=e}of(e){return new we(this,e)}}class we{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new we(this.type,t)}is(e){return this.type==e}static define(e={}){return new Cy(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let s of e){let r=s.map(t);r&&i.push(r)}return i}}we.reconfigure=we.define();we.appendConfig=we.define();class st{constructor(e,t,i,s,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&ip(i,t.newLength),r.some(a=>a.type==st.time)||(this.annotations=r.concat(st.time.of(Date.now())))}static create(e,t,i,s,r,o){return new st(e,t,i,s,r,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(st.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}st.time=Nn.define();st.userEvent=Nn.define();st.addToHistory=Nn.define();st.remote=Nn.define();function Ay(n,e){let t=[];for(let i=0,s=0;;){let r,o;if(i=n[i]))r=n[i++],o=n[i++];else if(s=0;s--){let r=i[s](n);r instanceof st?n=r:Array.isArray(r)&&r.length==1&&r[0]instanceof st?n=r[0]:n=dp(e,Gi(r),!1)}return n}function Ry(n){let e=n.startState,t=e.facet(hp),i=n;for(let s=t.length-1;s>=0;s--){let r=t[s](n);r&&Object.keys(r).length&&(i=fp(i,hc(e,r,n.changes.newLength),!0))}return i==n?n:st.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const Xy=[];function Gi(n){return n==null?Xy:Array.isArray(n)?n:[n]}var We=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(We||(We={}));const Ey=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let uc;try{uc=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Zy(n){if(uc)return uc.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||Ey.test(t)))return!0}return!1}function My(n){return e=>{if(!/\S/.test(e))return We.Space;if(Zy(e))return We.Word;for(let t=0;t-1)return We.Word;return We.Other}}class _e{constructor(e,t,i,s,r,o){this.config=e,this.doc=t,this.selection=i,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let a=0;as.set(c,a)),t=null),s.set(o.value.compartment,o.value.extension)):o.is(we.reconfigure)?(t=null,i=o.value):o.is(we.appendConfig)&&(t=null,i=Gi(i).concat(o.value));let r;t?r=e.startState.values.slice():(t=So.resolve(i,s,this),r=new _e(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,c)=>c.reconfigure(a,this),null).values),new _e(t,e.newDoc,e.newSelection,r,(o,a)=>a.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:q.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),s=this.changes(i.changes),r=[i.range],o=Gi(i.effects);for(let a=1;ao.spec.fromJSON(a,c)))}}return _e.create({doc:e.doc,selection:q.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=So.resolve(e.extensions||[],new Map),i=e.doc instanceof Ce?e.doc:Ce.of((e.doc||"").split(t.staticFacet(_e.lineSeparator)||rc)),s=e.selection?e.selection instanceof q?e.selection:q.single(e.selection.anchor,e.selection.head):q.single(0);return ip(s,i.length),t.staticFacet(op)||(s=s.asSingle()),new _e(t,i,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(_e.tabSize)}get lineBreak(){return this.facet(_e.lineSeparator)||` `}get readOnly(){return this.facet(up)}phrase(e,...t){for(let i of this.facet(_e.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(rp))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return My(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,a=e-i;for(;o>0;){let c=bt(t,o,!1);if(r(t.slice(c,o))!=We.Word)break;o=c}for(;an.length?n[0]:4});_e.lineSeparator=ap;_e.readOnly=up;_e.phrases=ee.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});_e.languageData=rp;_e.changeFilter=lp;_e.transactionFilter=cp;_e.transactionExtender=hp;is.reconfigure=we.define();function _n(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],a=i[r];if(a===void 0)i[r]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](a,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class bi{eq(e){return this==e}range(e,t=e){return fc.create(e,t,this)}}bi.prototype.startSide=bi.prototype.endSide=0;bi.prototype.point=!1;bi.prototype.mapMode=pt.TrackDel;let fc=class pp{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new pp(e,t,i)}};function dc(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Th{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,a=r.length;;){if(o==a)return o;let c=o+a>>1,h=r[c]-e||(i?this.value[c].endSide:this.value[c].startSide)-t;if(c==o)return h>=0?o:a;h>=0?a=c:o=c+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rm||p==m&&h.startSide>0&&h.endSide<=0)continue;(m-p||h.endSide-h.startSide)<0||(o<0&&(o=p),h.point&&(a=Math.max(a,m-p)),i.push(h),s.push(p-o),r.push(m-o))}return{mapped:i.length?new Th(s,r,i,a):null,pos:o}}}class Xe{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new Xe(e,t,i,s)}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:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(dc)),this.isEmpty)return t.length?Xe.of(t):this;let a=new mp(this,null,-1).goto(0),c=0,h=[],u=new ni;for(;a.value||c=0){let f=t[c++];u.addInner(f.from,f.to,f.value)||h.push(f)}else a.rangeIndex==1&&a.chunkIndexthis.chunkEnd(a.chunkIndex)||ra.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Ys.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ys.from(e).goto(t)}static compare(e,t,i,s,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),c=Bu(o,a,i),h=new vs(o,c,r),u=new vs(a,c,r);i.iterGaps((f,p,m)=>Yu(h,f,u,p,m,s)),i.empty&&i.length==0&&Yu(h,0,u,0,0,s)}static eq(e,t,i=0,s){s==null&&(s=1e9-1);let r=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),o=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let a=Bu(r,o),c=new vs(r,a,0).goto(i),h=new vs(o,a,0).goto(i);for(;;){if(c.to!=h.to||!pc(c.active,h.active)||c.point&&(!h.point||!c.point.eq(h.point)))return!1;if(c.to>s)return!0;c.next(),h.next()}}static spans(e,t,i,s,r=-1){let o=new vs(e,null,r).goto(t),a=t,c=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let u=o.activeForPoint(o.to),f=o.pointFroma&&(s.span(a,h,o.active,c),c=o.openEnd(h));if(o.to>i)return c+(o.point&&o.to>i?1:0);a=o.to,o.next()}}static of(e,t=!1){let i=new ni;for(let s of e instanceof fc?[e]:t?Dy(e):e)i.add(s.from,s.to,s.value);return i.finish()}}Xe.empty=new Xe([],[],null,-1);function Dy(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(dc);e=i}return n}Xe.empty.nextLayer=Xe.empty;class ni{finishChunk(e){this.chunks.push(new Th(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new ni)).add(e,t,i)}addInner(e,t,i){let s=e-this.lastTo||i.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(Xe.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=Xe.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Bu(n,e,t){let i=new Map;for(let r of n)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&s.push(new mp(o,t,i,r));return s.length==1?s[0]:new Ys(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)pl(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)pl(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),pl(this.heap,0)}}}function pl(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let s=n[i];if(i+1=0&&(s=n[i+1],i++),t.compare(s)<0)break;n[i]=t,n[e]=s,e=i}}class vs{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Ys.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){$r(this.active,e),$r(this.activeTo,e),$r(this.activeRank,e),this.minActive=Fu(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:s,rank:r}=this.cursor;for(;t-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),i&&$r(i,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[s]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Yu(n,e,t,i,s,r){n.goto(e),t.goto(i);let o=i+s,a=i,c=i-e;for(;;){let h=n.to+c-t.to||n.endSide-t.endSide,u=h<0?n.to+c:t.to,f=Math.min(u,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&pc(n.activeForPoint(n.to),t.activeForPoint(t.to))||r.comparePoint(a,f,n.point,t.point):f>a&&!pc(n.active,t.active)&&r.compareRange(a,f,n.active,t.active),u>o)break;a=u,h<=0&&n.next(),h>=0&&t.next()}}function pc(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Fu(n,e){let t=-1,i=1e9;for(let s=0;s=e)return s;if(s==n.length)break;r+=n.charCodeAt(s)==9?t-r%t:1,s=bt(n,s)}return i===!0?-1:n.length}const Oc="ͼ",zu=typeof Symbol>"u"?"__"+Oc:Symbol.for(Oc),gc=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ii{constructor(e,t){this.rules=[];let{finish:i}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,a,c,h){let u=[],f=/^@(\w+)\b/.exec(o[0]),p=f&&f[1]=="keyframes";if(f&&a==null)return c.push(o[0]+";");for(let m in a){let O=a[m];if(/&/.test(m))r(m.split(/,\s*/).map(k=>o.map(y=>k.replace(/&/,y))).reduce((k,y)=>k.concat(y)),O,c);else if(O&&typeof O=="object"){if(!f)throw new RangeError("The value of a property ("+m+") should be a primitive value.");r(s(m),O,u,p)}else O!=null&&u.push(m.replace(/_.*/,"").replace(/[A-Z]/g,k=>"-"+k.toLowerCase())+": "+O+";")}(u.length||p)&&c.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=Gu[zu]||1;return Gu[zu]=e+1,Oc+e.toString(36)}static mount(e,t){(e[gc]||new Ny(e)).mount(Array.isArray(t)?t:[t])}}let Hu=new Map;class Ny{constructor(e){let t=e.ownerDocument||e,i=t.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=Hu.get(t);if(s)return e.adoptedStyleSheets=[s.sheet,...e.adoptedStyleSheets],e[gc]=s;this.sheet=new i.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Hu.set(t,this)}else{this.styleTag=t.createElement("style");let s=e.head||e;s.insertBefore(this.styleTag,s.firstChild)}this.modules=[],e[gc]=this}mount(e){let t=this.sheet,i=0,s=0;for(let r=0;r-1&&(this.modules.splice(a,1),s--,a=-1),a==-1){if(this.modules.splice(s++,0,o),t)for(let c=0;c",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},qy=typeof navigator<"u"&&/Mac/.test(navigator.platform),Vy=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var dt=0;dt<10;dt++)si[48+dt]=si[96+dt]=String(dt);for(var dt=1;dt<=24;dt++)si[dt+111]="F"+dt;for(var dt=65;dt<=90;dt++)si[dt]=String.fromCharCode(dt+32),Fs[dt]=String.fromCharCode(dt);for(var ml in si)Fs.hasOwnProperty(ml)||(Fs[ml]=si[ml]);function Ly(n){var e=qy&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Vy&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Fs:si)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function bo(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function ss(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Wy(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function io(n,e){if(!e.anchorNode)return!1;try{return ss(n,e.anchorNode)}catch{return!1}}function zs(n){return n.nodeType==3?rs(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function wo(n,e,t,i){return t?Ju(n,e,t,i,-1)||Ju(n,e,t,i,1):!1}function xo(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Ju(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:ri(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=xo(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?ri(n):0}else return!1}}function ri(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ch(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function jy(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function Uy(n,e,t,i,s,r,o,a){let c=n.ownerDocument,h=c.defaultView||window;for(let u=n;u;)if(u.nodeType==1){let f,p=u==c.body;if(p)f=jy(h);else{if(u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let k=u.getBoundingClientRect();f={left:k.left,right:k.left+u.clientWidth,top:k.top,bottom:k.top+u.clientHeight}}let m=0,O=0;if(s=="nearest")e.top0&&e.bottom>f.bottom+O&&(O=e.bottom-f.bottom+O+o)):e.bottom>f.bottom&&(O=e.bottom-f.bottom+o,t<0&&e.top-O0&&e.right>f.right+m&&(m=e.right-f.right+m+r)):e.right>f.right&&(m=e.right-f.right+r,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class Yy{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?ri(t):0),i,Math.min(e.focusOffset,i?ri(i):0))}set(e,t,i,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=s}}let Di=null;function Op(n){if(n.setActive)return n.setActive();if(Di)return n.focus(Di);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Di==null?{get preventScroll(){return Di={preventScroll:!0},!0}}:void 0),!Di){Di=!1;for(let t=0;tt)return f.domBoundsAround(e,t,h);if(p>=e&&s==-1&&(s=c,r=h),h>t&&f.dom.parentNode==this.dom){o=c,a=u;break}u=p,h=p+f.breakAfter}return{from:r,to:a<0?i+this.length:a,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),t.dirty&1)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Ah){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Sp(n,e,t,i,s,r,o,a,c){let{children:h}=n,u=h.length?h[e]:null,f=r.length?r[r.length-1]:null,p=f?f.breakAfter:o;if(!(e==i&&u&&!o&&!p&&r.length<2&&u.merge(t,s,r.length?f:null,t==0,a,c))){if(i0&&(!o&&r.length&&u.merge(t,u.length,r[0],!1,a,0)?u.breakAfter=r.shift().breakAfter:(t2);var te={mac:sf||/Mac/.test(Et.platform),windows:/Win/.test(Et.platform),linux:/Linux|X11/.test(Et.platform),ie:oa,ie_version:bp?yc.documentMode||6:kc?+kc[1]:Sc?+Sc[1]:0,gecko:tf,gecko_version:tf?+(/Firefox\/(\d+)/.exec(Et.userAgent)||[0,0])[1]:0,chrome:!!Ol,chrome_version:Ol?+Ol[1]:0,ios:sf,android:/Android\b/.test(Et.userAgent),webkit:nf,safari:wp,webkit_version:nf?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:yc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const Gy=256;class wi extends Ne{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return i&&(!(i instanceof wi)||this.length-(t-e)+i.length>Gy)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new wi(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new mt(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return bc(this.dom,e,t)}}class Zn extends Ne{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let s of t)s.setParent(this)}setAttrs(e){if(gp(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e,t){this.dom?this.dirty&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,s,r,o){return i&&(!(i instanceof Zn&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(s=r),i=c,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new Zn(this.mark,t,o)}domAtPos(e){return _p(this,e)}coordsAt(e,t){return Tp(this,e,t)}}function bc(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let s=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?te.chrome||te.gecko||(e?(s--,o=1):r=0)?0:a.length-1];return te.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(a,h=>h.width)||c),o?Ch(c,o<0):c||null}class zn extends Ne{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new(e.customView||zn)(e,t,i)}split(e){let t=zn.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,s,r,o){return i&&(!(i instanceof zn)||!this.widget.compare(i.widget)||e>0&&r<=0||t0)?mt.before(this.dom):mt.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?s.length-1:0;r=s[a],!(e>0?a==0:a==s.length-1||r.tops.domAtPos(r),(s,r)=>new mt(s,Math.min(r,s.nodeValue.length))):new mt(i,Math.min(e,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:i,text:s}=this.widget;return i?Qp(e,t,i,s,this.length-i.length):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:i,text:s}=this.widget;return i?wc(e,t,i,s,this.length-i.length,(r,o,a)=>r.coordsAt(o,a),(r,o,a)=>bc(r,o,a)):bc(s,e,t)}destroy(){var e;super.destroy(),(e=this.widget.topView)===null||e===void 0||e.destroy()}get isEditable(){return!0}canReuseDOM(){return!0}}function wc(n,e,t,i,s,r,o){if(t instanceof Zn){for(let a=t.dom.firstChild;a;a=a.nextSibling){let c=Ne.get(a);if(c){let h=ss(a,i),u=c.length+(h?s:0);if(n0?mt.before(this.dom):mt.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Ce.empty}get isHidden(){return!0}}wi.prototype.children=zn.prototype.children=os.prototype.children=Ah;function _p(n,e){let t=n.dom,{children:i}=n,s=0;for(let r=0;sr&&e0;r--){let o=i[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof Zn&&s.length&&(i=s[s.length-1])instanceof Zn&&i.mark.eq(e.mark)?$p(i,e.children[0],t-1):(s.push(e),e.setParent(n)),n.length+=e.length}function Tp(n,e,t){let i=null,s=-1,r=null,o=-1;function a(h,u){for(let f=0,p=0;f=u&&(m.children.length?a(m,u-p):(!r||r.isHidden&&t>0)&&(O>u||p==O&&m.getSide()>0)?(r=m,o=u-p):(p0?3e8:-4e8:t>0?1e8:-1e8,new oi(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,s;if(e.isBlockGap)i=-5e8,s=4e8;else{let{start:r,end:o}=Cp(e,t);i=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new oi(e,i,s,t,e.widget||null,!0)}static line(e){return new pr(e)}static set(e,t=!1){return Xe.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}le.none=Xe.empty;class aa extends le{constructor(e){let{start:t,end:i}=Cp(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof aa&&this.tagName==e.tagName&&this.class==e.class&&Ih(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}aa.prototype.point=!1;class pr extends le{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof pr&&this.spec.class==e.spec.class&&Ih(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}pr.prototype.mapMode=pt.TrackBefore;pr.prototype.point=!0;class oi extends le{constructor(e,t,i,s,r,o){super(t,i,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?pt.TrackBefore:pt.TrackAfter:pt.TrackDel}get type(){return this.startSide=5||this.widget.lineBreaks>0)}eq(e){return e instanceof oi&&Jy(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}oi.prototype.point=!0;function Cp(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function Jy(n,e){return n==e||!!(n&&e&&n.compare(e))}function Qc(n,e,t,i=0){let s=t.length-1;s>=0&&t[s]+i>=n?t[s]=Math.max(t[s],e):t.push(n,e)}class Qt extends Ne{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,s,r,o){if(i){if(!(i instanceof Qt))return!1;this.dom||i.transferDOM(this)}return s&&this.setDeco(i?i.attrs:null),kp(this,e,t,i?i.children:[],r,o),!0}split(e){let t=new Qt;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i,off:s}=this.childPos(e);s&&(t.append(this.children[i].split(s),0),this.children[i].merge(s,this.children[i].length,null,!1,0,0),i++);for(let r=i;r0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Ih(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){$p(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=xc(t,this.attrs||{})),i&&(this.attrs=xc({class:i},this.attrs||{}))}domAtPos(e){return _p(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.dirty|=6)}sync(e,t){var i;this.dom?this.dirty&4&&(gp(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(vc(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&Ne.get(s)instanceof Zn;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=Ne.get(s))===null||i===void 0?void 0:i.isEditable)==!1&&(!te.ios||!this.children.some(r=>r instanceof wi))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof wi)||/[^ -~]/.test(i.text))return null;let s=zs(i.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=Tp(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof Qt)return r;if(o>t)break}s=o+r.breakAfter}return null}}class ki extends Ne{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,s,r,o){return i&&(!(i instanceof ki)||!this.widget.compare(i.widget)||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Cr(new wi(this.text.slice(this.textOff,this.textOff+s)),t),i),this.atCursorPos=!0,this.textOff+=s,e-=s,i=0}}span(e,t,i,s){this.buildText(t-e,i,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,i,s,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof oi){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(i instanceof oi)if(i.block){let{type:c}=i;c==Ge.WidgetAfter&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new ki(i.widget||new rf("div"),a,c))}else{let c=zn.create(i.widget||new rf("span"),a,a?0:i.startSide),h=this.atCursorPos&&!c.isEditable&&r<=s.length&&(e0),u=!c.isEditable&&(es.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!c.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),h&&(f.append(Cr(new os(1),s),r),r=s.length+Math.max(0,r-s.length)),f.append(Cr(c,s),r),this.atCursorPos=u,this.pendingBuffer=u?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,i,s,r){let o=new Rh(e,t,i,r);return o.openEnd=Xe.spans(s,t,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function Cr(n,e){for(let t of e)n=new Zn(t,[n],n.length);return n}class rf extends qn{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}const Ap=ee.define(),Ip=ee.define(),Rp=ee.define(),Xp=ee.define(),Pc=ee.define(),Ep=ee.define(),Zp=ee.define(),Mp=ee.define({combine:n=>n.some(e=>e)}),Dp=ee.define({combine:n=>n.some(e=>e)});class vo{constructor(e,t="nearest",i="nearest",s=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=s,this.xMargin=r}map(e){return e.empty?this:new vo(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const of=we.define({map:(n,e)=>n.map(e)});function jt(n,e,t){let i=n.facet(Xp);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const la=ee.define({combine:n=>n.length?n[0]:!0});let Ky=0;const Es=ee.define();class rt{constructor(e,t,i,s){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:i,provide:s,decorations:r}=t||{};return new rt(Ky++,e,i,o=>{let a=[Es.of(o)];return r&&a.push(Gs.of(c=>{let h=c.plugin(o);return h?r(h):le.none})),s&&a.push(s(o)),a})}static fromClass(e,t){return rt.define(i=>new e(i),t)}}class gl{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(jt(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){jt(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){jt(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Np=ee.define(),Xh=ee.define(),Gs=ee.define(),Eh=ee.define(),qp=ee.define();function Vp(n){let e=0,t=0,i=0,s=0;for(let r of n.state.facet(qp)){let o=r(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:i,bottom:s}}const Zs=ee.define();class kn{constructor(e,t,i,s){this.fromA=e,this.toA=t,this.fromB=i,this.toB=s}join(e){return new kn(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>i.toA)){if(s.toAu)break;r+=2}if(!c)return i;new kn(c.fromA,c.toA,c.fromB,c.toB).addToSet(i),o=c.toA,a=c.toB}}}class Qo{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=it.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,a,c)=>s.push(new kn(r,o,a,c))),this.changedRanges=s}static create(e,t,i){return new Qo(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}var Fe=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(Fe||(Fe={}));const _c=Fe.LTR,eS=Fe.RTL;function Lp(n){let e=[];for(let t=0;t=t){if(a.level==i)return o;(r<0||(s!=0?s<0?a.fromt:e[r].level>a.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}const Ye=[];function rS(n,e){let t=n.length,i=e==_c?1:2,s=e==_c?2:1;if(!n||i==1&&!sS.test(n))return Wp(t);for(let o=0,a=i,c=i;o=0;p-=3)if(an[p+1]==-u){let m=an[p+2],O=m&2?i:m&4?m&1?s:i:0;O&&(Ye[o]=Ye[an[p]]=O),a=p;break}}else{if(an.length==189)break;an[a++]=o,an[a++]=h,an[a++]=c}else if((f=Ye[o])==2||f==1){let p=f==i;c=p?0:1;for(let m=a-3;m>=0;m-=3){let O=an[m+2];if(O&2)break;if(p)an[m+2]|=2;else{if(O&4)break;an[m+2]|=4}}}for(let o=0;oa;){let u=h,f=Ye[--h]!=2;for(;h>a&&f==(Ye[h-1]!=2);)h--;r.push(new Ji(h,u,f?2:1))}else r.push(new Ji(a,o,0))}else for(let o=0;or)&&this.lineBreak(),s=o}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,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,a;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(a=s.exec(t))&&(r=a.index,o=a[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=o-1);i=r+o}}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 s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.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+Math.min(t,i.offset))}}function af(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}class lf{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class cf extends Ne{constructor(e){super(),this.view=e,this.compositionDeco=le.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Qt],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new kn(0,0,0,e.state.doc.length)],0)}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every(({fromA:o,toA:a})=>athis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=le.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=lS(this.view,e.changes)),(te.ie||te.chrome)&&!this.compositionDeco.size&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=this.decorations,s=this.updateDeco(),r=fS(i,s,e.changes);return t=kn.extendWithRanges(t,r),this.dirty==0&&t.length==0?!1:(this.updateInner(t,e.startState.doc.length),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let r=te.chrome||te.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,r),this.dirty=0,r&&(r.written||i.selectionRange.focusNode!=r.node)&&(this.forceSelection=!0),this.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to=0?e[s]:null;if(!r)break;let{fromA:o,toA:a,fromB:c,toB:h}=r,{content:u,breakAtStart:f,openStart:p,openEnd:m}=Rh.build(this.view.state.doc,c,h,this.decorations,this.dynamicDecorationMap),{i:O,off:k}=i.findPos(a,1),{i:y,off:S}=i.findPos(o,-1);Sp(this,y,S,O,k,u,f,p,m)}}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom,r=!s&&io(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,c=this.domAtPos(a.anchor),h=a.empty?c:this.domAtPos(a.head);if(te.gecko&&a.empty&&!this.compositionDeco.size&&aS(c)){let f=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(f,c.node.childNodes[c.offset]||null)),c=h=new mt(f,0),o=!0}let u=this.view.observer.selectionRange;(o||!u.focusNode||!wo(c.node,c.offset,u.anchorNode,u.anchorOffset)||!wo(h.node,h.offset,u.focusNode,u.focusOffset))&&(this.view.observer.ignore(()=>{te.android&&te.chrome&&this.dom.contains(u.focusNode)&&dS(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=bo(this.view.root);if(f)if(a.empty){if(te.gecko){let p=hS(c.node,c.offset);if(p&&p!=3){let m=Yp(c.node,c.offset,p==1?1:-1);m&&(c=new mt(m,p==1?0:m.nodeValue.length))}}f.collapse(c.node,c.offset),a.bidiLevel!=null&&u.cursorBidiLevel!=null&&(u.cursorBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(c.node,c.offset);try{f.extend(h.node,h.offset)}catch{}}else{let p=document.createRange();a.anchor>a.head&&([c,h]=[h,c]),p.setEnd(h.node,h.offset),p.setStart(c.node,c.offset),f.removeAllRanges(),f.addRange(p)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,h)),this.impreciseAnchor=c.precise?null:new mt(u.anchorNode,u.anchorOffset),this.impreciseHead=h.precise?null:new mt(u.focusNode,u.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let{view:e}=this,t=e.state.selection.main,i=bo(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=Qt.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let c=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!c||!h||c.bottom>h.top)return;let u=this.domAtPos(t.head+t.assoc);i.collapse(u.node,u.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(s,r)}nearest(e){for(let t=e;t;){let i=Ne.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;to||e==o&&r.type!=Ge.WidgetBefore&&r.type!=Ge.WidgetAfter&&(!s||t==2||this.children[s-1].breakAfter||this.children[s-1].type==Ge.WidgetBefore&&t>-2))return r.coordsAt(e-o,t);i=o}}measureVisibleLineHeights(e){let t=[],{from:i,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,c=this.view.textDirection==Fe.LTR;for(let h=0,u=0;us)break;if(h>=i){let m=f.dom.getBoundingClientRect();if(t.push(m.height),o){let O=f.dom.lastChild,k=O?zs(O):[];if(k.length){let y=k[k.length-1],S=c?y.right-m.left:m.right-y.left;S>a&&(a=S,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=p)}}}h=p+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?Fe.RTL:Fe.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Qt){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,i,s;return e.className="cm-line",e.style.width="99999px",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=zs(e.firstChild)[0];t=e.getBoundingClientRect().height,i=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new yp(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>i){let a=t.lineBlockAt(o).bottom-t.lineBlockAt(i).top;e.push(le.replace({widget:new hf(a),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return le.set(e)}updateDeco(){let e=this.view.state.facet(Gs).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),s;if(!i)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)});let r=Vp(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom};Uy(this.view.scrollDOM,o,t.head-1)return le.none;if(c-a0)i=i.childNodes[s-1],s=ri(i);else break}if(t>=0)for(let i=n,s=e;;){if(i.nodeType==3)return i;if(i.nodeType==1&&s=0)i=i.childNodes[s],s=0;else break}return null}function hS(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e0;){let h=bt(s.text,o,!1);if(i(s.text.slice(h,o))!=c)break;o=h}for(;an?e.left-n:Math.max(0,n-e.right)}function OS(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function yl(n,e){return n.tope.top+1}function uf(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function Tc(n,e,t){let i,s,r,o,a=!1,c,h,u,f;for(let O=n.firstChild;O;O=O.nextSibling){let k=zs(O);for(let y=0;yQ||o==Q&&r>P){i=O,s=S,r=P,o=Q;let _=Q?t0?y0)}P==0?t>S.bottom&&(!u||u.bottomS.top)&&(h=O,f=S):u&&yl(u,S)?u=ff(u,S.bottom):f&&yl(f,S)&&(f=uf(f,S.top))}}if(u&&u.bottom>=t?(i=c,s=u):f&&f.top<=t&&(i=h,s=f),!i)return{node:n,offset:0};let p=Math.max(s.left,Math.min(s.right,e));if(i.nodeType==3)return df(i,p,t);if(a&&i.contentEditable!="false")return Tc(i,p,t);let m=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(s.left+s.right)/2?1:0);return{node:n,offset:m}}function df(n,e,t){let i=n.nodeValue.length,s=-1,r=1e9,o=0;for(let a=0;at?u.top-t:t-u.bottom)-1;if(u.left-1<=e&&u.right+1>=e&&f=(u.left+u.right)/2,m=p;if((te.chrome||te.gecko)&&rs(n,a).getBoundingClientRect().left==u.right&&(m=!p),f<=0)return{node:n,offset:a+(m?1:0)};s=a+(m?1:0),r=f}}}return{node:n,offset:s>-1?s:o>0?n.nodeValue.length:0}}function Fp(n,e,t,i=-1){var s,r;let o=n.contentDOM.getBoundingClientRect(),a=o.top+n.viewState.paddingTop,c,{docHeight:h}=n.viewState,{x:u,y:f}=e,p=f-a;if(p<0)return 0;if(p>h)return n.state.doc.length;for(let _=n.defaultLineHeight/2,v=!1;c=n.elementAtHeight(p),c.type!=Ge.Text;)for(;p=i>0?c.bottom+_:c.top-_,!(p>=0&&p<=h);){if(v)return t?null:0;v=!0,i=-i}f=a+p;let m=c.from;if(mn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:pf(n,o,c,u,f);let O=n.dom.ownerDocument,k=n.root.elementFromPoint?n.root:O,y=k.elementFromPoint(u,f);y&&!n.contentDOM.contains(y)&&(y=null),y||(u=Math.max(o.left+1,Math.min(o.right-1,u)),y=k.elementFromPoint(u,f),y&&!n.contentDOM.contains(y)&&(y=null));let S,P=-1;if(y&&((s=n.docView.nearest(y))===null||s===void 0?void 0:s.isEditable)!=!1){if(O.caretPositionFromPoint){let _=O.caretPositionFromPoint(u,f);_&&({offsetNode:S,offset:P}=_)}else if(O.caretRangeFromPoint){let _=O.caretRangeFromPoint(u,f);_&&({startContainer:S,startOffset:P}=_,(!n.contentDOM.contains(S)||te.safari&&gS(S,P,u)||te.chrome&&yS(S,P,u))&&(S=void 0))}}if(!S||!n.docView.dom.contains(S)){let _=Qt.find(n.docView,m);if(!_)return p>c.top+c.height/2?c.to:c.from;({node:S,offset:P}=Tc(_.dom,u,f))}let Q=n.docView.nearest(S);if(!Q)return null;if(Q.isWidget&&((r=Q.dom)===null||r===void 0?void 0:r.nodeType)==1){let _=Q.dom.getBoundingClientRect();return e.y<_.top||e.y<=_.bottom&&e.x<=(_.left+_.right)/2?Q.posAtStart:Q.posAtEnd}else return Q.localPosFromDOM(S,P)+Q.posAtStart}function pf(n,e,t,i,s){let r=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let a=Math.floor((s-t.top)/n.defaultLineHeight);r+=a*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+mc(o,r,n.state.tabSize)}function gS(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let s=n.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return rs(n,i-1,i).getBoundingClientRect().left>t}function yS(n,e,t){if(e!=0)return!1;for(let s=n;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let i=n.nodeType==1?n.getBoundingClientRect():rs(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function Cc(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==Ge.Text))return i}return t}function SS(n,e,t,i){let s=Cc(n,e.head),r=!i||s.type!=Ge.Text||!(n.lineWrapping||s.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=n.dom.getBoundingClientRect(),a=n.textDirectionAt(s.from),c=n.posAtCoords({x:t==(a==Fe.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(c!=null)return q.cursor(c,t?-1:1)}return q.cursor(t?s.to:s.from,t?-1:1)}function mf(n,e,t,i){let s=n.state.doc.lineAt(e.head),r=n.bidiSpans(s),o=n.textDirectionAt(s.from);for(let a=e,c=null;;){let h=oS(s,r,o,a,t),u=jp;if(!h){if(s.number==(t?n.state.doc.lines:1))return a;u=` `,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),h=q.cursor(t?s.from:s.to)}if(c){if(!c(u))return a}else{if(!i)return h;c=i(u)}a=h}}function kS(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==We.Space&&(s=o),s==o}}function bS(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return q.cursor(s,e.assoc);let o=e.goalColumn,a,c=n.contentDOM.getBoundingClientRect(),h=n.coordsAtPos(s),u=n.documentTop;if(h)o==null&&(o=h.left-c.left),a=r<0?h.top:h.bottom;else{let m=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(c.right-c.left,n.defaultCharacterWidth*(s-m.from))),a=(r<0?m.top:m.bottom)+u}let f=c.left+o,p=i??n.defaultLineHeight>>1;for(let m=0;;m+=10){let O=a+(p+m)*r,k=Fp(n,{x:f,y:O},!1,r);if(Oc.bottom||(r<0?ks))return q.cursor(k,e.assoc,void 0,o)}}function so(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,a)=>{if(e>r&&es(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:q.cursor(i,i{this.ignoreDuringComposition(s)||s.type=="keydown"&&this.keydown(e,s)||(this.mustFlushObserver(s)&&e.observer.forceFlush(),this.runCustomHandlers(s.type,e,s)?s.preventDefault():i(e,s))};for(let i in et){let s=et[i];e.contentDOM.addEventListener(i,r=>{Of(e,r)&&t(s,r)},Ac[i]),this.registeredEvents.push(i)}e.scrollDOM.addEventListener("mousedown",i=>{if(i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&(t(et.mousedown,i),!i.defaultPrevented&&i.button==2)){let s=e.contentDOM.style.minHeight;e.contentDOM.style.minHeight="100%",setTimeout(()=>e.contentDOM.style.minHeight=s,200)}}),e.scrollDOM.addEventListener("drop",i=>{i.target==e.scrollDOM&&i.clientY>e.contentDOM.getBoundingClientRect().bottom&&t(et.drop,i)}),te.chrome&&te.chrome_version==102&&e.scrollDOM.addEventListener("wheel",()=>{this.chromeScrollHack<0?e.contentDOM.style.pointerEvents="none":window.clearTimeout(this.chromeScrollHack),this.chromeScrollHack=setTimeout(()=>{this.chromeScrollHack=-1,e.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=e.hasFocus,te.safari&&e.contentDOM.addEventListener("input",()=>null)}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let s;this.customHandlers=[];for(let r of t)if(s=(i=r.update(e).spec)===null||i===void 0?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:s});for(let o in s)this.registeredEvents.indexOf(o)<0&&o!="scroll"&&(this.registeredEvents.push(o),e.contentDOM.addEventListener(o,a=>{Of(e,a)&&this.runCustomHandlers(o,e,a)&&a.preventDefault()}))}}runCustomHandlers(e,t,i){for(let s of this.customHandlers){let r=s.handlers[e];if(r)try{if(r.call(s.plugin,i,t)||i.defaultPrevented)return!0}catch(o){jt(t.state,o)}}return!1}runScrollHandlers(e,t){this.lastScrollTop=e.scrollDOM.scrollTop,this.lastScrollLeft=e.scrollDOM.scrollLeft;for(let i of this.customHandlers){let s=i.handlers.scroll;if(s)try{s.call(i.plugin,t,e)}catch(r){jt(e.state,r)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()s.keyCode==t.keyCode))&&!t.ctrlKey||xS.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=i||t,setTimeout(()=>this.flushIOSKey(e),250),!0):!1}flushIOSKey(e){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,Hi(e.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:te.safari&&!te.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}mustFlushObserver(e){return e.type=="keydown"&&e.keyCode!=229}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const zp=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],xS="dthko",Gp=[16,17,18,20,91,92,224,225],Ar=6;function Ir(n){return Math.max(0,n)*.7+8}class vS{constructor(e,t,i,s){this.view=e,this.style=i,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=By(e.contentDOM),this.atoms=e.state.facet(Eh).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(_e.allowMultipleSelections)&&QS(e,t),this.dragMove=PS(e,t),this.dragging=_S(e,t)&&em(t)==1?null:!1}start(e){this.dragging===!1&&(e.preventDefault(),this.select(e))}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging!==!1)return;this.select(this.lastEvent=e);let i=0,s=0,r=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=Vp(this.view);e.clientX-o.left<=r.left+Ar?i=-Ir(r.left-e.clientX):e.clientX+o.right>=r.right-Ar&&(i=Ir(e.clientX-r.right)),e.clientY-o.top<=r.top+Ar?s=-Ir(r.top-e.clientY):e.clientY+o.bottom>=r.bottom-Ar&&(s=Ir(e.clientY-r.bottom)),this.setScrollSpeed(i,s)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function QS(n,e){let t=n.state.facet(Ap);return t.length?t[0](e):te.mac?e.metaKey:e.ctrlKey}function PS(n,e){let t=n.state.facet(Ip);return t.length?t[0](e):te.mac?!e.altKey:!e.ctrlKey}function _S(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=bo(n.root);if(!i||i.rangeCount==0)return!0;let s=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Of(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=Ne.get(t))&&i.ignoreEvent(e))return!1;return!0}const et=Object.create(null),Ac=Object.create(null),Hp=te.ie&&te.ie_version<15||te.ios&&te.webkit_version<604;function $S(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),Jp(n,t.value)},50)}function Jp(n,e){let{state:t}=n,i,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Ic!=null&&t.selection.ranges.every(c=>c.empty)&&Ic==r.toString()){let c=-1;i=t.changeByRange(h=>{let u=t.doc.lineAt(h.from);if(u.from==c)return{range:h};c=u.from;let f=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:u.from,insert:f},range:q.cursor(h.from+f.length)}})}else o?i=t.changeByRange(c=>{let h=r.line(s++);return{changes:{from:c.from,to:c.to,insert:h.text},range:q.cursor(c.from+h.length)}}):i=t.replaceSelection(r);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}et.keydown=(n,e)=>{n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now())};et.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};et.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Ac.touchstart=Ac.touchmove={passive:!0};et.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return;let t=null;for(let i of n.state.facet(Rp))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=AS(n,e)),t){let i=n.root.activeElement!=n.contentDOM;n.inputState.startMouseSelection(new vS(n,e,t,i)),i&&n.observer.ignore(()=>Op(n.contentDOM)),n.inputState.mouseSelection&&n.inputState.mouseSelection.start(e)}};function gf(n,e,t,i){if(i==1)return q.cursor(e,t);if(i==2)return pS(n.state,e,t);{let s=Qt.find(n.docView,e),r=n.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,a=s?s.posAtEnd:r.to;return an>=e.top&&n<=e.bottom,yf=(n,e,t)=>Kp(e,t)&&n>=t.left&&n<=t.right;function TS(n,e,t,i){let s=Qt.find(n.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&yf(t,i,o))return-1;let a=s.coordsAt(r,1);return a&&yf(t,i,a)?1:o&&Kp(i,o)?-1:1}function Sf(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:TS(n,t,e.clientX,e.clientY)}}const CS=te.ie&&te.ie_version<=11;let kf=null,bf=0,wf=0;function em(n){if(!CS)return n.detail;let e=kf,t=wf;return kf=n,wf=Date.now(),bf=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(bf+1)%3:1}function AS(n,e){let t=Sf(n,e),i=em(e),s=n.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,a){let c=Sf(n,r),h,u=gf(n,c.pos,c.bias,i);if(t.pos!=c.pos&&!o){let f=gf(n,t.pos,t.bias,i),p=Math.min(f.from,u.from),m=Math.max(f.to,u.to);u=p1&&(h=IS(s,c.pos))?h:a?s.addRange(u):q.create([u])}}}function IS(n,e){for(let t=0;t=e)return q.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}et.dragstart=(n,e)=>{let{selection:{main:t}}=n.state,{mouseSelection:i}=n.inputState;i&&(i.dragging=t),e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove")};function xf(n,e,t,i){if(!t)return;let s=n.posAtCoords({x:e.clientX,y:e.clientY},!1);e.preventDefault();let{mouseSelection:r}=n.inputState,o=i&&r&&r.dragging&&r.dragMove?{from:r.dragging.from,to:r.dragging.to}:null,a={from:s,insert:t},c=n.state.changes(o?[o,a]:a);n.focus(),n.dispatch({changes:c,selection:{anchor:c.mapPos(s,-1),head:c.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"})}et.drop=(n,e)=>{if(!e.dataTransfer)return;if(n.state.readOnly)return e.preventDefault();let t=e.dataTransfer.files;if(t&&t.length){e.preventDefault();let i=Array(t.length),s=0,r=()=>{++s==t.length&&xf(n,e,i.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(i[o]=a.result),r()},a.readAsText(t[o])}}else xf(n,e,e.dataTransfer.getData("Text"),!0)};et.paste=(n,e)=>{if(n.state.readOnly)return e.preventDefault();n.observer.flush();let t=Hp?null:e.clipboardData;t?(Jp(n,t.getData("text/plain")||t.getData("text/uri-text")),e.preventDefault()):$S(n)};function RS(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function XS(n){let e=[],t=[],i=!1;for(let s of n.selection.ranges)s.empty||(e.push(n.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of n.selection.ranges){let o=n.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),s=o.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let Ic=null;et.copy=et.cut=(n,e)=>{let{text:t,ranges:i,linewise:s}=XS(n.state);if(!t&&!s)return;Ic=s?t:null;let r=Hp?null:e.clipboardData;r?(e.preventDefault(),r.clearData(),r.setData("text/plain",t)):RS(n,t),e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})};const tm=Nn.define();function nm(n,e){let t=[];for(let i of n.facet(Zp)){let s=i(n,e);s&&t.push(s)}return t?n.update({effects:t,annotations:tm.of(!0)}):null}function im(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=nm(n.state,e);t?n.dispatch(t):n.update([])}},10)}et.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),im(n)};et.blur=n=>{n.observer.clearSelectionRange(),im(n)};et.compositionstart=et.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};et.compositionend=n=>{n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,te.chrome&&te.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.compositionDeco.size&&n.update([])},50)};et.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};et.beforeinput=(n,e)=>{var t;let i;if(te.chrome&&te.android&&(i=zp.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}};const vf=["pre-wrap","normal","pre-line","break-spaces"];class ES{constructor(e){this.lineWrapping=e,this.doc=Ce.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return vf.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,c=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=i,this.textHeight=s,this.lineLength=r,c){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>ro&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return wt.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,s){let r=this,o=i.doc;for(let a=s.length-1;a>=0;a--){let{fromA:c,toA:h,fromB:u,toB:f}=s[a],p=r.lineAt(c,Ve.ByPosNoHeight,i.setDoc(t),0,0),m=p.to>=h?p:r.lineAt(h,Ve.ByPosNoHeight,i,0,0);for(f+=m.to-h,h=m.to;a>0&&p.from<=s[a-1].toA;)c=s[a-1].fromA,u=s[a-1].fromB,a--,cr*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),i+=1+a.break,s-=a.size}else if(r>s*2){let a=e[i];a.break?e.splice(i,1,a.left,null,a.right):e.splice(i,1,a.left,a.right),i+=2+a.break,r-=a.size}else break;else if(s=r&&o(this.blockAt(0,i,s,r))}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(e,s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Rt extends sm{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,s){return new pn(s,this.length,i,this.height,this.breaks)}replace(e,t,i){let s=i[0];return i.length==1&&(s instanceof Rt||s instanceof ut&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof ut?s=new Rt(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):wt.of(i)}updateHeight(e,t=0,i=!1,s){return s&&s.from<=t&&s.more?this.setHeight(e,s.heights[s.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class ut extends wt{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-i+1,o,a=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*r);o=c/r,this.length>r+1&&(a=(this.height-c)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:s,perLine:o,perChar:a}}blockAt(e,t,i,s){let{firstLine:r,lastLine:o,perLine:a,perChar:c}=this.heightMetrics(t,s);if(t.lineWrapping){let h=s+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),u=t.doc.lineAt(h),f=a+u.length*c,p=Math.max(i,e-f/2);return new pn(u.from,u.length,p,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((e-i)/a))),{from:u,length:f}=t.doc.line(r+h);return new pn(u,f,i+a*h,a,0)}}lineAt(e,t,i,s,r){if(t==Ve.ByHeight)return this.blockAt(e,i,s,r);if(t==Ve.ByPosNoHeight){let{from:m,to:O}=i.doc.lineAt(e);return new pn(m,O-m,0,0,0)}let{firstLine:o,perLine:a,perChar:c}=this.heightMetrics(i,r),h=i.doc.lineAt(e),u=a+h.length*c,f=h.number-o,p=s+a*f+c*(h.from-r-f);return new pn(h.from,h.length,Math.max(s,Math.min(p,s+this.height-u)),u,0)}forEachLine(e,t,i,s,r,o){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:a,perLine:c,perChar:h}=this.heightMetrics(i,r);for(let u=e,f=s;u<=t;){let p=i.doc.lineAt(u);if(u==e){let O=p.number-a;f+=c*O+h*(e-r-O)}let m=c+h*p.length;o(new pn(p.from,p.length,f,m,0)),f+=m,u=p.to+1}}replace(e,t,i){let s=this.length-t;if(s>0){let r=i[i.length-1];r instanceof ut?i[i.length-1]=new ut(r.length+s):i.push(null,new ut(s-1))}if(e>0){let r=i[0];r instanceof ut?i[0]=new ut(e+r.length):i.unshift(new ut(e-1),null)}return wt.of(i)}decomposeLeft(e,t){t.push(new ut(e-1),null)}decomposeRight(e,t){t.push(null,new ut(this.length-e-1))}updateHeight(e,t=0,i=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],a=Math.max(t,s.from),c=-1;for(s.from>t&&o.push(new ut(s.from-t-1).updateHeight(e,t));a<=r&&s.more;){let u=e.doc.lineAt(a).length;o.length&&o.push(null);let f=s.heights[s.index++];c==-1?c=f:Math.abs(f-c)>=ro&&(c=-2);let p=new Rt(u,f);p.outdated=!1,o.push(p),a+=u+1}a<=r&&o.push(null,new ut(r-a).updateHeight(e,a));let h=wt.of(o);return(c<0||Math.abs(h.height-this.height)>=ro||Math.abs(c-this.heightMetrics(e,t).perLine)>=ro)&&(e.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class MS extends wt{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,s){let r=i+this.left.height;return ea))return h;let u=t==Ve.ByPosNoHeight?Ve.ByPosNoHeight:Ve.ByPos;return c?h.join(this.right.lineAt(a,u,i,o,a)):this.left.lineAt(a,u,i,s,r).join(h)}forEachLine(e,t,i,s,r,o){let a=s+this.left.height,c=r+this.left.length+this.break;if(this.break)e=c&&this.right.forEachLine(e,t,i,a,c,o);else{let h=this.lineAt(c,Ve.ByPos,i,s,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,a,c,o)}}replace(e,t,i){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let a of i)r.push(a);if(e>0&&Qf(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,s=i+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?wt.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,s){let{left:r,right:o}=this,a=t+r.length+this.break,c=null;return s&&s.from<=t+r.length&&s.more?c=r=r.updateHeight(e,t,i,s):r.updateHeight(e,t,i),s&&s.from<=a+o.length&&s.more?c=o=o.updateHeight(e,a,i,s):o.updateHeight(e,a,i),c?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Qf(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof ut&&(i=n[e+1])instanceof ut&&n.splice(e-1,3,new ut(t.length+1+i.length))}const DS=5;class Zh{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Rt?s.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Rt(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=DS)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Rt(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new ut(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Rt)return e;let t=new Rt(0,-1);return this.nodes.push(t),t}addBlock(e){var t;this.enterLine();let i=(t=e.deco)===null||t===void 0?void 0:t.type;i==Ge.WidgetAfter&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,i!=Ge.WidgetBefore&&(this.covering=e)}addLineDeco(e,t,i){let s=this.ensureLine();s.length+=i,s.collapsed+=i,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Rt)&&!this.isCovered?this.nodes.push(new Rt(0,-1)):(this.writtenTou.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let p=u.getBoundingClientRect();r=Math.max(r,p.left),o=Math.min(o,p.right),a=Math.max(a,p.top),c=h==n.parentNode?p.bottom:Math.min(c,p.bottom)}h=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,c)-(t.top+e)}}function LS(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class kl{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new ES(t),this.stateDeco=e.facet(Gs).filter(i=>typeof i!="function"),this.heightMap=wt.empty().applyChanges(this.stateDeco,Ce.empty,this.heightOracle.setDoc(e.doc),[new kn(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=le.set(this.lineGaps.map(i=>i.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let s=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Rr(r,o))}}this.viewports=e.sort((i,s)=>i.from-s.from),this.scaler=this.heightMap.height<=7e6?_f:new BS(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Ms(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Gs).filter(u=>typeof u!="function");let s=e.changedRanges,r=kn.extendWithRanges(s,NS(i,this.stateDeco,e?e.changes:it.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.lineBlockAtHeight(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let c=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.headc.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,t));let h=!e.changes.empty||e.flags&2||c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Dp)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),s=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Fe.RTL:Fe.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),a=t.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let h=0,u=0,f=parseInt(i.paddingTop)||0,p=parseInt(i.paddingBottom)||0;(this.paddingTop!=f||this.paddingBottom!=p)&&(this.paddingTop=f,this.paddingBottom=p,h|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=8),this.scrollTop!=e.scrollDOM.scrollTop&&(this.scrollAnchorHeight=-1,this.scrollTop=e.scrollDOM.scrollTop),this.scrolledToBottom=this.scrollTop>e.scrollDOM.scrollHeight-e.scrollDOM.clientHeight-4;let m=(this.printing?LS:VS)(t,this.paddingTop),O=m.top-this.pixelViewport.top,k=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let y=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(y!=this.inView&&(this.inView=y,y&&(c=!0)),!this.inView&&!this.scrollTarget)return 0;let S=a.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,h|=8),c){let Q=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(Q)&&(o=!0),o||s.lineWrapping&&Math.abs(S-this.contentDOMWidth)>s.charWidth){let{lineHeight:_,charWidth:v,textHeight:$}=e.docView.measureTextSize();o=_>0&&s.refresh(r,_,v,$,S/v,Q),o&&(e.docView.minWidth=0,h|=8)}O>0&&k>0?u=Math.max(O,k):O<0&&k<0&&(u=Math.min(O,k)),s.heightChanged=!1;for(let _ of this.viewports){let v=_.from==this.viewport.from?Q:e.docView.measureVisibleLineHeights(_);this.heightMap=(o?wt.empty().applyChanges(this.stateDeco,Ce.empty,this.heightOracle,[new kn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new ZS(_.from,v))}s.heightChanged&&(h|=2)}let P=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return P&&(this.viewport=this.getViewport(u,this.scrollTarget)),this.updateForViewport(),(h&2||P)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,c=new Rr(s.lineAt(o-i*1e3,Ve.ByHeight,r,0,0).from,s.lineAt(a+(1-i)*1e3,Ve.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(hc.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=s.lineAt(h,Ve.ByPos,r,0,0),p;t.y=="center"?p=(f.top+f.bottom)/2-u/2:t.y=="start"||t.y=="nearest"&&h=a+Math.max(10,Math.min(i,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=Fe.LTR&&!i)return[];let a=[],c=(h,u,f,p)=>{if(u-hh&&yy.from>=f.from&&y.to<=f.to&&Math.abs(y.from-h)y.fromS));if(!k){if(uy.from<=u&&y.to>=u)){let y=t.moveToLineBoundary(q.cursor(u),!1,!0).head;y>h&&(u=y)}k=new kl(h,u,this.gapSize(f,h,u,p))}a.push(k)};for(let h of this.viewportLines){if(h.lengthh.from&&c(h.from,p,h,u),mt.draw(this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Xe.spans(e,this.viewport.from,this.viewport.to,{span(s,r){t.push({from:s,to:r})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((s,r)=>s.from!=t[r].from||s.to!=t[r].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Ms(this.heightMap.lineAt(e,Ve.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Ms(this.heightMap.lineAt(this.scaler.fromDOM(e),Ve.ByHeight,this.heightOracle,0,0),this.scaler)}elementAtHeight(e){return Ms(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Rr{constructor(e,t){this.from=e,this.to=t}}function jS(n,e,t){let i=[],s=n,r=0;return Xe.spans(t,n,e,{span(){},point(o,a){o>s&&(i.push({from:s,to:o}),r+=o-s),s=a}},20),s=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let s=0;;s++){let{from:r,to:o}=e[s],a=o-r;if(i<=a)return r+i;i-=a}}function Er(n,e){let t=0;for(let{from:i,to:s}of n.ranges){if(e<=s){t+=e-i;break}t+=s-i}return t/n.total}function US(n,e){for(let t of n)if(e(t))return t}const _f={toDOM(n){return n},fromDOM(n){return n},scale:1};class BS{constructor(e,t,i){let s=0,r=0,o=0;this.viewports=i.map(({from:a,to:c})=>{let h=t.lineAt(a,Ve.ByPos,e,0,0).top,u=t.lineAt(c,Ve.ByPos,e,0,0).bottom;return s+=u-h,{from:a,to:c,top:h,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let a of this.viewports)a.domTop=o+(a.top-r)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),r=a.bottom}toDOM(e){for(let t=0,i=0,s=0;;t++){let r=tMs(s,e)):n._content)}const Zr=ee.define({combine:n=>n.join(" ")}),Rc=ee.define({combine:n=>n.indexOf(!0)>-1}),Xc=ii.newName(),rm=ii.newName(),om=ii.newName(),am={"&light":"."+rm,"&dark":"."+om};function Ec(n,e,t){return new ii(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,s=>{if(s=="&")return n;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):n+" "+i}})}const YS=Ec("."+Xc,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},am);class FS{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="";let{impreciseHead:r,impreciseAnchor:o}=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=r||o?[]:GS(e),c=new Up(a,e.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=HS(a,this.bounds.from)}else{let a=e.observer.selectionRange,c=r&&r.node==a.focusNode&&r.offset==a.focusOffset||!ss(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),h=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!ss(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset);this.newSel=q.single(h,c)}}}function lm(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,c=s.from,h=null;(r===8||te.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:n.state.doc.slice(s.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,s.to))}:(te.mac||te.android)&&t&&t.from==t.to&&t.from==s.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=q.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Ce.of([" "])}):te.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` `&&n.lineWrapping&&(i&&(i=q.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:Ce.of([" "])}),t){let o=n.state;if(te.ios&&n.inputState.flushIOSKey(n)||te.android&&(t.from==s.from&&t.to==s.to&&t.insert.length==1&&t.insert.lines==2&&Hi(n.contentDOM,"Enter",13)||(t.from==s.from-1&&t.to==s.to&&t.insert.length==0||r==8&&t.insert.lengthu(n,t.from,t.to,a)))return!0;n.inputState.composing>=0&&n.inputState.composing++;let c;if(t.from>=s.from&&t.to<=s.to&&t.to-t.from>=(s.to-s.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&n.inputState.composing<0){let u=s.fromt.to?o.sliceDoc(t.to,s.to):"";c=o.replaceSelection(n.state.toText(u+t.insert.sliceString(0,void 0,n.state.lineBreak)+f))}else{let u=o.changes(t),f=i&&i.main.to<=u.newLength?i.main:void 0;if(o.selection.ranges.length>1&&n.inputState.composing>=0&&t.to<=s.to&&t.to>=s.to-10){let p=n.state.sliceDoc(t.from,t.to),m=Bp(n)||n.state.doc.lineAt(s.head),O=s.to-t.to,k=s.to-s.from;c=o.changeByRange(y=>{if(y.from==s.from&&y.to==s.to)return{changes:u,range:f||y.map(u)};let S=y.to-O,P=S-p.length;if(y.to-y.from!=k||n.state.sliceDoc(P,S)!=p||m&&y.to>=m.from&&y.from<=m.to)return{range:y};let Q=o.changes({from:P,to:S,insert:t.insert}),_=y.to-s.to;return{changes:Q,range:f?q.range(Math.max(0,f.anchor+_),Math.max(0,f.head+_)):y.map(Q)}})}else c={changes:u,selection:f&&o.selection.replaceRange(f)}}let h="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,h+=".compose",n.inputState.compositionFirstChange&&(h+=".start",n.inputState.compositionFirstChange=!1)),n.dispatch(c,{scrollIntoView:!0,userEvent:h}),!0}else if(i&&!i.main.eq(s)){let o=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:a}),!0}else return!1}function zS(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(i=="end"){let c=Math.max(0,r-Math.min(o,a));t-=o+c-r}if(o=o?r-t:0;r-=c,a=r+(a-o),o=r}else if(a=a?r-t:0;r-=c,o=r+(o-a),a=r}return{from:r,toA:o,toB:a}}function GS(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new lf(t,i)),(s!=t||r!=i)&&e.push(new lf(s,r))),e}function HS(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?q.single(t+e,i+e):null}const JS={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},bl=te.ie&&te.ie_version<=11;class KS{constructor(e){this.view=e,this.active=!1,this.selectionRange=new Yy,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(te.ie&&te.ie_version<=11||te.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),bl&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)this.view.requestMeasure()),this.resizeContent.observe(e.contentDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runScrollHandlers(this.view,e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(la)?i.root.activeElement!=this.dom:!io(i.dom,s))return;let r=s.anchorNode&&i.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(te.ie&&te.ie_version<=11||te.android&&te.chrome)&&!i.state.selection.main.empty&&s.focusNode&&wo(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=te.safari&&e.root.nodeType==11&&Wy(this.dom.ownerDocument)==this.dom&&ek(this.view)||bo(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=io(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Hi(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:s}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),s=this.selectionChanged&&io(this.dom,this.selectionRange);return e<0&&!s?null:(e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new FS(this.view,e,t,i))}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return!1;let i=this.view.state,s=lm(this.view,t);return this.view.state==i&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.dirty|=4),e.type=="childList"){let i=$f(t,e.previousSibling||e.target.previousSibling,-1),s=$f(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i,s;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect(),(s=this.resizeContent)===null||s===void 0||s.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function $f(n,e,t){for(;e;){let i=Ne.get(e);if(i&&i.parent==n)return i;let s=e.parentNode;e=s!=n.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function ek(n){let e=null;function t(c){c.preventDefault(),c.stopImmediatePropagation(),e=c.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,s=e.startOffset,r=e.endContainer,o=e.endOffset,a=n.docView.domAtPos(n.state.selection.main.anchor);return wo(a.node,a.offset,r,o)&&([i,s,r,o]=[r,o,i,s]),{anchorNode:i,anchorOffset:s,focusNode:r,focusOffset:o}}class K{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this._root=e.root||Fy(e.parent)||document,this.viewState=new Pf(e.state||_e.create(e)),this.plugins=this.state.facet(Es).map(t=>new gl(t));for(let t of this.plugins)t.update(this);this.observer=new KS(this),this.inputState=new wS(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new cf(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}dispatch(...e){let t=e.length==1&&e[0]instanceof st?e[0]:this.state.update(...e);this._dispatch(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,s,r=this.state;for(let p of e){if(p.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=p.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,a=0,c=null;e.some(p=>p.annotation(tm))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=nm(r,o),c||(a=1));let h=this.observer.delayedAndroidKey,u=null;if(h?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(u=null)):this.observer.clear(),r.facet(_e.phrases)!=this.state.facet(_e.phrases))return this.setState(r);s=Qo.create(this,r,e),s.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let p of e){if(f&&(f=f.map(p.changes)),p.scrollIntoView){let{main:m}=p.state.selection;f=new vo(m.empty?m:q.cursor(m.head,m.head>m.anchor?-1:1))}for(let m of p.effects)m.is(of)&&(f=m.value)}this.viewState.update(s,f),this.bidiCache=Po.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Zs)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(p=>p.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(Zr)!=s.state.facet(Zr)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!s.empty)for(let p of this.state.facet(Pc))p(s);(c||u)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),u&&!lm(this,u)&&h.force&&Hi(this.contentDOM,h.key,h.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Pf(e),this.plugins=e.facet(Es).map(i=>new gl(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new cf(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Es),i=e.state.facet(Es);if(t!=i){let s=[];for(let r of i){let o=t.indexOf(r);if(o<0)s.push(new gl(r));else{let a=this.plugins[o];a.mustUpdate=e,s.push(a)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.scrollDOM,{scrollAnchorPos:s,scrollAnchorHeight:r}=this.viewState;if(this.viewState.scrollAnchorHeight=-1,r<0||i.scrollTop!=this.viewState.scrollTop)if(i.scrollTop>i.scrollHeight-i.clientHeight-4)s=-1,r=this.viewState.heightMap.height;else{let o=this.viewState.lineBlockAtHeight(i.scrollTop);s=o.from,r=o.top}try{for(let o=0;;o++){this.updateState=1;let a=this.viewport,c=this.viewState.measure(this);if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];c&4||([this.measureRequests,h]=[h,this.measureRequests]);let u=h.map(O=>{try{return O.read(this)}catch(k){return jt(this.state,k),Tf}}),f=Qo.create(this,this.state,[]),p=!1,m=!1;f.flags|=c,t?t.flags|=c:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),p=this.docView.update(f));for(let O=0;O-1){let k=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-r;(k>1||k<-1)&&(i.scrollTop+=k,m=!0)}}if(p&&this.docView.updateSelection(!0),this.viewport.from==a.from&&this.viewport.to==a.to&&!m&&this.measureRequests.length==0)break;r=-1}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(Pc))o(t)}get themeClasses(){return Xc+" "+(this.state.facet(Rc)?om:rm)+" "+this.state.facet(Zr)}updateAttrs(){let e=Cf(this,Np,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(la)?"true":"false",class:"cm-content",style:`${te.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Cf(this,Xh,t);let i=this.observer.ignore(()=>{let s=vc(this.contentDOM,this.contentAttrs,t),r=vc(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let s of i.effects)if(s.is(K.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Zs),ii.mount(this.root,this.styleModules.concat(YS).reverse())}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;ti.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return Sl(this,e,mf(this,e,t,i))}moveByGroup(e,t){return Sl(this,e,mf(this,e,t,i=>kS(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return SS(this,e,t,i)}moveVertically(e,t,i){return Sl(this,e,bS(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Fp(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[Ji.find(r,e-s.from,-1,t)];return Ch(i,o.dir==Fe.LTR==t>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Mp)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>tk)return Wp(e.length);let t=this.textDirectionAt(e.from);for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t)return s.order;let i=rS(e.text,t);return this.bidiCache.push(new Po(e.from,e.to,t,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||te.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{Op(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return of.of(new vo(typeof e=="number"?q.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return rt.define(()=>({}),{eventHandlers:e})}static theme(e,t){let i=ii.newName(),s=[Zr.of(i),Zs.of(Ec(`.${i}`,e))];return t&&t.dark&&s.push(Rc.of(!0)),s}static baseTheme(e){return Ti.lowest(Zs.of(Ec("."+Xc,e,am)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),s=i&&Ne.get(i)||Ne.get(e);return((t=s==null?void 0:s.rootView)===null||t===void 0?void 0:t.view)||null}}K.styleModule=Zs;K.inputHandler=Ep;K.focusChangeEffect=Zp;K.perLineTextDirection=Mp;K.exceptionSink=Xp;K.updateListener=Pc;K.editable=la;K.mouseSelectionStyle=Rp;K.dragMovesSelection=Ip;K.clickAddsSelectionRange=Ap;K.decorations=Gs;K.atomicRanges=Eh;K.scrollMargins=qp;K.darkTheme=Rc;K.contentAttributes=Xh;K.editorAttributes=Np;K.lineWrapping=K.contentAttributes.of({class:"cm-lineWrapping"});K.announce=we.define();const tk=4096,Tf={};class Po{constructor(e,t,i,s){this.from=e,this.to=t,this.dir=i,this.order=s}static update(e,t){if(t.empty)return e;let i=[],s=e.length?e[e.length-1].dir:Fe.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=i[s],o=typeof r=="function"?r(n):r;o&&xc(o,t)}return t}const nk=te.mac?"mac":te.windows?"win":te.linux?"linux":"key";function ik(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let s,r,o,a;for(let c=0;ci.concat(s),[]))),t}function rk(n,e,t){return hm(cm(n.state),e,n,t)}let Yn=null;const ok=4e3;function ak(n,e=nk){let t=Object.create(null),i=Object.create(null),s=(o,a)=>{let c=i[o];if(c==null)i[o]=a;else if(c!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,a,c,h)=>{var u,f;let p=t[o]||(t[o]=Object.create(null)),m=a.split(/ (?!$)/).map(y=>ik(y,e));for(let y=1;y{let Q=Yn={view:P,prefix:S,scope:o};return setTimeout(()=>{Yn==Q&&(Yn=null)},ok),!0}]})}let O=m.join(" ");s(O,!1);let k=p[O]||(p[O]={preventDefault:!1,run:((f=(u=p._any)===null||u===void 0?void 0:u.run)===null||f===void 0?void 0:f.slice())||[]});c&&k.run.push(c),h&&(k.preventDefault=!0)};for(let o of n){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of a){let u=t[h]||(t[h]=Object.create(null));u._any||(u._any={preventDefault:!1,run:[]});for(let f in u)u[f].run.push(o.any)}let c=o[e]||o.key;if(c)for(let h of a)r(h,c,o.run,o.preventDefault),o.shift&&r(h,"Shift-"+c,o.shift,o.preventDefault)}return t}function hm(n,e,t,i){let s=Ly(e),r=ft(s,0),o=Vt(r)==s.length&&s!=" ",a="",c=!1;Yn&&Yn.view==t&&Yn.scope==i&&(a=Yn.prefix+" ",(c=Gp.indexOf(e.keyCode)<0)&&(Yn=null));let h=new Set,u=O=>{if(O){for(let k of O.run)if(!h.has(k)&&(h.add(k),k(t,e)))return!0;O.preventDefault&&(c=!0)}return!1},f=n[i],p,m;if(f){if(u(f[a+Mr(s,e,!o)]))return!0;if(o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(te.windows&&e.ctrlKey&&e.altKey)&&(p=si[e.keyCode])&&p!=s){if(u(f[a+Mr(p,e,!0)]))return!0;if(e.shiftKey&&(m=Fs[e.keyCode])!=s&&m!=p&&u(f[a+Mr(m,e,!1)]))return!0}else if(o&&e.shiftKey&&u(f[a+Mr(s,e,!0)]))return!0;if(u(f._any))return!0}return c}class Or{constructor(e,t,i,s,r){this.className=e,this.left=t,this.top=i,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let s=e.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let r=um(e);return[new Or(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return lk(e,t,i)}}function um(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Fe.LTR?e.left:e.right-n.scrollDOM.clientWidth)-n.scrollDOM.scrollLeft,top:e.top-n.scrollDOM.scrollTop}}function If(n,e,t){let i=q.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:Ge.Text}}function lk(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),s=Math.min(t.to,n.viewport.to),r=n.textDirection==Fe.LTR,o=n.contentDOM,a=o.getBoundingClientRect(),c=um(n),h=o.querySelector(".cm-line"),u=h&&window.getComputedStyle(h),f=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),p=a.right-(u?parseInt(u.paddingRight):0),m=Cc(n,i),O=Cc(n,s),k=m.type==Ge.Text?m:null,y=O.type==Ge.Text?O:null;if(k&&(n.lineWrapping||m.widgetLineBreaks)&&(k=If(n,i,k)),y&&(n.lineWrapping||O.widgetLineBreaks)&&(y=If(n,s,y)),k&&y&&k.from==y.from)return P(Q(t.from,t.to,k));{let v=k?Q(t.from,null,k):_(m,!1),$=y?Q(null,t.to,y):_(O,!0),x=[];return(k||m).to<(y||O).from-(k&&y?1:0)||m.widgetLineBreaks>1&&v.bottom+n.defaultLineHeight/2<$.top?x.push(S(f,v.bottom,p,$.top)):v.bottom<$.top&&n.elementAtHeight((v.bottom+$.top)/2).type==Ge.Text&&(v.bottom=$.top=(v.bottom+$.top)/2),P(v).concat(x).concat(P($))}function S(v,$,x,C){return new Or(e,v-c.left,$-c.top-.01,x-v,C-$+.01)}function P({top:v,bottom:$,horizontal:x}){let C=[];for(let R=0;RY&&re.from=he)break;me>pe&&U(Math.max(ue,pe),v==null&&ue<=Y,Math.min(me,he),$==null&&me>=ce,ie.dir)}if(pe=de.to+1,pe>=he)break}return W.length==0&&U(Y,v==null,ce,$==null,n.textDirection),{top:C,bottom:R,horizontal:W}}function _(v,$){let x=a.top+($?v.top:v.bottom);return{top:x,bottom:x,horizontal:[]}}}function ck(n,e){return n.constructor==e.constructor&&n.eq(e)}class hk{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(oo)!=e.state.facet(oo)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&e.view.requestMeasure(this.measureReq)}setOrder(e){let t=0,i=e.facet(oo);for(;t!ck(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[i].constructor&&s.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const oo=ee.define();function fm(n){return[rt.define(e=>new hk(e,n)),oo.of(n)]}const dm=!te.ios,Hs=ee.define({combine(n){return _n(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function uk(n={}){return[Hs.of(n),fk,dk,pk,Dp.of(!0)]}function pm(n){return n.startState.facet(Hs)!=n.state.facet(Hs)}const fk=fm({above:!0,markers(n){let{state:e}=n,t=e.facet(Hs),i=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty?!r||dm:t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=s.empty?s:q.cursor(s.head,s.head>s.anchor?-1:1);for(let c of Or.forRange(n,o,a))i.push(c)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=pm(n);return t&&Rf(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){Rf(e.state,n)},class:"cm-cursorLayer"});function Rf(n,e){e.style.animationDuration=n.facet(Hs).cursorBlinkRate+"ms"}const dk=fm({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Or.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||pm(n)},class:"cm-selectionLayer"}),mm={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};dm&&(mm[".cm-line"].caretColor="transparent !important");const pk=Ti.highest(K.theme(mm)),Om=we.define({map(n,e){return n==null?null:e.mapPos(n)}}),Ds=ct.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Om)?i.value:t,n)}}),mk=rt.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(Ds);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(Ds)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let n=this.view.state.field(Ds),e=n!=null&&this.view.coordsAtPos(n);if(!e)return null;let t=this.view.scrollDOM.getBoundingClientRect();return{left:e.left-t.left+this.view.scrollDOM.scrollLeft,top:e.top-t.top+this.view.scrollDOM.scrollTop,height:e.bottom-e.top}}drawCursor(n){this.cursor&&(n?(this.cursor.style.left=n.left+"px",this.cursor.style.top=n.top+"px",this.cursor.style.height=n.height+"px"):this.cursor.style.left="-100000px")}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(Ds)!=n&&this.view.dispatch({effects:Om.of(n)})}},{eventHandlers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Ok(){return[Ds,mk]}function Xf(n,e,t,i,s){e.lastIndex=0;for(let r=n.iterRange(t,i),o=t,a;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;a=e.exec(r.value);)s(o+a.index,a)}function gk(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:s,to:r}of t)s=Math.max(n.state.doc.lineAt(s).from,s-e),r=Math.min(n.state.doc.lineAt(r).to,r+e),i.length&&i[i.length-1].to>=s?i[i.length-1].to=r:i.push({from:s,to:r});return i}class yk{constructor(e){const{regexp:t,decoration:i,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(a,c,h,u)=>s(u,h,h+a[0].length,a,c);else if(typeof i=="function")this.addMatch=(a,c,h,u)=>{let f=i(a,c,h);f&&u(h,h+a[0].length,f)};else if(i)this.addMatch=(a,c,h,u)=>u(h,h+a[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new ni,i=t.add.bind(t);for(let{from:s,to:r}of gk(e,this.maxLength))Xf(e.state.doc,this.regexp,s,r,(o,a)=>this.addMatch(a,e,o,i));return t.finish()}updateDeco(e,t){let i=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,a,c)=>{c>e.view.viewport.from&&a1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),i,s):t}updateRange(e,t,i,s){for(let r of e.visibleRanges){let o=Math.max(r.from,i),a=Math.min(r.to,s);if(a>o){let c=e.state.doc.lineAt(o),h=c.toc.from;o--)if(this.boundary.test(c.text[o-1-c.from])){u=o;break}for(;ap.push(S.range(k,y));if(c==h)for(this.regexp.lastIndex=u-c.from;(m=this.regexp.exec(c.text))&&m.indexthis.addMatch(y,e,k,O));t=t.update({filterFrom:u,filterTo:f,filter:(k,y)=>kf,add:p})}}return t}}const Zc=/x/.unicode!=null?"gu":"g",Sk=new RegExp(`[\0-\b --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Zc),kk={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"};let wl=null;function bk(){var n;if(wl==null&&typeof document<"u"&&document.body){let e=document.body.style;wl=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return wl||!1}const ao=ee.define({combine(n){let e=_n(n,{render:null,specialChars:Sk,addSpecialChars:null});return(e.replaceTabs=!bk())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Zc)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Zc)),e}});function wk(n={}){return[ao.of(n),xk()]}let Ef=null;function xk(){return Ef||(Ef=rt.fromClass(class{constructor(n){this.view=n,this.decorations=le.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(ao)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new yk({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ft(e[0],0);if(r==9){let o=s.lineAt(i),a=t.state.tabSize,c=dr(o.text,a,i-o.from);return le.replace({widget:new _k((a-c%a)*this.view.defaultCharacterWidth)})}return this.decorationCache[r]||(this.decorationCache[r]=le.replace({widget:new Pk(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(ao);n.startState.facet(ao)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const vk="•";function Qk(n){return n>=32?vk:n==10?"␤":String.fromCharCode(9216+n)}class Pk extends qn{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Qk(this.code),i=e.state.phrase("Control character")+" "+(kk[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class _k extends qn{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 $k(){return Ck}const Tk=le.line({class:"cm-activeLine"}),Ck=rt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let s=n.lineBlockAt(i.head);s.from>e&&(t.push(Tk.range(s.from)),e=s.from)}return le.set(t)}},{decorations:n=>n.decorations}),Mc=2e3;function Ak(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Mc||t.off>Mc||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let c=i;c<=s;c++){let h=n.doc.line(c);h.length<=a&&r.push(q.range(h.from+o,h.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let c=i;c<=s;c++){let h=n.doc.line(c),u=mc(h.text,o,n.tabSize,!0);if(u<0)r.push(q.cursor(h.to));else{let f=mc(h.text,a,n.tabSize);r.push(q.range(h.from+u,h.from+f))}}}return r}function Ik(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function Zf(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),s=t-i.from,r=s>Mc?-1:s==i.length?Ik(n,e.clientX):dr(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:r,off:s}}function Rk(n,e){let t=Zf(n,e),i=n.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},i=i.map(s.changes)}},get(s,r,o){let a=Zf(n,s);if(!a)return i;let c=Ak(n.state,t,a);return c.length?o?q.create(c.concat(i.ranges)):q.create(c):i}}:null}function Xk(n){let e=(n==null?void 0:n.eventFilter)||(t=>t.altKey&&t.button==0);return K.mouseSelectionStyle.of((t,i)=>e(i)?Rk(t,i):null)}const Ek={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},Zk={style:"cursor: crosshair"};function Mk(n={}){let[e,t]=Ek[n.key||"Alt"],i=rt.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventHandlers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[i,K.contentAttributes.of(s=>{var r;return!((r=s.plugin(i))===null||r===void 0)&&r.isDown?Zk:null})]}const Dr="-10000px";class gm{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(s=>s),this.tooltipViews=this.tooltips.map(i)}update(e){var t;let i=e.state.facet(this.facet),s=i.filter(o=>o);if(i===this.input){for(let o of this.tooltipViews)o.update&&o.update(e);return!1}let r=[];for(let o=0;o{var e,t,i;return{position:te.ios?"absolute":((e=n.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(s=>s.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||Dk}}}),Mf=new WeakMap,ym=rt.fromClass(class{constructor(n){this.view=n,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(xl);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new gm(n,Mh,t=>this.createTooltip(t)),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n);e&&this.observeIntersection();let t=e||n.geometryChanged,i=n.state.facet(xl);if(i.position!=this.position){this.position=i.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Dr,this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)}),size:this.manager.tooltipViews.map(({dom:e})=>e.getBoundingClientRect()),space:this.view.state.facet(xl).tooltipSpace(this.view)}}writeMeasure(n){var e;let{editor:t,space:i}=n,s=[];for(let r=0;r=Math.min(t.bottom,i.bottom)||h.rightMath.min(t.right,i.right)+.1){c.style.top=Dr;continue}let f=o.arrow?a.dom.querySelector(".cm-tooltip-arrow"):null,p=f?7:0,m=u.right-u.left,O=(e=Mf.get(a))!==null&&e!==void 0?e:u.bottom-u.top,k=a.offset||qk,y=this.view.textDirection==Fe.LTR,S=u.width>i.right-i.left?y?i.left:i.right-u.width:y?Math.min(h.left-(f?14:0)+k.x,i.right-m):Math.max(i.left,h.left-m+(f?14:0)-k.x),P=!!o.above;!o.strictSide&&(P?h.top-(u.bottom-u.top)-k.yi.bottom)&&P==i.bottom-h.bottom>h.top-i.top&&(P=!P);let Q=(P?h.top-i.top:i.bottom-h.bottom)-p;if(QS&&$.top<_+O&&$.bottom>_&&(_=P?$.top-O-2-p:$.bottom+p+2);this.position=="absolute"?(c.style.top=_-n.parent.top+"px",c.style.left=S-n.parent.left+"px"):(c.style.top=_+"px",c.style.left=S+"px"),f&&(f.style.left=`${h.left+(y?k.x:-k.x)-(S+14-7)}px`),a.overlap!==!0&&s.push({left:S,top:_,right:v,bottom:_+O}),c.classList.toggle("cm-tooltip-above",P),c.classList.toggle("cm-tooltip-below",!P),a.positioned&&a.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Dr}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),Nk=K.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),qk={x:0,y:0},Mh=ee.define({enables:[ym,Nk]}),_o=ee.define();class Dh{constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new gm(e,_o,t=>this.createHostedView(t))}static create(e){return new Dh(e)}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}}const Vk=Mh.compute([_o],n=>{let e=n.facet(_o).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Dh.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class Lk{constructor(e,t,i,s,r){this.view=e,this.source=t,this.field=i,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;ei.bottom||e.xi.right+this.view.defaultCharacterWidth)return;let s=this.view.bidiSpans(this.view.state.doc.lineAt(t)).find(a=>a.from<=t&&a.to>=t),r=s&&s.dir==Fe.RTL?-1:1,o=this.source(this.view,t,e.x{this.pending==a&&(this.pending=null,c&&this.view.dispatch({effects:this.setHover.of(c)}))},c=>jt(this.view.state,c,"hover tooltip"))}else o&&this.view.dispatch({effects:this.setHover.of(o)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let i=this.active;if(i&&!Df(this.lastMove.target)||this.pending){let{pos:s}=i||this.pending,r=(t=i==null?void 0:i.end)!==null&&t!==void 0?t:s;(s==r?this.view.posAtCoords(this.lastMove)!=s:!Wk(this.view,s,r,e.clientX,e.clientY,6))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!Df(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function Df(n){for(let e=n;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function Wk(n,e,t,i,s,r){let o=document.createRange(),a=n.domAtPos(e),c=n.domAtPos(t);o.setEnd(c.node,c.offset),o.setStart(a.node,a.offset);let h=o.getClientRects();o.detach();for(let u=0;u_o.from(s)});return[i,rt.define(s=>new Lk(s,n,i,t,e.hoverTime||300)),Vk]}function Sm(n,e){let t=n.plugin(ym);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const Uk=we.define(),Nf=ee.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Js(n,e){let t=n.plugin(km),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const km=rt.fromClass(class{constructor(n){this.input=n.state.facet(Ks),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(Nf);this.top=new Nr(n,!0,e.topContainer),this.bottom=new Nr(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(Nf);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Nr(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Nr(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Ks);if(t!=this.input){let i=t.filter(c=>c),s=[],r=[],o=[],a=[];for(let c of i){let h=this.specs.indexOf(c),u;h<0?(u=c(n.view),a.push(u)):(u=this.panels[h],u.update&&u.update(n)),s.push(u),(u.top?r:o).push(u)}this.specs=i,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let c of a)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>K.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Nr{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=qf(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=qf(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function qf(n){let e=n.nextSibling;return n.remove(),e}const Ks=ee.define({enables:km});class Mn extends bi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Mn.prototype.elementClass="";Mn.prototype.toDOM=void 0;Mn.prototype.mapMode=pt.TrackBefore;Mn.prototype.startSide=Mn.prototype.endSide=-1;Mn.prototype.point=!0;const lo=ee.define(),Bk={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Xe.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Ws=ee.define();function Yk(n){return[bm(),Ws.of(Object.assign(Object.assign({},Bk),n))]}const Dc=ee.define({combine:n=>n.some(e=>e)});function bm(n){let e=[Fk];return n&&n.fixed===!1&&e.push(Dc.of(!0)),e}const Fk=rt.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=n.state.facet(Ws).map(e=>new Lf(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(Dc),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Dc)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=Xe.iter(this.view.state.facet(lo),this.view.viewport.from),i=[],s=this.gutters.map(r=>new zk(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let a of r.type)if(a.type==Ge.Text&&o){Nc(t,i,a.from);for(let c of s)c.line(this.view,a,i);o=!1}else if(a.widget)for(let c of s)c.widget(this.view,a)}else if(r.type==Ge.Text){Nc(t,i,r.from);for(let o of s)o.line(this.view,r,i)}for(let r of s)r.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(Ws),t=n.state.facet(Ws),i=n.docChanged||n.heightChanged||n.viewportChanged||!Xe.eq(n.startState.facet(lo),n.state.facet(lo),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(n)&&(i=!0);else{i=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new Lf(this.view,r)):(this.gutters[o].update(n),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)this.dom.appendChild(r.dom);this.gutters=s}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>K.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==Fe.LTR?{left:t.dom.offsetWidth}:{right:t.dom.offsetWidth}})});function Vf(n){return Array.isArray(n)?n:[n]}function Nc(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class zk{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=Xe.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:s}=this,r=t.top-this.height;if(this.i==s.elements.length){let o=new wm(e,t.height,r,i);s.elements.push(o),s.dom.appendChild(o.dom)}else s.elements[this.i].update(e,t.height,r,i);this.height=t.bottom,this.i++}line(e,t,i){let s=[];Nc(this.cursor,s,t.from),i.length&&(s=s.concat(i));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t);i&&this.addElement(e,t,[i])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Lf{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let c=r.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=s.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,a,s)&&s.preventDefault()});this.markers=Vf(t.markers(e)),t.initialSpacer&&(this.spacer=new wm(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Vf(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let i=e.view.viewport;return!Xe.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class wm{constructor(e,t,i,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,s)}update(e,t,i,s){this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),Gk(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let i="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let a=o,c=rr(a,c,h)||o(a,c,h):o}return i}})}});class vl extends Mn{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Ql(n,e){return n.state.facet(Ui).formatNumber(e,n.state)}const Jk=Ws.compute([Ui],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Hk)},lineMarker(e,t,i){return i.some(s=>s.toDOM)?null:new vl(Ql(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(Ui)!=e.state.facet(Ui),initialSpacer(e){return new vl(Ql(e,Wf(e.state.doc.lines)))},updateSpacer(e,t){let i=Ql(t.view,Wf(t.view.state.doc.lines));return i==e.number?e:new vl(i)},domEventHandlers:n.facet(Ui).domEventHandlers}));function Kk(n={}){return[Ui.of(n),bm(),Jk]}function Wf(n){let e=9;for(;e{let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.head).from;s>t&&(t=s,e.push(eb.range(s)))}return Xe.of(e)});function nb(){return tb}const xm=1024;let ib=0;class Lt{constructor(e,t){this.from=e,this.to=t}}class ve{constructor(e={}){this.id=ib++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=xt.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}ve.closedBy=new ve({deserialize:n=>n.split(" ")});ve.openedBy=new ve({deserialize:n=>n.split(" ")});ve.group=new ve({deserialize:n=>n.split(" ")});ve.contextHash=new ve({perNode:!0});ve.lookAhead=new ve({perNode:!0});ve.mounted=new ve({perNode:!0});class sb{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const rb=Object.create(null);class xt{constructor(e,t,i,s=0){this.name=e,this.props=t,this.id=i,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):rb,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new xt(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(ve.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let s of i.split(" "))t[s]=e[i];return i=>{for(let s=i.prop(ve.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?i.name:s[r]];if(o)return o}}}}xt.none=new xt("",Object.create(null),0,8);class Nh{constructor(e){this.types=e;for(let t=0;t0;for(let c=this.cursor(o|De.IncludeAnonymous);;){let h=!1;if(c.from<=r&&c.to>=s&&(!a&&c.type.isAnonymous||t(c)!==!1)){if(c.firstChild())continue;h=!0}for(;h&&i&&(a||!c.type.isAnonymous)&&i(c),!c.nextSibling();){if(!c.parent())return;h=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Lh(xt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,s)=>new ze(this.type,t,i,s,this.propValues),e.makeTree||((t,i,s)=>new ze(xt.none,t,i,s)))}static build(e){return ab(e)}}ze.empty=new ze(xt.none,[],[],0);class qh{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new qh(this.buffer,this.index)}}class Ci{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return xt.none}toString(){let e=[];for(let t=0;t0));c=o[c+3]);return a}slice(e,t,i){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let a=e,c=0;a=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Qm(n,e){let t=n.childBefore(e);for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(n=t,t=i.prevSibling):t=i}return n}function as(n,e,t,i){for(var s;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?a.length:-1;e!=h;e+=t){let u=a[e],f=c[e]+o.from;if(vm(s,i,f,f+u.length)){if(u instanceof Ci){if(r&De.ExcludeBuffers)continue;let p=u.findChild(0,u.buffer.length,t,i-f,s);if(p>-1)return new mn(new ob(o,u,e,f),null,p)}else if(r&De.IncludeAnonymous||!u.type.isAnonymous||Vh(u)){let p;if(!(r&De.IgnoreMounts)&&u.props&&(p=u.prop(ve.mounted))&&!p.overlay)return new Ut(p.tree,f,e,o);let m=new Ut(u,f,e,o);return r&De.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?u.children.length-1:0,t,i,s)}}}if(r&De.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let s;if(!(i&De.IgnoreOverlays)&&(s=this._tree.prop(ve.mounted))&&s.overlay){let r=e-this.from;for(let{from:o,to:a}of s.overlay)if((t>0?o<=r:o=r:a>r))return new Ut(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new er(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return as(this,e,t,!1)}resolveInner(e,t=0){return as(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Qm(this,e)}getChild(e,t=null,i=null){let s=$o(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return $o(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return To(this,e)}}function $o(n,e,t,i){let s=n.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(;!s.type.is(t);)if(!s.nextSibling())return r}for(;;){if(i!=null&&s.type.is(i))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return i==null?r:[]}}function To(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class ob{constructor(e,t,i,s){this.parent=e,this.buffer=t,this.index=i,this.start=s}}class mn{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new mn(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&De.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new mn(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new mn(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new mn(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new er(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,s=this.index+4,r=i.buffer[this.index+3];if(r>s){let o=i.buffer[this.index+1];e.push(i.slice(s,r,o)),t.push(0)}return new ze(this.type,e,t,this.to-this.from)}resolve(e,t=0){return as(this,e,t,!1)}resolveInner(e,t=0){return as(this,e,t,!0)}enterUnfinishedNodesBefore(e){return Qm(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let s=$o(this,e,t,i);return s.length?s[0]:null}getChildren(e,t=null,i=null){return $o(this,e,t,i)}get node(){return this}matchContext(e){return To(this,e)}}class er{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Ut)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=i+s.buffer[e+1],this.to=i+s.buffer[e+2],!0}yield(e){return e?e instanceof Ut?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&De.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&De.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&De.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let s=i<0?0:this.stack[i]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(s)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let a=i._tree.children[r];if(this.mode&De.IncludeAnonymous||a instanceof Ci||!a.type.isAnonymous||Vh(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,i=r+1;break e}s=this.stack[--r]}for(let s=i;s=0;r--){if(r<0)return To(this.node,e,s);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function Vh(n){return n.children.some(e=>e instanceof Ci||!e.type.isAnonymous||Vh(e))}function ab(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:s=xm,reused:r=[],minRepeatType:o=i.types.length}=n,a=Array.isArray(t)?new qh(t,t.length):t,c=i.types,h=0,u=0;function f(_,v,$,x,C){let{id:R,start:W,end:U,size:Y}=a,ce=u;for(;Y<0;)if(a.next(),Y==-1){let ie=r[R];$.push(ie),x.push(W-_);return}else if(Y==-3){h=R;return}else if(Y==-4){u=R;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let re=c[R],pe,he,de=W-_;if(U-W<=s&&(he=k(a.pos-v,C))){let ie=new Uint16Array(he.size-he.skip),ue=a.pos-he.size,me=ie.length;for(;a.pos>ue;)me=y(he.start,ie,me);pe=new Ci(ie,U-he.start,i),de=he.start-_}else{let ie=a.pos-Y;a.next();let ue=[],me=[],be=R>=o?R:-1,Qe=0,Ie=U;for(;a.pos>ie;)be>=0&&a.id==be&&a.size>=0?(a.end<=Ie-s&&(m(ue,me,W,Qe,a.end,Ie,be,ce),Qe=ue.length,Ie=a.end),a.next()):f(W,ie,ue,me,be);if(be>=0&&Qe>0&&Qe-1&&Qe>0){let Re=p(re);pe=Lh(re,ue,me,0,ue.length,0,U-W,Re,Re)}else pe=O(re,ue,me,U-W,ce-U)}$.push(pe),x.push(de)}function p(_){return(v,$,x)=>{let C=0,R=v.length-1,W,U;if(R>=0&&(W=v[R])instanceof ze){if(!R&&W.type==_&&W.length==x)return W;(U=W.prop(ve.lookAhead))&&(C=$[R]+W.length+U)}return O(_,v,$,x,C)}}function m(_,v,$,x,C,R,W,U){let Y=[],ce=[];for(;_.length>x;)Y.push(_.pop()),ce.push(v.pop()+$-C);_.push(O(i.types[W],Y,ce,R-C,U-R)),v.push(C-$)}function O(_,v,$,x,C=0,R){if(h){let W=[ve.contextHash,h];R=R?[W].concat(R):[W]}if(C>25){let W=[ve.lookAhead,C];R=R?[W].concat(R):[W]}return new ze(_,v,$,x,R)}function k(_,v){let $=a.fork(),x=0,C=0,R=0,W=$.end-s,U={size:0,start:0,skip:0};e:for(let Y=$.pos-_;$.pos>Y;){let ce=$.size;if($.id==v&&ce>=0){U.size=x,U.start=C,U.skip=R,R+=4,x+=4,$.next();continue}let re=$.pos-ce;if(ce<0||re=o?4:0,he=$.start;for($.next();$.pos>re;){if($.size<0)if($.size==-3)pe+=4;else break e;else $.id>=o&&(pe+=4);$.next()}C=he,x+=ce,R+=pe}return(v<0||x==_)&&(U.size=x,U.start=C,U.skip=R),U.size>4?U:void 0}function y(_,v,$){let{id:x,start:C,end:R,size:W}=a;if(a.next(),W>=0&&x4){let Y=a.pos-(W-4);for(;a.pos>Y;)$=y(_,v,$)}v[--$]=U,v[--$]=R-_,v[--$]=C-_,v[--$]=x}else W==-3?h=x:W==-4&&(u=x);return $}let S=[],P=[];for(;a.pos>0;)f(n.start||0,n.bufferStart||0,S,P,-1);let Q=(e=n.length)!==null&&e!==void 0?e:S.length?P[0]+S[0].length:0;return new ze(c[n.topID],S.reverse(),P.reverse(),Q)}const Uf=new WeakMap;function co(n,e){if(!n.isAnonymous||e instanceof Ci||e.type!=n)return 1;let t=Uf.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof ze)){t=1;break}t+=co(n,i)}Uf.set(e,t)}return t}function Lh(n,e,t,i,s,r,o,a,c){let h=0;for(let O=i;O=u)break;$+=x}if(Q==_+1){if($>u){let x=O[_];m(x.children,x.positions,0,x.children.length,k[_]+P);continue}f.push(O[_])}else{let x=k[Q-1]+O[Q-1].length-v;f.push(Lh(n,O,k,_,Q,v,x,null,c))}p.push(v+P-r)}}return m(e,t,i,s,0),(a||c)(f,p,o)}class Pm{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof mn?this.setBuffer(e.context.buffer,e.index,t):e instanceof Ut&&this.map.set(e.tree,t)}get(e){return e instanceof mn?this.getBuffer(e.context.buffer,e.index):e instanceof Ut?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class En{constructor(e,t,i,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let s=[new En(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,i=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let a=0,c=0,h=0;;a++){let u=a=i)for(;o&&o.from=p.from||f<=p.to||h){let m=Math.max(p.from,c)-h,O=Math.min(p.to,f)-h;p=m>=O?null:new En(m,O,p.tree,p.offset+h,a>0,!!u)}if(p&&s.push(p),o.to>f)break;o=rnew Lt(s.from,s.to)):[new Lt(0,0)]:[new Lt(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let s=this.startParse(e,t,i);for(;;){let r=s.advance();if(r)return r}}}class lb{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function ca(n){return(e,t,i,s)=>new hb(e,n,t,i,s)}class Bf{constructor(e,t,i,s,r){if(this.parser=e,this.parse=t,this.overlay=i,this.target=s,this.ranges=r,!r.length||r.some(o=>o.from>=o.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(r))}}class cb{constructor(e,t,i,s,r,o,a){this.parser=e,this.predicate=t,this.mounts=i,this.index=s,this.start=r,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const qc=new ve({perNode:!0});class hb{constructor(e,t,i,s,r){this.nest=t,this.input=i,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new ze(i.type,i.children,i.positions,i.length,i.propValues.concat([[qc,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[ve.mounted.id]=new sb(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;tu.frag.from<=s.from&&u.frag.to>=s.to&&u.mount.overlay);if(h)for(let u of h.mount.overlay){let f=u.from+h.pos,p=u.to+h.pos;f>=s.from&&p<=s.to&&!t.ranges.some(m=>m.fromf)&&t.ranges.push({from:f,to:p})}}a=!1}else if(i&&(o=ub(i.ranges,s.from,s.to)))a=o!=2;else if(!s.type.isAnonymous&&s.fromnew Lt(f.from-s.from,f.to-s.from)):null,s.tree,u)),r.overlay?u.length&&(i={ranges:u,depth:0,prev:i}):a=!1}}else t&&(c=t.predicate(s))&&(c===!0&&(c=new Lt(s.from,s.to)),c.fromnew Lt(u.from-t.start,u.to-t.start)),t.target,h)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function ub(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Yf(n,e,t,i,s,r){if(e=e.to);i++);let o=s.children[i],a=o.buffer;function c(h,u,f,p,m){let O=h;for(;a[O+2]+r<=e.from;)O=a[O+3];let k=[],y=[];Yf(o,h,O,k,y,p);let S=a[O+1],P=a[O+2],Q=S+r==e.from&&P+r==e.to&&a[O]==e.type.id;return k.push(Q?e.toTree():c(O+4,a[O+3],o.set.types[a[O]],S,P-S)),y.push(S-p),Yf(o,a[O+3],u,k,y,p),new ze(f,k,y,m)}s.children[i]=c(0,a.length,xt.none,0,o.length);for(let h=0;h<=t;h++)n.childAfter(e.from)}class Ff{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(De.IncludeAnonymous|De.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,De.IgnoreOverlays|De.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof ze)t=t.children[0];else break}return!1}}let db=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(qc))!==null&&t!==void 0?t:i.to,this.inner=new Ff(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(qc))!==null&&e!==void 0?e:t.to,this.inner=new Ff(t.tree,-t.offset)}}findMounts(e,t){var i;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(ve.mounted);if(o&&o.parser==t)for(let a=this.fragI;a=r.to)break;c.tree==this.curFrag.tree&&s.push({frag:c,pos:r.from-c.offset,mount:o})}}}return s}};function zf(n,e){let t=null,i=e;for(let s=1,r=0;s=a)break;c.to<=o||(t||(i=t=e.slice()),c.froma&&t.splice(r+1,0,new Lt(a,c.to))):c.to>a?t[r--]=new Lt(a,c.to):t.splice(r--,1))}}return i}function pb(n,e,t,i){let s=0,r=0,o=!1,a=!1,c=-1e9,h=[];for(;;){let u=s==n.length?1e9:o?n[s].to:n[s].from,f=r==e.length?1e9:a?e[r].to:e[r].from;if(o!=a){let p=Math.max(c,t),m=Math.min(u,f,i);pnew Lt(p.from+i,p.to+i)),f=pb(e,u,c,h);for(let p=0,m=c;;p++){let O=p==f.length,k=O?h:f[p].from;if(k>m&&t.push(new En(m,k,s.tree,-o,r.from>=m||r.openStart,r.to<=k||r.openEnd)),O)break;m=f[p].to}}else t.push(new En(c,h,s.tree,-o,r.from>=o||r.openStart,r.to<=a||r.openEnd))}return t}let mb=0;class fn{constructor(e,t,i){this.set=e,this.base=t,this.modified=i,this.id=mb++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let t=new fn([],null,[]);if(t.set.push(t),e)for(let i of e.set)t.set.push(i);return t}static defineModifier(){let e=new Co;return t=>t.modified.indexOf(e)>-1?t:Co.get(t.base||t,t.modified.concat(e).sort((i,s)=>i.id-s.id))}}let Ob=0;class Co{constructor(){this.instances=[],this.id=Ob++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(a=>a.base==e&&gb(t,a.modified));if(i)return i;let s=[],r=new fn(s,e,t);for(let a of t)a.instances.push(r);let o=yb(t);for(let a of e.set)if(!a.modified.length)for(let c of o)s.push(Co.get(a,c));return r}}function gb(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function yb(n){let e=[[]];for(let t=0;ti.length-t.length)}function gr(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let s of t.split(" "))if(s){let r=[],o=2,a=s;for(let f=0;;){if(a=="..."&&f>0&&f+3==s.length){o=1;break}let p=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!p)throw new RangeError("Invalid path: "+s);if(r.push(p[0]=="*"?"":p[0][0]=='"'?JSON.parse(p[0]):p[0]),f+=p[0].length,f==s.length)break;let m=s[f++];if(f==s.length&&m=="!"){o=0;break}if(m!="/")throw new RangeError("Invalid path: "+s);a=s.slice(f)}let c=r.length-1,h=r[c];if(!h)throw new RangeError("Invalid path: "+s);let u=new Ao(i,o,c>0?r.slice(0,c):null);e[h]=u.sort(e[h])}}return $m.add(e)}const $m=new ve;class Ao{constructor(e,t,i,s){this.tags=e,this.mode=t,this.context=i,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let a of r)for(let c of a.set){let h=t[c.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Sb(n,e){let t=null;for(let i of n){let s=i.style(e);s&&(t=t?t+" "+s:s)}return t}function kb(n,e,t,i=0,s=n.length){let r=new bb(i,Array.isArray(e)?e:[e],t);r.highlightRange(n.cursor(),i,s,"",r.highlighters),r.flush(s)}class bb{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,s,r){let{type:o,from:a,to:c}=e;if(a>=i||c<=t)return;o.isTop&&(r=this.highlighters.filter(m=>!m.scope||m.scope(o)));let h=s,u=wb(e)||Ao.empty,f=Sb(r,u.tags);if(f&&(h&&(h+=" "),h+=f,u.mode==1&&(s+=(s?" ":"")+f)),this.startSpan(Math.max(t,a),h),u.opaque)return;let p=e.tree&&e.tree.prop(ve.mounted);if(p&&p.overlay){let m=e.node.enter(p.overlay[0].from+a,1),O=this.highlighters.filter(y=>!y.scope||y.scope(p.tree.type)),k=e.firstChild();for(let y=0,S=a;;y++){let P=y=Q||!e.nextSibling())););if(!P||Q>i)break;S=P.to+a,S>t&&(this.highlightRange(m.cursor(),Math.max(t,P.from+a),Math.min(i,S),"",O),this.startSpan(Math.min(i,S),h))}k&&e.parent()}else if(e.firstChild()){p&&(s="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,s,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function wb(n){let e=n.type.prop($m);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const G=fn.define,Vr=G(),Un=G(),Hf=G(Un),Jf=G(Un),Bn=G(),Lr=G(Bn),Pl=G(Bn),hn=G(),di=G(hn),ln=G(),cn=G(),Vc=G(),Qs=G(Vc),Wr=G(),b={comment:Vr,lineComment:G(Vr),blockComment:G(Vr),docComment:G(Vr),name:Un,variableName:G(Un),typeName:Hf,tagName:G(Hf),propertyName:Jf,attributeName:G(Jf),className:G(Un),labelName:G(Un),namespace:G(Un),macroName:G(Un),literal:Bn,string:Lr,docString:G(Lr),character:G(Lr),attributeValue:G(Lr),number:Pl,integer:G(Pl),float:G(Pl),bool:G(Bn),regexp:G(Bn),escape:G(Bn),color:G(Bn),url:G(Bn),keyword:ln,self:G(ln),null:G(ln),atom:G(ln),unit:G(ln),modifier:G(ln),operatorKeyword:G(ln),controlKeyword:G(ln),definitionKeyword:G(ln),moduleKeyword:G(ln),operator:cn,derefOperator:G(cn),arithmeticOperator:G(cn),logicOperator:G(cn),bitwiseOperator:G(cn),compareOperator:G(cn),updateOperator:G(cn),definitionOperator:G(cn),typeOperator:G(cn),controlOperator:G(cn),punctuation:Vc,separator:G(Vc),bracket:Qs,angleBracket:G(Qs),squareBracket:G(Qs),paren:G(Qs),brace:G(Qs),content:hn,heading:di,heading1:G(di),heading2:G(di),heading3:G(di),heading4:G(di),heading5:G(di),heading6:G(di),contentSeparator:G(hn),list:G(hn),quote:G(hn),emphasis:G(hn),strong:G(hn),link:G(hn),monospace:G(hn),strikethrough:G(hn),inserted:G(),deleted:G(),changed:G(),invalid:G(),meta:Wr,documentMeta:G(Wr),annotation:G(Wr),processingInstruction:G(Wr),definition:fn.defineModifier(),constant:fn.defineModifier(),function:fn.defineModifier(),standard:fn.defineModifier(),local:fn.defineModifier(),special:fn.defineModifier()};Tm([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var _l;const Bi=new ve;function Cm(n){return ee.define({combine:n?e=>e.concat(n):void 0})}const Wh=new ve;class en{constructor(e,t,i=[],s=""){this.data=e,this.name=s,_e.prototype.hasOwnProperty("tree")||Object.defineProperty(_e.prototype,"tree",{get(){return He(this)}}),this.parser=t,this.extension=[ai.of(this),_e.languageData.of((r,o,a)=>{let c=Kf(r,o,a),h=c.type.prop(Bi);if(!h)return[];let u=r.facet(h),f=c.type.prop(Wh);if(f){let p=c.resolve(o-c.from,a);for(let m of f)if(m.test(p,r)){let O=r.facet(m.facet);return m.type=="replace"?O:O.concat(u)}}return u})].concat(i)}isActiveAt(e,t,i=-1){return Kf(e,t,i).type.prop(Bi)==this.data}findRegions(e){let t=e.facet(ai);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],s=(r,o)=>{if(r.prop(Bi)==this.data){i.push({from:o,to:o+r.length});return}let a=r.prop(ve.mounted);if(a){if(a.tree.prop(Bi)==this.data){if(a.overlay)for(let c of a.overlay)i.push({from:c.from+o,to:c.to+o});else i.push({from:o,to:o+r.length});return}else if(a.overlay){let c=i.length;if(s(a.tree,a.overlay[0].from+o),i.length>c)return}}for(let c=0;ci.isTop?t:void 0)]}),e.name)}configure(e,t){return new xi(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function He(n){let e=n.field(en.state,!1);return e?e.tree:ze.empty}class xb{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Ps=null;class Io{constructor(e,t,i=[],s,r,o,a,c){this.parser=e,this.state=t,this.fragments=i,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=a,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Io(e,t,[],ze.empty,0,i,[],null)}startParse(){return this.parser.startParse(new xb(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ze.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(En.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Ps;Ps=this;try{return e()}finally{Ps=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=e1(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:s,treeLen:r,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((h,u,f,p)=>c.push({fromA:h,toA:u,fromB:f,toB:p})),i=En.applyChanges(i,c),s=ze.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let h of this.skipped){let u=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ue.from&&(this.fragments=e1(this.fragments,s,r),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends _m{createParse(t,i,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let c=Ps;if(c){for(let h of s)c.tempSkipped.push(h);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=o,new ze(xt.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Ps}}function e1(n,e,t){return En.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class ls{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new ls(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Io.create(e.facet(ai).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new ls(i)}}en.state=ct.define({create:ls.init,update(n,e){for(let t of e.effects)if(t.is(en.setState))return t.value;return e.startState.facet(ai)!=e.state.facet(ai)?ls.init(e.state):n.apply(e)}});let Am=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Am=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:500-100})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const $l=typeof navigator<"u"&&(!((_l=navigator.scheduling)===null||_l===void 0)&&_l.isInputPending)?()=>navigator.scheduling.isInputPending():null,vb=rt.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(en.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(en.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Am(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,c=r.context.work(()=>$l&&$l()||Date.now()>o,s+(a?0:1e5));this.chunkBudget-=Date.now()-t,(c||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:en.setState.of(new ls(r.context))})),this.chunkBudget>0&&!(c&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>jt(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ai=ee.define({combine(n){return n.length?n[0]:null},enables:n=>[en.state,vb,K.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class ha{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const Qb=ee.define(),ua=ee.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ro(n){let e=n.facet(ua);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function tr(n,e){let t="",i=n.tabSize,s=n.facet(ua)[0];if(s==" "){for(;e>=i;)t+=" ",e-=i;s=" "}for(let r=0;r=i.from&&s<=i.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return dr(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const da=new ve;function Pb(n,e,t){return Im(e.resolveInner(t).enterUnfinishedNodesBefore(t),t,n)}function _b(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function $b(n){let e=n.type.prop(da);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(ve.closedBy))){let s=n.lastChild,r=s&&i.indexOf(s.name)>-1;return o=>Rm(o,!0,1,void 0,r&&!_b(o)?s.from:void 0)}return n.parent==null?Tb:null}function Im(n,e,t){for(;n;n=n.parent){let i=$b(n);if(i)return i(Uh.create(t,e,n))}return null}function Tb(){return 0}class Uh extends fa{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new Uh(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Cb(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){let e=this.node.parent;return e?Im(e,this.pos,this.base):0}}function Cb(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Ab(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let s=n.options.simulateBreak,r=n.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let a=t.to;;){let c=e.childAfter(a);if(!c||c==i)return null;if(!c.type.isSkipped)return c.fromRm(i,e,t,n)}function Rm(n,e,t,i,s){let r=n.textAfter,o=r.match(/^\s*/)[0].length,a=i&&r.slice(o,o+i.length)==i||s==n.pos+o,c=e?Ab(n):null;return c?a?n.column(c.from):n.column(c.to):n.baseIndent+(a?0:n.unit*t)}const Rb=n=>n.baseIndent;function ho({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const Xb=200;function Eb(){return _e.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,s=t.lineAt(i);if(i>s.from+Xb)return n;let r=t.sliceString(s.from,i);if(!e.some(h=>h.test(r)))return n;let{state:o}=n,a=-1,c=[];for(let{head:h}of o.selection.ranges){let u=o.doc.lineAt(h);if(u.from==a)continue;a=u.from;let f=jh(o,u.from);if(f==null)continue;let p=/^\s*/.exec(u.text)[0],m=tr(o,f);p!=m&&c.push({from:u.from,to:u.from+p.length,insert:m})}return c.length?[n,{changes:c,sequential:!0}]:n})}const Zb=ee.define(),pa=new ve;function Xm(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(r&&o.from=e&&c.to>t&&(r=c)}}return r}function Db(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Xo(n,e,t){for(let i of n.facet(Zb)){let s=i(n,e,t);if(s)return s}return Mb(n,e,t)}function Em(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const ma=we.define({map:Em}),yr=we.define({map:Em});function Zm(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const vi=ct.define({create(){return le.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)t.is(ma)&&!Nb(n,t.value.from,t.value.to)?n=n.update({add:[t1.range(t.value.from,t.value.to)]}):t.is(yr)&&(n=n.update({filter:(i,s)=>t.value.from!=i||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:i}=e.selection.main;n.between(i,i,(s,r)=>{si&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(s,r)=>r<=i||s>=i}))}return n},provide:n=>K.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,s)=>{t.push(i,s)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!s||s.from>r)&&(s={from:r,to:o})}),s}function Nb(n,e,t){let i=!1;return n.between(e,e,(s,r)=>{s==e&&r==t&&(i=!0)}),i}function Mm(n,e){return n.field(vi,!1)?e:e.concat(we.appendConfig.of(qm()))}const qb=n=>{for(let e of Zm(n)){let t=Xo(n.state,e.from,e.to);if(t)return n.dispatch({effects:Mm(n.state,[ma.of(t),Dm(n,t)])}),!0}return!1},Vb=n=>{if(!n.state.field(vi,!1))return!1;let e=[];for(let t of Zm(n)){let i=Eo(n.state,t.from,t.to);i&&e.push(yr.of(i),Dm(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function Dm(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,s=n.state.doc.lineAt(e.to).number;return K.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${s}.`)}const Lb=n=>{let{state:e}=n,t=[];for(let i=0;i{let e=n.state.field(vi,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,s)=>{t.push(yr.of({from:i,to:s}))}),n.dispatch({effects:t}),!0},jb=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:qb},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Vb},{key:"Ctrl-Alt-[",run:Lb},{key:"Ctrl-Alt-]",run:Wb}],Ub={placeholderDOM:null,placeholderText:"…"},Nm=ee.define({combine(n){return _n(n,Ub)}});function qm(n){let e=[vi,Fb];return n&&e.push(Nm.of(n)),e}const t1=le.replace({widget:new class extends qn{toDOM(n){let{state:e}=n,t=e.facet(Nm),i=r=>{let o=n.lineBlockAt(n.posAtDOM(r.target)),a=Eo(n.state,o.from,o.to);a&&n.dispatch({effects:yr.of(a)}),r.preventDefault()};if(t.placeholderDOM)return t.placeholderDOM(n,i);let s=document.createElement("span");return s.textContent=t.placeholderText,s.setAttribute("aria-label",e.phrase("folded code")),s.title=e.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}}}),Bb={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Tl extends Mn{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Yb(n={}){let e=Object.assign(Object.assign({},Bb),n),t=new Tl(e,!0),i=new Tl(e,!1),s=rt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(ai)!=o.state.facet(ai)||o.startState.field(vi,!1)!=o.state.field(vi,!1)||He(o.startState)!=He(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new ni;for(let c of o.viewportLineBlocks){let h=Eo(o.state,c.from,c.to)?i:Xo(o.state,c.from,c.to)?t:null;h&&a.add(c.from,c.from,h)}return a.finish()}}),{domEventHandlers:r}=e;return[s,Yk({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(s))===null||a===void 0?void 0:a.markers)||Xe.empty},initialSpacer(){return new Tl(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,a,c)=>{if(r.click&&r.click(o,a,c))return!0;let h=Eo(o.state,a.from,a.to);if(h)return o.dispatch({effects:yr.of(h)}),!0;let u=Xo(o.state,a.from,a.to);return u?(o.dispatch({effects:ma.of(u)}),!0):!1}})}),qm()]}const Fb=K.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Sr{constructor(e,t){this.specs=e;let i;function s(a){let c=ii.newName();return(i||(i=Object.create(null)))["."+c]=a,c}const r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof en?a=>a.prop(Bi)==o.data:o?a=>a==o:void 0,this.style=Tm(e.map(a=>({tag:a.tag,class:a.class||s(Object.assign({},a,{tag:null}))})),{all:r}).style,this.module=i?new ii(i):null,this.themeType=t.themeType}static define(e,t){return new Sr(e,t||{})}}const Lc=ee.define(),Vm=ee.define({combine(n){return n.length?[n[0]]:null}});function Cl(n){let e=n.facet(Lc);return e.length?e:n.facet(Vm)}function Lm(n,e){let t=[Gb],i;return n instanceof Sr&&(n.module&&t.push(K.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(Vm.of(n)):i?t.push(Lc.computeN([K.darkTheme],s=>s.facet(K.darkTheme)==(i=="dark")?[n]:[])):t.push(Lc.of(n)),t}class zb{constructor(e){this.markCache=Object.create(null),this.tree=He(e.state),this.decorations=this.buildDeco(e,Cl(e.state))}update(e){let t=He(e.state),i=Cl(e.state),s=i!=Cl(e.startState);t.length{i.add(o,a,this.markCache[c]||(this.markCache[c]=le.mark({class:c})))},s,r);return i.finish()}}const Gb=Ti.high(rt.fromClass(zb,{decorations:n=>n.decorations})),Hb=Sr.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),Jb=K.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Wm=1e4,jm="()[]{}",Um=ee.define({combine(n){return _n(n,{afterCursor:!0,brackets:jm,maxScanDistance:Wm,renderMatch:tw})}}),Kb=le.mark({class:"cm-matchingBracket"}),ew=le.mark({class:"cm-nonmatchingBracket"});function tw(n){let e=[],t=n.matched?Kb:ew;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const nw=ct.define({create(){return le.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(Um);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=On(e.state,s.head,-1,i)||s.head>0&&On(e.state,s.head-1,1,i)||i.afterCursor&&(On(e.state,s.head,1,i)||s.headK.decorations.from(n)}),iw=[nw,Jb];function sw(n={}){return[Um.of(n),iw]}const Bm=new ve;function Wc(n,e,t){let i=n.prop(e<0?ve.openedBy:ve.closedBy);if(i)return i;if(n.name.length==1){let s=t.indexOf(n.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function jc(n){let e=n.type.prop(Bm);return e?e(n.node):n}function On(n,e,t,i={}){let s=i.maxScanDistance||Wm,r=i.brackets||jm,o=He(n),a=o.resolveInner(e,t);for(let c=a;c;c=c.parent){let h=Wc(c.type,t,r);if(h&&c.from0?e>=u.from&&eu.from&&e<=u.to))return rw(n,e,t,c,u,h,r)}}return ow(n,e,t,o,a.type,s,r)}function rw(n,e,t,i,s,r,o){let a=i.parent,c={from:s.from,to:s.to},h=0,u=a==null?void 0:a.cursor();if(u&&(t<0?u.childBefore(i.from):u.childAfter(i.to)))do if(t<0?u.to<=i.from:u.from>=i.to){if(h==0&&r.indexOf(u.type.name)>-1&&u.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},u=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let p=0;!u.next().done&&p<=r;){let m=u.value;t<0&&(p+=m.length);let O=e+p*t;for(let k=t>0?0:m.length-1,y=t>0?m.length:-1;k!=y;k+=t){let S=o.indexOf(m[k]);if(!(S<0||i.resolveInner(O+k,1).type!=s))if(S%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:O+k,to:O+k+1},matched:S>>1==c>>1};f--}}t>0&&(p+=m.length)}return u.done?{start:h,matched:!1}:null}const aw=Object.create(null),n1=[xt.none],i1=[],lw=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])lw[n]=cw(aw,e);function Al(n,e){i1.indexOf(n)>-1||(i1.push(n),console.warn(e))}function cw(n,e){let t=null;for(let r of e.split(".")){let o=n[r]||b[r];o?typeof o=="function"?t?t=o(t):Al(r,`Modifier ${r} used at start of tag`):t?Al(r,`Tag ${r} used as modifier`):t=o:Al(r,`Unknown highlighting tag ${r}`)}if(!t)return 0;let i=e.replace(/ /g,"_"),s=xt.define({id:n1.length,name:i,props:[gr({[i]:t})]});return n1.push(s),s.id}const hw=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=Yh(n.state,t.from);return i.line?uw(n):i.block?dw(n):!1};function Bh(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const uw=Bh(Ow,0),fw=Bh(Ym,0),dw=Bh((n,e)=>Ym(n,e,mw(e)),0);function Yh(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const _s=50;function pw(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-_s,i),o=n.sliceDoc(s,s+_s),a=/\s*$/.exec(r)[0].length,c=/^\s*/.exec(o)[0].length,h=r.length-a;if(r.slice(h-e.length,h)==e&&o.slice(c,c+t.length)==t)return{open:{pos:i-a,margin:a&&1},close:{pos:s+c,margin:c&&1}};let u,f;s-i<=2*_s?u=f=n.sliceDoc(i,s):(u=n.sliceDoc(i,i+_s),f=n.sliceDoc(s-_s,s));let p=/^\s*/.exec(u)[0].length,m=/\s*$/.exec(f)[0].length,O=f.length-m-t.length;return u.slice(p,p+e.length)==e&&f.slice(O,O+t.length)==t?{open:{pos:i+p+e.length,margin:/\s/.test(u.charAt(p+e.length))?1:0},close:{pos:s-m-t.length,margin:/\s/.test(f.charAt(O-1))?1:0}}:null}function mw(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),s=t.to<=i.to?i:n.doc.lineAt(t.to),r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=s.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:s.to})}return e}function Ym(n,e,t=e.selection.ranges){let i=t.map(r=>Yh(e,r.from).block);if(!i.every(r=>r))return null;let s=t.map((r,o)=>pw(e,i[o],r.from,r.to));if(n!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(n!=1&&s.some(r=>r)){let r=[];for(let o=0,a;os&&(r==o||o>f.from)){s=f.from;let p=/^\s*/.exec(f.text)[0].length,m=p==f.length,O=f.text.slice(p,p+h.length)==h?p:-1;pr.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:a,token:c,indent:h,empty:u,single:f}of i)(f||!u)&&r.push({from:a.from+h,insert:c+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:a,token:c}of i)if(a>=0){let h=o.from+a,u=h+c.length;o.text[u-o.from]==" "&&u++,r.push({from:h,to:u})}return{changes:r}}return null}const Uc=Nn.define(),gw=Nn.define(),yw=ee.define(),Fm=ee.define({combine(n){return _n(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,s)=>e(i,s)||t(i,s)})}});function Sw(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const zm=ct.define({create(){return gn.empty},update(n,e){let t=e.state.facet(Fm),i=e.annotation(Uc);if(i){let c=e.docChanged?q.single(Sw(e.changes)):void 0,h=Pt.fromTransaction(e,c),u=i.side,f=u==0?n.undone:n.done;return h?f=Zo(f,f.length,t.minDepth,h):f=Jm(f,e.startState.selection),new gn(u==0?i.rest:f,u==0?f:i.rest)}let s=e.annotation(gw);if((s=="full"||s=="before")&&(n=n.isolate()),e.annotation(st.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let r=Pt.fromTransaction(e),o=e.annotation(st.time),a=e.annotation(st.userEvent);return r?n=n.addChanges(r,o,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(s=="full"||s=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new gn(n.done.map(Pt.fromJSON),n.undone.map(Pt.fromJSON))}});function kw(n={}){return[zm,Fm.of(n),K.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Gm:e.inputType=="historyRedo"?Bc:null;return i?(e.preventDefault(),i(t)):!1}})]}function Oa(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let s=t.field(zm,!1);if(!s)return!1;let r=s.pop(n,t,e);return r?(i(r),!0):!1}}const Gm=Oa(0,!1),Bc=Oa(1,!1),bw=Oa(0,!0),ww=Oa(1,!0);class Pt{constructor(e,t,i,s,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new Pt(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new Pt(e.changes&&it.fromJSON(e.changes),[],e.mapped&&Sn.fromJSON(e.mapped),e.startSelection&&q.fromJSON(e.startSelection),e.selectionsAfter.map(q.fromJSON))}static fromTransaction(e,t){let i=Wt;for(let s of e.startState.facet(yw)){let r=s(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Pt(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Wt)}static selection(e){return new Pt(void 0,Wt,void 0,void 0,e)}}function Zo(n,e,t,i){let s=e+1>t+20?e-t-1:0,r=n.slice(s,e);return r.push(i),r}function xw(n,e){let t=[],i=!1;return n.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,a)=>{for(let c=0;c=h&&o<=u&&(i=!0)}}),i}function vw(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Hm(n,e){return n.length?e.length?n.concat(e):n:e}const Wt=[],Qw=200;function Jm(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Qw));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Zo(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Pt.selection([e])]}function Pw(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Il(n,e){if(!n.length)return n;let t=n.length,i=Wt;for(;t;){let s=_w(n[t-1],e,i);if(s.changes&&!s.changes.empty||s.effects.length){let r=n.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,i=s.selectionsAfter}return i.length?[Pt.selection(i)]:Wt}function _w(n,e,t){let i=Hm(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):Wt,t);if(!n.changes)return Pt.selection(i);let s=n.changes.map(e),r=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(r):r;return new Pt(s,we.mapEffects(n.effects,e),o,n.startSelection.map(r),i)}const $w=/^(input\.type|delete)($|\.)/;class gn{constructor(e,t,i=0,s=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=s}isolate(){return this.prevTime?new gn(this.done,this.undone):this}addChanges(e,t,i,s,r){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!i||$w.test(i))&&(!a.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):ga(t,e))}function St(n){return n.textDirectionAt(n.state.selection.main.head)==Fe.LTR}const eO=n=>Km(n,!St(n)),tO=n=>Km(n,St(n));function nO(n,e){return sn(n,t=>t.empty?n.moveByGroup(t,e):ga(t,e))}const Cw=n=>nO(n,!St(n)),Aw=n=>nO(n,St(n));function Iw(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function ya(n,e,t){let i=He(n).resolveInner(e.head),s=t?ve.closedBy:ve.openedBy;for(let c=e.head;;){let h=t?i.childAfter(c):i.childBefore(c);if(!h)break;Iw(n,h,s)?i=h:c=t?h.to:h.from}let r=i.type.prop(s),o,a;return r&&(o=t?On(n,i.from,1):On(n,i.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?i.to:i.from,q.cursor(a,t?-1:1)}const Rw=n=>sn(n,e=>ya(n.state,e,!St(n))),Xw=n=>sn(n,e=>ya(n.state,e,St(n)));function iO(n,e){return sn(n,t=>{if(!t.empty)return ga(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const sO=n=>iO(n,!1),rO=n=>iO(n,!0);function oO(n){let e=n.scrollDOM.clientHeighto.empty?n.moveVertically(o,e,t.height):ga(o,e));if(s.eq(i.selection))return!1;let r;if(t.selfScroll){let o=n.coordsAtPos(i.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),c=a.top+t.marginTop,h=a.bottom-t.marginBottom;o&&o.top>c&&o.bottomaO(n,!1),Yc=n=>aO(n,!0);function ci(n,e,t){let i=n.lineBlockAt(e.head),s=n.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?i.to:i.from)&&(s=n.moveToLineBoundary(e,t,!1)),!t&&s.head==i.from&&i.length){let r=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(s=q.cursor(i.from+r))}return s}const Ew=n=>sn(n,e=>ci(n,e,!0)),Zw=n=>sn(n,e=>ci(n,e,!1)),Mw=n=>sn(n,e=>ci(n,e,!St(n))),Dw=n=>sn(n,e=>ci(n,e,St(n))),Nw=n=>sn(n,e=>q.cursor(n.lineBlockAt(e.head).from,1)),qw=n=>sn(n,e=>q.cursor(n.lineBlockAt(e.head).to,-1));function Vw(n,e,t){let i=!1,s=ms(n.selection,r=>{let o=On(n,r.head,-1)||On(n,r.head,1)||r.head>0&&On(n,r.head-1,1)||r.headVw(n,e,!1);function Ft(n,e){let t=ms(n.state.selection,i=>{let s=e(i);return q.range(i.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch($n(n.state,t)),!0)}function lO(n,e){return Ft(n,t=>n.moveByChar(t,e))}const cO=n=>lO(n,!St(n)),hO=n=>lO(n,St(n));function uO(n,e){return Ft(n,t=>n.moveByGroup(t,e))}const Ww=n=>uO(n,!St(n)),jw=n=>uO(n,St(n)),Uw=n=>Ft(n,e=>ya(n.state,e,!St(n))),Bw=n=>Ft(n,e=>ya(n.state,e,St(n)));function fO(n,e){return Ft(n,t=>n.moveVertically(t,e))}const dO=n=>fO(n,!1),pO=n=>fO(n,!0);function mO(n,e){return Ft(n,t=>n.moveVertically(t,e,oO(n).height))}const r1=n=>mO(n,!1),o1=n=>mO(n,!0),Yw=n=>Ft(n,e=>ci(n,e,!0)),Fw=n=>Ft(n,e=>ci(n,e,!1)),zw=n=>Ft(n,e=>ci(n,e,!St(n))),Gw=n=>Ft(n,e=>ci(n,e,St(n))),Hw=n=>Ft(n,e=>q.cursor(n.lineBlockAt(e.head).from)),Jw=n=>Ft(n,e=>q.cursor(n.lineBlockAt(e.head).to)),a1=({state:n,dispatch:e})=>(e($n(n,{anchor:0})),!0),l1=({state:n,dispatch:e})=>(e($n(n,{anchor:n.doc.length})),!0),c1=({state:n,dispatch:e})=>(e($n(n,{anchor:n.selection.main.anchor,head:0})),!0),h1=({state:n,dispatch:e})=>(e($n(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),Kw=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),ex=({state:n,dispatch:e})=>{let t=ka(n).map(({from:i,to:s})=>q.range(i,Math.min(s+1,n.doc.length)));return e(n.update({selection:q.create(t),userEvent:"select"})),!0},tx=({state:n,dispatch:e})=>{let t=ms(n.selection,i=>{var s;let r=He(n).resolveInner(i.head,1);for(;!(r.from=i.to||r.to>i.to&&r.from<=i.from||!(!((s=r.parent)===null||s===void 0)&&s.parent));)r=r.parent;return q.range(r.to,r.from)});return e($n(n,t)),!0},nx=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=q.create([t.main]):t.main.empty||(i=q.create([q.cursor(t.main.head)])),i?(e($n(n,i)),!0):!1};function Sa(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,s=i.changeByRange(r=>{let{from:o,to:a}=r;if(o==a){let c=e(o);co&&(t="delete.forward",c=jr(n,c,!0)),o=Math.min(o,c),a=Math.max(a,c)}else o=jr(n,o,!1),a=jr(n,a,!0);return o==a?{range:r}:{changes:{from:o,to:a},range:q.cursor(o)}});return s.changes.empty?!1:(n.dispatch(i.update(s,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?K.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function jr(n,e,t){if(n instanceof K)for(let i of n.state.facet(K.atomicRanges).map(s=>s(n)))i.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}const OO=(n,e)=>Sa(n,t=>{let{state:i}=n,s=i.doc.lineAt(t),r,o;if(!e&&t>s.from&&tOO(n,!1),gO=n=>OO(n,!0),yO=(n,e)=>Sa(n,t=>{let i=t,{state:s}=n,r=s.doc.lineAt(i),o=s.charCategorizer(i);for(let a=null;;){if(i==(e?r.to:r.from)){i==t&&r.number!=(e?s.doc.lines:1)&&(i+=e?1:-1);break}let c=bt(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,c)-r.from,Math.max(i,c)-r.from),u=o(h);if(a!=null&&u!=a)break;(h!=" "||i!=t)&&(a=u),i=c}return i}),SO=n=>yO(n,!1),ix=n=>yO(n,!0),kO=n=>Sa(n,e=>{let t=n.lineBlockAt(e).to;return eSa(n,e=>{let t=n.lineBlockAt(e).from;return e>t?t:Math.max(0,e-1)}),rx=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:Ce.of(["",""])},range:q.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},ox=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let s=i.from,r=n.doc.lineAt(s),o=s==r.from?s-1:bt(r.text,s-r.from,!1)+r.from,a=s==r.to?s+1:bt(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:a,insert:n.doc.slice(s,a).append(n.doc.slice(o,s))},range:q.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ka(n){let e=[],t=-1;for(let i of n.selection.ranges){let s=n.doc.lineAt(i.from),r=n.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=n.doc.lineAt(i.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:s.from,to:r.to,ranges:[i]});t=r.number+1}return e}function bO(n,e,t){if(n.readOnly)return!1;let i=[],s=[];for(let r of ka(n)){if(t?r.to==n.doc.length:r.from==0)continue;let o=n.doc.lineAt(t?r.to+1:r.from-1),a=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+n.lineBreak});for(let c of r.ranges)s.push(q.range(Math.min(n.doc.length,c.anchor+a),Math.min(n.doc.length,c.head+a)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:n.lineBreak+o.text});for(let c of r.ranges)s.push(q.range(c.anchor-a,c.head-a))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:q.create(s,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const ax=({state:n,dispatch:e})=>bO(n,e,!1),lx=({state:n,dispatch:e})=>bO(n,e,!0);function wO(n,e,t){if(n.readOnly)return!1;let i=[];for(let s of ka(n))t?i.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):i.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const cx=({state:n,dispatch:e})=>wO(n,e,!1),hx=({state:n,dispatch:e})=>wO(n,e,!0),ux=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(ka(e).map(({from:s,to:r})=>(s>0?s--:rn.moveVertically(s,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function fx(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=He(n).resolveInner(e),i=t.childBefore(e),s=t.childAfter(e),r;return i&&s&&i.to<=e&&s.from>=e&&(r=i.type.prop(ve.closedBy))&&r.indexOf(s.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(s.from).from?{from:i.to,to:s.from}:null}const dx=xO(!1),px=xO(!0);function xO(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(s=>{let{from:r,to:o}=s,a=e.doc.lineAt(r),c=!n&&r==o&&fx(e,r);n&&(r=o=(o<=a.to?a:e.doc.lineAt(o)).to);let h=new fa(e,{simulateBreak:r,simulateDoubleBreak:!!c}),u=jh(h,r);for(u==null&&(u=/^\s*/.exec(e.doc.lineAt(r).text)[0].length);oa.from&&r{let s=[];for(let o=i.from;o<=i.to;){let a=n.doc.lineAt(o);a.number>t&&(i.empty||i.to>a.from)&&(e(a,s,i),t=a.number),o=a.to+1}let r=n.changes(s);return{changes:s,range:q.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const mx=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new fa(n,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=Fh(n,(r,o,a)=>{let c=jh(i,r.from);if(c==null)return;/\S/.test(r.text)||(c=0);let h=/^\s*/.exec(r.text)[0],u=tr(n,c);(h!=u||a.fromn.readOnly?!1:(e(n.update(Fh(n,(t,i)=>{i.push({from:t.from,insert:n.facet(ua)})}),{userEvent:"input.indent"})),!0),QO=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Fh(n,(t,i)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=dr(s,n.tabSize),o=0,a=tr(n,Math.max(0,r-Ro(n)));for(;on.selection.ranges.some(t=>!t.empty)?vO({state:n,dispatch:e}):(e(n.update(n.replaceSelection(" "),{scrollIntoView:!0,userEvent:"input"})),!0),gx=[{key:"Ctrl-b",run:eO,shift:cO,preventDefault:!0},{key:"Ctrl-f",run:tO,shift:hO},{key:"Ctrl-p",run:sO,shift:dO},{key:"Ctrl-n",run:rO,shift:pO},{key:"Ctrl-a",run:Nw,shift:Hw},{key:"Ctrl-e",run:qw,shift:Jw},{key:"Ctrl-d",run:gO},{key:"Ctrl-h",run:Fc},{key:"Ctrl-k",run:kO},{key:"Ctrl-Alt-h",run:SO},{key:"Ctrl-o",run:rx},{key:"Ctrl-t",run:ox},{key:"Ctrl-v",run:Yc}],yx=[{key:"ArrowLeft",run:eO,shift:cO,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Cw,shift:Ww,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Mw,shift:zw,preventDefault:!0},{key:"ArrowRight",run:tO,shift:hO,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Aw,shift:jw,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Dw,shift:Gw,preventDefault:!0},{key:"ArrowUp",run:sO,shift:dO,preventDefault:!0},{mac:"Cmd-ArrowUp",run:a1,shift:c1},{mac:"Ctrl-ArrowUp",run:s1,shift:r1},{key:"ArrowDown",run:rO,shift:pO,preventDefault:!0},{mac:"Cmd-ArrowDown",run:l1,shift:h1},{mac:"Ctrl-ArrowDown",run:Yc,shift:o1},{key:"PageUp",run:s1,shift:r1},{key:"PageDown",run:Yc,shift:o1},{key:"Home",run:Zw,shift:Fw,preventDefault:!0},{key:"Mod-Home",run:a1,shift:c1},{key:"End",run:Ew,shift:Yw,preventDefault:!0},{key:"Mod-End",run:l1,shift:h1},{key:"Enter",run:dx},{key:"Mod-a",run:Kw},{key:"Backspace",run:Fc,shift:Fc},{key:"Delete",run:gO},{key:"Mod-Backspace",mac:"Alt-Backspace",run:SO},{key:"Mod-Delete",mac:"Alt-Delete",run:ix},{mac:"Mod-Backspace",run:sx},{mac:"Mod-Delete",run:kO}].concat(gx.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),Sx=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:Rw,shift:Uw},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Xw,shift:Bw},{key:"Alt-ArrowUp",run:ax},{key:"Shift-Alt-ArrowUp",run:cx},{key:"Alt-ArrowDown",run:lx},{key:"Shift-Alt-ArrowDown",run:hx},{key:"Escape",run:nx},{key:"Mod-Enter",run:px},{key:"Alt-l",mac:"Ctrl-l",run:ex},{key:"Mod-i",run:tx,preventDefault:!0},{key:"Mod-[",run:QO},{key:"Mod-]",run:vO},{key:"Mod-Alt-\\",run:mx},{key:"Shift-Mod-k",run:ux},{key:"Shift-Mod-\\",run:Lw},{key:"Mod-/",run:hw},{key:"Alt-A",run:fw}].concat(yx);function Me(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));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 s=t[i];typeof s=="string"?n.setAttribute(i,s):s!=null&&(n[i]=s)}e++}for(;en.normalize("NFKD"):n=>n;class cs{constructor(e,t,i=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=r?a=>r(u1(a)):u1,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ft(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Ph(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Vt(e);let s=this.normalize(t);for(let r=0,o=i;;r++){let a=s.charCodeAt(r),c=this.match(a,o);if(c)return this.value=c,this;if(r==s.length-1)break;o==i&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=Mo(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||s.to<=t){let a=new Ki(t,e.sliceString(t,i));return Rl.set(e,a),a}if(s.from==t&&s.to==i)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,s=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this.matchPos=Mo(this.text,s+(i==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ki.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&($O.prototype[Symbol.iterator]=TO.prototype[Symbol.iterator]=function(){return this});function kx(n){try{return new RegExp(n,zh),!0}catch{return!1}}function Mo(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function zc(n){let e=Me("input",{class:"cm-textfield",name:"line"}),t=Me("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:Do.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},Me("label",n.state.phrase("Go to line"),": ",e)," ",Me("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!s)return;let{state:r}=n,o=r.doc.lineAt(r.selection.main.head),[,a,c,h,u]=s,f=h?+h.slice(1):0,p=c?+c:o.number;if(c&&u){let O=p/100;a&&(O=O*(a=="-"?-1:1)+o.number/r.doc.lines),p=Math.round(r.doc.lines*O)}else c&&a&&(p=p*(a=="-"?-1:1)+o.number);let m=r.doc.line(Math.max(1,Math.min(r.doc.lines,p)));n.dispatch({effects:Do.of(!1),selection:q.cursor(m.from+Math.max(0,Math.min(f,m.length))),scrollIntoView:!0}),n.focus()}return{dom:t}}const Do=we.define(),f1=ct.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Do)&&(n=t.value);return n},provide:n=>Ks.from(n,e=>e?zc:null)}),bx=n=>{let e=Js(n,zc);if(!e){let t=[Do.of(!0)];n.state.field(f1,!1)==null&&t.push(we.appendConfig.of([f1,wx])),n.dispatch({effects:t}),e=Js(n,zc)}return e&&e.dom.querySelector("input").focus(),!0},wx=K.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),xx={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},CO=ee.define({combine(n){return _n(n,xx,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function vx(n){let e=[Tx,$x];return n&&e.push(CO.of(n)),e}const Qx=le.mark({class:"cm-selectionMatch"}),Px=le.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function d1(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=We.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=We.Word)}function _x(n,e,t,i){return n(e.sliceDoc(t,t+1))==We.Word&&n(e.sliceDoc(i-1,i))==We.Word}const $x=rt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(CO),{state:t}=n,i=t.selection;if(i.ranges.length>1)return le.none;let s=i.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return le.none;let c=t.wordAt(s.head);if(!c)return le.none;o=t.charCategorizer(s.head),r=t.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c200)return le.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(d1(o,t,s.from,s.to)&&_x(o,t,s.from,s.to)))return le.none}else if(r=t.sliceDoc(s.from,s.to).trim(),!r)return le.none}let a=[];for(let c of n.visibleRanges){let h=new cs(t.doc,r,c.from,c.to);for(;!h.next().done;){let{from:u,to:f}=h.value;if((!o||d1(o,t,u,f))&&(s.empty&&u<=s.from&&f>=s.to?a.push(Px.range(u,f)):(u>=s.to||f<=s.from)&&a.push(Qx.range(u,f)),a.length>e.maxMatches))return le.none}}return le.set(a)}},{decorations:n=>n.decorations}),Tx=K.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Cx=({state:n,dispatch:e})=>{let{selection:t}=n,i=q.create(t.ranges.map(s=>n.wordAt(s.head)||q.cursor(s.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function Ax(n,e){let{main:t,ranges:i}=n.selection,s=n.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,a=new cs(n.doc,e,i[i.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new cs(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(c=>c.from==a.value.from))continue;if(r){let c=n.wordAt(a.value.from);if(!c||c.from!=a.value.from||c.to!=a.value.to)continue}return a.value}}const Ix=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(r=>r.from===r.to))return Cx({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(r=>n.sliceDoc(r.from,r.to)!=i))return!1;let s=Ax(n,i);return s?(e(n.update({selection:n.selection.addRange(q.range(s.from,s.to),!1),effects:K.scrollIntoView(s.to)})),!0):!1},Os=ee.define({combine(n){return _n(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new jx(e),scrollToMatch:e=>K.scrollIntoView(e)})}});class AO{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||kx(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` `: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 Zx(this):new Xx(this)}getCursor(e,t=0,i){let s=e.doc?e:_e.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Wi(this,s,t,i):Li(this,s,t,i)}}class IO{constructor(e){this.spec=e}}function Li(n,e,t,i){return new cs(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?Rx(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function Rx(n,e){return(t,i,s,r)=>((r>t||r+s.length=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Li(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Wi(n,e,t,i){return new $O(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Ex(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function No(n,e){return n.slice(bt(n,e,!1),e)}function qo(n,e){return n.slice(e,bt(n,e))}function Ex(n){return(e,t,i)=>!i[0].length||(n(No(i.input,i.index))!=We.Word||n(qo(i.input,i.index))!=We.Word)&&(n(qo(i.input,i.index+i[0].length))!=We.Word||n(No(i.input,i.index+i[0].length))!=We.Word)}class Zx extends IO{nextMatch(e,t,i){let s=Wi(this.spec,e,i,e.doc.length).next();return s.done&&(s=Wi(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Wi(this.spec,e,r,i),a=null;for(;!o.next().done;)a=o.value;if(a&&(r==t||a.from>r+10))return a;if(r==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)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Wi(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const nr=we.define(),Gh=we.define(),Hn=ct.define({create(n){return new Xl(Gc(n).create(),null)},update(n,e){for(let t of e.effects)t.is(nr)?n=new Xl(t.value.create(),n.panel):t.is(Gh)&&(n=new Xl(n.query,t.value?Hh:null));return n},provide:n=>Ks.from(n,e=>e.panel)});class Xl{constructor(e,t){this.query=e,this.panel=t}}const Mx=le.mark({class:"cm-searchMatch"}),Dx=le.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Nx=rt.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(Hn))}update(n){let e=n.state.field(Hn);(e!=n.startState.field(Hn)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return le.none;let{view:t}=this,i=new ni;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)c=r[++s].to;n.highlight(t.state,a,c,(h,u)=>{let f=t.state.selection.ranges.some(p=>p.from==h&&p.to==u);i.add(h,u,f?Dx:Mx)})}return i.finish()}},{decorations:n=>n.decorations});function kr(n){return e=>{let t=e.state.field(Hn,!1);return t&&t.query.spec.valid?n(e,t):EO(e)}}const Vo=kr((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let s=q.single(i.from,i.to),r=n.state.facet(Os);return n.dispatch({selection:s,effects:[Jh(n,i),r.scrollToMatch(s.main,n)],userEvent:"select.search"}),XO(n),!0}),Lo=kr((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,s=e.prevMatch(t,i,i);if(!s)return!1;let r=q.single(s.from,s.to),o=n.state.facet(Os);return n.dispatch({selection:r,effects:[Jh(n,s),o.scrollToMatch(r.main,n)],userEvent:"select.search"}),XO(n),!0}),qx=kr((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:q.create(t.map(i=>q.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Vx=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:s}=t.main,r=[],o=0;for(let a=new cs(n.doc,n.sliceDoc(i,s));!a.next().done;){if(r.length>1e3)return!1;a.value.from==i&&(o=r.length),r.push(q.range(a.value.from,a.value.to))}return e(n.update({selection:q.create(r,o),userEvent:"select.search.matches"})),!0},p1=kr((n,{query:e})=>{let{state:t}=n,{from:i,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=[],a,c,h=[];if(r.from==i&&r.to==s&&(c=t.toText(e.getReplacement(r)),o.push({from:r.from,to:r.to,insert:c}),r=e.nextMatch(t,r.from,r.to),h.push(K.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),r){let u=o.length==0||o[0].from>=r.to?0:r.to-r.from-c.length;a=q.single(r.from-u,r.to-u),h.push(Jh(n,r)),h.push(t.facet(Os).scrollToMatch(a.main,n))}return n.dispatch({changes:o,selection:a,effects:h,userEvent:"input.replace"}),!0}),Lx=kr((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:K.announce.of(i),userEvent:"input.replace.all"}),!0});function Hh(n){return n.state.facet(Os).createPanel(n)}function Gc(n,e){var t,i,s,r,o;let a=n.selection.main,c=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!c)return e;let h=n.facet(Os);return new AO({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function RO(n){let e=Js(n,Hh);return e&&e.dom.querySelector("[main-field]")}function XO(n){let e=RO(n);e&&e==n.root.activeElement&&e.select()}const EO=n=>{let e=n.state.field(Hn,!1);if(e&&e.panel){let t=RO(n);if(t&&t!=n.root.activeElement){let i=Gc(n.state,e.query.spec);i.valid&&n.dispatch({effects:nr.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Gh.of(!0),e?nr.of(Gc(n.state,e.query.spec)):we.appendConfig.of(Bx)]});return!0},ZO=n=>{let e=n.state.field(Hn,!1);if(!e||!e.panel)return!1;let t=Js(n,Hh);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Gh.of(!1)}),!0},Wx=[{key:"Mod-f",run:EO,scope:"editor search-panel"},{key:"F3",run:Vo,shift:Lo,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Vo,shift:Lo,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ZO,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Vx},{key:"Alt-g",run:bx},{key:"Mod-d",run:Ix,preventDefault:!0}];class jx{constructor(e){this.view=e;let t=this.query=e.state.field(Hn).query.spec;this.commit=this.commit.bind(this),this.searchField=Me("input",{value:t.search,placeholder:At(e,"Find"),"aria-label":At(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Me("input",{value:t.replace,placeholder:At(e,"Replace"),"aria-label":At(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Me("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Me("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Me("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(s,r,o){return Me("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=Me("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,i("next",()=>Vo(e),[At(e,"next")]),i("prev",()=>Lo(e),[At(e,"previous")]),i("select",()=>qx(e),[At(e,"all")]),Me("label",null,[this.caseField,At(e,"match case")]),Me("label",null,[this.reField,At(e,"regexp")]),Me("label",null,[this.wordField,At(e,"by word")]),...e.state.readOnly?[]:[Me("br"),this.replaceField,i("replace",()=>p1(e),[At(e,"replace")]),i("replaceAll",()=>Lx(e),[At(e,"replace all")])],Me("button",{name:"close",onclick:()=>ZO(e),"aria-label":At(e,"close"),type:"button"},["×"])])}commit(){let e=new AO({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:nr.of(e)}))}keydown(e){rk(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Lo:Vo)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),p1(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(nr)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Os).top}}function At(n,e){return n.state.phrase(e)}const Ur=30,Br=/[\s\.,:;?!]/;function Jh(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),s=n.state.doc.lineAt(t).to,r=Math.max(i.from,e-Ur),o=Math.min(s,t+Ur),a=n.state.sliceDoc(r,o);if(r!=i.from){for(let c=0;ca.length-Ur;c--)if(!Br.test(a[c-1])&&Br.test(a[c])){a=a.slice(0,c);break}}return K.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${i.number}.`)}const Ux=K.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Bx=[Hn,Ti.lowest(Nx),Ux];class MO{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=He(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),s=t.text.slice(i-t.from,this.pos-t.from),r=s.search(NO(e,!1));return r<0?null:{from:i+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function m1(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Yx(n){let e=Object.create(null),t=Object.create(null);for(let{label:s}of n){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,i]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:Yx(e);return s=>{let r=s.matchBefore(i);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function Fx(n,e){return t=>{for(let i=He(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class O1{constructor(e,t,i,s){this.completion=e,this.source=t,this.match=i,this.score=s}}function Jn(n){return n.selection.main.from}function NO(n,e){var t;let{source:i}=n,s=e&&i[0]!="^",r=i[i.length-1]!="$";return!s&&!r?n:new RegExp(`${s?"^":""}(?:${i})${r?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const qO=Nn.define();function zx(n,e,t,i){let{main:s}=n.selection,r=t-s.from,o=i-s.from;return Object.assign(Object.assign({},n.changeByRange(a=>a!=s&&t!=i&&n.sliceDoc(a.from+r,a.from+o)!=n.sliceDoc(t,i)?{range:a}:{changes:{from:a.from+r,to:i==s.from?a.to:a.from+o,insert:e},range:q.cursor(a.from+r+e.length)})),{userEvent:"input.complete"})}const g1=new WeakMap;function Gx(n){if(!Array.isArray(n))return n;let e=g1.get(n);return e||g1.set(n,e=DO(n)),e}const Kh=we.define(),ir=we.define();class Hx{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&v<=57||v>=97&&v<=122?2:v>=65&&v<=90?1:0:($=Ph(v))!=$.toLowerCase()?1:$!=$.toUpperCase()?2:0;(!P||x==1&&y||_==0&&x!=0)&&(t[f]==v||i[f]==v&&(p=!0)?o[f++]=P:o.length&&(S=!1)),_=x,P+=Vt(v)}return f==c&&o[0]==0&&S?this.result(-100+(p?-200:0),o,e):m==c&&O==0?[-200-e.length+(k==e.length?0:-100),0,k]:a>-1?[-700-e.length,a,a+this.pattern.length]:m==c?[-200+-700-e.length,O,k]:f==c?this.result(-100+(p?-200:0)+-700+(S?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,i){let s=[e-i.length],r=1;for(let o of t){let a=o+(this.astral?Vt(ft(i,o)):1);r>1&&s[r-1]==o?s[r-1]=a:(s[r++]=o,s[r++]=a)}return s}}const _t=ee.define({combine(n){return _n(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Jx,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>y1(e(i),t(i)),optionClass:(e,t)=>i=>y1(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function y1(n,e){return n?e?n+" "+e:n:e}function Jx(n,e,t,i,s){let r=n.textDirection==Fe.RTL,o=r,a=!1,c="top",h,u,f=e.left-s.left,p=s.right-e.right,m=i.right-i.left,O=i.bottom-i.top;if(o&&f=O||k>e.top?h=t.bottom-e.top:(c="bottom",h=e.bottom-t.top)}return{style:`${c}: ${h}px; max-width: ${u}px`,class:"cm-completionInfo-"+(a?r?"left-narrow":"right-narrow":o?"left":"right")}}function Yr(n,e="option"){return t=>{let i=t.state.field(Xt,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+s*(n?1:-1):n?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:WO.of(a)}),!0}}const Kx=n=>{let e=n.state.field(Xt,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||Date.now()-e.open.timestampn.state.field(Xt,!1)?(n.dispatch({effects:Kh.of(!0)}),!0):!1,tv=n=>{let e=n.state.field(Xt,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:ir.of(null)}),!0)};class nv{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const S1=50,iv=50,sv=1e3,rv=rt.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(Xt).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(Xt);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Xt)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!Hc(i));for(let i=0;iiv&&Date.now()-s.time>sv){for(let r of s.context.abortListeners)try{r()}catch(o){jt(this.view.state,o)}s.context.abortListeners=null,this.running.splice(i--,1)}else s.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(s=>s.active.source==i.source))?setTimeout(()=>this.startUpdate(),S1):-1,this.composing!=0)for(let i of n.transactions)Hc(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(Xt);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=Jn(e),i=new MO(e,t,n.explicitPos==t),s=new nv(n,i);this.running.push(s),Promise.resolve(n.source(i)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:ir.of(null)}),jt(this.view.state,r)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),S1))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(_t);for(let i=0;io.source==s.active.source);if(r&&r.state==1)if(s.done==null){let o=new vt(s.active.source,0);for(let a of s.updates)o=o.update(a,t);o.state!=1&&e.push(o)}else this.startQuery(r)}e.length&&this.view.dispatch({effects:LO.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Xt,!1);if(e&&e.tooltip&&this.view.state.facet(_t).closeOnBlur){let t=e.open&&Sm(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:ir.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Kh.of(!1)}),20),this.composing=0}}});function VO(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(Xt).active.find(s=>s.source==e.source);return i instanceof es?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},zx(n.state,t,i.from,i.to)),{annotations:qO.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}function ov(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,s){let r=document.createElement("span");r.className="cm-completionLabel";let{label:o}=t,a=0;for(let c=1;ca&&r.appendChild(document.createTextNode(o.slice(a,h)));let f=r.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(o.slice(h,u))),f.className="cm-completionMatchedText",a=u}return at.position-i.position).map(t=>t.render)}function k1(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class av{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:r}=i.open,o=e.state.facet(_t);this.optionContent=ov(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=k1(s.length,r,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{for(let c=a.target,h;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(h=/-(\d+)$/.exec(c.id))&&+h[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(_t).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:ir.of(null)})}),this.list=this.dom.appendChild(this.createListBox(s,i.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}mount(){this.updateSel()}update(e){var t,i,s;let r=e.state.field(this.stateField),o=e.startState.field(this.stateField);this.updateTooltipClass(e.state),r!=o&&(this.updateSel(),((t=r.open)===null||t===void 0?void 0:t.disabled)!=((i=o.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!(!((s=r.open)===null||s===void 0)&&s.disabled)))}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=k1(t.options.length,t.selected,this.view.state.facet(_t).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o)}).catch(o=>jt(this.view.state,o,"completion info")):this.addInfoPane(r)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,s=this.range.from;i;i=i.nextSibling,s++)i.nodeName!="LI"||!i.id?s--:s==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&cv(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottomi.from||i.from==0))if(r=p,typeof h!="string"&&h.header)s.appendChild(h.header(h));else{let m=s.appendChild(document.createElement("completion-section"));m.textContent=p}}const u=s.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let p of this.optionContent){let m=p(a,this.view.state,c);m&&u.appendChild(m)}}return i.from&&s.classList.add("cm-completionListIncompleteTop"),i.tonew av(e,n)}function cv(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect();i.topt.bottom&&(n.scrollTop+=i.bottom-t.bottom)}function b1(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function hv(n,e){let t=[],i=null,s=c=>{t.push(c);let{section:h}=c.completion;if(h){i||(i=[]);let u=typeof h=="string"?h:h.name;i.some(f=>f.name==u)||i.push(typeof h=="string"?{name:u}:h)}};for(let c of n)if(c.hasResult())if(c.result.filter===!1){let h=c.result.getMatch;for(let u of c.result.options){let f=[1e9-t.length];if(h)for(let p of h(u))f.push(p);s(new O1(u,c.source,f,f[0]))}}else{let h=new Hx(e.sliceDoc(c.from,c.to)),u;for(let f of c.result.options)(u=h.match(f.label))&&s(new O1(f,c.source,u,u[0]+(f.boost||0)))}if(i){let c=Object.create(null),h=0,u=(f,p)=>{var m,O;return((m=f.rank)!==null&&m!==void 0?m:1e9)-((O=p.rank)!==null&&O!==void 0?O:1e9)||(f.nameu.score-h.score||a(h.completion,u.completion)))!o||o.label!=c.completion.label||o.detail!=c.completion.detail||o.type!=null&&c.completion.type!=null&&o.type!=c.completion.type||o.apply!=c.completion.apply?r.push(c):b1(c.completion)>b1(o)&&(r[r.length-1]=c),o=c.completion;return r}class Yi{constructor(e,t,i,s,r,o){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Yi(this.options,w1(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,s,r){let o=hv(e,t);if(!o.length)return s&&e.some(c=>c.state==1)?new Yi(s.options,s.attrs,s.tooltip,s.timestamp,s.selected,!0):null;let a=t.facet(_t).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let c=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(c,h.from):c,1e8),create:lv(Xt),above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new Yi(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Wo{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Wo(dv,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(_t),r=(i.override||t.languageDataAt("autocomplete",Jn(t)).map(Gx)).map(a=>(this.active.find(h=>h.source==a)||new vt(a,this.active.some(h=>h.state!=0)?1:0)).update(e,i));r.length==this.active.length&&r.every((a,c)=>a==this.active[c])&&(r=this.active);let o=this.open;o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!uv(r,this.active)?o=Yi.build(r,t,this.id,o,i):o&&o.disabled&&!r.some(a=>a.state==1)&&(o=null),!o&&r.every(a=>a.state!=1)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new vt(a.source,0):a));for(let a of e.effects)a.is(WO)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new Wo(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:fv}}function uv(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const dv=[];function Hc(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class vt{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Hc(e),s=this;i?s=s.handleUserEvent(e,i,t):e.docChanged?s=s.handleChange(e):e.selection&&s.state!=0&&(s=new vt(s.source,0));for(let r of e.effects)if(r.is(Kh))s=new vt(s.source,1,r.value?Jn(e.state):-1);else if(r.is(ir))s=new vt(s.source,0);else if(r.is(LO))for(let o of r.value)o.source==s.source&&(s=o);return s}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new vt(this.source,1)}handleChange(e){return e.changes.touchesRange(Jn(e.startState))?new vt(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new vt(this.source,this.state,e.mapPos(this.explicitPos))}}class es extends vt{constructor(e,t,i,s,r){super(e,2,t),this.result=i,this.from=s,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var s;let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=Jn(e.state);if((this.explicitPos<0?a<=r:ao||t=="delete"&&Jn(e.startState)==this.from)return new vt(this.source,t=="input"&&i.activateOnTyping?1:0);let c=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),h;return pv(this.result.validFor,e.state,r,o)?new es(this.source,c,this.result,r,o):this.result.update&&(h=this.result.update(this.result,r,o,new MO(e.state,a,c>=0)))?new es(this.source,c,h,h.from,(s=h.to)!==null&&s!==void 0?s:Jn(e.state)):new vt(this.source,1,c)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new vt(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new es(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function pv(n,e,t,i){if(!n)return!1;let s=e.sliceDoc(t,i);return typeof n=="function"?n(s,t,i,e):NO(n,!0).test(s)}const LO=we.define({map(n,e){return n.map(t=>t.map(e))}}),WO=we.define(),Xt=ct.define({create(){return Wo.start()},update(n,e){return n.update(e)},provide:n=>[Mh.from(n,e=>e.tooltip),K.contentAttributes.from(n,e=>e.attrs)]}),jO=K.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class mv{constructor(e,t,i,s){this.field=e,this.line=t,this.from=i,this.to=s}}class eu{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,pt.TrackDel),i=e.mapPos(this.to,1,pt.TrackDel);return t==null||i==null?null:new eu(this.field,t,i)}}class tu{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let c of this.lines){if(i.length){let h=o,u=/^\t*/.exec(c)[0].length;for(let f=0;fnew eu(c.field,s[c.line]+c.from,s[c.line]+c.to));return{text:i,ranges:a}}static parse(e){let t=[],i=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let a=r[1]?+r[1]:null,c=r[2]||r[3]||"",h=-1;for(let u=0;u=h&&f.field++}s.push(new mv(h,i.length,r.index,r.index+c.length)),o=o.slice(0,r.index)+c+o.slice(r.index+r[0].length)}for(let a;a=/\\([{}])/.exec(o);){o=o.slice(0,a.index)+a[1]+o.slice(a.index+a[0].length);for(let c of s)c.line==i.length&&c.from>a.index&&(c.from--,c.to--)}i.push(o)}return new tu(i,s)}}let Ov=le.widget({widget:new class extends qn{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),gv=le.mark({class:"cm-snippetField"});class gs{constructor(e,t){this.ranges=e,this.active=t,this.deco=le.set(e.map(i=>(i.from==i.to?Ov:gv).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let s=i.map(e);if(!s)return null;t.push(s)}return new gs(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const br=we.define({map(n,e){return n&&n.map(e)}}),yv=we.define(),sr=ct.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(br))return t.value;if(t.is(yv)&&n)return new gs(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>K.decorations.from(n,e=>e?e.deco:le.none)});function nu(n,e){return q.create(n.filter(t=>t.field==e).map(t=>q.range(t.from,t.to)))}function Sv(n){let e=tu.parse(n);return(t,i,s,r)=>{let{text:o,ranges:a}=e.instantiate(t.state,s),c={changes:{from:s,to:r,insert:Ce.of(o)},scrollIntoView:!0,annotations:i?qO.of(i):void 0};if(a.length&&(c.selection=nu(a,0)),a.length>1){let h=new gs(a,0),u=c.effects=[br.of(h)];t.state.field(sr,!1)===void 0&&u.push(we.appendConfig.of([sr,vv,Qv,jO]))}t.dispatch(t.state.update(c))}}function UO(n){return({state:e,dispatch:t})=>{let i=e.field(sr,!1);if(!i||n<0&&i.active==0)return!1;let s=i.active+n,r=n>0&&!i.ranges.some(o=>o.field==s+n);return t(e.update({selection:nu(i.ranges,s),effects:br.of(r?null:new gs(i.ranges,s))})),!0}}const kv=({state:n,dispatch:e})=>n.field(sr,!1)?(e(n.update({effects:br.of(null)})),!0):!1,bv=UO(1),wv=UO(-1),xv=[{key:"Tab",run:bv,shift:wv},{key:"Escape",run:kv}],x1=ee.define({combine(n){return n.length?n[0]:xv}}),vv=Ti.highest(mr.compute([x1],n=>n.facet(x1)));function Gt(n,e){return Object.assign(Object.assign({},e),{apply:Sv(n)})}const Qv=K.domEventHandlers({mousedown(n,e){let t=e.state.field(sr,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=i&&r.to>=i);return!s||s.field==t.active?!1:(e.dispatch({selection:nu(t.ranges,s.field),effects:br.of(t.ranges.some(r=>r.field>s.field)?new gs(t.ranges,s.field):null)}),!0)}}),rr={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Si=we.define({map(n,e){let t=e.mapPos(n,-1,pt.TrackAfter);return t??void 0}}),iu=new class extends bi{};iu.startSide=1;iu.endSide=-1;const BO=ct.define({create(){return Xe.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head).from,i=e.startState.doc.lineAt(e.startState.selection.main.head).from;t!=e.changes.mapPos(i,-1)&&(n=Xe.empty)}n=n.map(e.changes);for(let t of e.effects)t.is(Si)&&(n=n.update({add:[iu.range(t.value,t.value+1)]}));return n}});function Pv(){return[$v,BO]}const El="()[]{}<>";function YO(n){for(let e=0;e{if((_v?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let s=n.state.selection.main;if(i.length>2||i.length==2&&Vt(ft(i,0))==1||e!=s.from||t!=s.to)return!1;let r=Av(n.state,i);return r?(n.dispatch(r),!0):!1}),Tv=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=FO(n,n.selection.main.head).brackets||rr.brackets,s=null,r=n.changeByRange(o=>{if(o.empty){let a=Iv(n.doc,o.head);for(let c of i)if(c==a&&ba(n.doc,o.head)==YO(ft(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:q.cursor(o.head-c.length)}}return{range:s=o}});return s||e(n.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},Cv=[{key:"Backspace",run:Tv}];function Av(n,e){let t=FO(n,n.selection.main.head),i=t.brackets||rr.brackets;for(let s of i){let r=YO(ft(s,0));if(e==s)return r==s?Ev(n,s,i.indexOf(s+s+s)>-1,t):Rv(n,s,r,t.before||rr.before);if(e==r&&zO(n,n.selection.main.from))return Xv(n,s,r)}return null}function zO(n,e){let t=!1;return n.field(BO).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function ba(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Vt(ft(t,0)))}function Iv(n,e){let t=n.sliceString(e-2,e);return Vt(ft(t,0))==t.length?t:t.slice(1)}function Rv(n,e,t,i){let s=null,r=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Si.of(o.to+e.length),range:q.range(o.anchor+e.length,o.head+e.length)};let a=ba(n.doc,o.head);return!a||/\s/.test(a)||i.indexOf(a)>-1?{changes:{insert:e+t,from:o.head},effects:Si.of(o.head+e.length),range:q.cursor(o.head+e.length)}:{range:s=o}});return s?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Xv(n,e,t){let i=null,s=n.changeByRange(r=>r.empty&&ba(n.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:q.cursor(r.head+t.length)}:i={range:r});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Ev(n,e,t,i){let s=i.stringPrefixes||rr.stringPrefixes,r=null,o=n.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Si.of(a.to+e.length),range:q.range(a.anchor+e.length,a.head+e.length)};let c=a.head,h=ba(n.doc,c),u;if(h==e){if(v1(n,c))return{changes:{insert:e+e,from:c},effects:Si.of(c+e.length),range:q.cursor(c+e.length)};if(zO(n,c)){let p=t&&n.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+p.length,insert:p},range:q.cursor(c+p.length)}}}else{if(t&&n.sliceDoc(c-2*e.length,c)==e+e&&(u=Q1(n,c-2*e.length,s))>-1&&v1(n,u))return{changes:{insert:e+e+e+e,from:c},effects:Si.of(c+e.length),range:q.cursor(c+e.length)};if(n.charCategorizer(c)(h)!=We.Word&&Q1(n,c,s)>-1&&!Zv(n,c,e,s))return{changes:{insert:e+e,from:c},effects:Si.of(c+e.length),range:q.cursor(c+e.length)}}return{range:r=a}});return r?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function v1(n,e){let t=He(n).resolveInner(e+1);return t.parent&&t.from==e}function Zv(n,e,t,i){let s=He(n).resolveInner(e,-1),r=i.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=n.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),c=a.indexOf(t);if(!c||c>-1&&i.indexOf(a.slice(0,c))>-1){let u=s.firstChild;for(;u&&u.from==s.from&&u.to-u.from>t.length+c;){if(n.sliceDoc(u.to-t.length,u.to)==t)return!1;u=u.firstChild}return!0}let h=s.to==e&&s.parent;if(!h)break;s=h}return!1}function Q1(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=We.Word)return e;for(let s of t){let r=e-s.length;if(n.sliceDoc(r,e)==s&&i(n.sliceDoc(r-1,r))!=We.Word)return r}return-1}function Mv(n={}){return[Xt,_t.of(n),rv,Dv,jO]}const GO=[{key:"Ctrl-Space",run:ev},{key:"Escape",run:tv},{key:"ArrowDown",run:Yr(!0)},{key:"ArrowUp",run:Yr(!1)},{key:"PageDown",run:Yr(!0,"page")},{key:"PageUp",run:Yr(!1,"page")},{key:"Enter",run:Kx}],Dv=Ti.highest(mr.computeN([_t],n=>n.facet(_t).defaultKeymap?[GO]:[]));class Nv{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class mi{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let s=e,r=i.facet(KO).markerFilter;r&&(s=r(s));let o=le.set(s.map(a=>a.from==a.to||a.from==a.to-1&&i.doc.lineAt(a.from).to==a.from?le.widget({widget:new Fv(a),diagnostic:a}).range(a.from):le.mark({attributes:{class:"cm-lintRange cm-lintRange-"+a.severity},diagnostic:a}).range(a.from,a.to)),!0);return new mi(o,t,hs(o))}}function hs(n,e=null,t=0){let i=null;return n.between(t,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostic!=e))return i=new Nv(s,r,o.diagnostic),!1}),i}function qv(n,e){let t=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(i=>i.is(HO))||n.changes.touchesRange(t.from,t.to))}function Vv(n,e){return n.field(Zt,!1)?e:e.concat(we.appendConfig.of(Hv))}const HO=we.define(),su=we.define(),JO=we.define(),Zt=ct.define({create(){return new mi(le.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),i=null;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);i=hs(t,n.selected.diagnostic,s)||hs(t,null,s)}n=new mi(t,n.panel,i)}for(let t of e.effects)t.is(HO)?n=mi.init(t.value,n.panel,e.state):t.is(su)?n=new mi(n.diagnostics,t.value?wa.open:null,n.selected):t.is(JO)&&(n=new mi(n.diagnostics,n.panel,t.value));return n},provide:n=>[Ks.from(n,e=>e.panel),K.decorations.from(n,e=>e.diagnostics)]}),Lv=le.mark({class:"cm-lintRange cm-lintRange-active"});function Wv(n,e,t){let{diagnostics:i}=n.state.field(Zt),s=[],r=2e8,o=0;i.between(e-(t<0?1:0),e+(t>0?1:0),(c,h,{spec:u})=>{e>=c&&e<=h&&(c==h||(e>c||t>0)&&(etg(n,t,!1)))}const Uv=n=>{let e=n.state.field(Zt,!1);(!e||!e.panel)&&n.dispatch({effects:Vv(n.state,[su.of(!0)])});let t=Js(n,wa.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},P1=n=>{let e=n.state.field(Zt,!1);return!e||!e.panel?!1:(n.dispatch({effects:su.of(!1)}),!0)},Bv=n=>{let e=n.state.field(Zt,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},Yv=[{key:"Mod-Shift-m",run:Uv,preventDefault:!0},{key:"F8",run:Bv}],KO=ee.define({combine(n){return Object.assign({sources:n.map(e=>e.source)},_n(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function eg(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;ir.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function tg(n,e,t){var i;let s=t?eg(e.actions):[];return Me("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Me("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(i=e.actions)===null||i===void 0?void 0:i.map((r,o)=>{let a=!1,c=p=>{if(p.preventDefault(),a)return;a=!0;let m=hs(n.state.field(Zt).diagnostics,e);m&&r.apply(n,m.from,m.to)},{name:h}=r,u=s[o]?h.indexOf(s[o]):-1,f=u<0?h:[h.slice(0,u),Me("u",h.slice(u,u+1)),h.slice(u+1)];return Me("button",{type:"button",class:"cm-diagnosticAction",onclick:c,onmousedown:c,"aria-label":` Action: ${h}${u<0?"":` (access key "${s[o]})"`}.`},f)}),e.source&&Me("div",{class:"cm-diagnosticSource"},e.source))}class Fv extends qn{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Me("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class _1{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=tg(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class wa{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)P1(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=eg(r.actions);for(let a=0;a{for(let r=0;rP1(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Zt).selected;if(!e)return-1;for(let t=0;t{let h=-1,u;for(let f=i;fi&&(this.items.splice(i,h-i),s=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),r=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),i++});i({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:a})=>{o.topa.bottom&&(this.list.scrollTop+=o.bottom-a.bottom)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Zt),i=hs(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:JO.of(i)})}static open(e){return new wa(e)}}function zv(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function Zl(n){return zv(``,'width="6" height="3"')}const Gv=K.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Zl("#d11")},".cm-lintRange-warning":{backgroundImage:Zl("orange")},".cm-lintRange-info":{backgroundImage:Zl("#999")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),Hv=[Zt,K.decorations.compute([Zt],n=>{let{selected:e,panel:t}=n.field(Zt);return!e||!t||e.from==e.to?le.none:le.set([Lv.range(e.from,e.to)])}),jk(Wv,{hideOn:qv}),Gv],Jv=(()=>[Kk(),nb(),wk(),kw(),Yb(),uk(),Ok(),_e.allowMultipleSelections.of(!0),Eb(),Lm(Hb,{fallback:!0}),sw(),Pv(),Mv(),Xk(),Mk(),$k(),vx(),mr.of([...Cv,...Sx,...Wx,...Tw,...jb,...GO,...Yv])])();class jo{constructor(e,t,i,s,r,o,a,c,h,u=0,f){this.p=e,this.stack=t,this.state=i,this.reducePos=s,this.pos=r,this.score=o,this.buffer=a,this.bufferBase=c,this.curContext=h,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let s=e.parser.context;return new jo(e,[],t,i,i,0,[],0,s?new $1(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,s=e&65535,{parser:r}=this.p,o=r.dynamicPrecedence(s);if(o&&(this.score+=o),i==0){this.pushState(r.getGoto(this.state,s,!0),this.reducePos),s=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(s,c)}storeNode(e,t,i,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(t==i)return;if(o.buffer[a-2]>=t){o.buffer[a-2]=i;return}}}if(!r||this.pos==i)this.buffer.push(e,t,i,s);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0)for(;o>0&&this.buffer[o-2]>i;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4);this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=i,this.buffer[o+3]=s}}shift(e,t,i){let s=this.pos;if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=i,this.shiftContext(t,s),t<=this.p.parser.maxNode&&this.buffer.push(t,s,i,4);else{let r=e,{parser:o}=this.p;(i>this.pos||t<=o.maxNode)&&(this.pos=i,o.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,s),this.shiftContext(t,s),t<=o.maxNode&&this.buffer.push(t,s,i,4)}}apply(e,t,i){e&65536?this.reduce(e):this.shift(e,t,i)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(i,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new jo(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Kv(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let r=0,o;rc&1&&a==o)||s.push(t[r],o)}t=s}let i=[];for(let s=0;s>19,s=t&65535,r=this.stack.length-i*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(s,r)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-r;if(a>1){let c=o&65535,h=this.stack.length-a*3;if(h>=0&&e.getGoto(this.stack[h],c,!1)>=0)return a<<19|65536|c}}else{let a=i(o,r+1);if(a!=null)return a}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class $1{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}var T1;(function(n){n[n.Insert=200]="Insert",n[n.Delete=190]="Delete",n[n.Reduce=100]="Reduce",n[n.MaxNext=4]="MaxNext",n[n.MaxInsertStackDepth=300]="MaxInsertStackDepth",n[n.DampenInsertStackDepth=120]="DampenInsertStackDepth",n[n.MinBigReduction=2e3]="MinBigReduction"})(T1||(T1={}));class Kv{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}}class Uo{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Uo(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Uo(this.stack,this.pos,this.index)}}function Ns(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,s=0;i=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,a=!0),r+=c,a)break;r*=46}t?t[s++]=r:t=new e(r)}return t}class uo{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const C1=new uo;class eQ{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=C1,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,s=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-i.to,i=o}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,s;if(t>=0&&t=this.chunk2Pos&&ia.to&&(this.chunk2=this.chunk2.slice(0,a.to-i)),s=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),s}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=C1,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(i+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return i}}class ts{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;ng(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}ts.prototype.contextual=ts.prototype.fallback=ts.prototype.extend=!1;class In{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?Ns(e):e}token(e,t){let i=e.pos,s=0;for(;ng(this.data,e,t,0,this.data,this.precTable),!(e.token.value>-1);){if(this.elseToken==null)return;if(e.next<0)break;e.advance(),e.reset(e.pos,e.token),s++}s&&(e.reset(i,e.token),e.acceptToken(this.elseToken,s))}}In.prototype.contextual=ts.prototype.fallback=ts.prototype.extend=!1;class Tn{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function ng(n,e,t,i,s,r){let o=0,a=1<0){let O=n[m];if(c.allows(O)&&(e.token.value==-1||e.token.value==O||tQ(O,e.token.value,s,r))){e.acceptToken(O);break}}let u=e.next,f=0,p=n[o+2];if(e.next<0&&p>f&&n[h+p*3-3]==65535&&n[h+p*3-3]==65535){o=n[h+p*3-1];continue e}for(;f>1,O=h+m+(m<<1),k=n[O],y=n[O+1]||65536;if(u=y)f=m+1;else{o=n[O+2],e.advance();continue e}}break}}function A1(n,e,t){for(let i=e,s;(s=n[i])!=65535;i++)if(s==t)return i-e;return-1}function tQ(n,e,t,i){let s=A1(t,i,e);return s<0||A1(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class nQ{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?R1(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?R1(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(r instanceof ze){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}}class iQ{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new uo)}getActions(e){let t=0,i=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,c=0;for(let h=0;hf.end+25&&(c=Math.max(f.lookAhead,c)),f.value!=0)){let p=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!u.extend&&(i=f,t>p))break}}for(;this.actions.length>t;)this.actions.pop();return c&&e.setLookAhead(c),!i&&e.pos==this.stream.end&&(i=new uo,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new uo,{pos:i,p:s}=e;return t.start=i,t.end=Math.min(i+1,s.stream.end),t.value=i==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,i){let s=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(s,e),i),e.value>-1){let{parser:r}=i.p;for(let o=0;o=0&&i.p.parser.dialect.allows(a>>1)){a&1?e.extended=a>>1:e.value=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,i,s){for(let r=0;re.bufferLength*4?new nQ(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)i.push(a);else{if(this.advanceStack(a,i,e))continue;{s||(s=[],r=[]),s.push(a);let c=this.tokens.getMainToken(a);r.push(c.value,c.end)}}break}}if(!i.length){let o=s&&oQ(s);if(o)return this.stackToTree(o);if(this.parser.strict)throw Ht&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,i);if(o)return this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((a,c)=>c.score-a.score);i.length>o;)i.pop();i.some(a=>a.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let o=0;o500&&h.buffer.length>500)if((a.score-h.score||a.buffer.length-h.buffer.length)>0)i.splice(c--,1);else{i.splice(o--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let h=e.curContext&&e.curContext.tracker.strict,u=h?e.curContext.hash:0;for(let f=this.fragments.nodeAt(s);f;){let p=this.parser.nodeSet.types[f.type.id]==f.type?r.getGoto(e.state,f.type.id):-1;if(p>-1&&f.length&&(!h||(f.prop(ve.contextHash)||0)==u))return e.useNode(f,p),Ht&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(f.type.id)})`),!0;if(!(f instanceof ze)||f.children.length==0||f.positions[0]>0)break;let m=f.children[0];if(m instanceof ze&&f.positions[0]==0)f=m;else break}}let a=r.stateSlot(e.state,4);if(a>0)return e.reduce(a),Ht&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(a&65535)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let h=0;hs?t.push(O):i.push(O)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return E1(e,t),!0}}runRecovery(e,t,i){let s=null,r=!1;for(let o=0;o ":"";if(a.deadEnd&&(r||(r=!0,a.restart(),Ht&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,i))))continue;let f=a.split(),p=u;for(let m=0;f.forceReduce()&&m<10&&(Ht&&console.log(p+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));m++)Ht&&(p=this.stackID(f)+" -> ");for(let m of a.recoverByInsert(c))Ht&&console.log(u+this.stackID(m)+" (via recover-insert)"),this.advanceFully(m,i);this.stream.end>a.pos?(h==a.pos&&(h++,c=0),a.recoverByDelete(c,h),Ht&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(c)})`),E1(a,i)):(!s||s.scoren;class ig{constructor(e){this.start=e.start,this.shift=e.shift||Dl,this.reduce=e.reduce||Dl,this.reuse=e.reuse||Dl,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Qi extends _m{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;ae.topRules[a][1]),s=[];for(let a=0;a=0)r(u,c,a[h++]);else{let f=a[h+-u];for(let p=-u;p>0;p--)r(a[h++],c,f);h++}}}this.nodeSet=new Nh(t.map((a,c)=>xt.define({name:c>=this.minRepeatTerm?void 0:a,id:c,props:s[c],top:i.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=xm;let o=Ns(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;atypeof a=="number"?new ts(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let s=new sQ(this,e,t,i);for(let r of this.wrappers)s=r(s,e,t,i);return s}getGoto(e,t,i=!1){let s=this.goto;if(t>=s[0])return-1;for(let r=s[t+1];;){let o=s[r++],a=o&1,c=s[r++];if(a&&i)return c;for(let h=r+(o>>1);r0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),s=i?t(i):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Rn(this.data,r+2);else break;s=t(Rn(this.data,r+1))}return s}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Rn(this.data,i+2);else break;if(!(this.data[i+2]&1)){let s=this.data[i+1];t.some((r,o)=>o&1&&r==s)||t.push(this.data[i],s)}}return t}configure(e){let t=Object.assign(Object.create(Qi.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let s=e.tokenizers.find(r=>r.from==i);return s?s.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,s)=>{let r=e.specializers.find(a=>a.from==i.external);if(!r)return i;let o=Object.assign(Object.assign({},i),{external:r.to});return t.specializers[s]=Z1(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let r of e.split(" ")){let o=t.indexOf(r);o>=0&&(i[o]=!0)}let s=null;for(let r=0;ri)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}const aQ=54,lQ=1,cQ=55,hQ=2,uQ=56,fQ=3,M1=4,dQ=5,Bo=6,sg=7,rg=8,og=9,ag=10,pQ=11,mQ=12,OQ=13,Nl=57,gQ=14,D1=58,lg=20,yQ=22,cg=23,SQ=24,Jc=26,hg=27,kQ=28,bQ=31,wQ=34,xQ=36,vQ=37,QQ=0,PQ=1,_Q={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},$Q={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},N1={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 TQ(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}function ug(n){return n==9||n==10||n==13||n==32}let q1=null,V1=null,L1=0;function Kc(n,e){let t=n.pos+e;if(L1==t&&V1==n)return q1;let i=n.peek(e);for(;ug(i);)i=n.peek(++e);let s="";for(;TQ(i);)s+=String.fromCharCode(i),i=n.peek(++e);return V1=n,L1=t,q1=s?s.toLowerCase():i==CQ||i==AQ?void 0:null}const fg=60,Yo=62,ru=47,CQ=63,AQ=33,IQ=45;function W1(n,e){this.name=n,this.parent=e,this.hash=e?e.hash:0;for(let t=0;t-1?new W1(Kc(i,1)||"",n):n},reduce(n,e){return e==lg&&n?n.parent:n},reuse(n,e,t,i){let s=e.type.id;return s==Bo||s==xQ?new W1(Kc(i,1)||"",n):n},hash(n){return n?n.hash:0},strict:!1}),EQ=new Tn((n,e)=>{if(n.next!=fg){n.next<0&&e.context&&n.acceptToken(Nl);return}n.advance();let t=n.next==ru;t&&n.advance();let i=Kc(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?gQ:Bo);let s=e.context?e.context.name:null;if(t){if(i==s)return n.acceptToken(pQ);if(s&&$Q[s])return n.acceptToken(Nl,-2);if(e.dialectEnabled(QQ))return n.acceptToken(mQ);for(let r=e.context;r;r=r.parent)if(r.name==i)return;n.acceptToken(OQ)}else{if(i=="script")return n.acceptToken(sg);if(i=="style")return n.acceptToken(rg);if(i=="textarea")return n.acceptToken(og);if(_Q.hasOwnProperty(i))return n.acceptToken(ag);s&&N1[s]&&N1[s][i]?n.acceptToken(Nl,-1):n.acceptToken(Bo)}},{contextual:!0}),ZQ=new Tn(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(D1);break}if(n.next==IQ)e++;else if(n.next==Yo&&e>=2){t>3&&n.acceptToken(D1,-2);break}else e=0;n.advance()}});function MQ(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const DQ=new Tn((n,e)=>{if(n.next==ru&&n.peek(1)==Yo){let t=e.dialectEnabled(PQ)||MQ(e.context);n.acceptToken(t?dQ:M1,2)}else n.next==Yo&&n.acceptToken(M1,1)});function ou(n,e,t){let i=2+n.length;return new Tn(s=>{for(let r=0,o=0,a=0;;a++){if(s.next<0){a&&s.acceptToken(e);break}if(r==0&&s.next==fg||r==1&&s.next==ru||r>=2&&ro?s.acceptToken(e,-o):s.acceptToken(t,-(o-2));break}else if((s.next==10||s.next==13)&&a){s.acceptToken(e,1);break}else r=o=0;s.advance()}})}const NQ=ou("script",aQ,lQ),qQ=ou("style",cQ,hQ),VQ=ou("textarea",uQ,fQ),LQ=gr({"Text RawText":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),WQ=Qi.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO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OS!TOhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:XQ,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,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!Hpqr!Ncrs!Hpsw!Ncwx!Hpx!P!Nc!P!Q!Hp!Q!_!Nc!_!a!Hp!a!b# p!b#s!Nc#s$f!Hp$f;'S!Nc;'S;=`#!}<%l?Ah!Nc?Ah?BY!Hp?BY?Mn!Nc?MnO!HpT# ubhSOq!Hpqr!Ncrs!Hpsw!Ncwx!Hpx!P!Nc!P!Q!Hp!Q!_!Nc!_!`!Hp!`!a!If!a#s!Nc#s$f!Hp$f;'S!Nc;'S;=`#!}<%l?Ah!Nc?Ah?BY!Hp?BY?Mn!Nc?MnO!HpT##QP;=`<%l!Nc!V##^chS!a`!cpOq!G_qr!Eyrs!HUsv!Eyvw!Ncwx!Jvx!P!Ey!P!Q!G_!Q!_!Ey!_!`!G_!`!a!Mm!a#s!Ey#s$f!G_$f;'S!Ey;'S;=`#$i<%l?Ah!Ey?Ah?BY!G_?BY?Mn!Ey?MnO!G_!V#$lP;=`<%l!Ey!V#$zXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[NQ,qQ,VQ,DQ,EQ,ZQ,0,1,2,3,4,5],topRules:{Document:[0,15]},dialects:{noMatch:0,selfClosing:485},tokenPrec:487});function dg(n,e){let t=Object.create(null);for(let i of n.getChildren(cg)){let s=i.getChild(SQ),r=i.getChild(Jc)||i.getChild(hg);s&&(t[e.read(s.from,s.to)]=r?r.type.id==Jc?e.read(r.from+1,r.to-1):e.read(r.from,r.to):"")}return t}function j1(n,e){let t=n.getChild(yQ);return t?e.read(t.from,t.to):" "}function ql(n,e,t){let i;for(let s of t)if(!s.attrs||s.attrs(i||(i=dg(n.node.parent.firstChild,e))))return{parser:s.parser};return null}function pg(n=[],e=[]){let t=[],i=[],s=[],r=[];for(let a of n)(a.tag=="script"?t:a.tag=="style"?i:a.tag=="textarea"?s:r).push(a);let o=e.length?Object.create(null):null;for(let a of e)(o[a.name]||(o[a.name]=[])).push(a);return ca((a,c)=>{let h=a.type.id;if(h==kQ)return ql(a,c,t);if(h==bQ)return ql(a,c,i);if(h==wQ)return ql(a,c,s);if(h==lg&&r.length){let u=a.node,f=u.firstChild,p=f&&j1(f,c),m;if(p){for(let O of r)if(O.tag==p&&(!O.attrs||O.attrs(m||(m=dg(u,c))))){let k=u.lastChild;return{parser:O.parser,overlay:[{from:f.to,to:k.type.id==vQ?k.from:u.to}]}}}}if(o&&h==cg){let u=a.node,f;if(f=u.firstChild){let p=o[c.read(f.from,f.to)];if(p)for(let m of p){if(m.tagName&&m.tagName!=j1(u.parent,c))continue;let O=u.lastChild;if(O.type.id==Jc){let k=O.from+1,y=O.lastChild,S=O.to-(y&&y.isError?0:1);if(S>k)return{parser:m.parser,overlay:[{from:k,to:S}]}}else if(O.type.id==hg)return{parser:m.parser,overlay:[{from:O.from,to:O.to}]}}}}return null})}const jQ=95,U1=1,UQ=96,BQ=97,B1=2,mg=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],YQ=58,FQ=40,Og=95,zQ=91,fo=45,GQ=46,HQ=35,JQ=37;function Fo(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function KQ(n){return n>=48&&n<=57}const eP=new Tn((n,e)=>{for(let t=!1,i=0,s=0;;s++){let{next:r}=n;if(Fo(r)||r==fo||r==Og||t&&KQ(r))!t&&(r!=fo||s>0)&&(t=!0),i===s&&r==fo&&i++,n.advance();else{t&&n.acceptToken(r==FQ?UQ:i==2&&e.canShift(B1)?B1:BQ);break}}}),tP=new Tn(n=>{if(mg.includes(n.peek(-1))){let{next:e}=n;(Fo(e)||e==Og||e==HQ||e==GQ||e==zQ||e==YQ||e==fo)&&n.acceptToken(jQ)}}),nP=new Tn(n=>{if(!mg.includes(n.peek(-1))){let{next:e}=n;if(e==JQ&&(n.advance(),n.acceptToken(U1)),Fo(e)){do n.advance();while(Fo(n.next));n.acceptToken(U1)}}}),iP=gr({"AtKeyword import charset namespace keyframes media supports":b.definitionKeyword,"from to selector":b.keyword,NamespaceName:b.namespace,KeyframeName:b.labelName,KeyframeRangeName:b.operatorKeyword,TagName:b.tagName,ClassName:b.className,PseudoClassName:b.constant(b.className),IdName:b.labelName,"FeatureName PropertyName":b.propertyName,AttributeName:b.attributeName,NumberLiteral:b.number,KeywordQuery:b.keyword,UnaryQueryOp:b.operatorKeyword,"CallTag ValueName":b.atom,VariableName:b.variableName,Callee:b.operatorKeyword,Unit:b.unit,"UniversalSelector NestingSelector":b.definitionOperator,MatchOp:b.compareOperator,"ChildOp SiblingOp, LogicOp":b.logicOperator,BinOp:b.arithmeticOperator,Important:b.modifier,Comment:b.blockComment,ColorLiteral:b.color,"ParenthesizedContent StringLiteral":b.string,":":b.punctuation,"PseudoOp #":b.derefOperator,"; ,":b.separator,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace}),sP={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},rP={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},oP={__proto__:null,not:128,only:128},aP=Qi.deserialize({version:14,states:"8`QYQ[OOO#_Q[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO#fQ[O'#CfO$YQXO'#CaO$aQ[O'#ChO$lQ[O'#DPO$qQ[O'#DTOOQP'#Ee'#EeO$vQdO'#DeO%bQ[O'#DrO$vQdO'#DtO%sQ[O'#DvO&OQ[O'#DyO&WQ[O'#EPO&fQ[O'#EROOQS'#Ed'#EdOOQS'#ET'#ETQYQ[OOO&mQXO'#CdO'bQWO'#DaO'gQWO'#EkO'rQ[O'#EkQOQWOOOOQP'#Cg'#CgOOQP,59Q,59QO#fQ[O,59QO'|Q[O'#EWO(hQWO,58{O(pQ[O,59SO$lQ[O,59kO$qQ[O,59oO'|Q[O,59sO'|Q[O,59uO'|Q[O,59vO({Q[O'#D`OOQS,58{,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z;'S%^;'S;=`%o<%lO%^XFeU|POy%^z!`%^!`!aFw!a;'S%^;'S;=`%o<%lO%^XGOS|PoWOy%^z;'S%^;'S;=`%o<%lO%^XG_WOy%^z!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHO[!YPoWOy%^z}%^}!OGw!O!Q%^!Q![Gw![!c%^!c!}Gw!}#T%^#T#oGw#o;'S%^;'S;=`%o<%lO%^XHySxPOy%^z;'S%^;'S;=`%o<%lO%^^I[SvUOy%^z;'S%^;'S;=`%o<%lO%^XIkUOy%^z#b%^#b#cI}#c;'S%^;'S;=`%o<%lO%^XJSUoWOy%^z#W%^#W#XJf#X;'S%^;'S;=`%o<%lO%^XJmS!`PoWOy%^z;'S%^;'S;=`%o<%lO%^XJ|UOy%^z#f%^#f#gJf#g;'S%^;'S;=`%o<%lO%^ZKeS!RROy%^z;'S%^;'S;=`%o<%lO%^_KvS!QVOy%^z;'S%^;'S;=`%o<%lO%^ZLXU!PPOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^WLnP;=`<%l$}",tokenizers:[tP,nP,eP,0,1,2,3],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:96,get:n=>sP[n]||-1},{term:56,get:n=>rP[n]||-1},{term:97,get:n=>oP[n]||-1}],tokenPrec:1142});let Vl=null;function Ll(){if(!Vl&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));Vl=e.sort().map(i=>({type:"property",label:i}))}return Vl||[]}const Y1=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),F1=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),lP=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),Ln=/^(\w[\w-]*|-\w[\w-]*|)$/,cP=/^-(-[\w-]*)?$/;function hP(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const z1=new Pm,uP=["Declaration"];function fP(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function gg(n,e,t){if(e.to-e.from>4096){let i=z1.get(e);if(i)return i;let s=[],r=new Set,o=e.cursor(De.IncludeAnonymous);if(o.firstChild())do for(let a of gg(n,o.node,t))r.has(a.label)||(r.add(a.label),s.push(a));while(o.nextSibling());return z1.set(e,s),s}else{let i=[],s=new Set;return e.cursor().iterate(r=>{var o;if(t(r)&&r.matchContext(uP)&&((o=r.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=n.sliceString(r.from,r.to);s.has(a)||(s.add(a),i.push({label:a,type:"variable"}))}}),i}}const dP=n=>e=>{let{state:t,pos:i}=e,s=He(t).resolveInner(i,-1),r=s.type.isError&&s.from==s.to-1&&t.doc.sliceString(s.from,s.to)=="-";if(s.name=="PropertyName"||(r||s.name=="TagName")&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:Ll(),validFor:Ln};if(s.name=="ValueName")return{from:s.from,options:F1,validFor:Ln};if(s.name=="PseudoClassName")return{from:s.from,options:Y1,validFor:Ln};if(n(s)||(e.explicit||r)&&hP(s,t.doc))return{from:n(s)||r?s.from:i,options:gg(t.doc,fP(s),n),validFor:cP};if(s.name=="TagName"){for(let{parent:c}=s;c;c=c.parent)if(c.name=="Block")return{from:s.from,options:Ll(),validFor:Ln};return{from:s.from,options:lP,validFor:Ln}}if(!e.explicit)return null;let o=s.resolve(i),a=o.childBefore(i);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:i,options:Y1,validFor:Ln}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:i,options:F1,validFor:Ln}:o.name=="Block"||o.name=="Styles"?{from:i,options:Ll(),validFor:Ln}:null},pP=dP(n=>n.name=="VariableName"),zo=xi.define({name:"css",parser:aP.configure({props:[da.add({Declaration:ho()}),pa.add({Block:Xm})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function yg(){return new ha(zo,zo.data.of({autocomplete:pP}))}const G1=302,H1=1,mP=2,J1=303,OP=305,gP=306,yP=3,SP=4,kP=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],Sg=125,bP=59,K1=47,wP=42,xP=43,vP=45,QP=new ig({start:!1,shift(n,e){return e==yP||e==SP||e==OP?n:e==gP},strict:!1}),PP=new Tn((n,e)=>{let{next:t}=n;(t==Sg||t==-1||e.context)&&e.canShift(J1)&&n.acceptToken(J1)},{contextual:!0,fallback:!0}),_P=new Tn((n,e)=>{let{next:t}=n,i;kP.indexOf(t)>-1||t==K1&&((i=n.peek(1))==K1||i==wP)||t!=Sg&&t!=bP&&t!=-1&&!e.context&&e.canShift(G1)&&n.acceptToken(G1)},{contextual:!0}),$P=new Tn((n,e)=>{let{next:t}=n;if((t==xP||t==vP)&&(n.advance(),t==n.next)){n.advance();let i=!e.context&&e.canShift(H1);n.acceptToken(i?H1:mP)}},{contextual:!0}),TP=gr({"get set async static":b.modifier,"for while do if else switch try catch finally return throw break continue default case":b.controlKeyword,"in of await yield void typeof delete instanceof":b.operatorKeyword,"let var const function class extends":b.definitionKeyword,"import export from":b.moduleKeyword,"with debugger as new":b.keyword,TemplateString:b.special(b.string),super:b.atom,BooleanLiteral:b.bool,this:b.self,null:b.null,Star:b.modifier,VariableName:b.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":b.function(b.variableName),VariableDefinition:b.definition(b.variableName),Label:b.labelName,PropertyName:b.propertyName,PrivatePropertyName:b.special(b.propertyName),"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),"FunctionDeclaration/VariableDefinition":b.function(b.definition(b.variableName)),"ClassDeclaration/VariableDefinition":b.definition(b.className),PropertyDefinition:b.definition(b.propertyName),PrivatePropertyDefinition:b.definition(b.special(b.propertyName)),UpdateOp:b.updateOperator,LineComment:b.lineComment,BlockComment:b.blockComment,Number:b.number,String:b.string,Escape:b.escape,ArithOp:b.arithmeticOperator,LogicOp:b.logicOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,RegExp:b.regexp,Equals:b.definitionOperator,Arrow:b.function(b.punctuation),": Spread":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,"InterpolationStart InterpolationEnd":b.special(b.brace),".":b.derefOperator,", ;":b.separator,"@":b.meta,TypeName:b.typeName,TypeDefinition:b.definition(b.typeName),"type enum interface implements namespace module declare":b.definitionKeyword,"abstract global Privacy readonly override":b.modifier,"is keyof unique infer":b.operatorKeyword,JSXAttributeValue:b.attributeValue,JSXText:b.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":b.angleBracket,"JSXIdentifier JSXNameSpacedName":b.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":b.attributeName,"JSXBuiltin/JSXIdentifier":b.standard(b.tagName)}),CP={__proto__:null,export:14,as:19,from:27,default:30,async:35,function:36,extends:46,this:50,true:58,false:58,null:70,void:74,typeof:78,super:96,new:130,delete:146,yield:155,await:159,class:164,public:221,private:221,protected:221,readonly:223,instanceof:242,satisfies:245,in:246,const:248,import:280,keyof:335,unique:339,infer:345,is:381,abstract:401,implements:403,type:405,let:408,var:410,interface:417,enum:421,namespace:427,module:429,declare:433,global:437,for:456,of:465,while:468,with:472,do:476,if:480,else:482,switch:486,case:492,try:498,catch:502,finally:506,return:510,throw:514,break:518,continue:522,debugger:526},AP={__proto__:null,async:117,get:119,set:121,declare:181,public:183,private:183,protected:183,static:185,abstract:187,override:189,readonly:195,accessor:197,new:385},IP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ka~O!S&|i!V&|i~P!6UO!V'vO!S(Xi~O!V'}O!S(fi~O!S(gi!V(gi~P!6UO!V(di!g(di^(di'k(di~P!6UO#X2^O!V(di!g(di^(di'k(di~O!V(ZO!g(ci~O|%vO!X%wO!x]O#b2cO#c2bO't%eO~O|%vO!X%wO#c2bO't%eO~Og2jO!X'QO%a2iO~Og2jO!X'QO%a2iO'}%OO~O#dvaPvaXva^vakva!eva!fva!hva!lva#gva#hva#iva#jva#kva#lva#mva#nva#ova#qva#sva#uva#vva'kva(Rva(bva!gva!Sva'ivaova!Xva%ava!ava~P#L|O#d$laP$laX$la^$lak$laz$la!e$la!f$la!h$la!l$la#g$la#h$la#i$la#j$la#k$la#l$la#m$la#n$la#o$la#q$la#s$la#u$la#v$la'k$la(R$la(b$la!g$la!S$la'i$lao$la!X$la%a$la!a$la~P#MrO#d$naP$naX$na^$nak$naz$na!e$na!f$na!h$na!l$na#g$na#h$na#i$na#j$na#k$na#l$na#m$na#n$na#o$na#q$na#s$na#u$na#v$na'k$na(R$na(b$na!g$na!S$na'i$nao$na!X$na%a$na!a$na~P#NeO#d$|aP$|aX$|a^$|ak$|az$|a!V$|a!e$|a!f$|a!h$|a!l$|a#g$|a#h$|a#i$|a#j$|a#k$|a#l$|a#m$|a#n$|a#o$|a#q$|a#s$|a#u$|a#v$|a'k$|a(R$|a(b$|a!g$|a!S$|a'i$|a#X$|ao$|a!X$|a%a$|a!a$|a~P#)tO^#[q!V#[q'k#[q'i#[q!S#[q!g#[qo#[q!X#[q%a#[q!a#[q~P!6UOd'OX!V'OX~P!'^O!V.YOd([a~O!U2rO!V'PX!g'PX~P%QO!V.]O!g(]a~O!V.]O!g(]a~P!6UO!S2uO~O#y!ja!W!ja~PJ`O#y!ba!V!ba!W!ba~P#@_O#y!na!W!na~P!8oO#y!pa!W!pa~P!;YO!X3XO$UfO$_3YO~O!W3^O~Oo3_O~P#)tO^$hq!V$hq'k$hq'i$hq!S$hq!g$hqo$hq!X$hq%a$hq!a$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+e-mt#cZ|}#d#e#h%Z(X(Y(Z+h-s-t-u-w2b2c5wQ1_,ZQ1r,oQ5e1jQ7m5fT:x&y+fT#]W%vS#[W%vS'u#S'}S'z#V+eS,t&y+fT-h't-mT'O!c%wQ$hfR)j$mT)_$h)`R3Z.kT*O$u*QR*W$xQ/}*zQ2e.OQ4s0wQ5{2iQ7X4vQ7x5zQ8e7WQ8w7wQ9W8gQ9`8yQ9e9XR9h9alpOXr!X#`%]&d&f&g&i,],b1b1eQ&^!TR,Q&ZV%z|},ZR0q+qR,P&XQ%szR+c%tR+X%nT&b!U&eT&c!U&eT1d,b1e",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:364,context:QP,nodeProps:[["group",-26,6,14,16,62,199,203,206,207,209,212,215,225,227,233,235,237,239,242,248,254,256,258,260,262,264,265,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,103,104,113,114,131,134,136,137,138,139,141,142,162,163,165,"Expression",-23,24,26,30,34,36,38,166,168,170,171,173,174,175,177,178,179,181,182,183,193,195,197,198,"Type",-3,84,96,102,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",143,"JSXStartTag",155,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",144,"JSXSelfCloseEndTag JSXEndTag",160,"JSXEndTag"]],propSources:[TP],skippedNodes:[0,3,4,268],repeatNodeCount:33,tokenData:"$>y(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst: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1,78:1,163:1,191:1},specialized:[{term:312,get:n=>CP[n]||-1},{term:328,get:n=>AP[n]||-1},{term:67,get:n=>IP[n]||-1}],tokenPrec:12712}),XP=[Gt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Gt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Gt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Gt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Gt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Gt(`try { \${} } catch (\${error}) { \${} }`,{label:"try",detail:"/ catch block",type:"keyword"}),Gt("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Gt(`if (\${}) { \${} } else { \${} }`,{label:"if",detail:"/ else block",type:"keyword"}),Gt(`class \${name} { constructor(\${params}) { \${} } }`,{label:"class",detail:"definition",type:"keyword"}),Gt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Gt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],ed=new Pm,kg=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function $s(n){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,n),!0}}const EP=["FunctionDeclaration"],ZP={FunctionDeclaration:$s("function"),ClassDeclaration:$s("class"),ClassExpression:()=>!0,EnumDeclaration:$s("constant"),TypeAliasDeclaration:$s("type"),NamespaceDeclaration:$s("namespace"),VariableDefinition(n,e){n.matchContext(EP)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function bg(n,e){let t=ed.get(e);if(t)return t;let i=[],s=!0;function r(o,a){let c=n.sliceString(o.from,o.to);i.push({label:c,type:a})}return e.cursor(De.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let a=ZP[o.name];if(a&&a(o,r)||kg.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of bg(n,o.node))i.push(a);return!1}}),ed.set(e,i),i}const td=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,wg=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function MP(n){let e=He(n.state).resolveInner(n.pos,-1);if(wg.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&td.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let s=e;s;s=s.parent)kg.has(s.name)&&(i=i.concat(bg(n.state.doc,s)));return{options:i,from:t?e.from:n.pos,validFor:td}}const bn=xi.define({name:"javascript",parser:RP.configure({props:[da.add({IfStatement:ho({except:/^\s*({|else\b)/}),TryStatement:ho({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Rb,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:Ib({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":ho({except:/^{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),pa.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Xm,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),xg={test:n=>/^JSX/.test(n.name),facet:Cm({commentTokens:{block:{open:"{/*",close:"*/}"}}})},vg=bn.configure({dialect:"ts"},"typescript"),Qg=bn.configure({dialect:"jsx",props:[Wh.add(n=>n.isTop?[xg]:void 0)]}),Pg=bn.configure({dialect:"jsx ts",props:[Wh.add(n=>n.isTop?[xg]:void 0)]},"typescript"),DP="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(n=>({label:n,type:"keyword"}));function _g(n={}){let e=n.jsx?n.typescript?Pg:Qg:n.typescript?vg:bn;return new ha(e,[bn.data.of({autocomplete:Fx(wg,DO(XP.concat(DP)))}),bn.data.of({autocomplete:MP}),n.jsx?LP:[]])}function NP(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function nd(n,e,t=n.length){for(let i=e==null?void 0:e.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return n.sliceString(i.from,Math.min(i.to,t));return""}function qP(n){return n&&(n.name=="JSXEndTag"||n.name=="JSXSelfCloseEndTag")}const VP=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),LP=K.inputHandler.of((n,e,t,i)=>{if((VP?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=">"&&i!="/"||!bn.isActiveAt(n.state,e,-1))return!1;let{state:s}=n,r=s.changeByRange(o=>{var a;let{head:c}=o,h=He(s).resolveInner(c,-1),u;if(h.name=="JSXStartTag"&&(h=h.parent),!(h.name=="JSXAttributeValue"&&h.to>c)){if(i==">"&&h.name=="JSXFragmentTag")return{range:q.cursor(c+1),changes:{from:c,insert:">"}};if(i=="/"&&h.name=="JSXFragmentTag"){let f=h.parent,p=f==null?void 0:f.parent;if(f.from==c-1&&((a=p.lastChild)===null||a===void 0?void 0:a.name)!="JSXEndTag"&&(u=nd(s.doc,p==null?void 0:p.firstChild,c))){let m=`/${u}>`;return{range:q.cursor(c+m.length),changes:{from:c,insert:m}}}}else if(i==">"){let f=NP(h);if(f&&!qP(f.lastChild)&&s.sliceDoc(c,c+2)!="`}}}}return{range:o}});return r.changes.empty?!1:(n.dispatch(r,{userEvent:"input.type",scrollIntoView:!0}),!0)}),Ts=["_blank","_self","_top","_parent"],Wl=["ascii","utf-8","utf-16","latin1","latin1"],jl=["get","post","put","delete"],Ul=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],It=["true","false"],se={},WP={a:{attrs:{href:null,ping:null,type:null,media:null,target:Ts,hreflang:null}},abbr:se,address:se,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:se,aside:se,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:se,base:{attrs:{href:null,target:Ts}},bdi:se,bdo:se,blockquote:{attrs:{cite:null}},body:se,br:se,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Ul,formmethod:jl,formnovalidate:["novalidate"],formtarget:Ts,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:se,center:se,cite:se,code:se,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:se,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:se,div:se,dl:se,dt:se,em:se,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:se,figure:se,footer:se,form:{attrs:{action:null,name:null,"accept-charset":Wl,autocomplete:["on","off"],enctype:Ul,method:jl,novalidate:["novalidate"],target:Ts}},h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:se,hgroup:se,hr:se,html:{attrs:{manifest:null}},i:se,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Ul,formmethod:jl,formnovalidate:["novalidate"],formtarget:Ts,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:se,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:se,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:se,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Wl,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:se,noscript:se,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:se,param:{attrs:{name:null,value:null}},pre:se,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:se,rt:se,ruby:se,samp:se,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Wl}},section:se,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:se,source:{attrs:{src:null,type:null,media:null}},span:se,strong:se,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:se,summary:se,sup:se,table:se,tbody:se,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:se,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:se,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:se,time:{attrs:{datetime:null}},title:se,tr:se,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:se,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:se},$g={accesskey:null,class:null,contenteditable:It,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:It,autocorrect:It,autocapitalize:It,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":It,"aria-autocomplete":["inline","list","both","none"],"aria-busy":It,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":It,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":It,"aria-hidden":It,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":It,"aria-multiselectable":It,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":It,"aria-relevant":null,"aria-required":It,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Tg="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(n=>"on"+n);for(let n of Tg)$g[n]=null;class Go{constructor(e,t){this.tags=Object.assign(Object.assign({},WP),e),this.globalAttrs=Object.assign(Object.assign({},$g),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Go.default=new Go;function us(n,e,t=n.length){if(!e)return"";let i=e.firstChild,s=i&&i.getChild("TagName");return s?n.sliceString(s.from,Math.min(s.to,t)):""}function fs(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function Cg(n,e,t){let i=t.tags[us(n,fs(e))];return(i==null?void 0:i.children)||t.allTags}function au(n,e){let t=[];for(let i=fs(e);i&&!i.type.isTop;i=fs(i.parent)){let s=us(n,i);if(s&&i.lastChild.name=="CloseTag")break;s&&t.indexOf(s)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(s)}return t}const Ag=/^[:\-\.\w\u00b7-\uffff]*$/;function id(n,e,t,i,s){let r=/\s*>/.test(n.sliceDoc(s,s+5))?"":">",o=fs(t,!0);return{from:i,to:s,options:Cg(n.doc,o,e).map(a=>({label:a,type:"type"})).concat(au(n.doc,t).map((a,c)=>({label:"/"+a,apply:"/"+a+r,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function sd(n,e,t,i){let s=/\s*>/.test(n.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:au(n.doc,e).map((r,o)=>({label:r,apply:r+s,type:"type",boost:99-o})),validFor:Ag}}function jP(n,e,t,i){let s=[],r=0;for(let o of Cg(n.doc,t,e))s.push({label:"<"+o,type:"type"});for(let o of au(n.doc,t))s.push({label:"",type:"type",boost:99-r++});return{from:i,to:i,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function UP(n,e,t,i,s){let r=fs(t),o=r?e.tags[us(n.doc,r)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:s,options:c.map(h=>({label:h,type:"property"})),validFor:Ag}}function BP(n,e,t,i,s){var r;let o=(r=t.parent)===null||r===void 0?void 0:r.getChild("AttributeName"),a=[],c;if(o){let h=n.sliceDoc(o.from,o.to),u=e.globalAttrs[h];if(!u){let f=fs(t),p=f?e.tags[us(n.doc,f)]:null;u=(p==null?void 0:p.attrs)&&p.attrs[h]}if(u){let f=n.sliceDoc(i,s).toLowerCase(),p='"',m='"';/^['"]/.test(f)?(c=f[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",m=n.sliceDoc(s,s+1)==f[0]?"":f[0],f=f.slice(1),i++):c=/^[^\s<>='"]*$/;for(let O of u)a.push({label:O,apply:p+O+m,type:"constant"})}}return{from:i,to:s,options:a,validFor:c}}function YP(n,e){let{state:t,pos:i}=e,s=He(t).resolveInner(i),r=s.resolve(i,-1);for(let o=i,a;s==r&&(a=r.childBefore(o));){let c=a.lastChild;if(!c||!c.type.isError||c.fromYP(i,s)}const Ig=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:vg.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:Qg.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:Pg.parser},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:bn.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:zo.parser}],Rg=[{name:"style",parser:zo.parser.configure({top:"Styles"})}].concat(Tg.map(n=>({name:n,parser:bn.parser}))),Xg=xi.define({name:"html",parser:WQ.configure({props:[da.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].lengthn.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),po=Xg.configure({wrap:pg(Ig,Rg)});function eh(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=pg((n.nestedLanguages||[]).concat(Ig),(n.nestedAttributes||[]).concat(Rg)));let i=t?Xg.configure({wrap:t,dialect:e}):e?po.configure({dialect:e}):po;return new ha(i,[po.data.of({autocomplete:FP(n)}),n.autoCloseTags!==!1?zP:[],_g().support,yg().support])}const rd=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),zP=K.inputHandler.of((n,e,t,i)=>{if(n.composing||n.state.readOnly||e!=t||i!=">"&&i!="/"||!po.isActiveAt(n.state,e,-1))return!1;let{state:s}=n,r=s.changeByRange(o=>{var a,c,h;let{head:u}=o,f=He(s).resolveInner(u,-1),p;if((f.name=="TagName"||f.name=="StartTag")&&(f=f.parent),i==">"&&f.name=="OpenTag"){if(((c=(a=f.parent)===null||a===void 0?void 0:a.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(p=us(s.doc,f.parent,u))&&!rd.has(p)){let m=n.state.doc.sliceString(u,u+1)===">",O=`${m?"":">"}`;return{range:q.cursor(u+1),changes:{from:u+(m?1:0),insert:O}}}}else if(i=="/"&&f.name=="OpenTag"){let m=f.parent,O=m==null?void 0:m.parent;if(m.from==u-1&&((h=O.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(p=us(s.doc,O,u))&&!rd.has(p)){let k=n.state.doc.sliceString(u,u+1)===">",y=`/${p}${k?"":">"}`,S=u+y.length+(k?1:0);return{range:q.cursor(S),changes:{from:u,insert:y}}}}return{range:o}});return r.changes.empty?!1:(n.dispatch(r,{userEvent:"input.type",scrollIntoView:!0}),!0)}),GP=Qi.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new In("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new In("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new In("[~RPwxU~ZOp~~",11,15),new In("[~RPrsU~ZOn~~",11,14),new In("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new In("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),HP=bn.parser.configure({top:"SingleExpression"}),Eg=GP.configure({props:[gr({Text:b.content,Is:b.definitionOperator,AttributeName:b.attributeName,VueAttributeName:b.keyword,Identifier:b.variableName,"AttributeValue ScriptAttributeValue":b.attributeValue,Entity:b.character,"{{ }}":b.brace,"@ :":b.punctuation})]}),Zg={parser:HP},JP=Eg.configure({wrap:ca((n,e)=>n.name=="InterpolationContent"?Zg:null)}),KP=Eg.configure({wrap:ca((n,e)=>n.name=="AttributeScript"?Zg:null),top:"Attribute"}),e_={parser:JP},t_={parser:KP},th=eh();function Mg(n){return n.configure({dialect:"selfClosing",wrap:ca(i_)},"vue")}const n_=Mg(th.language);function i_(n,e){switch(n.name){case"Attribute":return/^(@|:|v-)/.test(e.read(n.from,n.from+2))?t_:null;case"Text":return e_}return null}function od(n={}){let e=th;if(n.base){if(n.base.language.name!="html"||!(n.base.language instanceof xi))throw new RangeError("The base option must be the result of calling html(...)");e=n.base}return new ha(e.language==th.language?n_:Mg(e.language),[e.support,e.language.data.of({closeBrackets:{brackets:["{",'"']}})])}const s_="#e5c07b",ad="#e06c75",r_="#56b6c2",o_="#ffffff",mo="#abb2bf",nh="#7d8799",a_="#61afef",l_="#98c379",ld="#d19a66",c_="#c678dd",h_="#21252b",cd="#2c313a",hd="#282c34",Bl="#353a42",u_="#3E4451",ud="#528bff",f_=K.theme({"&":{color:mo,backgroundColor:hd},".cm-content":{caretColor:ud},".cm-cursor, .cm-dropCursor":{borderLeftColor:ud},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:u_},".cm-panels":{backgroundColor:h_,color:mo},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:hd,color:nh,border:"none"},".cm-activeLineGutter":{backgroundColor:cd},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Bl},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Bl,borderBottomColor:Bl},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:cd,color:mo}}},{dark:!0}),d_=Sr.define([{tag:b.keyword,color:c_},{tag:[b.name,b.deleted,b.character,b.propertyName,b.macroName],color:ad},{tag:[b.function(b.variableName),b.labelName],color:a_},{tag:[b.color,b.constant(b.name),b.standard(b.name)],color:ld},{tag:[b.definition(b.name),b.separator],color:mo},{tag:[b.typeName,b.className,b.number,b.changed,b.annotation,b.modifier,b.self,b.namespace],color:s_},{tag:[b.operator,b.operatorKeyword,b.url,b.escape,b.regexp,b.link,b.special(b.string)],color:r_},{tag:[b.meta,b.comment],color:nh},{tag:b.strong,fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.link,color:nh,textDecoration:"underline"},{tag:b.heading,fontWeight:"bold",color:ad},{tag:[b.atom,b.bool,b.special(b.variableName)],color:ld},{tag:[b.processingInstruction,b.string,b.inserted],color:l_},{tag:b.invalid,color:o_}]),p_=[f_,Lm(d_)];var ot=Uint8Array,$t=Uint16Array,xa=Uint32Array,va=new ot([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Qa=new ot([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),ih=new ot([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dg=function(n,e){for(var t=new $t(31),i=0;i<31;++i)t[i]=e+=1<>>1|(Le&21845)<<1;Wn=(Wn&52428)>>>2|(Wn&13107)<<2,Wn=(Wn&61680)>>>4|(Wn&3855)<<4,rh[Le]=((Wn&65280)>>>8|(Wn&255)<<8)>>>1}var wn=function(n,e,t){for(var i=n.length,s=0,r=new $t(e);s>>c]=h}else for(a=new $t(i),s=0;s>>15-n[s]);return a},li=new ot(288);for(var Le=0;Le<144;++Le)li[Le]=8;for(var Le=144;Le<256;++Le)li[Le]=9;for(var Le=256;Le<280;++Le)li[Le]=7;for(var Le=280;Le<288;++Le)li[Le]=8;var or=new ot(32);for(var Le=0;Le<32;++Le)or[Le]=5;var O_=wn(li,9,0),g_=wn(li,9,1),y_=wn(or,5,0),S_=wn(or,5,1),Yl=function(n){for(var e=n[0],t=1;te&&(e=n[t]);return e},Jt=function(n,e,t){var i=e/8|0;return(n[i]|n[i+1]<<8)>>(e&7)&t},Fl=function(n,e){var t=e/8|0;return(n[t]|n[t+1]<<8|n[t+2]<<16)>>(e&7)},lu=function(n){return(n+7)/8|0},Pa=function(n,e,t){(e==null||e<0)&&(e=0),(t==null||t>n.length)&&(t=n.length);var i=new(n.BYTES_PER_ELEMENT==2?$t:n.BYTES_PER_ELEMENT==4?xa:ot)(t-e);return i.set(n.subarray(e,t)),i},k_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Kt=function(n,e,t){var i=new Error(e||k_[n]);if(i.code=n,Error.captureStackTrace&&Error.captureStackTrace(i,Kt),!t)throw i;return i},b_=function(n,e,t){var i=n.length;if(!i||t&&t.f&&!t.l)return e||new ot(0);var s=!e||t,r=!t||t.i;t||(t={}),e||(e=new ot(i*3));var o=function(V){var j=e.length;if(V>j){var B=new ot(Math.max(j*2,V));B.set(e),e=B}},a=t.f||0,c=t.p||0,h=t.b||0,u=t.l,f=t.d,p=t.m,m=t.n,O=i*8;do{if(!u){a=Jt(n,c,1);var k=Jt(n,c+1,3);if(c+=3,k)if(k==1)u=g_,f=S_,p=9,m=5;else if(k==2){var Q=Jt(n,c,31)+257,_=Jt(n,c+10,15)+4,v=Q+Jt(n,c+5,31)+1;c+=14;for(var $=new ot(v),x=new ot(19),C=0;C<_;++C)x[ih[C]]=Jt(n,c+C*3,7);c+=_*3;for(var R=Yl(x),W=(1<>>4;if(y<16)$[C++]=y;else{var ce=0,re=0;for(y==16?(re=3+Jt(n,c,3),c+=2,ce=$[C-1]):y==17?(re=3+Jt(n,c,7),c+=3):y==18&&(re=11+Jt(n,c,127),c+=7);re--;)$[C++]=ce}}var pe=$.subarray(0,Q),he=$.subarray(Q);p=Yl(pe),m=Yl(he),u=wn(pe,p,1),f=wn(he,m,1)}else Kt(1);else{var y=lu(c)+4,S=n[y-4]|n[y-3]<<8,P=y+S;if(P>i){r&&Kt(0);break}s&&o(h+S),e.set(n.subarray(y,P),h),t.b=h+=S,t.p=c=P*8,t.f=a;continue}if(c>O){r&&Kt(0);break}}s&&o(h+131072);for(var de=(1<>>4;if(c+=ce&15,c>O){r&&Kt(0);break}if(ce||Kt(2),me<256)e[h++]=me;else if(me==256){ue=c,u=null;break}else{var be=me-254;if(me>264){var C=me-257,Qe=va[C];be=Jt(n,c,(1<>>4;Ie||Kt(3),c+=Ie&15;var he=m_[Re];if(Re>3){var Qe=Qa[Re];he+=Fl(n,c)&(1<O){r&&Kt(0);break}s&&o(h+131072);for(var E=h+be;h>>8},Cs=function(n,e,t){t<<=e&7;var i=e/8|0;n[i]|=t,n[i+1]|=t>>>8,n[i+2]|=t>>>16},zl=function(n,e){for(var t=[],i=0;ip&&(p=r[i].s);var m=new $t(p+1),O=oh(t[u-1],m,0);if(O>e){var i=0,k=0,y=O-e,S=1<e)k+=S-(1<>>=y;k>0;){var Q=r[i].s;m[Q]=0&&k;--i){var _=r[i].s;m[_]==e&&(--m[_],++k)}O=e}return[new ot(m),O]},oh=function(n,e,t){return n.s==-1?Math.max(oh(n.l,e,t+1),oh(n.r,e,t+1)):e[n.s]=t},dd=function(n){for(var e=n.length;e&&!n[--e];);for(var t=new $t(++e),i=0,s=n[0],r=1,o=function(c){t[i++]=c},a=1;a<=e;++a)if(n[a]==s&&a!=e)++r;else{if(!s&&r>2){for(;r>138;r-=138)o(32754);r>2&&(o(r>10?r-11<<5|28690:r-3<<5|12305),r=0)}else if(r>3){for(o(s),--r;r>6;r-=6)o(8304);r>2&&(o(r-3<<5|8208),r=0)}for(;r--;)o(s);r=1,s=n[a]}return[t.subarray(0,i),e]},As=function(n,e){for(var t=0,i=0;i>>8,n[s+2]=n[s]^255,n[s+3]=n[s+1]^255;for(var r=0;r4&&!W[ih[Y-1]];--Y);var ce=h+5<<3,re=As(s,li)+As(r,or)+o,pe=As(s,p)+As(r,k)+o+14+3*Y+As(x,W)+(2*x[16]+3*x[17]+7*x[18]);if(ce<=re&&ce<=pe)return ah(e,u,n.subarray(c,c+h));var he,de,ie,ue;if(Cn(e,u,1+(pe15&&(Cn(e,u,Ie[C]>>>5&127),u+=Ie[C]>>>12)}}else he=O_,de=li,ie=y_,ue=or;for(var C=0;C255){var Re=i[C]>>>18&31;Cs(e,u,he[Re+257]),u+=de[Re+257],Re>7&&(Cn(e,u,i[C]>>>23&31),u+=va[Re]);var E=i[C]&31;Cs(e,u,ie[E]),u+=ue[E],E>3&&(Cs(e,u,i[C]>>>5&8191),u+=Qa[E])}else Cs(e,u,he[i[C]]),u+=de[i[C]];return Cs(e,u,he[256]),u+de[256]},w_=new xa([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),cu=new ot(0),x_=function(n,e,t,i,s,r){var o=n.length,a=new ot(i+o+5*(1+Math.ceil(o/7e3))+s),c=a.subarray(i,a.length-s),h=0;if(!e||o<8)for(var u=0;u<=o;u+=65535){var f=u+65535;f>=o&&(c[h>>3]=r),h=ah(c,h+1,n.subarray(u,f))}else{for(var p=w_[e-1],m=p>>>13,O=p&8191,k=(1<7e3||W>24576)&&he>423){h=pd(n,c,0,v,$,x,R,W,Y,u-Y,h),W=C=R=0,Y=u;for(var de=0;de<286;++de)$[de]=0;for(var de=0;de<30;++de)x[de]=0}var ie=2,ue=0,me=O,be=re-pe&32767;if(he>2&&ce==_(u-be))for(var Qe=Math.min(m,he)-1,Ie=Math.min(32767,u),Re=Math.min(258,he);be<=Ie&&--me&&re!=pe;){if(n[u+ie]==n[u+ie-be]){for(var E=0;Eie){if(ie=E,ue=be,E>Qe)break;for(var V=Math.min(be,E-2),j=0,de=0;dej&&(j=I,pe=B)}}}re=pe,pe=y[re],be+=re-pe+32768&32767}if(ue){v[W++]=268435456|sh[ie]<<18|fd[ue];var Z=sh[ie]&31,L=fd[ue]&31;R+=va[Z]+Qa[L],++$[257+Z],++x[L],U=u+ie,++C}else v[W++]=n[u],++$[n[u]]}}h=pd(n,c,r,v,$,x,R,W,Y,u-Y,h),!r&&h&7&&(h=ah(c,h+1,cu))}return Pa(a,0,i+lu(h)+s)},v_=function(){var n=1,e=0;return{p:function(t){for(var i=n,s=e,r=t.length|0,o=0;o!=r;){for(var a=Math.min(o+2655,r);o>16),s=(s&65535)+15*(s>>16)}n=i,e=s},d:function(){return n%=65521,e%=65521,(n&255)<<24|n>>>8<<16|(e&255)<<8|e>>>8}}},Q_=function(n,e,t,i,s){return x_(n,e.level==null?6:e.level,e.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):12+e.mem,t,i,!s)},P_=function(n,e,t){for(;t;++e)n[e]=t,t>>>=8},__=function(n,e){var t=e.level,i=t==0?0:t<6?1:t==9?3:2;n[0]=120,n[1]=i<<6|(i?32-2*i:1)},$_=function(n){((n[0]&15)!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&Kt(6,"invalid zlib data"),n[1]&32&&Kt(6,"invalid zlib data: preset dictionaries not supported")};function T_(n,e){e||(e={});var t=v_();t.p(n);var i=Q_(n,e,2,4);return __(i,e),P_(i,i.length-4,t.d()),i}function C_(n,e){return b_(($_(n),n.subarray(2,-4)),e)}var md=typeof TextEncoder<"u"&&new TextEncoder,lh=typeof TextDecoder<"u"&&new TextDecoder,A_=0;try{lh.decode(cu,{stream:!0}),A_=1}catch{}var I_=function(n){for(var e="",t=0;;){var i=n[t++],s=(i>127)+(i>223)+(i>239);if(t+s>n.length)return[e,Pa(n,t-1)];s?s==3?(i=((i&15)<<18|(n[t++]&63)<<12|(n[t++]&63)<<6|n[t++]&63)-65536,e+=String.fromCharCode(55296|i>>10,56320|i&1023)):s&1?e+=String.fromCharCode((i&31)<<6|n[t++]&63):e+=String.fromCharCode((i&15)<<12|(n[t++]&63)<<6|n[t++]&63):e+=String.fromCharCode(i)}};function Lg(n,e){if(e){for(var t=new ot(n.length),i=0;i>1)),o=0,a=function(u){r[o++]=u},i=0;ir.length){var c=new ot(o+8+(s-i<<1));c.set(r),r=c}var h=n.charCodeAt(i);h<128||e?a(h):h<2048?(a(192|h>>6),a(128|h&63)):h>55295&&h<57344?(h=65536+(h&1047552)|n.charCodeAt(++i)&1023,a(240|h>>18),a(128|h>>12&63),a(128|h>>6&63),a(128|h&63)):(a(224|h>>12),a(128|h>>6&63),a(128|h&63))}return Pa(r,0,o)}function Wg(n,e){if(e){for(var t="",i=0;i{t&&clearTimeout(t),t=setTimeout(()=>{n(...i)},e)}}function X_(n){const e=Lg(n),t=T_(e,{level:9}),i=Wg(t,!0);return btoa(i)}function E_(n){const e=atob(n);if(e.startsWith("xÚ")){const t=Lg(e,!0),i=C_(t);return Wg(i)}return decodeURIComponent(escape(e))}const Z_=M.defineComponent({__name:"CodeMirror",props:{mode:{default:"vue"},value:{default:""},readonly:{type:Boolean,default:!1}},emits:["change"],setup(n,{emit:e}){const t=n,i=M.ref(),s=M.inject("autoresize");return M.onMounted(()=>{const r=new is,o=new is,a=_e.create({extensions:[Jv,r.of(od({base:eh({matchClosingTags:!0,autoCloseTags:!0})})),_e.tabSize.of(2),K.updateListener.of(h=>{h.docChanged&&e("change",h.state.doc.toString())}),p_,o.of(_e.readOnly.of(!!t.readonly)),mr.of([{key:"Tab",run:Ox,shift:QO}])]}),c=new K({state:a,parent:i.value});M.watchEffect(()=>{const h=c.state.doc.toString();t.value!==h&&c.dispatch({changes:{from:0,to:c.state.doc.length,insert:t.value}})}),M.watchEffect(()=>{t.mode==="javascript"?c.dispatch({effects:r.reconfigure(_g())}):t.mode==="css"?c.dispatch({effects:r.reconfigure(yg())}):c.dispatch({effects:r.reconfigure(od({base:eh({matchClosingTags:!0,autoCloseTags:!0})}))})}),M.watchEffect(()=>{c.dispatch({effects:o.reconfigure(_e.readOnly.of(!!t.readonly))})}),setTimeout(()=>{c.requestMeasure()},50),s&&window.addEventListener("resize",R_(()=>{c.requestMeasure()}))}),(r,o)=>(M.openBlock(),M.createElementBlock("div",{ref_key:"el",ref:i,class:"editor"},null,512))}}),M_=M.defineComponent({__name:"Message",props:["err","warn"],setup(n){const e=n,t=M.ref(!1);M.watch(()=>[e.err,e.warn],()=>{t.value=!1});function i(s){if(typeof s=="string")return s;{let r=s.message;const o=s.loc;return o&&o.start&&(r=`(${o.start.line}:${o.start.column}) ${r}`),r}}return(s,r)=>(M.openBlock(),M.createBlock(M.Transition,{name:"fade"},{default:M.withCtx(()=>[!t.value&&(n.err||n.warn)?(M.openBlock(),M.createElementBlock("div",{key:0,class:M.normalizeClass(["msg",n.err?"err":"warn"])},[M.createElementVNode("pre",null,M.toDisplayString(i(n.err||n.warn)),1),M.createElementVNode("button",{class:"dismiss",onClick:r[0]||(r[0]=o=>t.value=!0)}," ✕ ")],2)):M.createCommentVNode("",!0)]),_:1}))}}),Od=Gd(M_,[["__scopeId","data-v-757b5e62"]]),qt={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},gd={silent:{level:-1},fatal:{level:qt.fatal},error:{level:qt.error},warn:{level:qt.warn},log:{level:qt.log},info:{level:qt.info},success:{level:qt.success},fail:{level:qt.fail},ready:{level:qt.info},start:{level:qt.info},debug:{level:qt.debug},trace:{level:qt.trace},verbose:{level:qt.verbose}};function Gl(n){return n!==null&&typeof n=="object"}function ch(n,e,t=".",i){if(!Gl(e))return ch(n,{},t,i);const s=Object.assign({},e);for(const r in n){if(r==="__proto__"||r==="constructor")continue;const o=n[r];o!=null&&(i&&i(s,r,o,t)||(Array.isArray(o)&&Array.isArray(s[r])?s[r]=[...o,...s[r]]:Gl(o)&&Gl(s[r])?s[r]=ch(o,s[r],(t?`${t}.`:"")+r.toString(),i):s[r]=o))}return s}function D_(n){return(...e)=>e.reduce((t,i)=>ch(t,i,"",n),{})}const N_=D_();function q_(n){return Object.prototype.toString.call(n)==="[object Object]"}function V_(n){return!(!q_(n)||!n.message&&!n.args||n.stack)}let Hl=!1;const yd=[];class Ot{constructor(e={}){const t=e.types||gd;this.options=N_({...e,defaults:{...e.defaults},level:Jl(e.level,t),reporters:[...e.reporters||[]]},{types:gd,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const i in t){const s={type:i,...this.options.defaults,...t[i]};this[i]=this._wrapLogFn(s),this[i].raw=this._wrapLogFn(s,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=Jl(e,this.options.types,this.options.level)}prompt(e,t){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,t)}create(e){return new Ot({...this.options,...e})}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const t=this.options.reporters.indexOf(e);if(t>=0)return this.options.reporters.splice(t,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,t){e&&(e.__write||(e.__write=e.write),e.write=i=>{this[t].raw(String(i).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){Hl=!0}resumeLogs(){Hl=!1;const e=yd.splice(0);for(const t of e)t[0]._logFn(t[1],t[2])}mockTypes(e){const t=e||this.options.mockFn;if(typeof t=="function")for(const i in this.options.types)this[i]=t(i,this.options.types[i])||this[i],this[i].raw=this[i]}_wrapLogFn(e,t){return(...i)=>{if(Hl){yd.push([this,e,i,t]);return}return this._logFn(e,i,t)}}_logFn(e,t,i){if((e.level||0)>this.level)return!1;const s={date:new Date,args:[],...e,level:Jl(e.level,this.options.types)};!i&&t.length===1&&V_(t[0])?Object.assign(s,t[0]):s.args=[...t],s.message&&(s.args.unshift(s.message),delete s.message),s.additional&&(Array.isArray(s.additional)||(s.additional=s.additional.split(` `)),s.args.push(` `+s.additional.join(` `)),delete s.additional),s.type=typeof s.type=="string"?s.type.toLowerCase():"log",s.tag=typeof s.tag=="string"?s.tag.toLowerCase():"";const r=(a=!1)=>{const c=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&c>0){const h=[...this._lastLog.object.args];c>1&&h.push(`(repeated ${c} times)`),this._log({...this._lastLog.object,args:h}),this._lastLog.count=1}a&&(this._lastLog.object=s,this._log(s))};clearTimeout(this._lastLog.timeout);const o=this._lastLog.time&&s.date?s.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=s.date,othis.options.throttleMin)){this._lastLog.timeout=setTimeout(r,this.options.throttle);return}}catch{}r(!0)}_log(e){for(const t of this.options.reporters)t.log(e,{options:this.options})}}function Jl(n,e={},t=3){return n===void 0?t:typeof n=="number"?n:e[n]&&e[n].level!==void 0?e[n].level:t}Ot.prototype.add=Ot.prototype.addReporter;Ot.prototype.remove=Ot.prototype.removeReporter;Ot.prototype.clear=Ot.prototype.removeReporter;Ot.prototype.withScope=Ot.prototype.withTag;Ot.prototype.mock=Ot.prototype.mockTypes;Ot.prototype.pause=Ot.prototype.pauseLogs;Ot.prototype.resume=Ot.prototype.resumeLogs;function L_(n={}){return new Ot(n)}class W_{constructor(e){this.options={...e},this.defaultColor="#7f8c8d",this.levelColorMap={0:"#c0392b",1:"#f39c12",3:"#00BCD4"},this.typeColorMap={success:"#2ecc71"}}_getLogFn(e){return e<1?console.__error||console.error:e===1?console.__warn||console.warn:console.__log||console.log}log(e){const t=this._getLogFn(e.level),i=e.type!=="log"?e.type:"",s=e.tag||"",o=` background: ${this.typeColorMap[e.type]||this.levelColorMap[e.level]||this.defaultColor}; border-radius: 0.5em; color: white; font-weight: bold; padding: 2px 0.5em; `,a=`%c${[s,i].filter(Boolean).join(":")}`;typeof e.args[0]=="string"?t(`${a}%c ${e.args[0]}`,o,"",...e.args.slice(1)):t(a,o,...e.args)}}function j_(n={}){return L_({reporters:n.reporters||[new W_({})],prompt(t,i={}){return i.type==="confirm"?Promise.resolve(confirm(t)):Promise.resolve(prompt(t))},...n})}const Sd=j_();var w;(function(n){n[n.NONE=0]="NONE";const t=0+1;n[n._abstract=t]="_abstract";const i=t+1;n[n._accessor=i]="_accessor";const s=i+1;n[n._as=s]="_as";const r=s+1;n[n._assert=r]="_assert";const o=r+1;n[n._asserts=o]="_asserts";const a=o+1;n[n._async=a]="_async";const c=a+1;n[n._await=c]="_await";const h=c+1;n[n._checks=h]="_checks";const u=h+1;n[n._constructor=u]="_constructor";const f=u+1;n[n._declare=f]="_declare";const p=f+1;n[n._enum=p]="_enum";const m=p+1;n[n._exports=m]="_exports";const O=m+1;n[n._from=O]="_from";const k=O+1;n[n._get=k]="_get";const y=k+1;n[n._global=y]="_global";const S=y+1;n[n._implements=S]="_implements";const P=S+1;n[n._infer=P]="_infer";const Q=P+1;n[n._interface=Q]="_interface";const _=Q+1;n[n._is=_]="_is";const v=_+1;n[n._keyof=v]="_keyof";const $=v+1;n[n._mixins=$]="_mixins";const x=$+1;n[n._module=x]="_module";const C=x+1;n[n._namespace=C]="_namespace";const R=C+1;n[n._of=R]="_of";const W=R+1;n[n._opaque=W]="_opaque";const U=W+1;n[n._out=U]="_out";const Y=U+1;n[n._override=Y]="_override";const ce=Y+1;n[n._private=ce]="_private";const re=ce+1;n[n._protected=re]="_protected";const pe=re+1;n[n._proto=pe]="_proto";const he=pe+1;n[n._public=he]="_public";const de=he+1;n[n._readonly=de]="_readonly";const ie=de+1;n[n._require=ie]="_require";const ue=ie+1;n[n._satisfies=ue]="_satisfies";const me=ue+1;n[n._set=me]="_set";const be=me+1;n[n._static=be]="_static";const Qe=be+1;n[n._symbol=Qe]="_symbol";const Ie=Qe+1;n[n._type=Ie]="_type";const Re=Ie+1;n[n._unique=Re]="_unique";const E=Re+1;n[n._using=E]="_using"})(w||(w={}));var l;(function(n){n[n.PRECEDENCE_MASK=15]="PRECEDENCE_MASK";const t=16;n[n.IS_KEYWORD=t]="IS_KEYWORD";const i=32;n[n.IS_ASSIGN=i]="IS_ASSIGN";const s=64;n[n.IS_RIGHT_ASSOCIATIVE=s]="IS_RIGHT_ASSOCIATIVE";const r=128;n[n.IS_PREFIX=r]="IS_PREFIX";const o=256;n[n.IS_POSTFIX=o]="IS_POSTFIX";const a=512;n[n.IS_EXPRESSION_START=a]="IS_EXPRESSION_START";const c=512;n[n.num=c]="num";const h=1536;n[n.bigint=h]="bigint";const u=2560;n[n.decimal=u]="decimal";const f=3584;n[n.regexp=f]="regexp";const p=4608;n[n.string=p]="string";const m=5632;n[n.name=m]="name";const O=6144;n[n.eof=O]="eof";const k=7680;n[n.bracketL=k]="bracketL";const y=8192;n[n.bracketR=y]="bracketR";const S=9728;n[n.braceL=S]="braceL";const P=10752;n[n.braceBarL=P]="braceBarL";const Q=11264;n[n.braceR=Q]="braceR";const _=12288;n[n.braceBarR=_]="braceBarR";const v=13824;n[n.parenL=v]="parenL";const $=14336;n[n.parenR=$]="parenR";const x=15360;n[n.comma=x]="comma";const C=16384;n[n.semi=C]="semi";const R=17408;n[n.colon=R]="colon";const W=18432;n[n.doubleColon=W]="doubleColon";const U=19456;n[n.dot=U]="dot";const Y=20480;n[n.question=Y]="question";const ce=21504;n[n.questionDot=ce]="questionDot";const re=22528;n[n.arrow=re]="arrow";const pe=23552;n[n.template=pe]="template";const he=24576;n[n.ellipsis=he]="ellipsis";const de=25600;n[n.backQuote=de]="backQuote";const ie=27136;n[n.dollarBraceL=ie]="dollarBraceL";const ue=27648;n[n.at=ue]="at";const me=29184;n[n.hash=me]="hash";const be=29728;n[n.eq=be]="eq";const Qe=30752;n[n.assign=Qe]="assign";const Ie=32640;n[n.preIncDec=Ie]="preIncDec";const Re=33664;n[n.postIncDec=Re]="postIncDec";const E=34432;n[n.bang=E]="bang";const V=35456;n[n.tilde=V]="tilde";const j=35841;n[n.pipeline=j]="pipeline";const B=36866;n[n.nullishCoalescing=B]="nullishCoalescing";const A=37890;n[n.logicalOR=A]="logicalOR";const I=38915;n[n.logicalAND=I]="logicalAND";const Z=39940;n[n.bitwiseOR=Z]="bitwiseOR";const L=40965;n[n.bitwiseXOR=L]="bitwiseXOR";const H=41990;n[n.bitwiseAND=H]="bitwiseAND";const F=43015;n[n.equality=F]="equality";const J=44040;n[n.lessThan=J]="lessThan";const xe=45064;n[n.greaterThan=xe]="greaterThan";const ae=46088;n[n.relationalOrEqual=ae]="relationalOrEqual";const Oe=47113;n[n.bitShiftL=Oe]="bitShiftL";const $e=48137;n[n.bitShiftR=$e]="bitShiftR";const Ee=49802;n[n.plus=Ee]="plus";const Be=50826;n[n.minus=Be]="minus";const Je=51723;n[n.modulo=Je]="modulo";const ht=52235;n[n.star=ht]="star";const Ct=53259;n[n.slash=Ct]="slash";const gt=54348;n[n.exponent=gt]="exponent";const ui=55296;n[n.jsxName=ui]="jsxName";const Ri=56320;n[n.jsxText=Ri]="jsxText";const ws=57344;n[n.jsxEmptyText=ws]="jsxEmptyText";const Xi=58880;n[n.jsxTagStart=Xi]="jsxTagStart";const fi=59392;n[n.jsxTagEnd=fi]="jsxTagEnd";const zt=60928;n[n.typeParameterStart=zt]="typeParameterStart";const Vn=61440;n[n.nonNullAssertion=Vn]="nonNullAssertion";const Ei=62480;n[n._break=Ei]="_break";const Zi=63504;n[n._case=Zi]="_case";const Mi=64528;n[n._catch=Mi]="_catch";const Ea=65552;n[n._continue=Ea]="_continue";const Za=66576;n[n._debugger=Za]="_debugger";const Ma=67600;n[n._default=Ma]="_default";const Da=68624;n[n._do=Da]="_do";const Na=69648;n[n._else=Na]="_else";const qa=70672;n[n._finally=qa]="_finally";const Va=71696;n[n._for=Va]="_for";const La=73232;n[n._function=La]="_function";const Wa=73744;n[n._if=Wa]="_if";const ja=74768;n[n._return=ja]="_return";const Ua=75792;n[n._switch=Ua]="_switch";const Ba=77456;n[n._throw=Ba]="_throw";const Ya=77840;n[n._try=Ya]="_try";const Fa=78864;n[n._var=Fa]="_var";const za=79888;n[n._let=za]="_let";const Ga=80912;n[n._const=Ga]="_const";const Ha=81936;n[n._while=Ha]="_while";const Ja=82960;n[n._with=Ja]="_with";const Ka=84496;n[n._new=Ka]="_new";const el=85520;n[n._this=el]="_this";const tl=86544;n[n._super=tl]="_super";const nl=87568;n[n._class=nl]="_class";const il=88080;n[n._extends=il]="_extends";const sl=89104;n[n._export=sl]="_export";const rl=90640;n[n._import=rl]="_import";const ol=91664;n[n._yield=ol]="_yield";const al=92688;n[n._null=al]="_null";const ll=93712;n[n._true=ll]="_true";const cl=94736;n[n._false=cl]="_false";const hl=95256;n[n._in=hl]="_in";const ul=96280;n[n._instanceof=ul]="_instanceof";const fl=97936;n[n._typeof=fl]="_typeof";const dl=98960;n[n._void=dl]="_void";const iy=99984;n[n._delete=iy]="_delete";const sy=100880;n[n._async=sy]="_async";const ry=101904;n[n._get=ry]="_get";const oy=102928;n[n._set=oy]="_set";const ay=103952;n[n._declare=ay]="_declare";const ly=104976;n[n._readonly=ly]="_readonly";const cy=106e3;n[n._abstract=cy]="_abstract";const hy=107024;n[n._static=hy]="_static";const uy=107536;n[n._public=uy]="_public";const fy=108560;n[n._private=fy]="_private";const dy=109584;n[n._protected=dy]="_protected";const py=110608;n[n._override=py]="_override";const my=112144;n[n._as=my]="_as";const Oy=113168;n[n._enum=Oy]="_enum";const gy=114192;n[n._type=gy]="_type";const yy=115216;n[n._implements=yy]="_implements"})(l||(l={}));function U_(n){switch(n){case l.num:return"num";case l.bigint:return"bigint";case l.decimal:return"decimal";case l.regexp:return"regexp";case l.string:return"string";case l.name:return"name";case l.eof:return"eof";case l.bracketL:return"[";case l.bracketR:return"]";case l.braceL:return"{";case l.braceBarL:return"{|";case l.braceR:return"}";case l.braceBarR:return"|}";case l.parenL:return"(";case l.parenR:return")";case l.comma:return",";case l.semi:return";";case l.colon:return":";case l.doubleColon:return"::";case l.dot:return".";case l.question:return"?";case l.questionDot:return"?.";case l.arrow:return"=>";case l.template:return"template";case l.ellipsis:return"...";case l.backQuote:return"`";case l.dollarBraceL:return"${";case l.at:return"@";case l.hash:return"#";case l.eq:return"=";case l.assign:return"_=";case l.preIncDec:return"++/--";case l.postIncDec:return"++/--";case l.bang:return"!";case l.tilde:return"~";case l.pipeline:return"|>";case l.nullishCoalescing:return"??";case l.logicalOR:return"||";case l.logicalAND:return"&&";case l.bitwiseOR:return"|";case l.bitwiseXOR:return"^";case l.bitwiseAND:return"&";case l.equality:return"==/!=";case l.lessThan:return"<";case l.greaterThan:return">";case l.relationalOrEqual:return"<=/>=";case l.bitShiftL:return"<<";case l.bitShiftR:return">>/>>>";case l.plus:return"+";case l.minus:return"-";case l.modulo:return"%";case l.star:return"*";case l.slash:return"/";case l.exponent:return"**";case l.jsxName:return"jsxName";case l.jsxText:return"jsxText";case l.jsxEmptyText:return"jsxEmptyText";case l.jsxTagStart:return"jsxTagStart";case l.jsxTagEnd:return"jsxTagEnd";case l.typeParameterStart:return"typeParameterStart";case l.nonNullAssertion:return"nonNullAssertion";case l._break:return"break";case l._case:return"case";case l._catch:return"catch";case l._continue:return"continue";case l._debugger:return"debugger";case l._default:return"default";case l._do:return"do";case l._else:return"else";case l._finally:return"finally";case l._for:return"for";case l._function:return"function";case l._if:return"if";case l._return:return"return";case l._switch:return"switch";case l._throw:return"throw";case l._try:return"try";case l._var:return"var";case l._let:return"let";case l._const:return"const";case l._while:return"while";case l._with:return"with";case l._new:return"new";case l._this:return"this";case l._super:return"super";case l._class:return"class";case l._extends:return"extends";case l._export:return"export";case l._import:return"import";case l._yield:return"yield";case l._null:return"null";case l._true:return"true";case l._false:return"false";case l._in:return"in";case l._instanceof:return"instanceof";case l._typeof:return"typeof";case l._void:return"void";case l._delete:return"delete";case l._async:return"async";case l._get:return"get";case l._set:return"set";case l._declare:return"declare";case l._readonly:return"readonly";case l._abstract:return"abstract";case l._static:return"static";case l._public:return"public";case l._private:return"private";case l._protected:return"protected";case l._override:return"override";case l._as:return"as";case l._enum:return"enum";case l._type:return"type";case l._implements:return"implements";default:return""}}class Qn{constructor(e,t,i){this.startTokenIndex=e,this.endTokenIndex=t,this.isFunctionScope=i}}class B_{constructor(e,t,i,s,r,o,a,c,h,u,f,p,m){this.potentialArrowAt=e,this.noAnonFunctionType=t,this.inDisallowConditionalTypesContext=i,this.tokensLength=s,this.scopesLength=r,this.pos=o,this.type=a,this.contextualKeyword=c,this.start=h,this.end=u,this.isType=f,this.scopeDepth=p,this.error=m}}class kt{constructor(){kt.prototype.__init.call(this),kt.prototype.__init2.call(this),kt.prototype.__init3.call(this),kt.prototype.__init4.call(this),kt.prototype.__init5.call(this),kt.prototype.__init6.call(this),kt.prototype.__init7.call(this),kt.prototype.__init8.call(this),kt.prototype.__init9.call(this),kt.prototype.__init10.call(this),kt.prototype.__init11.call(this),kt.prototype.__init12.call(this),kt.prototype.__init13.call(this)}__init(){this.potentialArrowAt=-1}__init2(){this.noAnonFunctionType=!1}__init3(){this.inDisallowConditionalTypesContext=!1}__init4(){this.tokens=[]}__init5(){this.scopes=[]}__init6(){this.pos=0}__init7(){this.type=l.eof}__init8(){this.contextualKeyword=w.NONE}__init9(){this.start=0}__init10(){this.end=0}__init11(){this.isType=!1}__init12(){this.scopeDepth=0}__init13(){this.error=null}snapshot(){return new B_(this.potentialArrowAt,this.noAnonFunctionType,this.inDisallowConditionalTypesContext,this.tokens.length,this.scopes.length,this.pos,this.type,this.contextualKeyword,this.start,this.end,this.isType,this.scopeDepth,this.error)}restoreFromSnapshot(e){this.potentialArrowAt=e.potentialArrowAt,this.noAnonFunctionType=e.noAnonFunctionType,this.inDisallowConditionalTypesContext=e.inDisallowConditionalTypesContext,this.tokens.length=e.tokensLength,this.scopes.length=e.scopesLength,this.pos=e.pos,this.type=e.type,this.contextualKeyword=e.contextualKeyword,this.start=e.start,this.end=e.end,this.isType=e.isType,this.scopeDepth=e.scopeDepth,this.error=e.error}}var T;(function(n){n[n.backSpace=8]="backSpace";const t=10;n[n.lineFeed=t]="lineFeed";const i=9;n[n.tab=i]="tab";const s=13;n[n.carriageReturn=s]="carriageReturn";const r=14;n[n.shiftOut=r]="shiftOut";const o=32;n[n.space=o]="space";const a=33;n[n.exclamationMark=a]="exclamationMark";const c=34;n[n.quotationMark=c]="quotationMark";const h=35;n[n.numberSign=h]="numberSign";const u=36;n[n.dollarSign=u]="dollarSign";const f=37;n[n.percentSign=f]="percentSign";const p=38;n[n.ampersand=p]="ampersand";const m=39;n[n.apostrophe=m]="apostrophe";const O=40;n[n.leftParenthesis=O]="leftParenthesis";const k=41;n[n.rightParenthesis=k]="rightParenthesis";const y=42;n[n.asterisk=y]="asterisk";const S=43;n[n.plusSign=S]="plusSign";const P=44;n[n.comma=P]="comma";const Q=45;n[n.dash=Q]="dash";const _=46;n[n.dot=_]="dot";const v=47;n[n.slash=v]="slash";const $=48;n[n.digit0=$]="digit0";const x=49;n[n.digit1=x]="digit1";const C=50;n[n.digit2=C]="digit2";const R=51;n[n.digit3=R]="digit3";const W=52;n[n.digit4=W]="digit4";const U=53;n[n.digit5=U]="digit5";const Y=54;n[n.digit6=Y]="digit6";const ce=55;n[n.digit7=ce]="digit7";const re=56;n[n.digit8=re]="digit8";const pe=57;n[n.digit9=pe]="digit9";const he=58;n[n.colon=he]="colon";const de=59;n[n.semicolon=de]="semicolon";const ie=60;n[n.lessThan=ie]="lessThan";const ue=61;n[n.equalsTo=ue]="equalsTo";const me=62;n[n.greaterThan=me]="greaterThan";const be=63;n[n.questionMark=be]="questionMark";const Qe=64;n[n.atSign=Qe]="atSign";const Ie=65;n[n.uppercaseA=Ie]="uppercaseA";const Re=66;n[n.uppercaseB=Re]="uppercaseB";const E=67;n[n.uppercaseC=E]="uppercaseC";const V=68;n[n.uppercaseD=V]="uppercaseD";const j=69;n[n.uppercaseE=j]="uppercaseE";const B=70;n[n.uppercaseF=B]="uppercaseF";const A=71;n[n.uppercaseG=A]="uppercaseG";const I=72;n[n.uppercaseH=I]="uppercaseH";const Z=73;n[n.uppercaseI=Z]="uppercaseI";const L=74;n[n.uppercaseJ=L]="uppercaseJ";const H=75;n[n.uppercaseK=H]="uppercaseK";const F=76;n[n.uppercaseL=F]="uppercaseL";const J=77;n[n.uppercaseM=J]="uppercaseM";const xe=78;n[n.uppercaseN=xe]="uppercaseN";const ae=79;n[n.uppercaseO=ae]="uppercaseO";const Oe=80;n[n.uppercaseP=Oe]="uppercaseP";const $e=81;n[n.uppercaseQ=$e]="uppercaseQ";const Ee=82;n[n.uppercaseR=Ee]="uppercaseR";const Be=83;n[n.uppercaseS=Be]="uppercaseS";const Je=84;n[n.uppercaseT=Je]="uppercaseT";const ht=85;n[n.uppercaseU=ht]="uppercaseU";const Ct=86;n[n.uppercaseV=Ct]="uppercaseV";const gt=87;n[n.uppercaseW=gt]="uppercaseW";const ui=88;n[n.uppercaseX=ui]="uppercaseX";const Ri=89;n[n.uppercaseY=Ri]="uppercaseY";const ws=90;n[n.uppercaseZ=ws]="uppercaseZ";const Xi=91;n[n.leftSquareBracket=Xi]="leftSquareBracket";const fi=92;n[n.backslash=fi]="backslash";const zt=93;n[n.rightSquareBracket=zt]="rightSquareBracket";const Vn=94;n[n.caret=Vn]="caret";const Ei=95;n[n.underscore=Ei]="underscore";const Zi=96;n[n.graveAccent=Zi]="graveAccent";const Mi=97;n[n.lowercaseA=Mi]="lowercaseA";const Ea=98;n[n.lowercaseB=Ea]="lowercaseB";const Za=99;n[n.lowercaseC=Za]="lowercaseC";const Ma=100;n[n.lowercaseD=Ma]="lowercaseD";const Da=101;n[n.lowercaseE=Da]="lowercaseE";const Na=102;n[n.lowercaseF=Na]="lowercaseF";const qa=103;n[n.lowercaseG=qa]="lowercaseG";const Va=104;n[n.lowercaseH=Va]="lowercaseH";const La=105;n[n.lowercaseI=La]="lowercaseI";const Wa=106;n[n.lowercaseJ=Wa]="lowercaseJ";const ja=107;n[n.lowercaseK=ja]="lowercaseK";const Ua=108;n[n.lowercaseL=Ua]="lowercaseL";const Ba=109;n[n.lowercaseM=Ba]="lowercaseM";const Ya=110;n[n.lowercaseN=Ya]="lowercaseN";const Fa=111;n[n.lowercaseO=Fa]="lowercaseO";const za=112;n[n.lowercaseP=za]="lowercaseP";const Ga=113;n[n.lowercaseQ=Ga]="lowercaseQ";const Ha=114;n[n.lowercaseR=Ha]="lowercaseR";const Ja=115;n[n.lowercaseS=Ja]="lowercaseS";const Ka=116;n[n.lowercaseT=Ka]="lowercaseT";const el=117;n[n.lowercaseU=el]="lowercaseU";const tl=118;n[n.lowercaseV=tl]="lowercaseV";const nl=119;n[n.lowercaseW=nl]="lowercaseW";const il=120;n[n.lowercaseX=il]="lowercaseX";const sl=121;n[n.lowercaseY=sl]="lowercaseY";const rl=122;n[n.lowercaseZ=rl]="lowercaseZ";const ol=123;n[n.leftCurlyBrace=ol]="leftCurlyBrace";const al=124;n[n.verticalBar=al]="verticalBar";const ll=125;n[n.rightCurlyBrace=ll]="rightCurlyBrace";const cl=126;n[n.tilde=cl]="tilde";const hl=160;n[n.nonBreakingSpace=hl]="nonBreakingSpace";const ul=5760;n[n.oghamSpaceMark=ul]="oghamSpaceMark";const fl=8232;n[n.lineSeparator=fl]="lineSeparator";const dl=8233;n[n.paragraphSeparator=dl]="paragraphSeparator"})(T||(T={}));let _a,Pe,Te,d,z,jg;function ar(){return jg++}function Y_(n){if("pos"in n){const e=z_(n.pos);n.message+=` (${e.line}:${e.column})`,n.loc=e}return n}class F_{constructor(e,t){this.line=e,this.column=t}}function z_(n){let e=1,t=1;for(let i=0;iT.lowercaseZ));){const s=bd[n+(e-T.lowercaseA)+1];if(s===-1)break;n=s,t++}const i=bd[n];if(i>-1&&!nn[e]){d.pos=t,i&1?ge(i>>>1):ge(l.name,i>>>1);return}for(;t=z.length){const n=d.tokens;n.length>=2&&n[n.length-1].start>=z.length&&n[n.length-2].start>=z.length&&ye("Unexpectedly reached the end of input."),ge(l.eof);return}r$(z.charCodeAt(d.pos))}function r$(n){wr[n]||n===T.backslash||n===T.atSign&&z.charCodeAt(d.pos+1)===T.atSign?J_():i0(n)}function o$(){for(;z.charCodeAt(d.pos)!==T.asterisk||z.charCodeAt(d.pos+1)!==T.slash;)if(d.pos++,d.pos>z.length){ye("Unterminated comment",d.pos-2);return}d.pos+=2}function e0(n){let e=z.charCodeAt(d.pos+=n);if(d.pos=T.digit0&&n<=T.digit9){s0(!0);return}n===T.dot&&z.charCodeAt(d.pos+2)===T.dot?(d.pos+=3,ge(l.ellipsis)):(++d.pos,ge(l.dot))}function l$(){z.charCodeAt(d.pos+1)===T.equalsTo?Ae(l.assign,2):Ae(l.slash,1)}function c$(n){let e=n===T.asterisk?l.star:l.modulo,t=1,i=z.charCodeAt(d.pos+1);n===T.asterisk&&i===T.asterisk&&(t++,i=z.charCodeAt(d.pos+2),e=l.exponent),i===T.equalsTo&&z.charCodeAt(d.pos+2)!==T.greaterThan&&(t++,e=l.assign),Ae(e,t)}function h$(n){const e=z.charCodeAt(d.pos+1);if(e===n){z.charCodeAt(d.pos+2)===T.equalsTo?Ae(l.assign,3):Ae(n===T.verticalBar?l.logicalOR:l.logicalAND,2);return}if(n===T.verticalBar){if(e===T.greaterThan){Ae(l.pipeline,2);return}else if(e===T.rightCurlyBrace&&Te){Ae(l.braceBarR,2);return}}if(e===T.equalsTo){Ae(l.assign,2);return}Ae(n===T.verticalBar?l.bitwiseOR:l.bitwiseAND,1)}function u$(){z.charCodeAt(d.pos+1)===T.equalsTo?Ae(l.assign,2):Ae(l.bitwiseXOR,1)}function f$(n){const e=z.charCodeAt(d.pos+1);if(e===n){Ae(l.preIncDec,2);return}e===T.equalsTo?Ae(l.assign,2):n===T.plusSign?Ae(l.plus,1):Ae(l.minus,1)}function d$(){const n=z.charCodeAt(d.pos+1);if(n===T.lessThan){if(z.charCodeAt(d.pos+2)===T.equalsTo){Ae(l.assign,3);return}d.isType?Ae(l.lessThan,1):Ae(l.bitShiftL,2);return}n===T.equalsTo?Ae(l.relationalOrEqual,2):Ae(l.lessThan,1)}function n0(){if(d.isType){Ae(l.greaterThan,1);return}const n=z.charCodeAt(d.pos+1);if(n===T.greaterThan){const e=z.charCodeAt(d.pos+2)===T.greaterThan?3:2;if(z.charCodeAt(d.pos+e)===T.equalsTo){Ae(l.assign,e+1);return}Ae(l.bitShiftR,e);return}n===T.equalsTo?Ae(l.relationalOrEqual,2):Ae(l.greaterThan,1)}function p$(){d.type===l.greaterThan&&(d.pos-=1,n0())}function m$(n){const e=z.charCodeAt(d.pos+1);if(e===T.equalsTo){Ae(l.equality,z.charCodeAt(d.pos+2)===T.equalsTo?3:2);return}if(n===T.equalsTo&&e===T.greaterThan){d.pos+=2,ge(l.arrow);return}Ae(n===T.equalsTo?l.eq:l.bang,1)}function O$(){const n=z.charCodeAt(d.pos+1),e=z.charCodeAt(d.pos+2);n===T.questionMark&&!(Te&&d.isType)?e===T.equalsTo?Ae(l.assign,3):Ae(l.nullishCoalescing,2):n===T.dot&&!(e>=T.digit0&&e<=T.digit9)?(d.pos+=2,ge(l.questionDot)):(++d.pos,ge(l.question))}function i0(n){switch(n){case T.numberSign:++d.pos,ge(l.hash);return;case T.dot:a$();return;case T.leftParenthesis:++d.pos,ge(l.parenL);return;case T.rightParenthesis:++d.pos,ge(l.parenR);return;case T.semicolon:++d.pos,ge(l.semi);return;case T.comma:++d.pos,ge(l.comma);return;case T.leftSquareBracket:++d.pos,ge(l.bracketL);return;case T.rightSquareBracket:++d.pos,ge(l.bracketR);return;case T.leftCurlyBrace:Te&&z.charCodeAt(d.pos+1)===T.verticalBar?Ae(l.braceBarL,2):(++d.pos,ge(l.braceL));return;case T.rightCurlyBrace:++d.pos,ge(l.braceR);return;case T.colon:z.charCodeAt(d.pos+1)===T.colon?Ae(l.doubleColon,2):(++d.pos,ge(l.colon));return;case T.questionMark:O$();return;case T.atSign:++d.pos,ge(l.at);return;case T.graveAccent:++d.pos,ge(l.backQuote);return;case T.digit0:{const e=z.charCodeAt(d.pos+1);if(e===T.lowercaseX||e===T.uppercaseX||e===T.lowercaseO||e===T.uppercaseO||e===T.lowercaseB||e===T.uppercaseB){y$();return}}case T.digit1:case T.digit2:case T.digit3:case T.digit4:case T.digit5:case T.digit6:case T.digit7:case T.digit8:case T.digit9:s0(!1);return;case T.quotationMark:case T.apostrophe:S$(n);return;case T.slash:l$();return;case T.percentSign:case T.asterisk:c$(n);return;case T.verticalBar:case T.ampersand:h$(n);return;case T.caret:u$();return;case T.plusSign:case T.dash:f$(n);return;case T.lessThan:d$();return;case T.greaterThan:n0();return;case T.equalsTo:case T.exclamationMark:m$(n);return;case T.tilde:Ae(l.tilde,1);return}ye(`Unexpected character '${String.fromCharCode(n)}'`,d.pos)}function Ae(n,e){d.pos+=e,ge(n)}function g$(){const n=d.pos;let e=!1,t=!1;for(;;){if(d.pos>=z.length){ye("Unterminated regular expression",n);return}const i=z.charCodeAt(d.pos);if(e)e=!1;else{if(i===T.leftSquareBracket)t=!0;else if(i===T.rightSquareBracket&&t)t=!1;else if(i===T.slash&&!t)break;e=i===T.backslash}++d.pos}++d.pos,b$(),ge(l.regexp)}function Kl(){for(;;){const n=z.charCodeAt(d.pos);if(n>=T.digit0&&n<=T.digit9||n===T.underscore)d.pos++;else break}}function y$(){for(d.pos+=2;;){const e=z.charCodeAt(d.pos);if(e>=T.digit0&&e<=T.digit9||e>=T.lowercaseA&&e<=T.lowercaseF||e>=T.uppercaseA&&e<=T.uppercaseF||e===T.underscore)d.pos++;else break}z.charCodeAt(d.pos)===T.lowercaseN?(++d.pos,ge(l.bigint)):ge(l.num)}function s0(n){let e=!1,t=!1;n||Kl();let i=z.charCodeAt(d.pos);if(i===T.dot&&(++d.pos,Kl(),i=z.charCodeAt(d.pos)),(i===T.uppercaseE||i===T.lowercaseE)&&(i=z.charCodeAt(++d.pos),(i===T.plusSign||i===T.dash)&&++d.pos,Kl(),i=z.charCodeAt(d.pos)),i===T.lowercaseN?(++d.pos,e=!0):i===T.lowercaseM&&(++d.pos,t=!0),e){ge(l.bigint);return}if(t){ge(l.decimal);return}ge(l.num)}function S$(n){for(d.pos++;;){if(d.pos>=z.length){ye("Unterminated string constant");return}const e=z.charCodeAt(d.pos);if(e===T.backslash)d.pos++;else if(e===n)break;d.pos++}d.pos++,ge(l.string)}function k$(){for(;;){if(d.pos>=z.length){ye("Unterminated template");return}const n=z.charCodeAt(d.pos);if(n===T.graveAccent||n===T.dollarSign&&z.charCodeAt(d.pos+1)===T.leftCurlyBrace){if(d.pos===d.start&&g(l.template))if(n===T.dollarSign){d.pos+=2,ge(l.dollarBraceL);return}else{++d.pos,ge(l.backQuote);return}ge(l.template);return}n===T.backslash&&d.pos++,d.pos++}}function b$(){for(;d.pos"],["nbsp"," "],["iexcl","¡"],["cent","¢"],["pound","£"],["curren","¤"],["yen","¥"],["brvbar","¦"],["sect","§"],["uml","¨"],["copy","©"],["ordf","ª"],["laquo","«"],["not","¬"],["shy","­"],["reg","®"],["macr","¯"],["deg","°"],["plusmn","±"],["sup2","²"],["sup3","³"],["acute","´"],["micro","µ"],["para","¶"],["middot","·"],["cedil","¸"],["sup1","¹"],["ordm","º"],["raquo","»"],["frac14","¼"],["frac12","½"],["frac34","¾"],["iquest","¿"],["Agrave","À"],["Aacute","Á"],["Acirc","Â"],["Atilde","Ã"],["Auml","Ä"],["Aring","Å"],["AElig","Æ"],["Ccedil","Ç"],["Egrave","È"],["Eacute","É"],["Ecirc","Ê"],["Euml","Ë"],["Igrave","Ì"],["Iacute","Í"],["Icirc","Î"],["Iuml","Ï"],["ETH","Ð"],["Ntilde","Ñ"],["Ograve","Ò"],["Oacute","Ó"],["Ocirc","Ô"],["Otilde","Õ"],["Ouml","Ö"],["times","×"],["Oslash","Ø"],["Ugrave","Ù"],["Uacute","Ú"],["Ucirc","Û"],["Uuml","Ü"],["Yacute","Ý"],["THORN","Þ"],["szlig","ß"],["agrave","à"],["aacute","á"],["acirc","â"],["atilde","ã"],["auml","ä"],["aring","å"],["aelig","æ"],["ccedil","ç"],["egrave","è"],["eacute","é"],["ecirc","ê"],["euml","ë"],["igrave","ì"],["iacute","í"],["icirc","î"],["iuml","ï"],["eth","ð"],["ntilde","ñ"],["ograve","ò"],["oacute","ó"],["ocirc","ô"],["otilde","õ"],["ouml","ö"],["divide","÷"],["oslash","ø"],["ugrave","ù"],["uacute","ú"],["ucirc","û"],["uuml","ü"],["yacute","ý"],["thorn","þ"],["yuml","ÿ"],["OElig","Œ"],["oelig","œ"],["Scaron","Š"],["scaron","š"],["Yuml","Ÿ"],["fnof","ƒ"],["circ","ˆ"],["tilde","˜"],["Alpha","Α"],["Beta","Β"],["Gamma","Γ"],["Delta","Δ"],["Epsilon","Ε"],["Zeta","Ζ"],["Eta","Η"],["Theta","Θ"],["Iota","Ι"],["Kappa","Κ"],["Lambda","Λ"],["Mu","Μ"],["Nu","Ν"],["Xi","Ξ"],["Omicron","Ο"],["Pi","Π"],["Rho","Ρ"],["Sigma","Σ"],["Tau","Τ"],["Upsilon","Υ"],["Phi","Φ"],["Chi","Χ"],["Psi","Ψ"],["Omega","Ω"],["alpha","α"],["beta","β"],["gamma","γ"],["delta","δ"],["epsilon","ε"],["zeta","ζ"],["eta","η"],["theta","θ"],["iota","ι"],["kappa","κ"],["lambda","λ"],["mu","μ"],["nu","ν"],["xi","ξ"],["omicron","ο"],["pi","π"],["rho","ρ"],["sigmaf","ς"],["sigma","σ"],["tau","τ"],["upsilon","υ"],["phi","φ"],["chi","χ"],["psi","ψ"],["omega","ω"],["thetasym","ϑ"],["upsih","ϒ"],["piv","ϖ"],["ensp"," "],["emsp"," "],["thinsp"," "],["zwnj","‌"],["zwj","‍"],["lrm","‎"],["rlm","‏"],["ndash","–"],["mdash","—"],["lsquo","‘"],["rsquo","’"],["sbquo","‚"],["ldquo","“"],["rdquo","”"],["bdquo","„"],["dagger","†"],["Dagger","‡"],["bull","•"],["hellip","…"],["permil","‰"],["prime","′"],["Prime","″"],["lsaquo","‹"],["rsaquo","›"],["oline","‾"],["frasl","⁄"],["euro","€"],["image","ℑ"],["weierp","℘"],["real","ℜ"],["trade","™"],["alefsym","ℵ"],["larr","←"],["uarr","↑"],["rarr","→"],["darr","↓"],["harr","↔"],["crarr","↵"],["lArr","⇐"],["uArr","⇑"],["rArr","⇒"],["dArr","⇓"],["hArr","⇔"],["forall","∀"],["part","∂"],["exist","∃"],["empty","∅"],["nabla","∇"],["isin","∈"],["notin","∉"],["ni","∋"],["prod","∏"],["sum","∑"],["minus","−"],["lowast","∗"],["radic","√"],["prop","∝"],["infin","∞"],["ang","∠"],["and","∧"],["or","∨"],["cap","∩"],["cup","∪"],["int","∫"],["there4","∴"],["sim","∼"],["cong","≅"],["asymp","≈"],["ne","≠"],["equiv","≡"],["le","≤"],["ge","≥"],["sub","⊂"],["sup","⊃"],["nsub","⊄"],["sube","⊆"],["supe","⊇"],["oplus","⊕"],["otimes","⊗"],["perp","⊥"],["sdot","⋅"],["lceil","⌈"],["rceil","⌉"],["lfloor","⌊"],["rfloor","⌋"],["lang","〈"],["rang","〉"],["loz","◊"],["spades","♠"],["clubs","♣"],["hearts","♥"],["diams","♦"]]);function r0(n){const[e,t]=wd(n.jsxPragma||"React.createElement"),[i,s]=wd(n.jsxFragmentPragma||"React.Fragment");return{base:e,suffix:t,fragmentBase:i,fragmentSuffix:s}}function wd(n){let e=n.indexOf(".");return e===-1&&(e=n.length),[n.slice(0,e),n.slice(e)]}class rn{getPrefixCode(){return""}getHoistedCode(){return""}getSuffixCode(){return""}}class Oi extends rn{__init(){this.lastLineNumber=1}__init2(){this.lastIndex=0}__init3(){this.filenameVarName=null}__init4(){this.esmAutomaticImportNameResolutions={}}__init5(){this.cjsAutomaticModuleNameResolutions={}}constructor(e,t,i,s,r){super(),this.rootTransformer=e,this.tokens=t,this.importProcessor=i,this.nameManager=s,this.options=r,Oi.prototype.__init.call(this),Oi.prototype.__init2.call(this),Oi.prototype.__init3.call(this),Oi.prototype.__init4.call(this),Oi.prototype.__init5.call(this),this.jsxPragmaInfo=r0(r),this.isAutomaticRuntime=r.jsxRuntime==="automatic",this.jsxImportSource=r.jsxImportSource||"react"}process(){return this.tokens.matches1(l.jsxTagStart)?(this.processJSXTag(),!0):!1}getPrefixCode(){let e="";if(this.filenameVarName&&(e+=`const ${this.filenameVarName} = ${JSON.stringify(this.options.filePath||"")};`),this.isAutomaticRuntime)if(this.importProcessor)for(const[t,i]of Object.entries(this.cjsAutomaticModuleNameResolutions))e+=`var ${i} = require("${t}");`;else{const{createElement:t,...i}=this.esmAutomaticImportNameResolutions;t&&(e+=`import {createElement as ${t}} from "${this.jsxImportSource}";`);const s=Object.entries(i).map(([r,o])=>`${r} as ${o}`).join(", ");if(s){const r=this.jsxImportSource+(this.options.production?"/jsx-runtime":"/jsx-dev-runtime");e+=`import {${s}} from "${r}";`}}return e}processJSXTag(){const{jsxRole:e,start:t}=this.tokens.currentToken(),i=this.options.production?null:this.getElementLocationCode(t);this.isAutomaticRuntime&&e!==tn.KeyAfterPropSpread?this.transformTagToJSXFunc(i,e):this.transformTagToCreateElement(i)}getElementLocationCode(e){return`lineNumber: ${this.getLineNumberForIndex(e)}`}getLineNumberForIndex(e){const t=this.tokens.code;for(;this.lastIndex or > at the end of the tag.");s&&this.tokens.appendCode(`, ${s}`)}for(this.options.production||(s===null&&this.tokens.appendCode(", void 0"),this.tokens.appendCode(`, ${i}, ${this.getDevSource(e)}, this`)),this.tokens.removeInitialToken();!this.tokens.matches1(l.jsxTagEnd);)this.tokens.removeToken();this.tokens.replaceToken(")")}transformTagToCreateElement(e){if(this.tokens.replaceToken(this.getCreateElementInvocationCode()),this.tokens.matches1(l.jsxTagEnd))this.tokens.replaceToken(`${this.getFragmentCode()}, null`),this.processChildren(!0);else if(this.processTagIntro(),this.processPropsObjectWithDevInfo(e),!this.tokens.matches2(l.slash,l.jsxTagEnd))if(this.tokens.matches1(l.jsxTagEnd))this.tokens.removeToken(),this.processChildren(!0);else throw new Error("Expected either /> or > at the end of the tag.");for(this.tokens.removeInitialToken();!this.tokens.matches1(l.jsxTagEnd);)this.tokens.removeToken();this.tokens.replaceToken(")")}getJSXFuncInvocationCode(e){return this.options.production?e?this.claimAutoImportedFuncInvocation("jsxs","/jsx-runtime"):this.claimAutoImportedFuncInvocation("jsx","/jsx-runtime"):this.claimAutoImportedFuncInvocation("jsxDEV","/jsx-dev-runtime")}getCreateElementInvocationCode(){if(this.isAutomaticRuntime)return this.claimAutoImportedFuncInvocation("createElement","");{const{jsxPragmaInfo:e}=this;return`${this.importProcessor&&this.importProcessor.getIdentifierReplacement(e.base)||e.base}${e.suffix}(`}}getFragmentCode(){if(this.isAutomaticRuntime)return this.claimAutoImportedName("Fragment",this.options.production?"/jsx-runtime":"/jsx-dev-runtime");{const{jsxPragmaInfo:e}=this;return(this.importProcessor&&this.importProcessor.getIdentifierReplacement(e.fragmentBase)||e.fragmentBase)+e.fragmentSuffix}}claimAutoImportedFuncInvocation(e,t){const i=this.claimAutoImportedName(e,t);return this.importProcessor?`${i}.call(void 0, `:`${i}(`}claimAutoImportedName(e,t){if(this.importProcessor){const i=this.jsxImportSource+t;return this.cjsAutomaticModuleNameResolutions[i]||(this.cjsAutomaticModuleNameResolutions[i]=this.importProcessor.getFreeIdentifierForPath(i)),`${this.cjsAutomaticModuleNameResolutions[i]}.${e}`}else return this.esmAutomaticImportNameResolutions[e]||(this.esmAutomaticImportNameResolutions[e]=this.nameManager.claimFreeName(`_${e}`)),this.esmAutomaticImportNameResolutions[e]}processTagIntro(){let e=this.tokens.currentIndex()+1;for(;this.tokens.tokens[e].isType||!this.tokens.matches2AtIndex(e-1,l.jsxName,l.jsxName)&&!this.tokens.matches2AtIndex(e-1,l.greaterThan,l.jsxName)&&!this.tokens.matches1AtIndex(e,l.braceL)&&!this.tokens.matches1AtIndex(e,l.jsxTagEnd)&&!this.tokens.matches2AtIndex(e,l.slash,l.jsxTagEnd);)e++;if(e===this.tokens.currentIndex()+1){const t=this.tokens.identifierName();o0(t)&&this.tokens.replaceToken(`'${t}'`)}for(;this.tokens.currentIndex()=T.lowercaseA&&e<=T.lowercaseZ}function x$(n){let e="",t="",i=!1,s=!1;for(let r=0;r=T.digit0&&n<=T.digit9}function P$(n){return n>=T.digit0&&n<=T.digit9||n>=T.lowercaseA&&n<=T.lowercaseF||n>=T.uppercaseA&&n<=T.uppercaseF}function l0(n,e){const t=r0(e),i=new Set;for(let s=0;s0||t.namedExports.length>0)continue;[...t.defaultNames,...t.wildcardNames,...t.namedImports.map(({localName:s})=>s)].every(s=>this.isTypeName(s))&&this.importsToReplace.set(e,"")}}isTypeName(e){return this.isTypeScriptTransformEnabled&&!this.nonTypeIdentifiers.has(e)}generateImportReplacements(){for(const[e,t]of this.importInfoByPath.entries()){const{defaultNames:i,wildcardNames:s,namedImports:r,namedExports:o,exportStarNames:a,hasStarExport:c}=t;if(i.length===0&&s.length===0&&r.length===0&&o.length===0&&a.length===0&&!c){this.importsToReplace.set(e,`require('${e}');`);continue}const h=this.getFreeIdentifierForPath(e);let u;this.enableLegacyTypeScriptModuleInterop?u=h:u=s.length>0?s[0]:this.getFreeIdentifierForPath(e);let f=`var ${h} = require('${e}');`;if(s.length>0)for(const p of s){const m=this.enableLegacyTypeScriptModuleInterop?h:`${this.helperManager.getHelperName("interopRequireWildcard")}(${h})`;f+=` var ${p} = ${m};`}else a.length>0&&u!==h?f+=` var ${u} = ${this.helperManager.getHelperName("interopRequireWildcard")}(${h});`:i.length>0&&u!==h&&(f+=` var ${u} = ${this.helperManager.getHelperName("interopRequireDefault")}(${h});`);for(const{importedName:p,localName:m}of o)f+=` ${this.helperManager.getHelperName("createNamedExportFrom")}(${h}, '${m}', '${p}');`;for(const p of a)f+=` exports.${p} = ${u};`;c&&(f+=` ${this.helperManager.getHelperName("createStarExport")}(${h});`),this.importsToReplace.set(e,f);for(const p of i)this.identifierReplacements.set(p,`${u}.default`);for(const{importedName:p,localName:m}of r)this.identifierReplacements.set(m,`${h}.${p}`)}}getFreeIdentifierForPath(e){const t=e.split("/"),s=t[t.length-1].replace(/\W/g,"");return this.nameManager.claimFreeName(`_${s}`)}preprocessImportAtIndex(e){const t=[],i=[],s=[];if(e++,(this.tokens.matchesContextualAtIndex(e,w._type)||this.tokens.matches1AtIndex(e,l._typeof))&&!this.tokens.matches1AtIndex(e+1,l.comma)&&!this.tokens.matchesContextualAtIndex(e+1,w._from)||this.tokens.matches1AtIndex(e,l.parenL))return;if(this.tokens.matches1AtIndex(e,l.name)&&(t.push(this.tokens.identifierNameAtIndex(e)),e++,this.tokens.matches1AtIndex(e,l.comma)&&e++),this.tokens.matches1AtIndex(e,l.star)&&(e+=2,i.push(this.tokens.identifierNameAtIndex(e)),e++),this.tokens.matches1AtIndex(e,l.braceL)){const a=this.getNamedImports(e+1);e=a.newIndex;for(const c of a.namedImports)c.importedName==="default"?t.push(c.localName):s.push(c)}if(this.tokens.matchesContextualAtIndex(e,w._from)&&e++,!this.tokens.matches1AtIndex(e,l.string))throw new Error("Expected string token at the end of import statement.");const r=this.tokens.stringValueAtIndex(e),o=this.getImportInfo(r);o.defaultNames.push(...t),o.wildcardNames.push(...i),o.namedImports.push(...s),t.length===0&&i.length===0&&s.length===0&&(o.hasBareImport=!0)}preprocessExportAtIndex(e){if(this.tokens.matches2AtIndex(e,l._export,l._var)||this.tokens.matches2AtIndex(e,l._export,l._let)||this.tokens.matches2AtIndex(e,l._export,l._const))this.preprocessVarExportAtIndex(e);else if(this.tokens.matches2AtIndex(e,l._export,l._function)||this.tokens.matches2AtIndex(e,l._export,l._class)){const t=this.tokens.identifierNameAtIndex(e+2);this.addExportBinding(t,t)}else if(this.tokens.matches3AtIndex(e,l._export,l.name,l._function)){const t=this.tokens.identifierNameAtIndex(e+3);this.addExportBinding(t,t)}else this.tokens.matches2AtIndex(e,l._export,l.braceL)?this.preprocessNamedExportAtIndex(e):this.tokens.matches2AtIndex(e,l._export,l.star)&&this.preprocessExportStarAtIndex(e)}preprocessVarExportAtIndex(e){let t=0;for(let i=e+2;;i++)if(this.tokens.matches1AtIndex(i,l.braceL)||this.tokens.matches1AtIndex(i,l.dollarBraceL)||this.tokens.matches1AtIndex(i,l.bracketL))t++;else if(this.tokens.matches1AtIndex(i,l.braceR)||this.tokens.matches1AtIndex(i,l.bracketR))t--;else{if(t===0&&!this.tokens.matches1AtIndex(i,l.name))break;if(this.tokens.matches1AtIndex(1,l.eq)){const s=this.tokens.currentToken().rhsEndIndex;if(s==null)throw new Error("Expected = token with an end index.");i=s-1}else{const s=this.tokens.tokens[i];if(Fg(s)){const r=this.tokens.identifierNameAtIndex(i);this.identifierReplacements.set(r,`exports.${r}`)}}}}preprocessNamedExportAtIndex(e){e+=2;const{newIndex:t,namedImports:i}=this.getNamedImports(e);if(e=t,this.tokens.matchesContextualAtIndex(e,w._from))e++;else{for(const{importedName:o,localName:a}of i)this.addExportBinding(o,a);return}if(!this.tokens.matches1AtIndex(e,l.string))throw new Error("Expected string token at the end of import statement.");const s=this.tokens.stringValueAtIndex(e);this.getImportInfo(s).namedExports.push(...i)}preprocessExportStarAtIndex(e){let t=null;if(this.tokens.matches3AtIndex(e,l._export,l.star,l._as)?(e+=3,t=this.tokens.identifierNameAtIndex(e),e+=2):e+=3,!this.tokens.matches1AtIndex(e,l.string))throw new Error("Expected string token at the end of star export statement.");const i=this.tokens.stringValueAtIndex(e),s=this.getImportInfo(i);t!==null?s.exportStarNames.push(t):s.hasStarExport=!0}getNamedImports(e){const t=[];for(;;){if(this.tokens.matches1AtIndex(e,l.braceR)){e++;break}const i=lr(this.tokens,e);if(e=i.endIndex,i.isType||t.push({importedName:i.leftName,localName:i.rightName}),this.tokens.matches2AtIndex(e,l.comma,l.braceR)){e+=2;break}else if(this.tokens.matches1AtIndex(e,l.braceR)){e++;break}else if(this.tokens.matches1AtIndex(e,l.comma))e++;else throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[e])}`)}return{newIndex:e,namedImports:t}}getImportInfo(e){const t=this.importInfoByPath.get(e);if(t)return t;const i={defaultNames:[],wildcardNames:[],namedImports:[],namedExports:[],hasBareImport:!1,exportStarNames:[],hasStarExport:!1};return this.importInfoByPath.set(e,i),i}addExportBinding(e,t){this.exportBindingsByLocalName.has(e)||this.exportBindingsByLocalName.set(e,[]),this.exportBindingsByLocalName.get(e).push(t)}claimImportCode(e){const t=this.importsToReplace.get(e);return this.importsToReplace.set(e,""),t||""}getIdentifierReplacement(e){return this.identifierReplacements.get(e)||null}resolveExportBinding(e){const t=this.exportBindingsByLocalName.get(e);return!t||t.length===0?null:t.map(i=>`exports.${i}`).join(" = ")}getGlobalNames(){return new Set([...this.identifierReplacements.keys(),...this.exportBindingsByLocalName.keys()])}}var Yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _$(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var hh={exports:{}},zr={exports:{}},vd;function $$(){return vd||(vd=1,function(n,e){(function(t,i){i(e)})(Yt,function(t){t.get=void 0,t.put=void 0,t.pop=void 0;class i{constructor(){this._indexes={__proto__:null},this.array=[]}}t.get=(s,r)=>s._indexes[r],t.put=(s,r)=>{const o=t.get(s,r);if(o!==void 0)return o;const{array:a,_indexes:c}=s;return c[r]=a.push(r)-1},t.pop=s=>{const{array:r,_indexes:o}=s;if(r.length===0)return;const a=r.pop();o[a]=void 0},t.SetArray=i,Object.defineProperty(t,"__esModule",{value:!0})})}(zr,zr.exports)),zr.exports}var Gr={exports:{}},Qd;function T$(){return Qd||(Qd=1,function(n,e){(function(t,i){i(e)})(Yt,function(t){const i=",".charCodeAt(0),s=";".charCodeAt(0),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(64),a=new Uint8Array(128);for(let S=0;S>>=1,C&&(v=-2147483648|-v),Q[_]+=v,P}function p(S,P,Q){return P>=Q?!1:S.charCodeAt(P)!==i}function m(S){S.sort(O)}function O(S,P){return S[0]-P[0]}function k(S){const P=new Int32Array(5),Q=1024*16,_=Q-36,v=new Uint8Array(Q),$=v.subarray(0,_);let x=0,C="";for(let R=0;R0&&(x===Q&&(C+=c.decode(v),x=0),v[x++]=s),W.length!==0){P[0]=0;for(let U=0;U_&&(C+=c.decode($),v.copyWithin(0,_,x),x-=_),U>0&&(v[x++]=i),x=y(v,x,P,Y,0),Y.length!==1&&(x=y(v,x,P,Y,1),x=y(v,x,P,Y,2),x=y(v,x,P,Y,3),Y.length!==4&&(x=y(v,x,P,Y,4)))}}}return C+c.decode(v.subarray(0,x))}function y(S,P,Q,_,v){const $=_[v];let x=$-Q[v];Q[v]=$,x=x<0?-x<<1|1:x<<1;do{let C=x&31;x>>>=5,x>0&&(C|=32),S[P++]=o[C]}while(x>0);return P}t.decode=h,t.encode=k,Object.defineProperty(t,"__esModule",{value:!0})})}(Gr,Gr.exports)),Gr.exports}var Hr={exports:{}},Jr={exports:{}},Pd;function C$(){return Pd||(Pd=1,function(n,e){(function(t,i){i(e)})(Yt,function(t){const i=",".charCodeAt(0),s=";".charCodeAt(0),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(64),a=new Uint8Array(128);for(let S=0;S>>=1,C&&(v=-2147483648|-v),Q[_]+=v,P}function p(S,P,Q){return P>=Q?!1:S.charCodeAt(P)!==i}function m(S){S.sort(O)}function O(S,P){return S[0]-P[0]}function k(S){const P=new Int32Array(5),Q=1024*16,_=Q-36,v=new Uint8Array(Q),$=v.subarray(0,_);let x=0,C="";for(let R=0;R0&&(x===Q&&(C+=c.decode(v),x=0),v[x++]=s),W.length!==0){P[0]=0;for(let U=0;U_&&(C+=c.decode($),v.copyWithin(0,_,x),x-=_),U>0&&(v[x++]=i),x=y(v,x,P,Y,0),Y.length!==1&&(x=y(v,x,P,Y,1),x=y(v,x,P,Y,2),x=y(v,x,P,Y,3),Y.length!==4&&(x=y(v,x,P,Y,4)))}}}return C+c.decode(v.subarray(0,x))}function y(S,P,Q,_,v){const $=_[v];let x=$-Q[v];Q[v]=$,x=x<0?-x<<1|1:x<<1;do{let C=x&31;x>>>=5,x>0&&(C|=32),S[P++]=o[C]}while(x>0);return P}t.decode=h,t.encode=k,Object.defineProperty(t,"__esModule",{value:!0})})}(Jr,Jr.exports)),Jr.exports}var ec={exports:{}},_d;function A$(){return _d||(_d=1,function(n,e){(function(t,i){n.exports=i()})(Yt,function(){const t=/^[\w+.-]+:\/\//,i=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,s=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;var r;(function(Q){Q[Q.Empty=1]="Empty",Q[Q.Hash=2]="Hash",Q[Q.Query=3]="Query",Q[Q.RelativePath=4]="RelativePath",Q[Q.AbsolutePath=5]="AbsolutePath",Q[Q.SchemeRelative=6]="SchemeRelative",Q[Q.Absolute=7]="Absolute"})(r||(r={}));function o(Q){return t.test(Q)}function a(Q){return Q.startsWith("//")}function c(Q){return Q.startsWith("/")}function h(Q){return Q.startsWith("file:")}function u(Q){return/^[.?#]/.test(Q)}function f(Q){const _=i.exec(Q);return m(_[1],_[2]||"",_[3],_[4]||"",_[5]||"/",_[6]||"",_[7]||"")}function p(Q){const _=s.exec(Q),v=_[2];return m("file:","",_[1]||"","",c(v)?v:"/"+v,_[3]||"",_[4]||"")}function m(Q,_,v,$,x,C,R){return{scheme:Q,user:_,host:v,port:$,path:x,query:C,hash:R,type:r.Absolute}}function O(Q){if(a(Q)){const v=f("http:"+Q);return v.scheme="",v.type=r.SchemeRelative,v}if(c(Q)){const v=f("http://foo.com"+Q);return v.scheme="",v.host="",v.type=r.AbsolutePath,v}if(h(Q))return p(Q);if(o(Q))return f(Q);const _=f("http://foo.com/"+Q);return _.scheme="",_.host="",_.type=Q?Q.startsWith("?")?r.Query:Q.startsWith("#")?r.Hash:r.RelativePath:r.Empty,_}function k(Q){if(Q.endsWith("/.."))return Q;const _=Q.lastIndexOf("/");return Q.slice(0,_+1)}function y(Q,_){S(_,_.type),Q.path==="/"?Q.path=_.path:Q.path=k(_.path)+Q.path}function S(Q,_){const v=_<=r.RelativePath,$=Q.path.split("/");let x=1,C=0,R=!1;for(let U=1;U<$.length;U++){const Y=$[U];if(!Y){R=!0;continue}if(R=!1,Y!=="."){if(Y===".."){C?(R=!0,C--,x--):v&&($[x++]=Y);continue}$[x++]=Y,C++}}let W="";for(let U=1;U$&&($=R)}S(v,$);const x=v.query+v.hash;switch($){case r.Hash:case r.Query:return x;case r.RelativePath:{const C=v.path.slice(1);return C?u(_||Q)&&!u(C)?"./"+C+x:C+x:x||"."}case r.AbsolutePath:return v.path+x;default:return v.scheme+"//"+v.user+v.host+v.port+v.path+x}}return P})}(ec)),ec.exports}var $d;function I$(){return $d||($d=1,function(n,e){(function(t,i){i(e,C$(),A$())})(Yt,function(t,i,s){function r(A){return A&&typeof A=="object"&&"default"in A?A:{default:A}}var o=r(s);function a(A,I){return I&&!I.endsWith("/")&&(I+="/"),o.default(A,I)}function c(A){if(!A)return"";const I=A.lastIndexOf("/");return A.slice(0,I+1)}const h=0,u=1,f=2,p=3,m=4,O=1,k=2;function y(A,I){const Z=S(A,0);if(Z===A.length)return A;I||(A=A.slice());for(let L=Z;L>1),F=A[H][h]-I;if(F===0)return v=!0,H;F<0?Z=H+1:L=H-1}return v=!1,Z-1}function x(A,I,Z){for(let L=Z+1;L=0&&A[L][h]===I;Z=L--);return Z}function R(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function W(A,I,Z,L){const{lastKey:H,lastNeedle:F,lastIndex:J}=Z;let xe=0,ae=A.length-1;if(L===H){if(I===F)return v=J!==-1&&A[J][h]===I,J;I>=F?xe=J===-1?0:J:ae=J}return Z.lastKey=L,Z.lastNeedle=I,Z.lastIndex=$(A,I,xe,ae)}function U(A,I){const Z=I.map(ce);for(let L=0;LI;L--)A[L]=A[L-1];A[I]=Z}function ce(){return{__proto__:null}}const re=function(A,I){const Z=typeof A=="string"?JSON.parse(A):A;if(!("sections"in Z))return new Ie(Z,I);const L=[],H=[],F=[],J=[];pe(Z,I,L,H,F,J,0,0,1/0,1/0);const xe={version:3,file:Z.file,names:J,sources:H,sourcesContent:F,mappings:L};return t.presortedDecodedMap(xe)};function pe(A,I,Z,L,H,F,J,xe,ae,Oe){const{sections:$e}=A;for(let Ee=0;Ee<$e.length;Ee++){const{map:Be,offset:Je}=$e[Ee];let ht=ae,Ct=Oe;if(Ee+1<$e.length){const gt=$e[Ee+1].offset;ht=Math.min(ae,J+gt.line),ht===ae?Ct=Math.min(Oe,xe+gt.column):htae)return;const Ri=ie(Z,ui),ws=gt===0?xe:0,Xi=Je[gt];for(let fi=0;fi=Oe)return;if(zt.length===1){Ri.push([Vn]);continue}const Ei=Ee+zt[u],Zi=zt[f],Mi=zt[p];Ri.push(zt.length===4?[Vn,Ei,Zi,Mi]:[Vn,Ei,Zi,Mi,Be+zt[m]])}}}function de(A,I){for(let Z=0;Za(Je||"",Ee));const{mappings:Be}=H;typeof Be=="string"?(this._encoded=Be,this._decoded=void 0):(this._encoded=void 0,this._decoded=y(Be,L)),this._decodedMemo=R(),this._bySources=void 0,this._bySourceMemos=void 0}}(()=>{t.encodedMappings=I=>{var Z;return(Z=I._encoded)!==null&&Z!==void 0?Z:I._encoded=i.encode(I._decoded)},t.decodedMappings=I=>I._decoded||(I._decoded=i.decode(I._encoded)),t.traceSegment=(I,Z,L)=>{const H=t.decodedMappings(I);if(Z>=H.length)return null;const F=H[Z],J=j(F,I._decodedMemo,Z,L,Qe);return J===-1?null:F[J]},t.originalPositionFor=(I,{line:Z,column:L,bias:H})=>{if(Z--,Z<0)throw new Error(ue);if(L<0)throw new Error(me);const F=t.decodedMappings(I);if(Z>=F.length)return E(null,null,null,null);const J=F[Z],xe=j(J,I._decodedMemo,Z,L,H||Qe);if(xe===-1)return E(null,null,null,null);const ae=J[xe];if(ae.length===1)return E(null,null,null,null);const{names:Oe,resolvedSources:$e}=I;return E($e[ae[u]],ae[f]+1,ae[p],ae.length===5?Oe[ae[m]]:null)},t.allGeneratedPositionsFor=(I,{source:Z,line:L,column:H,bias:F})=>A(I,Z,L,H,F||be,!0),t.generatedPositionFor=(I,{source:Z,line:L,column:H,bias:F})=>A(I,Z,L,H,F||Qe,!1),t.eachMapping=(I,Z)=>{const L=t.decodedMappings(I),{names:H,resolvedSources:F}=I;for(let J=0;J{const{sources:L,resolvedSources:H,sourcesContent:F}=I;if(F==null)return null;let J=L.indexOf(Z);return J===-1&&(J=H.indexOf(Z)),J===-1?null:F[J]},t.presortedDecodedMap=(I,Z)=>{const L=new Ie(Re(I,[]),Z);return L._decoded=I.mappings,L},t.decodedMap=I=>Re(I,t.decodedMappings(I)),t.encodedMap=I=>Re(I,t.encodedMappings(I));function A(I,Z,L,H,F,J){if(L--,L<0)throw new Error(ue);if(H<0)throw new Error(me);const{sources:xe,resolvedSources:ae}=I;let Oe=xe.indexOf(Z);if(Oe===-1&&(Oe=ae.indexOf(Z)),Oe===-1)return J?[]:V(null,null);const Ee=(I._bySources||(I._bySources=U(t.decodedMappings(I),I._bySourceMemos=xe.map(R))))[Oe][L];if(Ee==null)return J?[]:V(null,null);const Be=I._bySourceMemos[Oe];if(J)return B(Ee,Be,L,H,F);const Je=j(Ee,Be,L,H,F);if(Je===-1)return V(null,null);const ht=Ee[Je];return V(ht[O]+1,ht[k])}})();function Re(A,I){return{version:A.version,file:A.file,names:A.names,sourceRoot:A.sourceRoot,sources:A.sources,sourcesContent:A.sourcesContent,mappings:I}}function E(A,I,Z,L){return{source:A,line:I,column:Z,name:L}}function V(A,I){return{line:A,column:I}}function j(A,I,Z,L,H){let F=W(A,L,I,Z);return v?F=(H===be?x:C)(A,L,F):H===be&&F++,F===-1||F===A.length?-1:F}function B(A,I,Z,L,H){let F=j(A,I,Z,L,Qe);if(!v&&H===be&&F++,F===-1||F===A.length)return[];const J=v?L:A[F][h];v||(F=C(A,J,F));const xe=x(A,J,F),ae=[];for(;F<=xe;F++){const Oe=A[F];ae.push(V(Oe[O]+1,Oe[k]))}return ae}t.AnyMap=re,t.GREATEST_LOWER_BOUND=Qe,t.LEAST_UPPER_BOUND=be,t.TraceMap=Ie,Object.defineProperty(t,"__esModule",{value:!0})})}(Hr,Hr.exports)),Hr.exports}(function(n,e){(function(t,i){i(e,$$(),T$(),I$())})(Yt,function(t,i,s,r){t.addSegment=void 0,t.addMapping=void 0,t.maybeAddSegment=void 0,t.maybeAddMapping=void 0,t.setSourceContent=void 0,t.toDecodedMap=void 0,t.toEncodedMap=void 0,t.fromMap=void 0,t.allMappings=void 0;let p;class m{constructor({file:x,sourceRoot:C}={}){this._names=new i.SetArray,this._sources=new i.SetArray,this._sourcesContent=[],this._mappings=[],this.file=x,this.sourceRoot=C}}t.addSegment=($,x,C,R,W,U,Y,ce)=>p(!1,$,x,C,R,W,U,Y,ce),t.maybeAddSegment=($,x,C,R,W,U,Y,ce)=>p(!0,$,x,C,R,W,U,Y,ce),t.addMapping=($,x)=>v(!1,$,x),t.maybeAddMapping=($,x)=>v(!0,$,x),t.setSourceContent=($,x,C)=>{const{_sources:R,_sourcesContent:W}=$;W[i.put(R,x)]=C},t.toDecodedMap=$=>{const{file:x,sourceRoot:C,_mappings:R,_sources:W,_sourcesContent:U,_names:Y}=$;return S(R),{version:3,file:x||void 0,names:Y.array,sourceRoot:C||void 0,sources:W.array,sourcesContent:U,mappings:R}},t.toEncodedMap=$=>{const x=t.toDecodedMap($);return Object.assign(Object.assign({},x),{mappings:s.encode(x.mappings)})},t.allMappings=$=>{const x=[],{_mappings:C,_sources:R,_names:W}=$;for(let U=0;U{const x=new r.TraceMap($),C=new m({file:x.file,sourceRoot:x.sourceRoot});return P(C._names,x.names),P(C._sources,x.sources),C._sourcesContent=x.sourcesContent||x.sources.map(()=>null),C._mappings=r.decodedMappings(x),C},p=($,x,C,R,W,U,Y,ce,re)=>{const{_mappings:pe,_sources:he,_sourcesContent:de,_names:ie}=x,ue=O(pe,C),me=k(ue,R);if(!W)return $&&Q(ue,me)?void 0:y(ue,me,[R]);const be=i.put(he,W),Qe=ce?i.put(ie,ce):-1;if(be===de.length&&(de[be]=re??null),!($&&_(ue,me,be,U,Y,Qe)))return y(ue,me,ce?[R,be,U,Y,Qe]:[R,be,U,Y])};function O($,x){for(let C=$.length;C<=x;C++)$[C]=[];return $[x]}function k($,x){let C=$.length;for(let R=C-1;R>=0;C=R--){const W=$[R];if(x>=W[0])break}return C}function y($,x,C){for(let R=$.length;R>x;R--)$[R]=$[R-1];$[x]=C}function S($){const{length:x}=$;let C=x;for(let R=C-1;R>=0&&!($[R].length>0);C=R,R--);C obj[importedName]}); } `,createStarExport:` function createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); } `,nullishCoalesce:` function nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } `,asyncNullishCoalesce:` async function asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } `,optionalChain:` function optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } `,asyncOptionalChain:` async function asyncOptionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = await fn(value); } else if (op === 'call' || op === 'optionalCall') { value = await fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } `,optionalChainDelete:` function optionalChainDelete(ops) { const result = OPTIONAL_CHAIN_NAME(ops); return result == null ? true : result; } `,asyncOptionalChainDelete:` async function asyncOptionalChainDelete(ops) { const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops); return result == null ? true : result; } `};class Ho{__init(){this.helperNames={}}__init2(){this.createRequireName=null}constructor(e){this.nameManager=e,Ho.prototype.__init.call(this),Ho.prototype.__init2.call(this)}getHelperName(e){let t=this.helperNames[e];return t||(t=this.nameManager.claimFreeName(`_${e}`),this.helperNames[e]=t,t)}emitHelpers(){let e="";this.helperNames.optionalChainDelete&&this.getHelperName("optionalChain"),this.helperNames.asyncOptionalChainDelete&&this.getHelperName("asyncOptionalChain");for(const[t,i]of Object.entries(E$)){const s=this.helperNames[t];let r=i;t==="optionalChainDelete"?r=r.replace("OPTIONAL_CHAIN_NAME",this.helperNames.optionalChain):t==="asyncOptionalChainDelete"?r=r.replace("ASYNC_OPTIONAL_CHAIN_NAME",this.helperNames.asyncOptionalChain):t==="require"&&(this.createRequireName===null&&(this.createRequireName=this.nameManager.claimFreeName("_createRequire")),r=r.replace(/CREATE_REQUIRE_NAME/g,this.createRequireName)),s&&(e+=" ",e+=r.replace(t,s).replace(/\s+/g," ").trim())}return e}}function Td(n,e,t){Z$(n,t)&&M$(n,e,t)}function Z$(n,e){for(const t of n.tokens)if(t.type===l.name&&K_(t)&&e.has(n.identifierNameForToken(t)))return!0;return!1}function M$(n,e,t){const i=[];let s=e.length-1;for(let r=n.tokens.length-1;;r--){for(;i.length>0&&i[i.length-1].startTokenIndex===r+1;)i.pop();for(;s>=0&&e[s].endTokenIndex===r+1;)i.push(e[s]),s--;if(r<0)break;const o=n.tokens[r],a=n.identifierNameForToken(o);if(i.length>1&&o.type===l.name&&t.has(a)){if(e$(o))Cd(i[i.length-1],n,a);else if(t$(o)){let c=i.length-1;for(;c>0&&!i[c].isFunctionScope;)c--;if(c<0)throw new Error("Did not find parent function scope.");Cd(i[c],n,a)}}}if(i.length>0)throw new Error("Expected empty scope stack after processing file.")}function Cd(n,e,t){for(let i=n.startTokenIndex;i=r._score)&&(r=c)}r&&r._score>0&&((t=this._propNames).push.apply(t,r._propNames),(i=this._messages).push.apply(i,r._messages))},n.prototype.getError=function(e){for(var t=[],i=this._propNames.length-1;i>=0;i--){var s=this._propNames[i];e+=typeof s=="number"?"["+s+"]":s?"."+s:"";var r=this._messages[i];r&&t.push(e+" "+r)}return new c0(e,t.join("; "))},n.prototype.getErrorDetail=function(e){for(var t=[],i=this._propNames.length-1;i>=0;i--){var s=this._propNames[i];e+=typeof s=="number"?"["+s+"]":s?"."+s:"";var r=this._messages[i];r&&t.push({path:e,message:r})}for(var o=null,i=t.length-1;i>=0;i--)o&&(t[i].nested=[o]),o=t[i];return o},n}();xn.DetailContext=h0;var V$=function(){function n(){this.contexts=[]}return n.prototype.createContext=function(){var e=new h0;return this.contexts.push(e),e},n}();(function(n){var e=Yt&&Yt.__extends||function(){var E=function(V,j){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(B,A){B.__proto__=A}||function(B,A){for(var I in A)A.hasOwnProperty(I)&&(B[I]=A[I])},E(V,j)};return function(V,j){E(V,j);function B(){this.constructor=V}V.prototype=j===null?Object.create(j):(B.prototype=j.prototype,new B)}}();Object.defineProperty(n,"__esModule",{value:!0}),n.basicTypes=n.BasicType=n.TParamList=n.TParam=n.param=n.TFunc=n.func=n.TProp=n.TOptional=n.opt=n.TIface=n.iface=n.TEnumLiteral=n.enumlit=n.TEnumType=n.enumtype=n.TIntersection=n.intersection=n.TUnion=n.union=n.TTuple=n.tuple=n.TArray=n.array=n.TLiteral=n.lit=n.TName=n.name=n.TType=void 0;var t=xn,i=function(){function E(){}return E}();n.TType=i;function s(E){return typeof E=="string"?o(E):E}function r(E,V){var j=E[V];if(!j)throw new Error("Unknown type "+V);return j}function o(E){return new a(E)}n.name=o;var a=function(E){e(V,E);function V(j){var B=E.call(this)||this;return B.name=j,B._failMsg="is not a "+j,B}return V.prototype.getChecker=function(j,B,A){var I=this,Z=r(j,this.name),L=Z.getChecker(j,B,A);return Z instanceof ie||Z instanceof V?L:function(H,F){return L(H,F)?!0:F.fail(null,I._failMsg,0)}},V}(i);n.TName=a;function c(E){return new h(E)}n.lit=c;var h=function(E){e(V,E);function V(j){var B=E.call(this)||this;return B.value=j,B.name=JSON.stringify(j),B._failMsg="is not "+B.name,B}return V.prototype.getChecker=function(j,B){var A=this;return function(I,Z){return I===A.value?!0:Z.fail(null,A._failMsg,-1)}},V}(i);n.TLiteral=h;function u(E){return new f(s(E))}n.array=u;var f=function(E){e(V,E);function V(j){var B=E.call(this)||this;return B.ttype=j,B}return V.prototype.getChecker=function(j,B){var A=this.ttype.getChecker(j,B);return function(I,Z){if(!Array.isArray(I))return Z.fail(null,"is not an array",0);for(var L=0;L0&&A.push(I+" more"),B._failMsg="is none of "+A.join(", ")):B._failMsg="is none of "+I+" types",B}return V.prototype.getChecker=function(j,B){var A=this,I=this.ttypes.map(function(Z){return Z.getChecker(j,B)});return function(Z,L){for(var H=L.unionResolver(),F=0;F0&&!d.error;)g(l.braceL)||g(l.bracketL)?n++:(g(l.braceR)||g(l.bracketR))&&n--,N();return!0}return!1}function ST(){const n=d.snapshot(),e=kT();return d.restoreFromSnapshot(n),e}function kT(){return N(),!!(g(l.parenR)||g(l.ellipsis)||yT()&&(g(l.colon)||g(l.comma)||g(l.question)||g(l.eq)||g(l.parenR)&&(N(),g(l.arrow))))}function cr(n){const e=Se(0);D(n),xT()||Ue(),ke(e)}function bT(){g(l.colon)&&cr(l.colon)}function ys(){g(l.colon)&&Qr()}function wT(){X(l.colon)&&Ue()}function xT(){const n=d.snapshot();return ne(w._asserts)?(N(),nt(w._is)?(Ue(),!0):fh()||g(l._this)?(N(),nt(w._is)&&Ue(),!0):(d.restoreFromSnapshot(n),!1)):fh()||g(l._this)?(N(),ne(w._is)&&!Dt()?(N(),Ue(),!0):(d.restoreFromSnapshot(n),!1)):!1}function Qr(){const n=Se(0);D(l.colon),Ue(),ke(n)}function Ue(){if(Xd(),d.inDisallowConditionalTypesContext||Dt()||!X(l._extends))return;const n=d.inDisallowConditionalTypesContext;d.inDisallowConditionalTypesContext=!0,Xd(),d.inDisallowConditionalTypesContext=n,D(l.question),Ue(),D(l.colon),Ue()}function vT(){return ne(w._abstract)&&je()===l._new}function Xd(){if(gT()){tc(Kn.TSFunctionType);return}if(g(l._new)){tc(Kn.TSConstructorType);return}else if(vT()){tc(Kn.TSAbstractConstructorType);return}OT()}function QT(){const n=Se(1);Ue(),D(l.greaterThan),ke(n),Pr()}function PT(){if(X(l.jsxTagStart)){d.tokens[d.tokens.length-1].type=l.typeParameterStart;const n=Se(1);for(;!g(l.greaterThan)&&!d.error;)Ue(),X(l.comma);Bt(),ke(n)}}function S0(){for(;!g(l.braceL)&&!d.error;)_T(),X(l.comma)}function _T(){vr(),g(l.lessThan)&&Ss()}function $T(){hi(!1),Ai(),X(l._extends)&&S0(),y0()}function TT(){hi(!1),Ai(),D(l.eq),Ue(),qe()}function CT(){if(g(l.string)?ds():fe(),X(l.eq)){const n=d.tokens.length-1;lt(),d.tokens[n].rhsEndIndex=d.tokens.length}}function gu(){for(hi(!1),D(l.braceL);!X(l.braceR)&&!d.error;)CT(),X(l.comma)}function yu(){D(l.braceL),Xa(l.braceR)}function ph(){hi(!1),X(l.dot)?ph():yu()}function k0(){ne(w._global)?fe():g(l.string)?Dn():ye(),g(l.braceL)?yu():qe()}function mh(){Jo(),D(l.eq),IT(),qe()}function AT(){return ne(w._require)&&je()===l.parenL}function IT(){AT()?RT():vr()}function RT(){tt(w._require),D(l.parenL),g(l.string)||ye(),ds(),D(l.parenR)}function XT(){if(yn())return!1;switch(d.type){case l._function:{const n=Se(1);N();const e=d.start;return _i(e,!0),ke(n),!0}case l._class:{const n=Se(1);return $i(!0,!1),ke(n),!0}case l._const:if(g(l._const)&&hu(w._enum)){const n=Se(1);return D(l._const),tt(w._enum),d.tokens[d.tokens.length-1].type=l._enum,gu(),ke(n),!0}case l._var:case l._let:{const n=Se(1);return bh(d.type!==l._var),ke(n),!0}case l.name:{const n=Se(1),e=d.contextualKeyword;let t=!1;return e===w._global?(k0(),t=!0):t=Aa(e,!0),ke(n),t}default:return!1}}function Ed(){return Aa(d.contextualKeyword,!0)}function ET(n){switch(n){case w._declare:{const e=d.tokens.length-1;if(XT())return d.tokens[e].type=l._declare,!0;break}case w._global:if(g(l.braceL))return yu(),!0;break;default:return Aa(n,!1)}return!1}function Aa(n,e){switch(n){case w._abstract:if(Ni(e)&&g(l._class))return d.tokens[d.tokens.length-1].type=l._abstract,$i(!0,!1),!0;break;case w._enum:if(Ni(e)&&g(l.name))return d.tokens[d.tokens.length-1].type=l._enum,gu(),!0;break;case w._interface:if(Ni(e)&&g(l.name)){const t=Se(e?2:1);return $T(),ke(t),!0}break;case w._module:if(Ni(e)){if(g(l.string)){const t=Se(e?2:1);return k0(),ke(t),!0}else if(g(l.name)){const t=Se(e?2:1);return ph(),ke(t),!0}}break;case w._namespace:if(Ni(e)&&g(l.name)){const t=Se(e?2:1);return ph(),ke(t),!0}break;case w._type:if(Ni(e)&&g(l.name)){const t=Se(e?2:1);return TT(),ke(t),!0}break}return!1}function Ni(n){return n?(N(),!0):!yn()}function ZT(){const n=d.snapshot();return Ca(),ks(),bT(),D(l.arrow),d.error?(d.restoreFromSnapshot(n),!1):(_r(!0),!0)}function Su(){d.type===l.bitShiftL&&(d.pos-=1,ge(l.lessThan)),Ss()}function Ss(){const n=Se(0);for(D(l.lessThan);!X(l.greaterThan)&&!d.error;)Ue(),X(l.comma);ke(n)}function b0(){if(g(l.name))switch(d.contextualKeyword){case w._abstract:case w._declare:case w._enum:case w._interface:case w._module:case w._namespace:case w._type:return!0}return!1}function MT(n,e){if(g(l.colon)&&cr(l.colon),!g(l.braceL)&&yn()){let t=d.tokens.length-1;for(;t>=0&&(d.tokens[t].start>=n||d.tokens[t].type===l._default||d.tokens[t].type===l._export);)d.tokens[t].isType=!0,t--;return}_r(!1,e)}function DT(n,e,t){if(!Dt()&&X(l.bang)){d.tokens[d.tokens.length-1].type=l.nonNullAssertion;return}if(g(l.lessThan)||g(l.bitShiftL)){const i=d.snapshot();if(!e&&T0()&&ZT())return;if(Su(),!e&&X(l.parenL)?(d.tokens[d.tokens.length-1].subscriptStartIndex=n,ei()):g(l.backQuote)?vu():(d.type===l.greaterThan||d.type!==l.parenL&&d.type&l.IS_EXPRESSION_START&&!Dt())&&ye(),d.error)d.restoreFromSnapshot(i);else return}else!e&&g(l.questionDot)&&je()===l.lessThan&&(N(),d.tokens[n].isOptionalChainStart=!0,d.tokens[d.tokens.length-1].subscriptStartIndex=n,Ss(),D(l.parenL),ei());bu(n,e,t)}function NT(){if(X(l._import))return ne(w._type)&&je()!==l.eq&&tt(w._type),mh(),!0;if(X(l.eq))return at(),qe(),!0;if(nt(w._as))return tt(w._namespace),fe(),qe(),!0;if(ne(w._type)){const n=je();(n===l.braceL||n===l.star)&&N()}return!1}function qT(){if(fe(),g(l.comma)||g(l.braceR)){d.tokens[d.tokens.length-1].identifierRole=oe.ImportDeclaration;return}if(fe(),g(l.comma)||g(l.braceR)){d.tokens[d.tokens.length-1].identifierRole=oe.ImportDeclaration,d.tokens[d.tokens.length-2].isType=!0,d.tokens[d.tokens.length-1].isType=!0;return}if(fe(),g(l.comma)||g(l.braceR)){d.tokens[d.tokens.length-3].identifierRole=oe.ImportAccess,d.tokens[d.tokens.length-1].identifierRole=oe.ImportDeclaration;return}fe(),d.tokens[d.tokens.length-3].identifierRole=oe.ImportAccess,d.tokens[d.tokens.length-1].identifierRole=oe.ImportDeclaration,d.tokens[d.tokens.length-4].isType=!0,d.tokens[d.tokens.length-3].isType=!0,d.tokens[d.tokens.length-2].isType=!0,d.tokens[d.tokens.length-1].isType=!0}function VT(){if(fe(),g(l.comma)||g(l.braceR)){d.tokens[d.tokens.length-1].identifierRole=oe.ExportAccess;return}if(fe(),g(l.comma)||g(l.braceR)){d.tokens[d.tokens.length-1].identifierRole=oe.ExportAccess,d.tokens[d.tokens.length-2].isType=!0,d.tokens[d.tokens.length-1].isType=!0;return}if(fe(),g(l.comma)||g(l.braceR)){d.tokens[d.tokens.length-3].identifierRole=oe.ExportAccess;return}fe(),d.tokens[d.tokens.length-3].identifierRole=oe.ExportAccess,d.tokens[d.tokens.length-4].isType=!0,d.tokens[d.tokens.length-3].isType=!0,d.tokens[d.tokens.length-2].isType=!0,d.tokens[d.tokens.length-1].isType=!0}function LT(){if(ne(w._abstract)&&je()===l._class)return d.type=l._abstract,N(),$i(!0,!0),!0;if(ne(w._interface)){const n=Se(2);return Aa(w._interface,!0),ke(n),!0}return!1}function WT(){if(d.type===l._const){const n=xr();if(n.type===l.name&&n.contextualKeyword===w._enum)return D(l._const),tt(w._enum),d.tokens[d.tokens.length-1].type=l._enum,gu(),!0}return!1}function jT(n){const e=d.tokens.length;mu([w._abstract,w._readonly,w._declare,w._static,w._override]);const t=d.tokens.length;if(g0()){const s=n?e-1:e;for(let r=s;r=z.length){ye("Unterminated JSX contents");return}const t=z.charCodeAt(d.pos);if(t===T.lessThan||t===T.leftCurlyBrace){if(d.pos===d.start){if(t===T.lessThan){d.pos++,ge(l.jsxTagStart);return}i0(t);return}ge(n&&!e?l.jsxEmptyText:l.jsxText);return}t===T.lineFeed?n=!0:t!==T.space&&t!==T.carriageReturn&&t!==T.tab&&(e=!0),d.pos++}}function rC(n){for(d.pos++;;){if(d.pos>=z.length){ye("Unterminated string constant");return}if(z.charCodeAt(d.pos)===n){d.pos++;break}d.pos++}ge(l.string)}function oC(){let n;do{if(d.pos>z.length){ye("Unexpectedly reached the end of input.");return}n=z.charCodeAt(++d.pos)}while(nn[n]||n===T.dash);ge(l.jsxName)}function Oh(){Bt()}function w0(n){if(Oh(),!X(l.colon)){d.tokens[d.tokens.length-1].identifierRole=n;return}Oh()}function x0(){const n=d.tokens.length;w0(oe.Access);let e=!1;for(;g(l.dot);)e=!0,Bt(),Oh();if(!e){const t=d.tokens[n],i=z.charCodeAt(t.start);i>=T.lowercaseA&&i<=T.lowercaseZ&&(t.identifierRole=null)}}function aC(){switch(d.type){case l.braceL:N(),at(),Bt();return;case l.jsxTagStart:Q0(),Bt();return;case l.string:Bt();return;default:ye("JSX value should be either an expression or a quoted JSX text")}}function lC(){D(l.ellipsis),at()}function cC(n){if(g(l.jsxTagEnd))return!1;x0(),Pe&&PT();let e=!1;for(;!g(l.slash)&&!g(l.jsxTagEnd)&&!d.error;){if(X(l.braceL)){e=!0,D(l.ellipsis),lt(),Bt();continue}e&&d.end-d.start===3&&z.charCodeAt(d.start)===T.lowercaseK&&z.charCodeAt(d.start+1)===T.lowercaseE&&z.charCodeAt(d.start+2)===T.lowercaseY&&(d.tokens[n].jsxRole=tn.KeyAfterPropSpread),w0(oe.ObjectKey),g(l.eq)&&(Bt(),aC())}const t=g(l.slash);return t&&Bt(),t}function hC(){g(l.jsxTagEnd)||x0()}function v0(){const n=d.tokens.length-1;d.tokens[n].jsxRole=tn.NoChildren;let e=0;if(!cC(n))for(qi();;)switch(d.type){case l.jsxTagStart:if(Bt(),g(l.slash)){Bt(),hC(),d.tokens[n].jsxRole!==tn.KeyAfterPropSpread&&(e===1?d.tokens[n].jsxRole=tn.OneChild:e>1&&(d.tokens[n].jsxRole=tn.StaticChildren));return}e++,v0(),qi();break;case l.jsxText:e++,qi();break;case l.jsxEmptyText:qi();break;case l.braceL:N(),g(l.ellipsis)?(lC(),qi(),e+=2):(g(l.braceR)||(e++,at()),qi());break;default:ye();return}}function Q0(){Bt(),v0()}function Bt(){d.tokens.push(new $a),t0(),d.start=d.pos;const n=z.charCodeAt(d.pos);if(wr[n])oC();else if(n===T.quotationMark||n===T.apostrophe)rC(n);else switch(++d.pos,n){case T.greaterThan:ge(l.jsxTagEnd);break;case T.lessThan:ge(l.jsxTagStart);break;case T.slash:ge(l.slash);break;case T.equalsTo:ge(l.eq);break;case T.leftCurlyBrace:ge(l.braceL);break;case T.dot:ge(l.dot);break;case T.colon:ge(l.colon);break;default:ye()}}function qi(){d.tokens.push(new $a),d.start=d.pos,sC()}function uC(n){if(g(l.question)){const e=je();if(e===l.colon||e===l.comma||e===l.parenR)return}P0(n)}function fC(){Gg(l.question),g(l.colon)&&(Pe?Qr():Te&&Ii())}class dC{constructor(e){this.stop=e}}function at(n=!1){if(lt(n),g(l.comma))for(;X(l.comma);)lt(n)}function lt(n=!1,e=!1){return Pe?JT(n,e):Te?y2(n,e):vn(n,e)}function vn(n,e){if(g(l._yield))return TC(),!1;(g(l.parenL)||g(l.name)||g(l._yield))&&(d.potentialArrowAt=d.start);const t=pC(n);return e&&xu(),d.type&l.IS_ASSIGN?(N(),lt(n),!1):t}function pC(n){return OC(n)?!0:(mC(n),!1)}function mC(n){Pe||Te?uC(n):P0(n)}function P0(n){X(l.question)&&(lt(),D(l.colon),lt(n))}function OC(n){const e=d.tokens.length;return Pr()?!0:(Oo(e,-1,n),!1)}function Oo(n,e,t){if(Pe&&(l._in&l.PRECEDENCE_MASK)>e&&!Dt()&&(nt(w._as)||nt(w._satisfies))){const s=Se(1);Ue(),ke(s),p$(),Oo(n,e,t);return}const i=d.type&l.PRECEDENCE_MASK;if(i>0&&(!t||!g(l._in))&&i>e){const s=d.type;N(),s===l.nullishCoalescing&&(d.tokens[d.tokens.length-1].nullishStartIndex=n);const r=d.tokens.length;Pr(),Oo(r,s&l.IS_RIGHT_ASSOCIATIVE?i-1:i,t),s===l.nullishCoalescing&&(d.tokens[n].numNullishCoalesceStarts++,d.tokens[d.tokens.length-1].numNullishCoalesceEnds++),Oo(n,e,t)}}function Pr(){if(Pe&&!_a&&X(l.lessThan))return QT(),!1;if(ne(w._module)&&Jg()===T.leftCurlyBrace&&!Ug())return CC(),!1;if(d.type&l.IS_PREFIX)return N(),Pr(),!1;if(_0())return!0;for(;d.type&l.IS_POSTFIX&&!Mt();)d.type===l.preIncDec&&(d.type=l.postIncDec),N();return!1}function _0(){const n=d.tokens.length;return Dn()?!0:(ku(n),d.tokens.length>n&&d.tokens[n].isOptionalChainStart&&(d.tokens[d.tokens.length-1].isOptionalChainEnd=!0),!1)}function ku(n,e=!1){Te?k2(n,e):$0(n,e)}function $0(n,e=!1){const t=new dC(!1);do gC(n,e,t);while(!t.stop&&!d.error)}function gC(n,e,t){Pe?DT(n,e,t):Te?e2(n,e,t):bu(n,e,t)}function bu(n,e,t){if(!e&&X(l.doubleColon))wu(),t.stop=!0,ku(n,e);else if(g(l.questionDot)){if(d.tokens[n].isOptionalChainStart=!0,e&&je()===l.parenL){t.stop=!0;return}N(),d.tokens[d.tokens.length-1].subscriptStartIndex=n,X(l.bracketL)?(at(),D(l.bracketR)):X(l.parenL)?ei():ta()}else if(X(l.dot))d.tokens[d.tokens.length-1].subscriptStartIndex=n,ta();else if(X(l.bracketL))d.tokens[d.tokens.length-1].subscriptStartIndex=n,at(),D(l.bracketR);else if(!e&&g(l.parenL))if(T0()){const i=d.snapshot(),s=d.tokens.length;N(),d.tokens[d.tokens.length-1].subscriptStartIndex=n;const r=ar();d.tokens[d.tokens.length-1].contextId=r,ei(),d.tokens[d.tokens.length-1].contextId=r,yC()&&(d.restoreFromSnapshot(i),t.stop=!0,d.scopeDepth++,ks(),SC(s))}else{N(),d.tokens[d.tokens.length-1].subscriptStartIndex=n;const i=ar();d.tokens[d.tokens.length-1].contextId=i,ei(),d.tokens[d.tokens.length-1].contextId=i}else g(l.backQuote)?vu():t.stop=!0}function T0(){return d.tokens[d.tokens.length-1].contextualKeyword===w._async&&!Mt()}function ei(){let n=!0;for(;!X(l.parenR)&&!d.error;){if(n)n=!1;else if(D(l.comma),X(l.parenR))break;R0(!1)}}function yC(){return g(l.colon)||g(l.arrow)}function SC(n){Pe?HT():Te&&g2(),D(l.arrow),ur(n)}function wu(){const n=d.tokens.length;Dn(),ku(n,!0)}function Dn(){if(X(l.modulo))return fe(),!1;if(g(l.jsxText)||g(l.jsxEmptyText))return ds(),!1;if(g(l.lessThan)&&_a)return d.type=l.jsxTagStart,Q0(),N(),!1;const n=d.potentialArrowAt===d.start;switch(d.type){case l.slash:case l.assign:i$();case l._super:case l._this:case l.regexp:case l.num:case l.bigint:case l.decimal:case l.string:case l._null:case l._true:case l._false:return N(),!1;case l._import:return N(),g(l.dot)&&(d.tokens[d.tokens.length-1].type=l.name,N(),fe()),!1;case l.name:{const e=d.tokens.length,t=d.start,i=d.contextualKeyword;return fe(),i===w._await?($C(),!1):i===w._async&&g(l._function)&&!Mt()?(N(),_i(t,!1),!1):n&&i===w._async&&!Mt()&&g(l.name)?(d.scopeDepth++,hi(!1),D(l.arrow),ur(e),!0):g(l._do)&&!Mt()?(N(),ti(),!1):n&&!Mt()&&g(l.arrow)?(d.scopeDepth++,du(!1),D(l.arrow),ur(e),!0):(d.tokens[d.tokens.length-1].identifierRole=oe.Access,!1)}case l._do:return N(),ti(),!1;case l.parenL:return C0(n);case l.bracketL:return N(),I0(l.bracketR,!0),!1;case l.braceL:return Qu(!1,!1),!1;case l._function:return kC(),!1;case l.at:Xu();case l._class:return $i(!1),!1;case l._new:return wC(),!1;case l.backQuote:return vu(),!1;case l.doubleColon:return N(),wu(),!1;case l.hash:{const e=Jg();return wr[e]||e===T.backslash?ta():N(),!1}default:return ye(),!1}}function ta(){X(l.hash),fe()}function kC(){const n=d.start;fe(),X(l.dot)&&fe(),_i(n,!1)}function ds(){N()}function Ia(){D(l.parenL),at(),D(l.parenR)}function C0(n){const e=d.snapshot(),t=d.tokens.length;D(l.parenL);let i=!0;for(;!g(l.parenR)&&!d.error;){if(i)i=!1;else if(D(l.comma),g(l.parenR))break;if(g(l.ellipsis)){f0(!1),xu();break}else lt(!1,!0)}return D(l.parenR),n&&bC()&&gh()?(d.restoreFromSnapshot(e),d.scopeDepth++,ks(),gh(),ur(t),d.error?(d.restoreFromSnapshot(e),C0(!1),!1):!0):!1}function bC(){return g(l.colon)||!Mt()}function gh(){return Pe?tC():Te?S2():X(l.arrow)}function xu(){(Pe||Te)&&fC()}function wC(){if(D(l._new),X(l.dot)){fe();return}xC(),Te&&t2(),X(l.parenL)&&I0(l.parenR)}function xC(){wu(),X(l.questionDot)}function vu(){for(Gn(),Gn();!g(l.backQuote)&&!d.error;)D(l.dollarBraceL),at(),Gn(),Gn();N()}function Qu(n,e){const t=ar();let i=!0;for(N(),d.tokens[d.tokens.length-1].contextId=t;!X(l.braceR)&&!d.error;){if(i)i=!1;else if(D(l.comma),X(l.braceR))break;let s=!1;if(g(l.ellipsis)){const r=d.tokens.length;if(u0(),n&&(d.tokens.length===r+2&&du(e),X(l.braceR)))break;continue}n||(s=X(l.star)),!n&&ne(w._async)?(s&&ye(),fe(),g(l.colon)||g(l.parenL)||g(l.braceR)||g(l.eq)||g(l.comma)||(g(l.star)&&(N(),s=!0),hr(t))):hr(t),_C(n,e,t)}d.tokens[d.tokens.length-1].contextId=t}function vC(n){return!n&&(g(l.string)||g(l.num)||g(l.bracketL)||g(l.name)||!!(d.type&l.IS_KEYWORD))}function QC(n,e){const t=d.start;return g(l.parenL)?(n&&ye(),yh(t,!1),!0):vC(n)?(hr(e),yh(t,!1),!0):!1}function PC(n,e){if(X(l.colon)){n?Ko(e):lt(!1);return}let t;n?d.scopeDepth===0?t=oe.ObjectShorthandTopLevelDeclaration:e?t=oe.ObjectShorthandBlockScopedDeclaration:t=oe.ObjectShorthandFunctionScopedDeclaration:t=oe.ObjectShorthand,d.tokens[d.tokens.length-1].identifierRole=t,Ko(e,!0)}function _C(n,e,t){Pe?FT():Te&&u2(),QC(n,t)||PC(n,e)}function hr(n){Te&&Ru(),X(l.bracketL)?(d.tokens[d.tokens.length-1].contextId=n,lt(),D(l.bracketR),d.tokens[d.tokens.length-1].contextId=n):(g(l.num)||g(l.string)||g(l.bigint)||g(l.decimal)?Dn():ta(),d.tokens[d.tokens.length-1].identifierRole=oe.ObjectKey,d.tokens[d.tokens.length-1].contextId=n)}function yh(n,e){const t=ar();d.scopeDepth++;const i=d.tokens.length;ks(e,t),A0(n,t);const r=d.tokens.length;d.scopes.push(new Qn(i,r,!0)),d.scopeDepth--}function ur(n){_r(!0);const e=d.tokens.length;d.scopes.push(new Qn(n,e,!0)),d.scopeDepth--}function A0(n,e=0){Pe?MT(n,e):Te?KC(e):_r(!1,e)}function _r(n,e=0){n&&!g(l.braceL)?lt():ti(!0,e)}function I0(n,e=!1){let t=!0;for(;!X(n)&&!d.error;){if(t)t=!1;else if(D(l.comma),X(n))break;R0(e)}}function R0(n){n&&g(l.comma)||(g(l.ellipsis)?(u0(),xu()):g(l.question)?N():lt(!1,!0))}function fe(){N(),d.tokens[d.tokens.length-1].type=l.name}function $C(){Pr()}function TC(){N(),!g(l.semi)&&!Mt()&&(X(l.star),lt())}function CC(){tt(w._module),D(l.braceL),Xa(l.braceR)}function AC(n){return(n.type===l.name||!!(n.type&l.IS_KEYWORD))&&n.contextualKeyword!==w._from}function Pn(n){const e=Se(0);D(n||l.colon),Tt(),ke(e)}function Zd(){D(l.modulo),tt(w._checks),X(l.parenL)&&(at(),D(l.parenR))}function Pu(){const n=Se(0);D(l.colon),g(l.modulo)?Zd():(Tt(),g(l.modulo)&&Zd()),ke(n)}function IC(){N(),_u(!0)}function RC(){N(),fe(),g(l.lessThan)&&on(),D(l.parenL),kh(),D(l.parenR),Pu(),qe()}function Sh(){g(l._class)?IC():g(l._function)?RC():g(l._var)?XC():nt(w._module)?X(l.dot)?MC():EC():ne(w._type)?DC():ne(w._opaque)?NC():ne(w._interface)?qC():g(l._export)?ZC():ye()}function XC(){N(),M0(),qe()}function EC(){for(g(l.string)?Dn():fe(),D(l.braceL);!g(l.braceR)&&!d.error;)g(l._import)?(N(),B0()):ye();D(l.braceR)}function ZC(){D(l._export),X(l._default)?g(l._function)||g(l._class)?Sh():(Tt(),qe()):g(l._var)||g(l._function)||g(l._class)||ne(w._opaque)?Sh():g(l.star)||g(l.braceL)||ne(w._interface)||ne(w._type)||ne(w._opaque)?j0():ye()}function MC(){tt(w._exports),Ii(),qe()}function DC(){N(),Tu()}function NC(){N(),Cu(!0)}function qC(){N(),_u()}function _u(n=!1){if(Ra(),g(l.lessThan)&&on(),X(l._extends))do go();while(!n&&X(l.comma));if(ne(w._mixins)){N();do go();while(X(l.comma))}if(ne(w._implements)){N();do go();while(X(l.comma))}na(n,!1,n)}function go(){X0(!1),g(l.lessThan)&&Pi()}function $u(){_u()}function Ra(){fe()}function Tu(){Ra(),g(l.lessThan)&&on(),Pn(l.eq),qe()}function Cu(n){tt(w._type),Ra(),g(l.lessThan)&&on(),g(l.colon)&&Pn(l.colon),n||Pn(l.eq),qe()}function VC(){Ru(),M0(),X(l.eq)&&Tt()}function on(){const n=Se(0);g(l.lessThan)||g(l.typeParameterStart)?N():ye();do VC(),g(l.greaterThan)||D(l.comma);while(!g(l.greaterThan)&&!d.error);D(l.greaterThan),ke(n)}function Pi(){const n=Se(0);for(D(l.lessThan);!g(l.greaterThan)&&!d.error;)Tt(),g(l.greaterThan)||D(l.comma);D(l.greaterThan),ke(n)}function LC(){if(tt(w._interface),X(l._extends))do go();while(X(l.comma));na(!1,!1,!1)}function Au(){g(l.num)||g(l.string)?Dn():fe()}function WC(){je()===l.colon?(Au(),Pn()):Tt(),D(l.bracketR),Pn()}function jC(){Au(),D(l.bracketR),D(l.bracketR),g(l.lessThan)||g(l.parenL)?Iu():(X(l.question),Pn())}function Iu(){for(g(l.lessThan)&&on(),D(l.parenL);!g(l.parenR)&&!g(l.ellipsis)&&!d.error;)ia(),g(l.parenR)||D(l.comma);X(l.ellipsis)&&ia(),D(l.parenR),Pn()}function UC(){Iu()}function na(n,e,t){let i;for(e&&g(l.braceBarL)?(D(l.braceBarL),i=l.braceBarR):(D(l.braceL),i=l.braceR);!g(i)&&!d.error;){if(t&&ne(w._proto)){const s=je();s!==l.colon&&s!==l.question&&(N(),n=!1)}if(n&&ne(w._static)){const s=je();s!==l.colon&&s!==l.question&&N()}if(Ru(),X(l.bracketL))X(l.bracketL)?jC():WC();else if(g(l.parenL)||g(l.lessThan))UC();else{if(ne(w._get)||ne(w._set)){const s=je();(s===l.name||s===l.string||s===l.num)&&N()}BC()}YC()}D(i)}function BC(){if(g(l.ellipsis)){if(D(l.ellipsis),X(l.comma)||X(l.semi),g(l.braceR))return;Tt()}else Au(),g(l.lessThan)||g(l.parenL)?Iu():(X(l.question),Pn())}function YC(){!X(l.semi)&&!X(l.comma)&&!g(l.braceR)&&!g(l.braceBarR)&&ye()}function X0(n){for(n||fe();X(l.dot);)fe()}function FC(){X0(!0),g(l.lessThan)&&Pi()}function zC(){D(l._typeof),E0()}function GC(){for(D(l.bracketL);d.pos0&&e0?this.tokens[this.tokenIndex-1].end:0,this.tokenIndex0&&this.tokenAtRelativeIndex(-1).type===l._delete?e.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName("asyncOptionalChainDelete"):this.resultCode+=this.helperManager.getHelperName("optionalChainDelete"):e.isAsyncOperation?this.resultCode+=this.helperManager.getHelperName("asyncOptionalChain"):this.resultCode+=this.helperManager.getHelperName("optionalChain"),this.resultCode+="([")}}appendTokenSuffix(){const e=this.currentToken();if(e.isOptionalChainEnd&&!this.disableESTransforms&&(this.resultCode+="])"),e.numNullishCoalesceEnds&&!this.disableESTransforms)for(let t=0;t ${t}require`);const i=this.tokens.currentToken().contextId;if(i==null)throw new Error("Expected context ID on dynamic import invocation.");for(this.tokens.copyToken();!this.tokens.matchesContextIdAndLabel(l.parenR,i);)this.rootTransformer.processToken();this.tokens.replaceToken(t?")))":"))");return}if(this.removeImportAndDetectIfType())this.tokens.removeToken();else{const t=this.tokens.stringValue();this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(t)),this.tokens.appendCode(this.importProcessor.claimImportCode(t))}Fi(this.tokens),this.tokens.matches1(l.semi)&&this.tokens.removeToken()}removeImportAndDetectIfType(){if(this.tokens.removeInitialToken(),this.tokens.matchesContextual(w._type)&&!this.tokens.matches1AtIndex(this.tokens.currentIndex()+1,l.comma)&&!this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+1,w._from))return this.removeRemainingImport(),!0;if(this.tokens.matches1(l.name)||this.tokens.matches1(l.star))return this.removeRemainingImport(),!1;if(this.tokens.matches1(l.string))return!1;let e=!1;for(;!this.tokens.matches1(l.string);)(!e&&this.tokens.matches1(l.braceL)||this.tokens.matches1(l.comma))&&(this.tokens.removeToken(),(this.tokens.matches2(l.name,l.comma)||this.tokens.matches2(l.name,l.braceR)||this.tokens.matches4(l.name,l.name,l.name,l.comma)||this.tokens.matches4(l.name,l.name,l.name,l.braceR))&&(e=!0)),this.tokens.removeToken();return!e}removeRemainingImport(){for(;!this.tokens.matches1(l.string);)this.tokens.removeToken()}processIdentifier(){const e=this.tokens.currentToken();if(e.shadowsGlobal)return!1;if(e.identifierRole===oe.ObjectShorthand)return this.processObjectShorthand();if(e.identifierRole!==oe.Access)return!1;const t=this.importProcessor.getIdentifierReplacement(this.tokens.identifierNameForToken(e));if(!t)return!1;let i=this.tokens.currentIndex()+1;for(;i=2&&this.tokens.matches1AtIndex(e-2,l.dot)||e>=2&&[l._var,l._let,l._const].includes(this.tokens.tokens[e-2].type))return!1;const i=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(t));return i?(this.tokens.copyToken(),this.tokens.appendCode(` ${i} =`),!0):!1}processComplexAssignment(){const e=this.tokens.currentIndex(),t=this.tokens.tokens[e-1];if(t.type!==l.name||t.shadowsGlobal||e>=2&&this.tokens.matches1AtIndex(e-2,l.dot))return!1;const i=this.importProcessor.resolveExportBinding(this.tokens.identifierNameForToken(t));return i?(this.tokens.appendCode(` = ${i}`),this.tokens.copyToken(),!0):!1}processPreIncDec(){const e=this.tokens.currentIndex(),t=this.tokens.tokens[e+1];if(t.type!==l.name||t.shadowsGlobal||e+2=1&&this.tokens.matches1AtIndex(e-1,l.dot))return!1;const s=this.tokens.identifierNameForToken(t),r=this.importProcessor.resolveExportBinding(s);if(!r)return!1;const o=this.tokens.rawCodeForToken(i),a=this.importProcessor.getIdentifierReplacement(s)||s;if(o==="++")this.tokens.replaceToken(`(${a} = ${r} = ${a} + 1, ${a} - 1)`);else if(o==="--")this.tokens.replaceToken(`(${a} = ${r} = ${a} - 1, ${a} + 1)`);else throw new Error(`Unexpected operator: ${o}`);return this.tokens.removeToken(),!0}processExportDefault(){if(this.tokens.matches4(l._export,l._default,l._function,l.name)||this.tokens.matches5(l._export,l._default,l.name,l._function,l.name)&&this.tokens.matchesContextualAtIndex(this.tokens.currentIndex()+2,w._async)){this.tokens.removeInitialToken(),this.tokens.removeToken();const e=this.processNamedFunction();this.tokens.appendCode(` exports.default = ${e};`)}else if(this.tokens.matches4(l._export,l._default,l._class,l.name)||this.tokens.matches5(l._export,l._default,l._abstract,l._class,l.name)||this.tokens.matches3(l._export,l._default,l.at)){this.tokens.removeInitialToken(),this.tokens.removeToken(),this.copyDecorators(),this.tokens.matches1(l._abstract)&&this.tokens.removeToken();const e=this.rootTransformer.processNamedClass();this.tokens.appendCode(` exports.default = ${e};`)}else if(H0(this.isTypeScriptTransformEnabled,this.tokens,this.declarationInfo))this.tokens.removeInitialToken(),this.tokens.removeToken(),this.tokens.removeToken();else if(this.reactHotLoaderTransformer){const e=this.nameManager.claimFreeName("_default");this.tokens.replaceToken(`let ${e}; exports.`),this.tokens.copyToken(),this.tokens.appendCode(` = ${e} =`),this.reactHotLoaderTransformer.setExtractedDefaultExportName(e)}else this.tokens.replaceToken("exports."),this.tokens.copyToken(),this.tokens.appendCode(" =")}copyDecorators(){for(;this.tokens.matches1(l.at);)if(this.tokens.copyToken(),this.tokens.matches1(l.parenL))this.tokens.copyExpectedToken(l.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(l.parenR);else{for(this.tokens.copyExpectedToken(l.name);this.tokens.matches1(l.dot);)this.tokens.copyExpectedToken(l.dot),this.tokens.copyExpectedToken(l.name);this.tokens.matches1(l.parenL)&&(this.tokens.copyExpectedToken(l.parenL),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(l.parenR))}}processExportVar(){this.isSimpleExportVar()?this.processSimpleExportVar():this.processComplexExportVar()}isSimpleExportVar(){let e=this.tokens.currentIndex();if(e++,e++,!this.tokens.matches1AtIndex(e,l.name))return!1;for(e++;et.call(e,...o)),e=void 0)}return t}const Kr="jest",kA=["mock","unmock","enableAutomock","disableAutomock"];class Zu extends rn{__init(){this.hoistedFunctionNames=[]}constructor(e,t,i,s){super(),this.rootTransformer=e,this.tokens=t,this.nameManager=i,this.importProcessor=s,Zu.prototype.__init.call(this)}process(){return this.tokens.currentToken().scopeDepth===0&&this.tokens.matches4(l.name,l.dot,l.name,l.parenL)&&this.tokens.identifierName()===Kr?SA([this,"access",e=>e.importProcessor,"optionalAccess",e=>e.getGlobalNames,"call",e=>e(),"optionalAccess",e=>e.has,"call",e=>e(Kr)])?!1:this.extractHoistedCalls():!1}getHoistedCode(){return this.hoistedFunctionNames.length>0?this.hoistedFunctionNames.map(e=>`${e}();`).join(""):""}extractHoistedCalls(){this.tokens.removeToken();let e=!1;for(;this.tokens.matches3(l.dot,l.name,l.parenL);){const t=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);if(kA.includes(t)){const s=this.nameManager.claimFreeName("__jestHoist");this.hoistedFunctionNames.push(s),this.tokens.replaceToken(`function ${s}(){${Kr}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(l.parenR),this.tokens.appendCode(";}"),e=!1}else e?this.tokens.copyToken():this.tokens.replaceToken(`${Kr}.`),this.tokens.copyToken(),this.tokens.copyToken(),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(l.parenR),e=!0}return!0}}class bA extends rn{constructor(e){super(),this.tokens=e}process(){if(this.tokens.matches1(l.num)){const e=this.tokens.currentTokenCode();if(e.includes("_"))return this.tokens.replaceToken(e.replace(/_/g,"")),!0}return!1}}class wA extends rn{constructor(e,t){super(),this.tokens=e,this.nameManager=t}process(){return this.tokens.matches2(l._catch,l.braceL)?(this.tokens.copyToken(),this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`),!0):!1}}class xA extends rn{constructor(e,t){super(),this.tokens=e,this.nameManager=t}process(){if(this.tokens.matches1(l.nullishCoalescing)){const i=this.tokens.currentToken();return this.tokens.tokens[i.nullishStartIndex].isAsyncOperation?this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => ("):this.tokens.replaceTokenTrimmingLeftWhitespace(", () => ("),!0}if(this.tokens.matches1(l._delete)&&this.tokens.tokenAtRelativeIndex(1).isOptionalChainStart)return this.tokens.removeInitialToken(),!0;const t=this.tokens.currentToken().subscriptStartIndex;if(t!=null&&this.tokens.tokens[t].isOptionalChainStart&&this.tokens.tokenAtRelativeIndex(-1).type!==l._super){const i=this.nameManager.claimFreeName("_");let s;if(t>0&&this.tokens.matches1AtIndex(t-1,l._delete)&&this.isLastSubscriptInChain()?s=`${i} => delete ${i}`:s=`${i} => ${i}`,this.tokens.tokens[t].isAsyncOperation&&(s=`async ${s}`),this.tokens.matches2(l.questionDot,l.parenL)||this.tokens.matches2(l.questionDot,l.lessThan))this.justSkippedSuper()&&this.tokens.appendCode(".bind(this)"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${s}`);else if(this.tokens.matches2(l.questionDot,l.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${s}`);else if(this.tokens.matches1(l.questionDot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${s}.`);else if(this.tokens.matches1(l.dot))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${s}.`);else if(this.tokens.matches1(l.bracketL))this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${s}[`);else if(this.tokens.matches1(l.parenL))this.justSkippedSuper()&&this.tokens.appendCode(".bind(this)"),this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${s}(`);else throw new Error("Unexpected subscript operator in optional chain.");return!0}return!1}isLastSubscriptInChain(){let e=0;for(let t=this.tokens.currentIndex()+1;;t++){if(t>=this.tokens.tokens.length)throw new Error("Reached the end of the code while finding the end of the access chain.");if(this.tokens.tokens[t].isOptionalChainStart?e++:this.tokens.tokens[t].isOptionalChainEnd&&e--,e<0)return!0;if(e===0&&this.tokens.tokens[t].subscriptStartIndex!=null)return!1}}justSkippedSuper(){let e=0,t=this.tokens.currentIndex()-1;for(;;){if(t<0)throw new Error("Reached the start of the code while finding the start of the access chain.");if(this.tokens.tokens[t].isOptionalChainStart?e--:this.tokens.tokens[t].isOptionalChainEnd&&e++,e<0)return!1;if(e===0&&this.tokens.tokens[t].subscriptStartIndex!=null)return this.tokens.tokens[t-1].type===l._super;t--}}}class vA extends rn{constructor(e,t,i,s){super(),this.rootTransformer=e,this.tokens=t,this.importProcessor=i,this.options=s}process(){const e=this.tokens.currentIndex();if(this.tokens.identifierName()==="createReactClass"){const t=this.importProcessor&&this.importProcessor.getIdentifierReplacement("createReactClass");return t?this.tokens.replaceToken(`(0, ${t})`):this.tokens.copyToken(),this.tryProcessCreateClassCall(e),!0}if(this.tokens.matches3(l.name,l.dot,l.name)&&this.tokens.identifierName()==="React"&&this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+2)==="createClass"){const t=this.importProcessor&&this.importProcessor.getIdentifierReplacement("React")||"React";return t?(this.tokens.replaceToken(t),this.tokens.copyToken(),this.tokens.copyToken()):(this.tokens.copyToken(),this.tokens.copyToken(),this.tokens.copyToken()),this.tryProcessCreateClassCall(e),!0}return!1}tryProcessCreateClassCall(e){const t=this.findDisplayName(e);t&&this.classNeedsDisplayName()&&(this.tokens.copyExpectedToken(l.parenL),this.tokens.copyExpectedToken(l.braceL),this.tokens.appendCode(`displayName: '${t}',`),this.rootTransformer.processBalancedCode(),this.tokens.copyExpectedToken(l.braceR),this.tokens.copyExpectedToken(l.parenR))}findDisplayName(e){return e<2?null:this.tokens.matches2AtIndex(e-2,l.name,l.eq)?this.tokens.identifierNameAtIndex(e-2):e>=2&&this.tokens.tokens[e-2].identifierRole===oe.ObjectKey?this.tokens.identifierNameAtIndex(e-2):this.tokens.matches2AtIndex(e-2,l._export,l._default)?this.getDisplayNameFromFilename():null}getDisplayNameFromFilename(){const t=(this.options.filePath||"unknown").split("/"),i=t[t.length-1],s=i.lastIndexOf("."),r=s===-1?i:i.slice(0,s);return r==="index"&&t[t.length-2]?t[t.length-2]:r}classNeedsDisplayName(){let e=this.tokens.currentIndex();if(!this.tokens.matches2(l.parenL,l.braceL))return!1;const t=e+1,i=this.tokens.tokens[t].contextId;if(i==null)throw new Error("Expected non-null context ID on object open-brace.");for(;e({variableName:i,uniqueLocalName:i}));return this.extractedDefaultExportName&&t.push({variableName:this.extractedDefaultExportName,uniqueLocalName:"default"}),` ;(function () { var reactHotLoader = require('react-hot-loader').default; var leaveModule = require('react-hot-loader').leaveModule; if (!reactHotLoader) { return; } ${t.map(({variableName:i,uniqueLocalName:s})=>` reactHotLoader.register(${i}, "${s}", ${JSON.stringify(this.filePath||"")});`).join(` `)} leaveModule(module); })();`}process(){return!1}}const QA=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","finally","for","function","if","import","in","instanceof","new","return","super","switch","this","throw","try","typeof","var","void","while","with","yield","enum","implements","interface","let","package","private","protected","public","static","await","false","null","true"]);function Wd(n){if(n.length===0||!wr[n.charCodeAt(0)])return!1;for(let e=1;e` var ${o};`).join("");for(const o of this.transformers)t+=o.getHoistedCode();let i="";for(const o of this.transformers)i+=o.getSuffixCode();const s=this.tokens.finish();let{code:r}=s;if(r.startsWith("#!")){let o=r.indexOf(` `);return o===-1&&(o=r.length,r+=` `),{code:r.slice(0,o+1)+t+r.slice(o+1)+i,mappings:this.shiftMappings(s.mappings,t.length)}}else return{code:t+r+i,mappings:this.shiftMappings(s.mappings,t.length)}}processBalancedCode(){let e=0,t=0;for(;!this.tokens.isAtEnd();){if(this.tokens.matches1(l.braceL)||this.tokens.matches1(l.dollarBraceL))e++;else if(this.tokens.matches1(l.braceR)){if(e===0)return;e--}if(this.tokens.matches1(l.parenL))t++;else if(this.tokens.matches1(l.parenR)){if(t===0)return;t--}this.processToken()}}processToken(){if(this.tokens.matches1(l._class)){this.processClass();return}for(const e of this.transformers)if(e.process())return;this.tokens.copyToken()}processNamedClass(){if(!this.tokens.matches2(l._class,l.name))throw new Error("Expected identifier for exported class name.");const e=this.tokens.identifierNameAtIndex(this.tokens.currentIndex()+1);return this.processClass(),e}processClass(){const e=pA(this,this.tokens,this.nameManager,this.disableESTransforms),t=(e.headerInfo.isExpression||!e.headerInfo.className)&&e.staticInitializerNames.length+e.instanceInitializerNames.length>0;let i=e.headerInfo.className;t&&(i=this.nameManager.claimFreeName("_class"),this.generatedVariables.push(i),this.tokens.appendCode(` (${i} =`));const r=this.tokens.currentToken().contextId;if(r==null)throw new Error("Expected class to have a context ID.");for(this.tokens.copyExpectedToken(l._class);!this.tokens.matchesContextIdAndLabel(l.braceL,r);)this.processToken();this.processClassBody(e,i);const o=e.staticInitializerNames.map(a=>`${i}.${a}()`);t?this.tokens.appendCode(`, ${o.map(a=>`${a}, `).join("")}${i})`):e.staticInitializerNames.length>0&&this.tokens.appendCode(` ${o.map(a=>`${a};`).join(" ")}`)}processClassBody(e,t){const{headerInfo:i,constructorInsertPos:s,constructorInitializerStatements:r,fields:o,instanceInitializerNames:a,rangesToRemove:c}=e;let h=0,u=0;const f=this.tokens.currentToken().contextId;if(f==null)throw new Error("Expected non-null context ID on class.");this.tokens.copyExpectedToken(l.braceL),this.isReactHotLoaderTransformEnabled&&this.tokens.appendCode("__reactstandin__regenerateByEval(key, code) {this[key] = eval(code);}");const p=r.length+a.length>0;if(s===null&&p){const m=this.makeConstructorInitCode(r,a,t);if(i.hasSuperclass){const O=this.nameManager.claimFreeName("args");this.tokens.appendCode(`constructor(...${O}) { super(...${O}); ${m}; }`)}else this.tokens.appendCode(`constructor() { ${m}; }`)}for(;!this.tokens.matchesContextIdAndLabel(l.braceR,f);)if(h=c[u].start){for(this.tokens.currentIndex()`${i}.prototype.${s}.call(this)`)].join(";")}processPossibleArrowParamEnd(){if(this.tokens.matches2(l.parenR,l.colon)&&this.tokens.tokenAtRelativeIndex(1).isType){let e=this.tokens.currentIndex()+1;for(;this.tokens.tokens[e].isType;)e++;if(this.tokens.matches1AtIndex(e,l.arrow)){for(this.tokens.removeInitialToken();this.tokens.currentIndex()"),!0}}return!1}processPossibleAsyncArrowWithTypeParams(){if(!this.tokens.matchesContextual(w._async)&&!this.tokens.matches1(l._async))return!1;const e=this.tokens.tokenAtRelativeIndex(1);if(e.type!==l.lessThan||!e.isType)return!1;let t=this.tokens.currentIndex()+1;for(;this.tokens.tokens[t].isType;)t++;if(this.tokens.matches1AtIndex(t,l.parenL)){for(this.tokens.replaceToken("async ("),this.tokens.removeInitialToken();this.tokens.currentIndex()this.string.length)return null;for(var o=0,a=this.offsets;a[o+1]<=r;)o++;var c=r-a[o];return{line:o,column:c}},s.prototype.indexForLocation=function(r){var o=r.line,a=r.column;return o<0||o>=this.offsets.length||a<0||a>this.lengthOfLine(o)?null:this.offsets[o]+a},s.prototype.lengthOfLine=function(r){var o=this.offsets[r],a=r===this.offsets.length-1?this.string.length:this.offsets[r+1];return a-o},s}();n.LinesAndColumns=i,n.default=i})(_A);function $A(n){const e=new Set;for(let t=0;t_.lang)||o.template&&o.template.lang){n.state.errors=['lang="x" pre-processors for