@mastra/deployer-cloud 1.80.0 → 1.81.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/studio/assets/{dist-Dcq2nGKl.js → dist-Bg8xUYnp.js} +1 -1
- package/dist/studio/assets/dist-BmVSD_5H.js +1 -0
- package/dist/studio/assets/dist-C0KhS3nZ.js +1 -0
- package/dist/studio/assets/{dist-BcV0fxOe.js → dist-CZ3nRtXK.js} +1 -1
- package/dist/studio/assets/{dist-rcSvr8nT.js → dist-CgB3_3n_.js} +1 -1
- package/dist/studio/assets/{dist-BVq4x0k2.js → dist-Dea0Dfa0.js} +1 -1
- package/dist/studio/assets/dist-DzzTkcfM.js +1 -0
- package/dist/studio/assets/{dist-t_wjP-TL.js → dist-hcr1S9ob.js} +1 -1
- package/dist/studio/assets/{dist-BZ0nnT2j.js → dist-kzlMryCP.js} +1 -1
- package/dist/studio/assets/{index-vbGyTFtx.js → index-U9xD1_It.js} +2 -2
- package/dist/studio/assets/{main-CFCsLUyC.js → main-CCDQ8J3X.js} +250 -250
- package/dist/studio/assets/style-CA46J9wW.css +3 -0
- package/dist/studio/index.html +2 -2
- package/dist/studio/mastra-dark-tile-dev.svg +26 -0
- package/package.json +7 -7
- package/dist/studio/assets/dist-CmRzlq9h.js +0 -1
- package/dist/studio/assets/dist-DjFwFQ6-.js +0 -1
- package/dist/studio/assets/dist-DkOJ_COt.js +0 -1
- package/dist/studio/assets/style-CGANhu7-.css +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=1024,t=0,n=class{constructor(e,t){this.from=e,this.to=t}},r=class{constructor(e={}){this.id=t++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=o.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};r.closedBy=new r({deserialize:e=>e.split(` `)}),r.openedBy=new r({deserialize:e=>e.split(` `)}),r.group=new r({deserialize:e=>e.split(` `)}),r.isolate=new r({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),r.contextHash=new r({perNode:!0}),r.lookAhead=new r({perNode:!0}),r.mounted=new r({perNode:!0});var i=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[r.mounted.id]}},a=Object.create(null),o=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):a,r=+!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}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(r.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(r.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}};o.none=new o(``,Object.create(null),0,8);var s=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new o(e.name,r,e.id,e.flags):e)}return new e(n)}},c=new WeakMap,l=new WeakMap,u;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(u||={});var d=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=i.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new ne(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new ne(c.get(this)||this.topNode);return r.moveTo(e,t),c.set(this,r._tree),r}get topNode(){return new _(this,0,0,null)}resolve(e,t=0){let n=h(c.get(this)||this.topNode,e,t,!1);return c.set(this,n),n}resolveInner(e,t=0){let n=h(l.get(this)||this.topNode,e,t,!0);return l.set(this,n),n}resolveStack(e,t=0){return te(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&u.IncludeAnonymous)>0;for(let e=this.cursor(a|u.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!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(t={}){return this.children.length<=8?this:se(o.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(o.none,t,n,r)))}static build(e){return ie(e)}};d.empty=new d(o.none,[],[],0);var f=class e{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 e(this.buffer,this.index)}},p=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return o.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(m(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function m(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function h(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof _&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:u.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof _&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var g=class{cursor(e=0){return new ne(this,e)}getChild(e,t=null,n=null){let r=v(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return v(this,e,t,n)}resolve(e,t=0){return h(this,e,t,!1)}resolveInner(e,t=0){return h(this,e,t,!0)}matchContext(e){return y(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},_=class e extends g{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,a,o=0){for(let s=this;;){for(let{children:c,positions:l}=s._tree,f=n>0?c.length:-1;t!=f;t+=n){let f=c[t],h=l[t]+s.from,g;if(o&u.EnterBracketed&&f instanceof d&&(g=i.get(f))&&!g.overlay&&g.bracketed&&r>=h&&r<=h+f.length||m(a,r,h,h+f.length)){if(f instanceof p){if(o&u.ExcludeBuffers)continue;let e=f.findChild(0,f.buffer.length,n,r-h,a);if(e>-1)return new b(new ee(s,f,t,h),null,e)}else if(o&u.IncludeAnonymous||!f.type.isAnonymous||re(f)){let c;if(!(o&u.IgnoreMounts)&&(c=i.get(f))&&!c.overlay)return new e(c.tree,h,t,s);let l=new e(f,h,t,s);return o&u.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(n<0?f.children.length-1:0,n,r,a,o)}}}if(o&u.IncludeAnonymous||!s.type.isAnonymous||(t=s.index>=0?s.index+n:n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let a;if(!(r&u.IgnoreOverlays)&&(a=i.get(this._tree))&&a.overlay){let i=t-this.from,o=r&u.EnterBracketed&&a.bracketed;for(let{from:t,to:r}of a.overlay)if((n>0||o?t<=i:t<i)&&(n<0||o?r>=i:r>i))return new e(a.tree,a.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function v(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function y(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var ee=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},b=class e extends g{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,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&u.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}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:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new d(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function x(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof _&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new S(i,n)}var S=class{constructor(e,t){this.heads=e,this.node=t}get next(){return x(this.heads)}};function te(e,t,n){let r=e.resolveInner(t,n),a=null;for(let e=r instanceof _?r:r.context.parent;e;e=e.parent)if(e.index<0){let i=e.parent;(a||=[r]).push(i.resolve(t,n)),e=i}else{let o=i.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let i=new _(o.tree,o.overlay[0].from+e.from,-1,e);(a||=[r]).push(h(i,t,n,!1))}}return a?x(a):r}var ne=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~u.EnterBracketed,e instanceof _)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.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:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof _?(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,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}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,n=this.mode){return this.buffer?n&u.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&u.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&u.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,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&u.IncludeAnonymous||e instanceof p||!e.type.isAnonymous||re(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new b(this.buffer,t,this.stack[e]);return this.bufferNode=new b(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return y(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return y(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function re(e){return e.children.some(e=>e instanceof p||!e.type.isAnonymous||re(e))}function ie(t){let{buffer:n,nodeSet:i,maxBufferLength:a=e,reused:o=[],minRepeatType:s=i.types.length}=t,c=Array.isArray(n)?new f(n,n.length):n,l=i.types,u=0,m=0;function h(e,t,n,r,d,f){let{id:x,start:S,end:te,size:ne}=c,re=m,ie=u;if(ne<0){if(c.next(),ne==-1){let t=o[x];n.push(t),r.push(S-e);return}if(ne==-3){u=x;return}if(ne==-4){m=x;return}throw RangeError(`Unrecognized record size: ${ne}`)}let ae=l[x],oe,ce,le=S-e;if(te-S<=a&&(ce=ee(c.pos-t,d))){let t=new Uint16Array(ce.size-ce.skip),n=c.pos-ce.size,r=t.length;for(;c.pos>n;)r=b(ce.start,t,r);oe=new p(t,te-ce.start,i),le=ce.start-e}else{let e=c.pos-ne;c.next();let t=[],n=[],r=x>=s?x:-1,i=0,o=te,l=re;for(;c.pos>e;)r>=0&&c.id==r&&c.size>=0?(c.end<=o-a&&(v(t,n,S,i,c.end,o,r,l,ie),i=t.length,o=c.end,l=m),c.next()):f>2500?g(S,e,t,n):h(S,e,t,n,r,f+1);if(r>=0&&i>0&&i<t.length&&v(t,n,S,i,S,o,r,l,ie),t.reverse(),n.reverse(),r>-1&&i>0){let e=_(ae,ie);oe=se(ae,t,n,0,t.length,0,te-S,e,e)}else oe=y(ae,t,n,te-S,re-te,ie)}n.push(oe),r.push(le)}function g(e,t,n,r){let o=[],s=0,l=-1;for(;c.pos>t;){let{id:e,start:t,end:n,size:r}=c;if(r>4)c.next();else if(l>-1&&t<l)break;else l<0&&(l=n-a),o.push(e,t,n),s++,c.next()}if(s){let t=new Uint16Array(s*4),a=o[o.length-2];for(let e=o.length-3,n=0;e>=0;e-=3)t[n++]=o[e],t[n++]=o[e+1]-a,t[n++]=o[e+2]-a,t[n++]=n;n.push(new p(t,o[2]-a,i)),r.push(a-e)}}function _(e,t){return(n,i,a)=>{let o=0,s=n.length-1,c,l;if(s>=0&&(c=n[s])instanceof d){if(!s&&c.type==e&&c.length==a)return c;(l=c.prop(r.lookAhead))&&(o=i[s]+c.length+l-a)}return y(e,n,i,a,o,t)}}function v(e,t,n,r,a,o,s,c,l){let u=[],d=[];for(;e.length>r;)u.push(e.pop()),d.push(t.pop()+n-a);e.push(y(i.types[s],u,d,o-a,c-o,l)),t.push(a-n)}function y(e,t,n,i,a,o,s){if(o){let e=[r.contextHash,o];s=s?[e].concat(s):[e]}if(a>25){let e=[r.lookAhead,a];s=s?[e].concat(s):[e]}return new d(e,t,n,i,s)}function ee(e,t){let n=c.fork(),r=0,i=0,o=0,l=n.end-a,u={size:0,start:0,skip:0};scan:for(let a=n.pos-e;n.pos>a;){let e=n.size;if(n.id==t&&e>=0){u.size=r,u.start=i,u.skip=o,o+=4,r+=4,n.next();continue}let c=n.pos-e;if(e<0||c<a||n.start<l)break;let d=n.id>=s?4:0,f=n.start;for(n.next();n.pos>c;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break scan}else n.id>=s&&(d+=4);n.next()}i=f,r+=e,o+=d}return(t<0||r==e)&&(u.size=r,u.start=i,u.skip=o),u.size>4?u:void 0}function b(e,t,n){let{id:r,start:i,end:a,size:o}=c;if(c.next(),o>=0&&r<s){let s=n;if(o>4){let r=c.pos-(o-4);for(;c.pos>r;)n=b(e,t,n)}t[--n]=s,t[--n]=a-e,t[--n]=i-e,t[--n]=r}else o==-3?u=r:o==-4&&(m=r);return n}let x=[],S=[];for(;c.pos>0;)h(t.start||0,t.bufferStart||0,x,S,-1,0);let te=t.length??(x.length?S[0]+x[0].length:0);return new d(l[t.topID],x.reverse(),S.reverse(),te)}var ae=new WeakMap;function oe(e,t){if(!e.isAnonymous||t instanceof p||t.type!=e)return 1;let n=ae.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof d)){n=1;break}n+=oe(e,r)}ae.set(t,n)}return n}function se(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=oe(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=oe(e,t[s]);for(s++;s<i;s++){let n=oe(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(se(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var ce=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof b?this.setBuffer(e.context.buffer,e.index,t):e instanceof _&&this.map.set(e.tree,t)}get(e){return e instanceof b?this.getBuffer(e.context.buffer,e.index):e instanceof _?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)}},le=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},ue=class{startParse(e,t,r){return typeof e==`string`&&(e=new de(e)),r=r?r.length?r.map(e=>new n(e.from,e.to)):[new n(0,0)]:[new n(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},de=class{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 fe(e){return(t,n,r,i)=>new _e(t,e,n,r,i)}var pe=class{constructor(e,t,n,r,i,a){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=i,this.from=a}};function me(e){if(!e.length||e.some(e=>e.from>=e.to))throw RangeError(`Invalid inner parse ranges given: `+JSON.stringify(e))}var he=class{constructor(e,t,n,r,i,a,o,s){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=i,this.bracketed=a,this.target=o,this.prev=s,this.depth=0,this.ranges=[]}},ge=new r({perNode:!0}),_e=class{constructor(e,t,n,r,i){this.nest=t,this.input=n,this.fragments=r,this.ranges=i,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),this.stoppedAt!=null)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return this.stoppedAt!=null&&(e=new d(e.type,e.children,e.positions,e.length,e.propValues.concat([[ge,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[r.mounted.id]=new i(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new Se(this.fragments),t=null,r=null,i=new ne(new _(this.baseTree,this.ranges[0].from,0,null),u.IncludeAnonymous|u.IgnoreMounts);scan:for(let a,o;;){let s=!0,c;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)s=!1;else if(e.hasNode(i)){if(t){let e=t.mounts.find(e=>e.frag.from<=i.from&&e.frag.to>=i.to&&e.mount.overlay);if(e)for(let n of e.mount.overlay){let r=n.from+e.pos,a=n.to+e.pos;r>=i.from&&a<=i.to&&!t.ranges.some(e=>e.from<a&&e.to>r)&&t.ranges.push({from:r,to:a})}}s=!1}else if(r&&(o=ve(r.ranges,i.from,i.to)))s=o!=2;else if(!i.type.isAnonymous&&(a=this.nest(i,this.input))&&(i.from<i.to||!a.overlay)){i.tree||(be(i),t&&t.depth++,r&&r.depth++);let o=e.findMounts(i.from,a.parser);if(typeof a.overlay==`function`)t=new he(a.parser,a.overlay,o,this.inner.length,i.from,!!a.bracketed,i.tree,t);else{let e=Ce(this.ranges,a.overlay||(i.from<i.to?[new n(i.from,i.to)]:[]));e.length&&me(e),(e.length||!a.overlay)&&this.inner.push(new pe(a.parser,e.length?a.parser.startParse(this.input,Te(o,e),e):a.parser.startParse(``),a.overlay?a.overlay.map(e=>new n(e.from-i.from,e.to-i.from)):null,!!a.bracketed,i.tree,e.length?e[0].from:i.from)),a.overlay?e.length&&(r={ranges:e,depth:0,prev:r}):s=!1}}else if(t&&(c=t.predicate(i))&&(c===!0&&(c=new n(i.from,i.to)),c.from<c.to)){let e=t.ranges.length-1;e>=0&&t.ranges[e].to==c.from?t.ranges[e]={from:t.ranges[e].from,to:c.to}:t.ranges.push(c)}if(s&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break scan;if(t&&!--t.depth){let e=Ce(this.ranges,t.ranges);e.length&&(me(e),this.inner.splice(t.index,0,new pe(t.parser,t.parser.startParse(this.input,Te(t.mounts,e),e),t.ranges.map(e=>new n(e.from-t.start,e.to-t.start)),t.bracketed,t.target,e[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}};function ve(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}function ye(e,t,n,r,i,a){if(t<n){let o=e.buffer[t+1];r.push(e.slice(t,n,o)),i.push(o-a)}}function be(e){let{node:t}=e,n=[],r=t.context.buffer;do n.push(e.index),e.parent();while(!e.tree);let i=e.tree,a=i.children.indexOf(r),s=i.children[a],c=s.buffer,l=[a];function u(e,r,i,a,o,f){let p=n[f],m=[],h=[];ye(s,e,p,m,h,a);let g=c[p+1],_=c[p+2];l.push(m.length);let v=f?u(p+4,c[p+3],s.set.types[c[p]],g,_-g,f-1):t.toTree();return m.push(v),h.push(g-a),ye(s,c[p+3],r,m,h,a),new d(i,m,h,o)}i.children[a]=u(0,c.length,o.none,0,s.length,n.length-1);for(let t of l){let n=e.tree.children[t],r=e.tree.positions[t];e.yield(new _(n,r+e.from,t,e._tree))}}var xe=class{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(u.IncludeAnonymous|u.IgnoreMounts|u.ExcludeBuffers)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)if(!(t.to>=n&&t.enter(n,1,u.IncludeAnonymous|u.IgnoreOverlays|u.ExcludeBuffers))){if(t.to<=n)t.next(!1)||(this.done=!0);else break}}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 d)t=t.children[0];else break}return!1}},Se=class{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=t.tree.prop(ge)??t.to,this.inner=new xe(t.tree,-t.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(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=e.tree.prop(ge)??e.to,this.inner=new xe(e.tree,-e.offset)}}findMounts(e,t){let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let i=e.tree?.prop(r.mounted);if(i&&i.parser==t)for(let t=this.fragI;t<this.fragments.length;t++){let r=this.fragments[t];if(r.from>=e.to)break;r.tree==this.curFrag.tree&&n.push({frag:r,pos:e.from-r.offset,mount:i})}}}return n}};function Ce(e,t){let r=null,i=t;for(let a=1,o=0;a<e.length;a++){let s=e[a-1].to,c=e[a].from;for(;o<i.length;o++){let e=i[o];if(e.from>=c)break;e.to<=s||(r||(i=r=t.slice()),e.from<s?(r[o]=new n(e.from,s),e.to>c&&r.splice(o+1,0,new n(c,e.to))):e.to>c?r[o--]=new n(c,e.to):r.splice(o--,1))}}return i}function we(e,t,r,i){let a=0,o=0,s=!1,c=!1,l=-1e9,u=[];for(;;){let d=a==e.length?1e9:s?e[a].to:e[a].from,f=o==t.length?1e9:c?t[o].to:t[o].from;if(s!=c){let e=Math.max(l,r),t=Math.min(d,f,i);e<t&&u.push(new n(e,t))}if(l=Math.min(d,f),l==1e9)break;d==l&&(s?(s=!1,a++):s=!0),f==l&&(c?(c=!1,o++):c=!0)}return u}function Te(e,t){let r=[];for(let{pos:i,mount:a,frag:o}of e){let e=i+(a.overlay?a.overlay[0].from:0),s=e+a.tree.length,c=Math.max(o.from,e),l=Math.min(o.to,s);if(a.overlay){let s=we(t,a.overlay.map(e=>new n(e.from+i,e.to+i)),c,l);for(let t=0,n=c;;t++){let i=t==s.length,c=i?l:s[t].from;if(c>n&&r.push(new le(n,c,a.tree,-e,o.from>=n||o.openStart,o.to<=c||o.openEnd)),i)break;n=s[t].to}}else r.push(new le(c,l,a.tree,-e,o.from>=e||o.openStart,o.to<=s||o.openEnd))}return r}var Ee=0,De=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Ee++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new ke(e);return e=>e.modified.indexOf(t)>-1?e:ke.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},Oe=0,ke=class e{constructor(e){this.name=e,this.instances=[],this.id=Oe++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&Ae(n,e.modified));if(r)return r;let i=[],a=new De(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=je(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function Ae(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function je(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function Me(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new Pe(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return Ne.add(t)}var Ne=new r({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth<=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new Pe(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),Pe=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Pe.empty=new Pe([],2,null);function Fe(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function Ie(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function Le(e,t,n,r=0,i=e.length){let a=new Re(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var Re=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,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,n,i,a){let{type:o,from:s,to:c}=e;if(s>=n||c<=t)return;o.isTop&&(a=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=i,u=ze(e)||Pe.empty,d=Ie(a,u.tags);if(d&&(l&&(l+=` `),l+=d,u.mode==1&&(i+=(i?` `:``)+d)),this.startSpan(Math.max(t,s),l),u.opaque)return;let f=e.tree&&e.tree.prop(r.mounted);if(f&&f.overlay){let r=e.node.enter(f.overlay[0].from+s,1),o=this.highlighters.filter(e=>!e.scope||e.scope(f.tree.type)),u=e.firstChild();for(let d=0,p=s;;d++){let m=d<f.overlay.length?f.overlay[d]:null,h=m?m.from+s:c,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,i,a),this.startSpan(Math.min(_,e.to),l),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+s,p>t&&(this.highlightRange(r.cursor(),Math.max(t,m.from+s),Math.min(n,p),``,o),this.startSpan(Math.min(n,p),l))}u&&e.parent()}else if(e.firstChild()){f&&(i=``);do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,a),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling());e.parent()}}};function ze(e){let t=e.type.prop(Ne);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var C=De.define,Be=C(),Ve=C(),He=C(Ve),Ue=C(Ve),We=C(),Ge=C(We),Ke=C(We),qe=C(),Je=C(qe),Ye=C(),Xe=C(),Ze=C(),Qe=C(Ze),$e=C(),w={comment:Be,lineComment:C(Be),blockComment:C(Be),docComment:C(Be),name:Ve,variableName:C(Ve),typeName:He,tagName:C(He),propertyName:Ue,attributeName:C(Ue),className:C(Ve),labelName:C(Ve),namespace:C(Ve),macroName:C(Ve),literal:We,string:Ge,docString:C(Ge),character:C(Ge),attributeValue:C(Ge),number:Ke,integer:C(Ke),float:C(Ke),bool:C(We),regexp:C(We),escape:C(We),color:C(We),url:C(We),keyword:Ye,self:C(Ye),null:C(Ye),atom:C(Ye),unit:C(Ye),modifier:C(Ye),operatorKeyword:C(Ye),controlKeyword:C(Ye),definitionKeyword:C(Ye),moduleKeyword:C(Ye),operator:Xe,derefOperator:C(Xe),arithmeticOperator:C(Xe),logicOperator:C(Xe),bitwiseOperator:C(Xe),compareOperator:C(Xe),updateOperator:C(Xe),definitionOperator:C(Xe),typeOperator:C(Xe),controlOperator:C(Xe),punctuation:Ze,separator:C(Ze),bracket:Qe,angleBracket:C(Qe),squareBracket:C(Qe),paren:C(Qe),brace:C(Qe),content:qe,heading:Je,heading1:C(Je),heading2:C(Je),heading3:C(Je),heading4:C(Je),heading5:C(Je),heading6:C(Je),contentSeparator:C(qe),list:C(qe),quote:C(qe),emphasis:C(qe),strong:C(qe),link:C(qe),monospace:C(qe),strikethrough:C(qe),inserted:C(),deleted:C(),changed:C(),invalid:C(),meta:$e,documentMeta:C($e),annotation:C($e),processingInstruction:C($e),definition:De.defineModifier(`definition`),constant:De.defineModifier(`constant`),function:De.defineModifier(`function`),standard:De.defineModifier(`standard`),local:De.defineModifier(`local`),special:De.defineModifier(`special`)};for(let e in w){let t=w[e];t instanceof De&&(t.name=e)}Fe([{tag:w.link,class:`tok-link`},{tag:w.heading,class:`tok-heading`},{tag:w.emphasis,class:`tok-emphasis`},{tag:w.strong,class:`tok-strong`},{tag:w.keyword,class:`tok-keyword`},{tag:w.atom,class:`tok-atom`},{tag:w.bool,class:`tok-bool`},{tag:w.url,class:`tok-url`},{tag:w.labelName,class:`tok-labelName`},{tag:w.inserted,class:`tok-inserted`},{tag:w.deleted,class:`tok-deleted`},{tag:w.literal,class:`tok-literal`},{tag:w.string,class:`tok-string`},{tag:w.number,class:`tok-number`},{tag:[w.regexp,w.escape,w.special(w.string)],class:`tok-string2`},{tag:w.variableName,class:`tok-variableName`},{tag:w.local(w.variableName),class:`tok-variableName tok-local`},{tag:w.definition(w.variableName),class:`tok-variableName tok-definition`},{tag:w.special(w.variableName),class:`tok-variableName2`},{tag:w.definition(w.propertyName),class:`tok-propertyName tok-definition`},{tag:w.typeName,class:`tok-typeName`},{tag:w.namespace,class:`tok-namespace`},{tag:w.className,class:`tok-className`},{tag:w.macroName,class:`tok-macroName`},{tag:w.propertyName,class:`tok-propertyName`},{tag:w.operator,class:`tok-operator`},{tag:w.comment,class:`tok-comment`},{tag:w.meta,class:`tok-meta`},{tag:w.invalid,class:`tok-invalid`},{tag:w.punctuation,class:`tok-punctuation`}]);var et=[],tt=[];(()=>{let e=`lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?tt:et).push(n+=e[t])})();function nt(e){if(e<768)return!1;for(let t=0,n=et.length;;){let r=t+n>>1;if(e<et[r])n=r;else if(e>=tt[r])t=r+1;else return!0;if(t==n)return!1}}function rt(e){return e>=127462&&e<=127487}var it=8205;function at(e,t,n=!0,r=!0){return(n?ot:st)(e,t,r)}function ot(e,t,n){if(t==e.length)return t;t&<(e.charCodeAt(t))&&ut(e.charCodeAt(t-1))&&t--;let r=ct(e,t);for(t+=dt(r);t<e.length;){let i=ct(e,t);if(r==it||i==it||n&&nt(i))t+=dt(i),r=i;else if(rt(i)){let n=0,r=t-2;for(;r>=0&&rt(ct(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function st(e,t,n){for(;t>0;){let r=ot(e,t-2,n);if(r<t)return r;t--}return 0}function ct(e,t){let n=e.charCodeAt(t);if(!ut(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return lt(r)?(n-55296<<10)+(r-56320)+65536:n}function lt(e){return e>=56320&&e<57344}function ut(e){return e>=55296&&e<56320}function dt(e){return e<65536?1:2}var T=class e{lineAt(e){if(e<0||e>this.length)throw 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 RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=bt(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),ft.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=bt(this,e,t);let n=[];return this.decompose(e,t,n,0),ft.from(n,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),n=this.length-this.scanIdentical(e,-1),r=new gt(this),i=new gt(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new gt(this,e)}iterRange(e,t=this.length){return new _t(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new vt(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new E(t):ft.from(E.split(t,[]))}},E=class e extends T{constructor(e,t=pt(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new yt(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(ht(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=mt(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=bt(this,t,n);let i=mt(this.text,mt(r.text,ht(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):ft.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
1
|
+
var e=1024,t=0,n=class{constructor(e,t){this.from=e,this.to=t}},r=class{constructor(e={}){this.id=t++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error(`This node type doesn't define a deserialize function`)}),this.combine=e.combine||null}add(e){if(this.perNode)throw RangeError(`Can't add per-node props to node types`);return typeof e!=`function`&&(e=o.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};r.closedBy=new r({deserialize:e=>e.split(` `)}),r.openedBy=new r({deserialize:e=>e.split(` `)}),r.group=new r({deserialize:e=>e.split(` `)}),r.isolate=new r({deserialize:e=>{if(e&&e!=`rtl`&&e!=`ltr`&&e!=`auto`)throw RangeError(`Invalid value for isolate: `+e);return e||`auto`}}),r.contextHash=new r({perNode:!0}),r.lookAhead=new r({perNode:!0}),r.mounted=new r({perNode:!0});var i=class{constructor(e,t,n,r=!1){this.tree=e,this.overlay=t,this.parser=n,this.bracketed=r}static get(e){return e&&e.props&&e.props[r.mounted.id]}},a=Object.create(null),o=class e{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(t){let n=t.props&&t.props.length?Object.create(null):a,r=+!!t.top|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),i=new e(t.name||``,n,t.id,r);if(t.props){for(let e of t.props)if(Array.isArray(e)||(e=e(i)),e){if(e[0].perNode)throw RangeError(`Can't store a per-node prop on a node type`);n[e[0].id]=e[1]}}return i}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(r.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let r of n.split(` `))t[r]=e[n];return e=>{for(let n=e.prop(r.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}};o.none=new o(``,Object.create(null),0,8);var s=class e{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError(`Node type ids should correspond to array positions when creating a node set`)}extend(...t){let n=[];for(let e of this.types){let r=null;for(let n of t){let t=n(e);if(t){r||=Object.assign({},e.props);let n=t[1],i=t[0];i.combine&&i.id in r&&(n=i.combine(r[i.id],n)),r[i.id]=n}}n.push(r?new o(e.name,r,e.id,e.flags):e)}return new e(n)}},c=new WeakMap,l=new WeakMap,u;(function(e){e[e.ExcludeBuffers=1]=`ExcludeBuffers`,e[e.IncludeAnonymous=2]=`IncludeAnonymous`,e[e.IgnoreMounts=4]=`IgnoreMounts`,e[e.IgnoreOverlays=8]=`IgnoreOverlays`,e[e.EnterBracketed=16]=`EnterBracketed`})(u||={});var d=class e{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length){this.props=Object.create(null);for(let[e,t]of i)this.props[typeof e==`number`?e:e.id]=t}}toString(){let e=i.get(this);if(e&&!e.overlay)return e.tree.toString();let t=``;for(let e of this.children){let n=e.toString();n&&(t&&(t+=`,`),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?`(`+t+`)`:``):t}cursor(e=0){return new ne(this.topNode,e)}cursorAt(e,t=0,n=0){let r=new ne(c.get(this)||this.topNode);return r.moveTo(e,t),c.set(this,r._tree),r}get topNode(){return new _(this,0,0,null)}resolve(e,t=0){let n=h(c.get(this)||this.topNode,e,t,!1);return c.set(this,n),n}resolveInner(e,t=0){let n=h(l.get(this)||this.topNode,e,t,!0);return l.set(this,n),n}resolveStack(e,t=0){return te(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:i=this.length}=e,a=e.mode||0,o=(a&u.IncludeAnonymous)>0;for(let e=this.cursor(a|u.IncludeAnonymous);;){let a=!1;if(e.from<=i&&e.to>=r&&(!o&&e.type.isAnonymous||t(e)!==!1)){if(e.firstChild())continue;a=!0}for(;a&&n&&(o||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;a=!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(t={}){return this.children.length<=8?this:se(o.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,r)=>new e(this.type,t,n,r,this.propValues),t.makeTree||((t,n,r)=>new e(o.none,t,n,r)))}static build(e){return ie(e)}};d.empty=new d(o.none,[],[],0);var f=class e{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 e(this.buffer,this.index)}},p=class e{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return o.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(`,`)}childString(e){let t=this.buffer[e],n=this.buffer[e+3],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),e+=4,n==e)return i;let a=[];for(;e<n;)a.push(this.childString(e)),e=this.buffer[e+3];return i+`(`+a.join(`,`)+`)`}findChild(e,t,n,r,i){let{buffer:a}=this,o=-1;for(let s=e;s!=t&&!(m(i,r,a[s+1],a[s+2])&&(o=s,n>0));s=a[s+3]);return o}slice(t,n,r){let i=this.buffer,a=new Uint16Array(n-t),o=0;for(let e=t,s=0;e<n;){a[s++]=i[e++],a[s++]=i[e++]-r;let n=a[s++]=i[e++]-r;a[s++]=i[e++]-t,o=Math.max(o,n)}return new e(a,o,this.set)}};function m(e,t,n,r){switch(e){case-2:return n<t;case-1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function h(e,t,n,r){for(;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof _&&e.index<0?null:e.parent;if(!t)return e;e=t}let i=r?0:u.IgnoreOverlays;if(r)for(let r=e,a=r.parent;a;r=a,a=r.parent)r instanceof _&&r.index<0&&a.enter(t,n,i)?.from!=r.from&&(e=a);for(;;){let r=e.enter(t,n,i);if(!r)return e;e=r}}var g=class{cursor(e=0){return new ne(this,e)}getChild(e,t=null,n=null){let r=v(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return v(this,e,t,n)}resolve(e,t=0){return h(this,e,t,!1)}resolveInner(e,t=0){return h(this,e,t,!0)}matchContext(e){return y(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}},_=class e extends g{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,n,r,a,o=0){for(let s=this;;){for(let{children:c,positions:l}=s._tree,f=n>0?c.length:-1;t!=f;t+=n){let f=c[t],h=l[t]+s.from,g;if(o&u.EnterBracketed&&f instanceof d&&(g=i.get(f))&&!g.overlay&&g.bracketed&&r>=h&&r<=h+f.length||m(a,r,h,h+f.length)){if(f instanceof p){if(o&u.ExcludeBuffers)continue;let e=f.findChild(0,f.buffer.length,n,r-h,a);if(e>-1)return new b(new ee(s,f,t,h),null,e)}else if(o&u.IncludeAnonymous||!f.type.isAnonymous||re(f)){let c;if(!(o&u.IgnoreMounts)&&(c=i.get(f))&&!c.overlay)return new e(c.tree,h,t,s);let l=new e(f,h,t,s);return o&u.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(n<0?f.children.length-1:0,n,r,a,o)}}}if(o&u.IncludeAnonymous||!s.type.isAnonymous||(t=s.index>=0?s.index+n:n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(t,n,r=0){let a;if(!(r&u.IgnoreOverlays)&&(a=i.get(this._tree))&&a.overlay){let i=t-this.from,o=r&u.EnterBracketed&&a.bracketed;for(let{from:t,to:r}of a.overlay)if((n>0||o?t<=i:t<i)&&(n<0||o?r>=i:r>i))return new e(a.tree,a.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function v(e,t,n,r){let i=e.cursor(),a=[];if(!i.firstChild())return a;if(n!=null){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return a}for(;;){if(r!=null&&i.type.is(r))return a;if(i.type.is(t)&&a.push(i.node),!i.nextSibling())return r==null?a:[]}}function y(e,t,n=t.length-1){for(let r=e;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}var ee=class{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}},b=class e extends g{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,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(t,n,r){let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],t,n-this.context.start,r);return a<0?null:new e(this.context,this,a)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(t,n,r=0){if(r&u.ExcludeBuffers)return null;let{buffer:i}=this.context,a=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,t-this.context.start,n);return a<0?null:new e(this.context,this,a)}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:t}=this.context,n=t.buffer[this.index+3];return n<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new e(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new e(this.context,this._parent,t.findChild(n,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let a=n.buffer[this.index+1];e.push(n.slice(r,i,a)),t.push(0)}return new d(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function x(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof _&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new S(i,n)}var S=class{constructor(e,t){this.heads=e,this.node=t}get next(){return x(this.heads)}};function te(e,t,n){let r=e.resolveInner(t,n),a=null;for(let e=r instanceof _?r:r.context.parent;e;e=e.parent)if(e.index<0){let i=e.parent;(a||=[r]).push(i.resolve(t,n)),e=i}else{let o=i.get(e.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let i=new _(o.tree,o.overlay[0].from+e.from,-1,e);(a||=[r]).push(h(i,t,n,!1))}}return a?x(a):r}var ne=class{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~u.EnterBracketed,e instanceof _)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.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:n,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return e?e instanceof _?(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,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return i<0?!1:(this.stack.push(this.index),this.yieldBuf(i))}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,n=this.mode){return this.buffer?n&u.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&u.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&u.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,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,i=e<0?-1:n._tree.children.length;r!=i;r+=e){let e=n._tree.children[r];if(this.mode&u.IncludeAnonymous||e instanceof p||!e.type.isAnonymous||re(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)scan:for(let r=this.index,i=this.stack.length;i>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,n=i+1;break scan}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new b(this.buffer,t,this.stack[e]);return this.bufferNode=new b(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return y(this.node.parent,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return y(this._tree,e,r);let a=n[t.buffer[this.stack[i]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}};function re(e){return e.children.some(e=>e instanceof p||!e.type.isAnonymous||re(e))}function ie(t){let{buffer:n,nodeSet:i,maxBufferLength:a=e,reused:o=[],minRepeatType:s=i.types.length}=t,c=Array.isArray(n)?new f(n,n.length):n,l=i.types,u=0,m=0;function h(e,t,n,r,d,f){let{id:x,start:S,end:te,size:ne}=c,re=m,ie=u;if(ne<0){if(c.next(),ne==-1){let t=o[x];n.push(t),r.push(S-e);return}if(ne==-3){u=x;return}if(ne==-4){m=x;return}throw RangeError(`Unrecognized record size: ${ne}`)}let ae=l[x],oe,ce,le=S-e;if(te-S<=a&&(ce=ee(c.pos-t,d))){let t=new Uint16Array(ce.size-ce.skip),n=c.pos-ce.size,r=t.length;for(;c.pos>n;)r=b(ce.start,t,r);oe=new p(t,te-ce.start,i),le=ce.start-e}else{let e=c.pos-ne;c.next();let t=[],n=[],r=x>=s?x:-1,i=0,o=te,l=re;for(;c.pos>e;)r>=0&&c.id==r&&c.size>=0?(c.end<=o-a&&(v(t,n,S,i,c.end,o,r,l,ie),i=t.length,o=c.end,l=m),c.next()):f>2500?g(S,e,t,n):h(S,e,t,n,r,f+1);if(r>=0&&i>0&&i<t.length&&v(t,n,S,i,S,o,r,l,ie),t.reverse(),n.reverse(),r>-1&&i>0){let e=_(ae,ie);oe=se(ae,t,n,0,t.length,0,te-S,e,e)}else oe=y(ae,t,n,te-S,re-te,ie)}n.push(oe),r.push(le)}function g(e,t,n,r){let o=[],s=0,l=-1;for(;c.pos>t;){let{id:e,start:t,end:n,size:r}=c;if(r>4)c.next();else if(l>-1&&t<l)break;else l<0&&(l=n-a),o.push(e,t,n),s++,c.next()}if(s){let t=new Uint16Array(s*4),a=o[o.length-2];for(let e=o.length-3,n=0;e>=0;e-=3)t[n++]=o[e],t[n++]=o[e+1]-a,t[n++]=o[e+2]-a,t[n++]=n;n.push(new p(t,o[2]-a,i)),r.push(a-e)}}function _(e,t){return(n,i,a)=>{let o=0,s=n.length-1,c,l;if(s>=0&&(c=n[s])instanceof d){if(!s&&c.type==e&&c.length==a)return c;(l=c.prop(r.lookAhead))&&(o=i[s]+c.length+l-a)}return y(e,n,i,a,o,t)}}function v(e,t,n,r,a,o,s,c,l){let u=[],d=[];for(;e.length>r;)u.push(e.pop()),d.push(t.pop()+n-a);e.push(y(i.types[s],u,d,o-a,c-o,l)),t.push(a-n)}function y(e,t,n,i,a,o,s){if(o){let e=[r.contextHash,o];s=s?[e].concat(s):[e]}if(a>25){let e=[r.lookAhead,a];s=s?[e].concat(s):[e]}return new d(e,t,n,i,s)}function ee(e,t){let n=c.fork(),r=0,i=0,o=0,l=n.end-a,u={size:0,start:0,skip:0};scan:for(let a=n.pos-e;n.pos>a;){let e=n.size;if(n.id==t&&e>=0){u.size=r,u.start=i,u.skip=o,o+=4,r+=4,n.next();continue}let c=n.pos-e;if(e<0||c<a||n.start<l)break;let d=n.id>=s?4:0,f=n.start;for(n.next();n.pos>c;){if(n.size<0){if(n.size==-3||n.size==-4)d+=4;else break scan}else n.id>=s&&(d+=4);n.next()}i=f,r+=e,o+=d}return(t<0||r==e)&&(u.size=r,u.start=i,u.skip=o),u.size>4?u:void 0}function b(e,t,n){let{id:r,start:i,end:a,size:o}=c;if(c.next(),o>=0&&r<s){let s=n;if(o>4){let r=c.pos-(o-4);for(;c.pos>r;)n=b(e,t,n)}t[--n]=s,t[--n]=a-e,t[--n]=i-e,t[--n]=r}else o==-3?u=r:o==-4&&(m=r);return n}let x=[],S=[];for(;c.pos>0;)h(t.start||0,t.bufferStart||0,x,S,-1,0);let te=t.length??(x.length?S[0]+x[0].length:0);return new d(l[t.topID],x.reverse(),S.reverse(),te)}var ae=new WeakMap;function oe(e,t){if(!e.isAnonymous||t instanceof p||t.type!=e)return 1;let n=ae.get(t);if(n==null){n=1;for(let r of t.children){if(r.type!=e||!(r instanceof d)){n=1;break}n+=oe(e,r)}ae.set(t,n)}return n}function se(e,t,n,r,i,a,o,s,c){let l=0;for(let n=r;n<i;n++)l+=oe(e,t[n]);let u=Math.ceil(l*1.5/8),d=[],f=[];function p(t,n,r,i,o){for(let s=r;s<i;){let r=s,l=n[s],m=oe(e,t[s]);for(s++;s<i;s++){let n=oe(e,t[s]);if(m+n>=u)break;m+=n}if(s==r+1){if(m>u){let e=t[r];p(e.children,e.positions,0,e.children.length,n[r]+o);continue}d.push(t[r])}else{let i=n[s-1]+t[s-1].length-l;d.push(se(e,t,n,r,s,l,i,null,c))}f.push(l+o-a)}}return p(t,n,r,i,0),(s||c)(d,f,o)}var ce=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof b?this.setBuffer(e.context.buffer,e.index,t):e instanceof _&&this.map.set(e.tree,t)}get(e){return e instanceof b?this.getBuffer(e.context.buffer,e.index):e instanceof _?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)}},le=class e{constructor(e,t,n,r,i=!1,a=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=!!i|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,n=[],r=!1){let i=[new e(0,t.length,t,0,!1,r)];for(let e of n)e.to>t.length&&i.push(e);return i}static applyChanges(t,n,r=128){if(!n.length)return t;let i=[],a=1,o=t.length?t[0]:null;for(let s=0,c=0,l=0;;s++){let u=s<n.length?n[s]:null,d=u?u.fromA:1e9;if(d-c>=r)for(;o&&o.from<d;){let n=o;if(c>=n.from||d<=n.to||l){let t=Math.max(n.from,c)-l,r=Math.min(n.to,d)-l;n=t>=r?null:new e(t,r,n.tree,n.offset+l,s>0,!!u)}if(n&&i.push(n),o.to>d)break;o=a<t.length?t[a++]:null}if(!u)break;c=u.toA,l=u.toA-u.toB}return i}},ue=class{startParse(e,t,r){return typeof e==`string`&&(e=new de(e)),r=r?r.length?r.map(e=>new n(e.from,e.to)):[new n(0,0)]:[new n(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}},de=class{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 fe(e){return(t,n,r,i)=>new _e(t,e,n,r,i)}var pe=class{constructor(e,t,n,r,i,a){this.parser=e,this.parse=t,this.overlay=n,this.bracketed=r,this.target=i,this.from=a}};function me(e){if(!e.length||e.some(e=>e.from>=e.to))throw RangeError(`Invalid inner parse ranges given: `+JSON.stringify(e))}var he=class{constructor(e,t,n,r,i,a,o,s){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=i,this.bracketed=a,this.target=o,this.prev=s,this.depth=0,this.ranges=[]}},ge=new r({perNode:!0}),_e=class{constructor(e,t,n,r,i){this.nest=t,this.input=n,this.fragments=r,this.ranges=i,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),this.stoppedAt!=null)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return this.stoppedAt!=null&&(e=new d(e.type,e.children,e.positions,e.length,e.propValues.concat([[ge,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[r.mounted.id]=new i(t,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new Se(this.fragments),t=null,r=null,i=new ne(new _(this.baseTree,this.ranges[0].from,0,null),u.IncludeAnonymous|u.IgnoreMounts);scan:for(let a,o;;){let s=!0,c;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)s=!1;else if(e.hasNode(i)){if(t){let e=t.mounts.find(e=>e.frag.from<=i.from&&e.frag.to>=i.to&&e.mount.overlay);if(e)for(let n of e.mount.overlay){let r=n.from+e.pos,a=n.to+e.pos;r>=i.from&&a<=i.to&&!t.ranges.some(e=>e.from<a&&e.to>r)&&t.ranges.push({from:r,to:a})}}s=!1}else if(r&&(o=ve(r.ranges,i.from,i.to)))s=o!=2;else if(!i.type.isAnonymous&&(a=this.nest(i,this.input))&&(i.from<i.to||!a.overlay)){i.tree||(be(i),t&&t.depth++,r&&r.depth++);let o=e.findMounts(i.from,a.parser);if(typeof a.overlay==`function`)t=new he(a.parser,a.overlay,o,this.inner.length,i.from,!!a.bracketed,i.tree,t);else{let e=Ce(this.ranges,a.overlay||(i.from<i.to?[new n(i.from,i.to)]:[]));e.length&&me(e),(e.length||!a.overlay)&&this.inner.push(new pe(a.parser,e.length?a.parser.startParse(this.input,Te(o,e),e):a.parser.startParse(``),a.overlay?a.overlay.map(e=>new n(e.from-i.from,e.to-i.from)):null,!!a.bracketed,i.tree,e.length?e[0].from:i.from)),a.overlay?e.length&&(r={ranges:e,depth:0,prev:r}):s=!1}}else if(t&&(c=t.predicate(i))&&(c===!0&&(c=new n(i.from,i.to)),c.from<c.to)){let e=t.ranges.length-1;e>=0&&t.ranges[e].to==c.from?t.ranges[e]={from:t.ranges[e].from,to:c.to}:t.ranges.push(c)}if(s&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break scan;if(t&&!--t.depth){let e=Ce(this.ranges,t.ranges);e.length&&(me(e),this.inner.splice(t.index,0,new pe(t.parser,t.parser.startParse(this.input,Te(t.mounts,e),e),t.ranges.map(e=>new n(e.from-t.start,e.to-t.start)),t.bracketed,t.target,e[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}};function ve(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}function ye(e,t,n,r,i,a){if(t<n){let o=e.buffer[t+1];r.push(e.slice(t,n,o)),i.push(o-a)}}function be(e){let{node:t}=e,n=[],r=t.context.buffer;do n.push(e.index),e.parent();while(!e.tree);let i=e.tree,a=i.children.indexOf(r),s=i.children[a],c=s.buffer,l=[a];function u(e,r,i,a,o,f){let p=n[f],m=[],h=[];ye(s,e,p,m,h,a);let g=c[p+1],_=c[p+2];l.push(m.length);let v=f?u(p+4,c[p+3],s.set.types[c[p]],g,_-g,f-1):t.toTree();return m.push(v),h.push(g-a),ye(s,c[p+3],r,m,h,a),new d(i,m,h,o)}i.children[a]=u(0,c.length,o.none,0,s.length,n.length-1);for(let t of l){let n=e.tree.children[t],r=e.tree.positions[t];e.yield(new _(n,r+e.from,t,e._tree))}}var xe=class{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(u.IncludeAnonymous|u.IgnoreMounts|u.ExcludeBuffers)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)if(!(t.to>=n&&t.enter(n,1,u.IncludeAnonymous|u.IgnoreOverlays|u.ExcludeBuffers))){if(t.to<=n)t.next(!1)||(this.done=!0);else break}}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 d)t=t.children[0];else break}return!1}},Se=class{constructor(e){if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let t=this.curFrag=e[0];this.curTo=t.tree.prop(ge)??t.to,this.inner=new xe(t.tree,-t.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(){if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let e=this.curFrag=this.fragments[this.fragI];this.curTo=e.tree.prop(ge)??e.to,this.inner=new xe(e.tree,-e.offset)}}findMounts(e,t){let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let i=e.tree?.prop(r.mounted);if(i&&i.parser==t)for(let t=this.fragI;t<this.fragments.length;t++){let r=this.fragments[t];if(r.from>=e.to)break;r.tree==this.curFrag.tree&&n.push({frag:r,pos:e.from-r.offset,mount:i})}}}return n}};function Ce(e,t){let r=null,i=t;for(let a=1,o=0;a<e.length;a++){let s=e[a-1].to,c=e[a].from;for(;o<i.length;o++){let e=i[o];if(e.from>=c)break;e.to<=s||(r||(i=r=t.slice()),e.from<s?(r[o]=new n(e.from,s),e.to>c&&r.splice(o+1,0,new n(c,e.to))):e.to>c?r[o--]=new n(c,e.to):r.splice(o--,1))}}return i}function we(e,t,r,i){let a=0,o=0,s=!1,c=!1,l=-1e9,u=[];for(;;){let d=a==e.length?1e9:s?e[a].to:e[a].from,f=o==t.length?1e9:c?t[o].to:t[o].from;if(s!=c){let e=Math.max(l,r),t=Math.min(d,f,i);e<t&&u.push(new n(e,t))}if(l=Math.min(d,f),l==1e9)break;d==l&&(s?(s=!1,a++):s=!0),f==l&&(c?(c=!1,o++):c=!0)}return u}function Te(e,t){let r=[];for(let{pos:i,mount:a,frag:o}of e){let e=i+(a.overlay?a.overlay[0].from:0),s=e+a.tree.length,c=Math.max(o.from,e),l=Math.min(o.to,s);if(a.overlay){let s=we(t,a.overlay.map(e=>new n(e.from+i,e.to+i)),c,l);for(let t=0,n=c;;t++){let i=t==s.length,c=i?l:s[t].from;if(c>n&&r.push(new le(n,c,a.tree,-e,o.from>=n||o.openStart,o.to<=c||o.openEnd)),i)break;n=s[t].to}}else r.push(new le(c,l,a.tree,-e,o.from>=e||o.openStart,o.to<=s||o.openEnd))}return r}var Ee=0,De=class e{constructor(e,t,n,r){this.name=e,this.set=t,this.base=n,this.modified=r,this.id=Ee++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(t,n){let r=typeof t==`string`?t:`?`;if(t instanceof e&&(n=t),n?.base)throw Error(`Can not derive from a modified tag`);let i=new e(r,[],null,[]);if(i.set.push(i),n)for(let e of n.set)i.set.push(e);return i}static defineModifier(e){let t=new ke(e);return e=>e.modified.indexOf(t)>-1?e:ke.get(e.base||e,e.modified.concat(t).sort((e,t)=>e.id-t.id))}},Oe=0,ke=class e{constructor(e){this.name=e,this.instances=[],this.id=Oe++}static get(t,n){if(!n.length)return t;let r=n[0].instances.find(e=>e.base==t&&Ae(n,e.modified));if(r)return r;let i=[],a=new De(t.name,i,t,n);for(let e of n)e.instances.push(a);let o=je(n);for(let n of t.set)if(!n.modified.length)for(let t of o)i.push(e.get(n,t));return a}};function Ae(e,t){return e.length==t.length&&e.every((e,n)=>e==t[n])}function je(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}function Me(e){let t=Object.create(null);for(let n in e){let r=e[n];Array.isArray(r)||(r=[r]);for(let e of n.split(` `))if(e){let n=[],i=2,a=e;for(let t=0;;){if(a==`...`&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!r)throw RangeError(`Invalid path: `+e);if(n.push(r[0]==`*`?``:r[0][0]==`"`?JSON.parse(r[0]):r[0]),t+=r[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&o==`!`){i=0;break}if(o!=`/`)throw RangeError(`Invalid path: `+e);a=e.slice(t)}let o=n.length-1,s=n[o];if(!s)throw RangeError(`Invalid path: `+e);t[s]=new Pe(r,i,o>0?n.slice(0,o):null).sort(t[s])}}return Ne.add(t)}var Ne=new r({combine(e,t){let n,r,i;for(;e||t;){if(!e||t&&e.depth<=t.depth?(i=t,t=t.next):(i=e,e=e.next),n&&n.mode==i.mode&&!i.context&&!n.context)continue;let a=new Pe(i.tags,i.mode,i.context);n?n.next=a:r=a,n=a}return r}}),Pe=class{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};Pe.empty=new Pe([],2,null);function Fe(e,t){let n=Object.create(null);for(let t of e)if(!Array.isArray(t.tag))n[t.tag.id]=t.class;else for(let e of t.tag)n[e.id]=t.class;let{scope:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+` `+r:r;break}}return t},scope:r}}function Ie(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+` `+e:e)}return n}function Le(e,t,n,r=0,i=e.length){let a=new Re(r,Array.isArray(t)?t:[t],n);a.highlightRange(e.cursor(),r,i,``,a.highlighters),a.flush(i)}var Re=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,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,n,i,a){let{type:o,from:s,to:c}=e;if(s>=n||c<=t)return;o.isTop&&(a=this.highlighters.filter(e=>!e.scope||e.scope(o)));let l=i,u=ze(e)||Pe.empty,d=Ie(a,u.tags);if(d&&(l&&(l+=` `),l+=d,u.mode==1&&(i+=(i?` `:``)+d)),this.startSpan(Math.max(t,s),l),u.opaque)return;let f=e.tree&&e.tree.prop(r.mounted);if(f&&f.overlay){let r=e.node.enter(f.overlay[0].from+s,1),o=this.highlighters.filter(e=>!e.scope||e.scope(f.tree.type)),u=e.firstChild();for(let d=0,p=s;;d++){let m=d<f.overlay.length?f.overlay[d]:null,h=m?m.from+s:c,g=Math.max(t,p),_=Math.min(n,h);if(g<_&&u)for(;e.from<_&&(this.highlightRange(e,g,_,i,a),this.startSpan(Math.min(_,e.to),l),!(e.to>=h||!e.nextSibling())););if(!m||h>n)break;p=m.to+s,p>t&&(this.highlightRange(r.cursor(),Math.max(t,m.from+s),Math.min(n,p),``,o),this.startSpan(Math.min(n,p),l))}u&&e.parent()}else if(e.firstChild()){f&&(i=``);do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,i,a),this.startSpan(Math.min(n,e.to),l)}while(e.nextSibling());e.parent()}}};function ze(e){let t=e.type.prop(Ne);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}var C=De.define,Be=C(),Ve=C(),He=C(Ve),Ue=C(Ve),We=C(),Ge=C(We),Ke=C(We),qe=C(),Je=C(qe),Ye=C(),Xe=C(),Ze=C(),Qe=C(Ze),$e=C(),w={comment:Be,lineComment:C(Be),blockComment:C(Be),docComment:C(Be),name:Ve,variableName:C(Ve),typeName:He,tagName:C(He),propertyName:Ue,attributeName:C(Ue),className:C(Ve),labelName:C(Ve),namespace:C(Ve),macroName:C(Ve),literal:We,string:Ge,docString:C(Ge),character:C(Ge),attributeValue:C(Ge),number:Ke,integer:C(Ke),float:C(Ke),bool:C(We),regexp:C(We),escape:C(We),color:C(We),url:C(We),keyword:Ye,self:C(Ye),null:C(Ye),atom:C(Ye),unit:C(Ye),modifier:C(Ye),operatorKeyword:C(Ye),controlKeyword:C(Ye),definitionKeyword:C(Ye),moduleKeyword:C(Ye),operator:Xe,derefOperator:C(Xe),arithmeticOperator:C(Xe),logicOperator:C(Xe),bitwiseOperator:C(Xe),compareOperator:C(Xe),updateOperator:C(Xe),definitionOperator:C(Xe),typeOperator:C(Xe),controlOperator:C(Xe),punctuation:Ze,separator:C(Ze),bracket:Qe,angleBracket:C(Qe),squareBracket:C(Qe),paren:C(Qe),brace:C(Qe),content:qe,heading:Je,heading1:C(Je),heading2:C(Je),heading3:C(Je),heading4:C(Je),heading5:C(Je),heading6:C(Je),contentSeparator:C(qe),list:C(qe),quote:C(qe),emphasis:C(qe),strong:C(qe),link:C(qe),monospace:C(qe),strikethrough:C(qe),inserted:C(),deleted:C(),changed:C(),invalid:C(),meta:$e,documentMeta:C($e),annotation:C($e),processingInstruction:C($e),definition:De.defineModifier(`definition`),constant:De.defineModifier(`constant`),function:De.defineModifier(`function`),standard:De.defineModifier(`standard`),local:De.defineModifier(`local`),special:De.defineModifier(`special`)};for(let e in w){let t=w[e];t instanceof De&&(t.name=e)}Fe([{tag:w.link,class:`tok-link`},{tag:w.heading,class:`tok-heading`},{tag:w.emphasis,class:`tok-emphasis`},{tag:w.strong,class:`tok-strong`},{tag:w.keyword,class:`tok-keyword`},{tag:w.atom,class:`tok-atom`},{tag:w.bool,class:`tok-bool`},{tag:w.url,class:`tok-url`},{tag:w.labelName,class:`tok-labelName`},{tag:w.inserted,class:`tok-inserted`},{tag:w.deleted,class:`tok-deleted`},{tag:w.literal,class:`tok-literal`},{tag:w.string,class:`tok-string`},{tag:w.number,class:`tok-number`},{tag:[w.regexp,w.escape,w.special(w.string)],class:`tok-string2`},{tag:w.variableName,class:`tok-variableName`},{tag:w.local(w.variableName),class:`tok-variableName tok-local`},{tag:w.definition(w.variableName),class:`tok-variableName tok-definition`},{tag:w.special(w.variableName),class:`tok-variableName2`},{tag:w.definition(w.propertyName),class:`tok-propertyName tok-definition`},{tag:w.typeName,class:`tok-typeName`},{tag:w.namespace,class:`tok-namespace`},{tag:w.className,class:`tok-className`},{tag:w.macroName,class:`tok-macroName`},{tag:w.propertyName,class:`tok-propertyName`},{tag:w.operator,class:`tok-operator`},{tag:w.comment,class:`tok-comment`},{tag:w.meta,class:`tok-meta`},{tag:w.invalid,class:`tok-invalid`},{tag:w.punctuation,class:`tok-punctuation`}]);var et=[],tt=[];(()=>{let e=`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,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5`.split(`,`).map(e=>e?parseInt(e,36):1);for(let t=0,n=0;t<e.length;t++)(t%2?tt:et).push(n+=e[t])})();function nt(e){if(e<768)return!1;for(let t=0,n=et.length;;){let r=t+n>>1;if(e<et[r])n=r;else if(e>=tt[r])t=r+1;else return!0;if(t==n)return!1}}function rt(e){return e>=127462&&e<=127487}var it=8205;function at(e,t,n=!0,r=!0){return(n?ot:st)(e,t,r)}function ot(e,t,n){if(t==e.length)return t;t&<(e.charCodeAt(t))&&ut(e.charCodeAt(t-1))&&t--;let r=ct(e,t);for(t+=dt(r);t<e.length;){let i=ct(e,t);if(r==it||i==it||n&&nt(i))t+=dt(i),r=i;else if(rt(i)){let n=0,r=t-2;for(;r>=0&&rt(ct(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function st(e,t,n){for(;t>1;){let r=ot(e,t-2,n);if(r<t)return r;t--}return 0}function ct(e,t){let n=e.charCodeAt(t);if(!ut(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return lt(r)?(n-55296<<10)+(r-56320)+65536:n}function lt(e){return e>=56320&&e<57344}function ut(e){return e>=55296&&e<56320}function dt(e){return e<65536?1:2}var T=class e{lineAt(e){if(e<0||e>this.length)throw 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 RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=bt(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),ft.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=bt(this,e,t);let n=[];return this.decompose(e,t,n,0),ft.from(n,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),n=this.length-this.scanIdentical(e,-1),r=new gt(this),i=new gt(e);for(let e=t,a=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(a+=r.value.length,r.done||a>=n)return!0}}iter(e=1){return new gt(this,e)}iterRange(e,t=this.length){return new _t(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t??=this.lines+1;let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new vt(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(t){if(t.length==0)throw RangeError(`A document must have at least one line`);return t.length==1&&!t[0]?e.empty:t.length<=32?new E(t):ft.from(E.split(t,[]))}},E=class e extends T{constructor(e,t=pt(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.text[i],o=r+a.length;if((t?n:o)>=e)return new yt(r,o,n,a);r=o+1,n++}}decompose(t,n,r,i){let a=t<=0&&n>=this.length?this:new e(ht(this.text,t,n),Math.min(n,this.length)-Math.max(0,t));if(i&1){let t=r.pop(),n=mt(a.text,t.text.slice(),0,a.length);if(n.length<=32)r.push(new e(n,t.length+a.length));else{let t=n.length>>1;r.push(new e(n.slice(0,t)),new e(n.slice(t)))}}else r.push(a)}replace(t,n,r){if(!(r instanceof e))return super.replace(t,n,r);[t,n]=bt(this,t,n);let i=mt(this.text,mt(r.text,ht(this.text,0,t)),n),a=this.length+r.length-(n-t);return i.length<=32?new e(i,a):ft.from(e.split(i,[]),a)}sliceString(e,t=this.length,n=`
|
|
2
2
|
`){[e,t]=bt(this,e,t);let r=``;for(let i=0,a=0;i<=t&&a<this.text.length;a++){let o=this.text[a],s=i+o.length;i>e&&a&&(r+=n),e<s&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=s+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(t,n){let r=[],i=-1;for(let a of t)r.push(a),i+=a.length+1,r.length==32&&(n.push(new e(r,i)),r=[],i=-1);return i>-1&&n.push(new e(r,i)),n}},ft=class e extends T{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,n,r){for(let i=0;;i++){let a=this.children[i],o=r+a.length,s=n+a.lines-1;if((t?s:o)>=e)return a.lineInner(e,t,n,r);r=o+1,n=s+1}}decompose(e,t,n,r){for(let i=0,a=0;a<=t&&i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(e<=s&&t>=a){let i=r&(a<=e|(s>=t?2:0));a>=e&&s<=t&&!i?n.push(o):o.decompose(e-a,t-a,n,i)}a=s+1}}replace(t,n,r){if([t,n]=bt(this,t,n),r.lines<this.lines)for(let i=0,a=0;i<this.children.length;i++){let o=this.children[i],s=a+o.length;if(t>=a&&n<=s){let c=o.replace(t-a,n-a,r),l=this.lines-o.lines+c.lines;if(c.lines<l>>4&&c.lines>l>>6){let a=this.children.slice();return a[i]=c,new e(a,this.length-(n-t)+r.length)}return super.replace(a,s,c)}a=s+1}return super.replace(t,n,r)}sliceString(e,t=this.length,n=`
|
|
3
3
|
`){[e,t]=bt(this,e,t);let r=``;for(let i=0,a=0;i<this.children.length&&a<=t;i++){let o=this.children[i],s=a+o.length;a>e&&i&&(r+=n),e<s&&t>a&&(r+=o.sliceString(e-a,t-a,n)),a=s+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(t,n){if(!(t instanceof e))return 0;let r=0,[i,a,o,s]=n>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;i+=n,a+=n){if(i==o||a==s)return r;let e=this.children[i],c=t.children[a];if(e!=c)return r+e.scanIdentical(c,n);r+=e.length+1}}static from(t,n=t.reduce((e,t)=>e+t.length+1,-1)){let r=0;for(let e of t)r+=e.lines;if(r<32){let e=[];for(let n of t)n.flatten(e);return new E(e,n)}let i=Math.max(32,r>>5),a=i<<1,o=i>>1,s=[],c=0,l=-1,u=[];function d(t){let n;if(t.lines>a&&t instanceof e)for(let e of t.children)d(e);else t.lines>o&&(c>o||!c)?(f(),s.push(t)):t instanceof E&&c&&(n=u[u.length-1])instanceof E&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new E(n.text.concat(t.text),n.length+1+t.length)):(c+t.lines>i&&f(),c+=t.lines,l+=t.length+1,u.push(t))}function f(){c!=0&&(s.push(u.length==1?u[0]:e.from(u,l)),l=-1,c=u.length=0)}for(let e of t)d(e);return f(),s.length==1?s[0]:new e(s,n)}};T.empty=new E([``],0);function pt(e){let t=-1;for(let n of e)t+=n.length+1;return t}function mt(e,t,n=0,r=1e9){for(let i=0,a=0,o=!0;a<e.length&&i<=r;a++){let s=e[a],c=i+s.length;c>=n&&(c>r&&(s=s.slice(0,r-i)),i<n&&(s=s.slice(n-i)),o?(t[t.length-1]+=s,o=!1):t.push(s)),i=c+1}return t}function ht(e,t,n){return mt(e,[``],t,n)}var gt=class{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value=``,this.nodes=[e],this.offsets=[t>0?1:(e instanceof E?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],a=i>>1,o=r instanceof E?r.text.length:r.children.length;if(a==(t>0?o:0)){if(n==0)return this.done=!0,this.value=``,this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((i&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
4
|
`,this;e--}else if(r instanceof E){let i=r.text[a+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=e==0?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[a+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof E?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},_t=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new gt(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}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 n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.slice(0,n),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!=``}},vt=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value=``,this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value=``,this.afterBreak=!1):t?(this.done=!0,this.value=``):n?this.afterBreak?this.value=``:(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<`u`&&(T.prototype[Symbol.iterator]=function(){return this.iter()},gt.prototype[Symbol.iterator]=_t.prototype[Symbol.iterator]=vt.prototype[Symbol.iterator]=function(){return this});var yt=class{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}};function bt(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function D(e,t,n=!0,r=!0){return at(e,t,n,r)}function xt(e){return e>=56320&&e<57344}function St(e){return e>=55296&&e<56320}function Ct(e,t){let n=e.charCodeAt(t);if(!St(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return xt(r)?(n-55296<<10)+(r-56320)+65536:n}function wt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Tt(e){return e<65536?1:2}var Et=/\r\n?|\n/,O=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(O||={}),Dt=class e{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,r=0;t<this.sections.length;){let i=this.sections[t++],a=this.sections[t++];a<0?(e(n,r,i),r+=i):r+=a,n+=i}}iterChangedRanges(e,t=!1){kt(this,e,t)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let n=this.sections[e++],r=this.sections[e++];r<0?t.push(n,r):t.push(r,n)}return new e(t)}composeDesc(e){return this.empty?e:e.empty?this:jt(this,e)}mapDesc(e,t=!1){return e.empty?this:At(this,e,t)}mapPos(e,t=-1,n=O.Simple){let r=0,i=0;for(let a=0;a<this.sections.length;){let o=this.sections[a++],s=this.sections[a++],c=r+o;if(s<0){if(c>e)return i+(e-r);i+=o}else{if(n!=O.Simple&&c>=e&&(n==O.TrackDel&&r<e&&c>e||n==O.TrackBefore&&r<e||n==O.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?i:i+s;i+=s}r=c}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],a=this.sections[n++],o=r+i;if(a>=0&&r<=t&&o>=e)return r<e&&o>t?`cover`:!0;r=o}return!1}toString(){let e=``;for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?` `:``)+n+(r>=0?`:`+r:``)}return e}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!=`number`))throw RangeError(`Invalid JSON representation of ChangeDesc`);return new e(t)}static create(t){return new e(t)}},k=class e extends Dt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError(`Applying change set to a document with the wrong length`);return kt(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return At(this,e,t,!0)}invert(t){let n=this.sections.slice(),r=[];for(let e=0,i=0;e<n.length;e+=2){let a=n[e],o=n[e+1];if(o>=0){n[e]=o,n[e+1]=a;let s=e>>1;for(;r.length<s;)r.push(T.empty);r.push(a?t.slice(i,i+a):T.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:jt(this,e,!0)}map(e,t=!1){return e.empty?this:At(this,e,t,!0)}iterChanges(e,t=!1){kt(this,e,t)}get desc(){return Dt.create(this.sections)}filter(t){let n=[],r=[],i=[],a=new Mt(this);done:for(let e=0,o=0;;){let s=e==t.length?1e9:t[e++];for(;o<s||o==s&&a.len==0;){if(a.done)break done;let e=Math.min(a.len,s-o);A(i,e,-1);let t=a.ins==-1?-1:a.off==0?a.ins:0;A(n,e,t),t>0&&Ot(r,n,a.text),a.forward(e),o+=e}let c=t[e++];for(;o<c;){if(a.done)break done;let e=Math.min(a.len,c-o);A(n,e,-1),A(i,e,a.ins==-1?-1:a.off==0?a.ins:0),a.forward(e),o+=e}}return{changes:new e(n,r),filtered:Dt.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):r==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(t,n,r){let i=[],a=[],o=0,s=null;function c(t=!1){if(!t&&!i.length)return;o<n&&A(i,n-o,-1);let r=new e(i,a);s=s?s.compose(r.map(s)):r,i=[],a=[],o=0}function l(t){if(Array.isArray(t))for(let e of t)l(e);else if(t instanceof e){if(t.length!=n)throw RangeError(`Mismatched change set length (got ${t.length}, expected ${n})`);c(),s=s?s.compose(t.map(s)):t}else{let{from:e,to:s=e,insert:l}=t;if(e>s||e<0||s>n)throw RangeError(`Invalid change range ${e} to ${s} (in doc of length ${n})`);let u=l?typeof l==`string`?T.of(l.split(r||Et)):l:T.empty,d=u.length;if(e==s&&d==0)return;e<o&&c(),e>o&&A(i,e-o,-1),A(i,s-e,d),Ot(a,i,u),o=s}}return l(t),c(!s),s}static empty(t){return new e(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError(`Invalid JSON representation of ChangeSet`);let n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e];if(typeof i==`number`)n.push(i,-1);else if(!Array.isArray(i)||typeof i[0]!=`number`||i.some((e,t)=>t&&typeof e!=`string`))throw RangeError(`Invalid JSON representation of ChangeSet`);else if(i.length==1)n.push(i[0],0);else{for(;r.length<e;)r.push(T.empty);r[e]=T.of(i.slice(1)),n.push(i[0],r[e].length)}}return new e(n,r)}static createSet(t,n){return new e(t,n)}};function A(e,t,n,r=!1){if(t==0&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:i>=0&&t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function Ot(e,t,n){if(n.length==0)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(T.empty);e.push(n)}}function kt(e,t,n){let r=e.inserted;for(let i=0,a=0,o=0;o<e.sections.length;){let s=e.sections[o++],c=e.sections[o++];if(c<0)i+=s,a+=s;else{let l=i,u=a,d=T.empty;for(;l+=s,u+=c,c&&r&&(d=d.append(r[o-2>>1])),!(n||o==e.sections.length||e.sections[o+1]<0);)s=e.sections[o++],c=e.sections[o++];t(i,l,a,u,d),i=l,a=u}}}function At(e,t,n,r=!1){let i=[],a=r?[]:null,o=new Mt(e),s=new Mt(t);for(let e=-1;;)if(o.done&&s.len||s.done&&o.len)throw Error(`Mismatched change set lengths`);else if(o.ins==-1&&s.ins==-1){let e=Math.min(o.len,s.len);A(i,e,-1),o.forward(e),s.forward(e)}else if(s.ins>=0&&(o.ins<0||e==o.i||o.off==0&&(s.len<o.len||s.len==o.len&&!n))){let t=s.len;for(A(i,s.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(A(i,0,o.ins),a&&Ot(a,i,o.text),e=o.i),o.forward(n),t-=n}s.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(s.ins==-1){let e=Math.min(n,s.len);t+=e,n-=e,s.forward(e)}else if(s.ins==0&&s.len<n)n-=s.len,s.next();else break;A(i,t,e<o.i?o.ins:0),a&&e<o.i&&Ot(a,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&s.done)return a?k.createSet(i,a):Dt.create(i);else throw Error(`Mismatched change set lengths`)}function jt(e,t,n=!1){let r=[],i=n?[]:null,a=new Mt(e),o=new Mt(t);for(let e=!1;;)if(a.done&&o.done)return i?k.createSet(r,i):Dt.create(r);else if(a.ins==0)A(r,a.len,0,e),a.next();else if(o.len==0&&!o.done)A(r,0,o.ins,e),i&&Ot(i,r,o.text),o.next();else if(a.done||o.done)throw Error(`Mismatched change set lengths`);else{let t=Math.min(a.len2,o.len),n=r.length;if(a.ins==-1){let n=o.ins==-1?-1:o.off?0:o.ins;A(r,t,n,e),i&&n&&Ot(i,r,o.text)}else o.ins==-1?(A(r,a.off?0:a.len,t,e),i&&Ot(i,r,a.textBit(t))):(A(r,a.off?0:a.len,o.off?0:o.ins,e),i&&!o.off&&Ot(i,r,o.text));e=(a.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),a.forward2(t),o.forward(t)}}var Mt=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?T.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?T.empty:t[n].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)}},Nt=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.flags=n,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(t,n=-1){let r,i;return this.empty?r=i=t.mapPos(this.from,n):(r=t.mapPos(this.from,1),i=t.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new e(r,i,this.flags,this.goalColumn)}extend(e,t=e,n=0){if(e<=this.anchor&&t>=this.anchor)return j.range(e,t,void 0,void 0,n);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return j.range(this.anchor,r,void 0,void 0,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!=`number`||typeof e.head!=`number`)throw RangeError(`Invalid JSON representation for SelectionRange`);return j.range(e.anchor,e.head)}static create(t,n,r,i){return new e(t,n,r,i)}},j=class e{constructor(e,t){this.ranges=e,this.mainIndex=t}map(t,n=-1){return t.empty?this:e.create(this.ranges.map(e=>e.map(t,n)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new e([this.main],0)}addRange(t,n=!0){return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}replaceRange(t,n=this.mainIndex){let r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!=`number`||t.main>=t.ranges.length)throw RangeError(`Invalid JSON representation for EditorSelection`);return new e(t.ranges.map(e=>Nt.fromJSON(e)),t.main)}static single(t,n=t){return new e([e.range(t,n)],0)}static create(t,n=0){if(t.length==0)throw RangeError(`A selection needs at least one range`);for(let r=0,i=0;i<t.length;i++){let a=t[i];if(a.empty?a.from<=r:a.from<r)return e.normalized(t.slice(),n);r=a.to}return new e(t,n)}static cursor(e,t=0,n,r){return Nt.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n)),r)}static range(e,t,n,r,i){let a=r==null?7:Math.min(6,r);return!i&&e!=t&&(i=t<e?1:-1),i&&(a|=i<0?8:16),t<e?Nt.create(t,e,a|32,n):Nt.create(e,t,a,n)}static undirectionalRange(e,t){return Nt.create(e,t,64,void 0)}static normalized(t,n=0){let r=t[n];t.sort((e,t)=>e.from-t.from),n=t.indexOf(r);for(let r=1;r<t.length;r++){let i=t[r],a=t[r-1];if(i.empty?i.from<=a.to:i.from<a.to){let o=a.from,s=Math.max(i.to,a.to);r<=n&&n--,t.splice(--r,2,i.anchor>i.head?e.range(s,o):e.range(o,s))}}return new e(t,n)}};function Pt(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError(`Selection points outside of document`)}var Ft=0,M=class e{constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=Ft++,this.default=e([]),this.extensions=typeof i==`function`?i(this):i}get reader(){return this}static define(t={}){return new e(t.combine||(e=>e),t.compareInput||((e,t)=>e===t),t.compare||(t.combine?(e,t)=>e===t:It),!!t.static,t.enables)}of(e){return new Lt([],this,0,e)}compute(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new Lt(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error(`Can't compute a static facet`);return new Lt(e,this,2,t)}from(e,t){return t||=e=>e,this.compute([e],n=>t(n.field(e)))}};function It(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}var Lt=class{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=Ft++}dynamicSlot(e){let t=this.value,n=this.facet.compareInput,r=this.id,i=e[r]>>1,a=this.type==2,o=!1,s=!1,c=[];for(let t of this.dependencies)t==`doc`?o=!0:t==`selection`?s=!0:(e[t.id]??1)&1||c.push(e[t.id]);return{create(e){return e.values[i]=t(e),1},update(e,r){if(o&&r.docChanged||s&&(r.docChanged||r.selection)||zt(e,c)){let r=t(e);if(a?!Rt(r,e.values[i],n):!n(r,e.values[i]))return e.values[i]=r,1}return 0},reconfigure:(e,o)=>{let s,c=o.config.address[r];if(c!=null){let r=Qt(o,c);if(this.dependencies.every(t=>t instanceof M?o.facet(t)===e.facet(t):t instanceof Ht?o.field(t,!1)==e.field(t,!1):!0)||(a?Rt(s=t(e),r,n):n(s=t(e),r)))return e.values[i]=r,0}else s=t(e);return e.values[i]=s,1}}}get extension(){return this}};function Rt(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function zt(e,t){let n=!1;for(let r of t)Zt(e,r)&1&&(n=!0);return n}function Bt(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),a=r.filter(e=>!(e&1)),o=e[t.id]>>1;function s(e){let n=[];for(let t=0;t<r.length;t++){let a=Qt(e,r[t]);if(i[t]==2)for(let e of a)n.push(e);else n.push(a)}return t.combine(n)}return{create(e){for(let t of r)Zt(e,t);return e.values[o]=s(e),1},update(e,n){if(!zt(e,a))return 0;let r=s(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let a=zt(e,r),c=i.config.facets[t.id],l=i.facet(t);if(c&&!a&&It(n,c))return e.values[o]=l,0;let u=s(e);return t.compare(u,l)?(e.values[o]=l,0):(e.values[o]=u,1)}}}var Vt=M.define({static:!0}),Ht=class e{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(t){let n=new e(Ft++,t.create,t.update,t.compare||((e,t)=>e===t),t);return t.provide&&(n.provides=t.provide(n)),n}create(e){return(e.facet(Vt).find(e=>e.field==this)?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,1)},reconfigure:(e,n)=>{let r=e.facet(Vt),i=n.facet(Vt),a;return(a=r.find(e=>e.field==this))&&a!=i.find(e=>e.field==this)?(e.values[t]=a.create(e),1):n.config.address[this.id]==null?(e.values[t]=this.create(e),1):(e.values[t]=n.field(this),0)}}}init(e){return[this,Vt.of({field:this,create:e})]}get extension(){return this}},Ut={lowest:4,low:3,default:2,high:1,highest:0};function Wt(e){return t=>new Kt(t,e)}var Gt={highest:Wt(Ut.highest),high:Wt(Ut.high),default:Wt(Ut.default),low:Wt(Ut.low),lowest:Wt(Ut.lowest)},Kt=class{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}},qt=class e{of(e){return new Jt(this,e)}reconfigure(t){return e.reconfigure.of({compartment:this,extension:t})}get(e){return e.config.compartments.get(this)}},Jt=class{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}},Yt=class e{constructor(e,t,n,r,i,a){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(t,n,r){let i=[],a=Object.create(null),o=new Map;for(let e of Xt(t,n,o))e instanceof Ht?i.push(e):(a[e.facet.id]||(a[e.facet.id]=[])).push(e);let s=Object.create(null),c=[],l=[];for(let e of i)s[e.id]=l.length<<1,l.push(t=>e.slot(t));let u=r?.config.facets;for(let e in a){let t=a[e],n=t[0].facet,i=u&&u[e]||[];if(t.every(e=>e.type==0)){if(s[n.id]=c.length<<1|1,It(i,t))c.push(r.facet(n));else{let e=n.combine(t.map(e=>e.value));c.push(r&&n.compare(e,r.facet(n))?r.facet(n):e)}}else{for(let e of t)e.type==0?(s[e.id]=c.length<<1|1,c.push(e.value)):(s[e.id]=l.length<<1,l.push(t=>e.dynamicSlot(t)));s[n.id]=l.length<<1,l.push(e=>Bt(e,n,t))}}let d=l.map(e=>e(s));return new e(t,o,d,s,c,a)}};function Xt(e,t,n){let r=[[],[],[],[],[]],i=new Map;function a(e,o){let s=i.get(e);if(s!=null){if(s<=o)return;let t=r[s].indexOf(e);t>-1&&r[s].splice(t,1),e instanceof Jt&&n.delete(e.compartment)}if(i.set(e,o),Array.isArray(e))for(let t of e)a(t,o);else if(e instanceof Jt){if(n.has(e.compartment))throw RangeError(`Duplicate use of compartment in extensions`);let r=t.get(e.compartment)||e.inner;n.set(e.compartment,r),a(r,o)}else if(e instanceof Kt)a(e.inner,e.prec);else if(e instanceof Ht)r[o].push(e),e.provides&&a(e.provides,o);else if(e instanceof Lt)r[o].push(e),e.facet.extensions&&a(e.facet.extensions,Ut.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}).`);if(t==e)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);a(t,o)}}return a(e,Ut.default),r.reduce((e,t)=>e.concat(t))}function Zt(e,t){if(t&1)return 2;let n=t>>1,r=e.status[n];if(r==4)throw Error(`Cyclic dependency between fields and/or facets`);if(r&2)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function Qt(e,t){return t&1?e.config.staticValues[t>>1]:e.values[t>>1]}var $t=M.define(),en=M.define({combine:e=>e.some(e=>e),static:!0}),tn=M.define({combine:e=>e.length?e[0]:void 0,static:!0}),nn=M.define(),rn=M.define(),an=M.define(),on=M.define({combine:e=>e.length?e[0]:!1}),sn=class{constructor(e,t){this.type=e,this.value=t}static define(){return new cn}},cn=class{of(e){return new sn(this,e)}},ln=class{constructor(e){this.map=e}of(e){return new N(this,e)}},N=class e{constructor(e,t){this.type=e,this.value=t}map(t){let n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}is(e){return this.type==e}static define(e={}){return new ln(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}};N.reconfigure=N.define(),N.appendConfig=N.define();var P=class e{constructor(t,n,r,i,a,o){this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=a,this.scrollIntoView=o,this._doc=null,this._state=null,r&&Pt(r,n.newLength),a.some(t=>t.type==e.time)||(this.annotations=a.concat(e.time.of(Date.now())))}static create(t,n,r,i,a,o){return new e(t,n,r,i,a,o)}get newDoc(){return 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(t){let n=this.annotation(e.userEvent);return!!(n&&(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]==`.`))}};P.time=sn.define(),P.userEvent=sn.define(),P.addToHistory=sn.define(),P.remote=sn.define();function un(e,t){let n=[];for(let r=0,i=0;;){let a,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))a=e[r++],o=e[r++];else if(i<t.length)a=t[i++],o=t[i++];else return n;!n.length||n[n.length-1]<a?n.push(a,o):n[n.length-1]<o&&(n[n.length-1]=o)}}function dn(e,t,n){let r,i,a;return n?(r=t.changes,i=k.empty(t.changes.length),a=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),i=e.changes.mapDesc(t.changes,!0),a=e.changes.compose(r)),{changes:a,selection:t.selection?t.selection.map(i):e.selection?.map(r),effects:N.mapEffects(e.effects,r).concat(N.mapEffects(t.effects,i)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function fn(e,t,n){let r=t.selection,i=_n(t.annotations);return t.userEvent&&(i=i.concat(P.userEvent.of(t.userEvent))),{changes:t.changes instanceof k?t.changes:k.of(t.changes||[],n,e.facet(tn)),selection:r&&(r instanceof j?r:j.single(r.anchor,r.head)),effects:_n(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}function pn(e,t,n){let r=fn(e,t.length?t[0]:{},e.doc.length);t.length&&t[0].filter===!1&&(n=!1);for(let i=1;i<t.length;i++){t[i].filter===!1&&(n=!1);let a=!!t[i].sequential;r=dn(r,fn(e,t[i],a?r.changes.newLength:e.doc.length),a)}let i=P.create(e,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return hn(n?mn(i):i)}function mn(e){let t=e.startState,n=!0;for(let r of t.facet(nn)){let t=r(e);if(t===!1){n=!1;break}Array.isArray(t)&&(n=n===!0?t:un(n,t))}if(n!==!0){let r,i;if(n===!1)i=e.changes.invertedDesc,r=k.empty(t.doc.length);else{let t=e.changes.filter(n);r=t.changes,i=t.filtered.mapDesc(t.changes).invertedDesc}e=P.create(t,r,e.selection&&e.selection.map(i),N.mapEffects(e.effects,i),e.annotations,e.scrollIntoView)}let r=t.facet(rn);for(let n=r.length-1;n>=0;n--){let i=r[n](e);e=i instanceof P?i:Array.isArray(i)&&i.length==1&&i[0]instanceof P?i[0]:pn(t,_n(i),!1)}return e}function hn(e){let t=e.startState,n=t.facet(an),r=e;for(let i=n.length-1;i>=0;i--){let a=n[i](e);a&&Object.keys(a).length&&(r=dn(r,fn(t,a,e.changes.newLength),!0))}return r==e?e:P.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}var gn=[];function _n(e){return e==null?gn:Array.isArray(e)?e:[e]}var vn=(function(e){return e[e.Word=0]=`Word`,e[e.Space=1]=`Space`,e[e.Other=2]=`Other`,e})(vn||={}),yn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,bn;try{bn=RegExp(`[\\p{Alphabetic}\\p{Number}_]`,`u`)}catch{}function xn(e){if(bn)return bn.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>``&&(n.toUpperCase()!=n.toLowerCase()||yn.test(n)))return!0}return!1}function Sn(e){return t=>{if(!/\S/.test(t))return vn.Space;if(xn(t))return vn.Word;for(let n=0;n<e.length;n++)if(t.indexOf(e[n])>-1)return vn.Word;return vn.Other}}var F=class e{constructor(e,t,n,r,i,a){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,a&&(a._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)Zt(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw RangeError(`Field is not present in this state`)}else return Zt(this,n),Qt(this,n)}update(...e){return pn(this,e,!0)}applyTransaction(t){let n=this.config,{base:r,compartments:i}=n;for(let e of t.effects)e.is(qt.reconfigure)?(n&&=(i=new Map,n.compartments.forEach((e,t)=>i.set(t,e)),null),i.set(e.value.compartment,e.value.extension)):e.is(N.reconfigure)?(n=null,r=e.value):e.is(N.appendConfig)&&(n=null,r=_n(r).concat(e.value));let a;n?a=t.startState.values.slice():(n=Yt.resolve(r,i,this),a=new e(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let o=t.startState.facet(en)?t.newSelection:t.newSelection.asSingle();new e(n,t.newDoc,o,a,(e,n)=>n.update(e,t),t)}replaceSelection(e){return typeof e==`string`&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:j.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],a=_n(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),s=this.changes(o.changes),c=s.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(c);let l=r.mapDesc(s,!0);i.push(o.range.map(l)),r=r.compose(c),a=N.mapEffects(a,c).concat(N.mapEffects(_n(o.effects),l))}return{changes:r,selection:j.create(i,t.mainIndex),effects:a}}changes(t=[]){return t instanceof k?t:k.of(t,this.doc.length,this.facet(e.lineSeparator))}toText(t){return T.of(t.split(this.facet(e.lineSeparator)||Et))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Zt(this,t),Qt(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof Ht&&this.config.address[r.id]!=null&&(t[n]=r.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(t,n={},r){if(!t||typeof t.doc!=`string`)throw RangeError(`Invalid JSON representation for EditorState`);let i=[];if(r){for(let e in r)if(Object.prototype.hasOwnProperty.call(t,e)){let n=r[e],a=t[e];i.push(n.init(e=>n.spec.fromJSON(a,e)))}}return e.create({doc:t.doc,selection:j.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}static create(t={}){let n=Yt.resolve(t.extensions||[],new Map),r=t.doc instanceof T?t.doc:T.of((t.doc||``).split(n.staticFacet(e.lineSeparator)||Et)),i=t.selection?t.selection instanceof j?t.selection:j.single(t.selection.anchor,t.selection.head):j.single(0);return Pt(i,r.length),n.staticFacet(en)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(e.tabSize)}get lineBreak(){return this.facet(e.lineSeparator)||`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,I as t,Qt as n,T as r,en as i,h as a,i as o,s}from"./dist-
|
|
1
|
+
import{D as e,I as t,Qt as n,T as r,en as i,h as a,i as o,s}from"./dist-CgB3_3n_.js";import{r as c}from"./dist-kzlMryCP.js";var l=n({String:i.string,Number:i.number,"True False":i.bool,PropertyName:i.propertyName,Null:i.null,", :":i.separator,"[ ]":i.squareBracket,"{ }":i.brace}),u=c.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[l],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),d=o.define({name:`json`,parser:u.configure({props:[t.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),e.add({"Object Array":r})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function f(){return new s(d)}export{d as n,f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{t as json,n as jsonLanguage}from"./dist-Dea0Dfa0.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as DocInput,n as HighlightStyle,r as IndentContext,i as LRLanguage,a as Language,o as LanguageDescription,s as LanguageSupport,c as ParseContext,l as StreamLanguage,et as StringStream,u as TreeIndentContext,d as bidiIsolates,f as bracketMatching,p as bracketMatchingHandle,m as codeFolding,h as continuedIndent,g as defaultHighlightStyle,_ as defineLanguageFacet,v as delimitedIndent,y as ensureSyntaxTree,b as flatIndent,x as foldAll,S as foldCode,C as foldEffect,w as foldGutter,T as foldInside,E as foldKeymap,D as foldNodeProp,O as foldService,k as foldState,A as foldable,j as foldedRanges,M as forceParsing,N as getIndentUnit,P as getIndentation,F as highlightingFor,I as indentNodeProp,L as indentOnInput,R as indentRange,z as indentService,B as indentString,V as indentUnit,H as language,U as languageDataProp,W as matchBrackets,G as sublanguageProp,K as syntaxHighlighting,q as syntaxParserRunning,J as syntaxTree,Y as syntaxTreeAvailable,X as toggleFold,Z as unfoldAll,Q as unfoldCode,$ as unfoldEffect}from"./dist-
|
|
1
|
+
export{t as DocInput,n as HighlightStyle,r as IndentContext,i as LRLanguage,a as Language,o as LanguageDescription,s as LanguageSupport,c as ParseContext,l as StreamLanguage,et as StringStream,u as TreeIndentContext,d as bidiIsolates,f as bracketMatching,p as bracketMatchingHandle,m as codeFolding,h as continuedIndent,g as defaultHighlightStyle,_ as defineLanguageFacet,v as delimitedIndent,y as ensureSyntaxTree,b as flatIndent,x as foldAll,S as foldCode,C as foldEffect,w as foldGutter,T as foldInside,E as foldKeymap,D as foldNodeProp,O as foldService,k as foldState,A as foldable,j as foldedRanges,M as forceParsing,N as getIndentUnit,P as getIndentation,F as highlightingFor,I as indentNodeProp,L as indentOnInput,R as indentRange,z as indentService,B as indentString,V as indentUnit,H as language,U as languageDataProp,W as matchBrackets,G as sublanguageProp,K as syntaxHighlighting,q as syntaxParserRunning,J as syntaxTree,Y as syntaxTreeAvailable,X as toggleFold,Z as unfoldAll,Q as unfoldCode,$ as unfoldEffect}from"./dist-CgB3_3n_.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{an as e,cn as t,in as n,nn as r,rn as i,sn as a,tn as o}from"./dist-rcSvr8nT.js";var s=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new c(i,i.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){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(r,n,i,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new l(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}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 n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.storeNode(this.curContext.hash,this.reducePos,this.reducePos,-3,!0)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new c(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},c=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},l=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},u=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.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 e(this.stack,this.pos,this.index)}};function d(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var f=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},p=new f,m=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=p,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 n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1: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=p,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},h=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;v(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};h.prototype.contextual=h.prototype.fallback=h.prototype.extend=!1;var g=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?d(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(v(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};g.prototype.contextual=h.prototype.fallback=h.prototype.extend=!1;var _=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function v(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||b(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function y(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function b(e,t,n,r){let i=y(n,r,t);return i<0||y(n,r,e)<i}var x=/\bparse\b/.test({}.LOG),S=null;function C(e,t,n){let i=e.cursor(r.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.to<t:i.from>t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}var w=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?C(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?C(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],a=this.index[n];if(a==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[a],s=this.start[n]+r.positions[a];if(s>e)return this.nextStart=s,null;if(o instanceof t){let t=s>this.lastRepeatPos&&o.type.id>=this.minRepeat;if(s==e||t){let n=s+o.length,r;if(s>=this.safeFrom&&n<=this.safeTo&&(!(r=o.prop(i.lookAhead))||n+r<this.fragment.to)){if(t&&(this.lastRepeat=o,this.lastRepeatPos=s),s==e)return o}else if(s==e)return null}this.index[n]++,s+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}},T=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new f)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if((!n||c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new f,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new f,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=M(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(M(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(M(o,s+1),t,n,r))}return r}},E=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new m(t,r),this.tokens=new T(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[s.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new w(n,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&N(r);if(e)return x&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw x&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return x&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}tryReuse(e,n,r,a){if(!r)return null;let o=e.curContext&&e.curContext.tracker.strict,s=o?e.curContext.hash:0;for(;r;){let c=this.parser.nodeSet.types[r.type.id]==r.type?this.parser.getGoto(e.state,r.type.id):-1;if(c>-1&&r.length&&(!o||(r.prop(i.contextHash)||0)==s))return e.useNode(r,c,n),r;if(r.children.length==0||r.positions[0]>0)break;let l=r.children[0];if(l instanceof t&&(!a||l.type.id>=this.parser.minRepeatTerm))r=l;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=x?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos<r&&e.buffer.length&&e.buffer[e.buffer.length-2]<=e.reducePos&&this.fragments.lastRepeatPos==e.reducePos&&this.tryReuse(e,e.reducePos,this.fragments.lastRepeat,!0)||this.tryReuse(e,r,this.fragments.nodeAt(r),!1);if(t)return x&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(t.type.id)})`),!0}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),x&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),x&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return D(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=x?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),x&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(x&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)x&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))x&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),x&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),D(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),t.build({buffer:u.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(S||=new WeakMap).get(e);return t||S.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function D(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var O=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},k=e=>e,A=class{constructor(e){this.start=e.start,this.shift=e.shift||k,this.reduce=e.reduce||k,this.reuse=e.reuse||k,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},j=class t extends a{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let r=t.nodeNames.split(` `);this.minRepeatTerm=r.length;for(let e=0;e<t.repeatNodeCount;e++)r.push(``);let a=Object.keys(t.topRules).map(e=>t.topRules[e][1]),s=[];for(let e=0;e<r.length;e++)s.push([]);function c(e,t,n){s[e].push([t,t.deserialize(String(n))])}if(t.nodeProps)for(let e of t.nodeProps){let t=e[0];typeof t==`string`&&(t=i[t]);for(let n=1;n<e.length;){let r=e[n++];if(r>=0)c(r,t,e[n++]);else{let i=e[n+-r];for(let a=-r;a>0;a--)c(e[n++],t,i);n++}}}this.nodeSet=new n(r.map((n,r)=>e.define({name:r>=this.minRepeatTerm?void 0:n,id:r,props:s[r],top:a.indexOf(r)>-1,error:r==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(r)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=o;let l=d(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(P),this.states=d(t.states,Uint32Array),this.data=d(t.stateData),this.goto=d(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(e=>typeof e==`number`?new h(l,e):e),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.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,n){let r=new E(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=M(n,i+2)];else if(n[i+1]==2)return M(n,i+2);else break}if(a==t||a==0)return M(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=M(this.data,n+2);else break}r=t(M(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=M(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw RangeError(`Invalid top rule name ${e.top}`);n.top=t}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((t,r)=>{let i=e.specializers.find(e=>e.from==t.external);if(!i)return t;let a=Object.assign(Object.assign({},t),{external:i.to});return n.specializers[r]=P(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}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),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new O(e,n,r)}static deserialize(e){return new t(e)}};function M(e,t){return e[t]|e[t+1]<<16}function N(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function P(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}export{g as i,_ as n,j as r,A as t};
|
|
1
|
+
import{an as e,cn as t,in as n,nn as r,rn as i,sn as a,tn as o}from"./dist-CgB3_3n_.js";var s=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new c(i,i.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){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t,n){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.reducePos=this.pos=n+e.length;this.pushState(t,n),this.buffer.push(r,n,i,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new l(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}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 n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216)){if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.storeNode(this.curContext.hash,this.reducePos,this.reducePos,-3,!0)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new c(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},c=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},l=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},u=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.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 e(this.stack,this.pos,this.index)}};function d(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var f=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},p=new f,m=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=p,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 n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.next=this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?-1: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=p,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},h=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;v(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};h.prototype.contextual=h.prototype.fallback=h.prototype.extend=!1;var g=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?d(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(v(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};g.prototype.contextual=h.prototype.fallback=h.prototype.extend=!1;var _=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function v(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||b(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function y(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function b(e,t,n,r){let i=y(n,r,t);return i<0||y(n,r,e)<i}var x=/\bparse\b/.test({}.LOG),S=null;function C(e,t,n){let i=e.cursor(r.IncludeAnonymous);for(i.moveTo(t);;)if(!(n<0?i.childBefore(t):i.childAfter(t)))for(;;){if((n<0?i.to<t:i.from>t)&&!i.type.isError)return n<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(e.length,Math.max(i.from+1,t+25));if(n<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return n<0?0:e.length}}var w=class{constructor(e,t){this.fragments=e,this.minRepeat=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.lastRepeat=null,this.lastRepeatPos=-1,this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?C(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?C(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let n=this.trees.length-1;if(n<0)return this.nextFragment(),null;let r=this.trees[n],a=this.index[n];if(a==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=r.children[a],s=this.start[n]+r.positions[a];if(s>e)return this.nextStart=s,null;if(o instanceof t){let t=s>this.lastRepeatPos&&o.type.id>=this.minRepeat;if(s==e||t){let n=s+o.length,r;if(s>=this.safeFrom&&n<=this.safeTo&&(!(r=o.prop(i.lookAhead))||n+r<this.fragment.to)){if(t&&(this.lastRepeat=o,this.lastRepeatPos=s),s==e)return o}else if(s==e)return null}this.index[n]++,s+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[n]++,this.nextStart=s+o.length}}},T=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new f)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if((!n||c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new f,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new f,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535){if(o[s+1]==1)s=M(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(M(o,s+2),t,n,r));break}}o[s]==t&&(r=this.putAction(M(o,s+1),t,n,r))}return r}},E=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new m(t,r),this.tokens=new T(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[s.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new w(n,e.minRepeatTerm):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&N(r);if(e)return x&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw x&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return x&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}tryReuse(e,n,r,a){if(!r)return null;let o=e.curContext&&e.curContext.tracker.strict,s=o?e.curContext.hash:0;for(;r;){let c=this.parser.nodeSet.types[r.type.id]==r.type?this.parser.getGoto(e.state,r.type.id):-1;if(c>-1&&r.length&&(!o||(r.prop(i.contextHash)||0)==s))return e.useNode(r,c,n),r;if(r.children.length==0||r.positions[0]>0)break;let l=r.children[0];if(l instanceof t&&(!a||l.type.id>=this.parser.minRepeatTerm))r=l;else break}return null}advanceStack(e,t,n){let r=e.pos,{parser:i}=this,a=x?this.stackID(e)+` -> `:``;if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.reducePos<r&&e.buffer.length&&e.buffer[e.buffer.length-2]<=e.reducePos&&this.fragments.lastRepeatPos==e.reducePos&&this.tryReuse(e,e.reducePos,this.fragments.lastRepeat,!0)||this.tryReuse(e,r,this.fragments.nodeAt(r),!1);if(t)return x&&console.log(a+this.stackID(e)+` (via reuse of ${i.getName(t.type.id)})`),!0}let o=i.stateSlot(e.state,4);if(o>0)return e.reduce(o),x&&console.log(a+this.stackID(e)+` (via always-reduce ${i.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let s=this.tokens.getActions(e);for(let o=0;o<s.length;){let c=s[o++],l=s[o++],u=s[o++],d=o==s.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(c,l,p?p.start:f.pos,u),x&&console.log(a+this.stackID(f)+` (via ${c&65536?`reduce of ${i.getName(c&65535)}`:`shift`} for ${i.getName(l)} @ ${r}${f==e?``:`, split`})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return D(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=x?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),x&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(x&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)x&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))x&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),x&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),D(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(e){return e.close(),t.build({buffer:u.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(S||=new WeakMap).get(e);return t||S.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function D(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var O=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},k=e=>e,A=class{constructor(e){this.start=e.start,this.shift=e.shift||k,this.reduce=e.reduce||k,this.reuse=e.reuse||k,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},j=class t extends a{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let r=t.nodeNames.split(` `);this.minRepeatTerm=r.length;for(let e=0;e<t.repeatNodeCount;e++)r.push(``);let a=Object.keys(t.topRules).map(e=>t.topRules[e][1]),s=[];for(let e=0;e<r.length;e++)s.push([]);function c(e,t,n){s[e].push([t,t.deserialize(String(n))])}if(t.nodeProps)for(let e of t.nodeProps){let t=e[0];typeof t==`string`&&(t=i[t]);for(let n=1;n<e.length;){let r=e[n++];if(r>=0)c(r,t,e[n++]);else{let i=e[n+-r];for(let a=-r;a>0;a--)c(e[n++],t,i);n++}}}this.nodeSet=new n(r.map((n,r)=>e.define({name:r>=this.minRepeatTerm?void 0:n,id:r,props:s[r],top:a.indexOf(r)>-1,error:r==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(r)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=o;let l=d(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(P),this.states=d(t.states,Uint32Array),this.data=d(t.stateData),this.goto=d(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(e=>typeof e==`number`?new h(l,e):e),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.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,n){let r=new E(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535){if(n[i+1]==1)a=n[i=M(n,i+2)];else if(n[i+1]==2)return M(n,i+2);else break}if(a==t||a==0)return M(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=M(this.data,n+2);else break}r=t(M(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535){if(this.data[n+1]==1)n=M(this.data,n+2);else break}if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let n=Object.assign(Object.create(t.prototype),this);if(e.props&&(n.nodeSet=this.nodeSet.extend(...e.props)),e.top){let t=this.topRules[e.top];if(!t)throw RangeError(`Invalid top rule name ${e.top}`);n.top=t}return e.tokenizers&&(n.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((t,r)=>{let i=e.specializers.find(e=>e.from==t.external);if(!i)return t;let a=Object.assign(Object.assign({},t),{external:i.to});return n.specializers[r]=P(a),a})),e.contextTracker&&(n.context=e.contextTracker),e.dialect&&(n.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(n.strict=e.strict),e.wrap&&(n.wrappers=n.wrappers.concat(e.wrap)),e.bufferLength!=null&&(n.bufferLength=e.bufferLength),n}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),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new O(e,n,r)}static deserialize(e){return new t(e)}};function M(e,t){return e[t]|e[t+1]<<16}function N(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function P(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}export{g as i,_ as n,j as r,A as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./main-
|
|
2
|
-
import{t as e}from"./preload-helper-CRzLMJPS.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=!1;function n(e){return e instanceof Error?e.stack||e.message:String(e)}function r(e,{showDetails:r=t}={}){let i=document.getElementById(`root`);if(!i||i.childElementCount>0)return;let a=document.createElement(`main`);a.setAttribute(`role`,`alert`),a.style.cssText=`min-height:100vh;background:#0b0d10;color:#f4f4f5;font-family:"Mona Sans",ui-sans-serif,system-ui,sans-serif;font-feature-settings:"ss06" on;padding:32px;box-sizing:border-box;`;let o=document.createElement(`h1`);o.textContent=`Mastra Studio failed to start`,o.style.cssText=`font-size:20px;line-height:1.4;margin:0 0 8px;`;let s=document.createElement(`p`);if(s.textContent=r?`The startup module failed before React could render. Check the Vite terminal and browser console for the original request details.`:`The startup module failed before React could render. Run Studio in development mode to view detailed diagnostics.`,s.style.cssText=`color:#a1a1aa;max-width:760px;margin:0 0 20px;line-height:1.6;`,a.append(o,s),r){let t=document.createElement(`pre`);t.textContent=n(e),t.style.cssText=`white-space:pre-wrap;overflow:auto;background:#18181b;border:1px solid #3f3f46;border-radius:8px;padding:16px;max-width:100%;line-height:1.5;`,a.append(t)}i.replaceChildren(a)}try{let{startStudio:t}=await e(async()=>{let{startStudio:e}=await import(`./main-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./main-CCDQ8J3X.js","./rolldown-runtime-BWaJ3C7D.js","./preload-helper-CRzLMJPS.js","./dist-CgB3_3n_.js","./dist-CZ3nRtXK.js","./dist-kzlMryCP.js","./dist-Dea0Dfa0.js","./dist-Bg8xUYnp.js","./lib-DRuii7jc.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{t as e}from"./preload-helper-CRzLMJPS.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var t=!1;function n(e){return e instanceof Error?e.stack||e.message:String(e)}function r(e,{showDetails:r=t}={}){let i=document.getElementById(`root`);if(!i||i.childElementCount>0)return;let a=document.createElement(`main`);a.setAttribute(`role`,`alert`),a.style.cssText=`min-height:100vh;background:#0b0d10;color:#f4f4f5;font-family:"Mona Sans",ui-sans-serif,system-ui,sans-serif;font-feature-settings:"ss06" on;padding:32px;box-sizing:border-box;`;let o=document.createElement(`h1`);o.textContent=`Mastra Studio failed to start`,o.style.cssText=`font-size:20px;line-height:1.4;margin:0 0 8px;`;let s=document.createElement(`p`);if(s.textContent=r?`The startup module failed before React could render. Check the Vite terminal and browser console for the original request details.`:`The startup module failed before React could render. Run Studio in development mode to view detailed diagnostics.`,s.style.cssText=`color:#a1a1aa;max-width:760px;margin:0 0 20px;line-height:1.6;`,a.append(o,s),r){let t=document.createElement(`pre`);t.textContent=n(e),t.style.cssText=`white-space:pre-wrap;overflow:auto;background:#18181b;border:1px solid #3f3f46;border-radius:8px;padding:16px;max-width:100%;line-height:1.5;`,a.append(t)}i.replaceChildren(a)}try{let{startStudio:t}=await e(async()=>{let{startStudio:e}=await import(`./main-CCDQ8J3X.js`);return{startStudio:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8]),import.meta.url);t()}catch(e){console.error(`Mastra Studio failed to start`,e),r(e)}
|