-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathengine.ts
More file actions
1 lines (1 loc) · 152 KB
/
engine.ts
File metadata and controls
1 lines (1 loc) · 152 KB
1
/*Generated automatically*/export const engine = "()=>{var gr=Object.create;var de=Object.defineProperty;var Ir=Object.getOwnPropertyDescriptor;var vr=Object.getOwnPropertyNames;var yr=Object.getPrototypeOf,xr=Object.prototype.hasOwnProperty;var ut=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Sr=(r,e)=>{for(var t in e)de(r,t,{get:e[t],enumerable:!0})},pt=(r,e,t,n)=>{if(e&&typeof e==\"object\"||typeof e==\"function\")for(let s of vr(e))!xr.call(r,s)&&s!==t&&de(r,s,{get:()=>e[s],enumerable:!(n=Ir(e,s))||n.enumerable});return r};var Er=(r,e,t)=>(t=r!=null?gr(yr(r)):{},pt(e||!r||!r.__esModule?de(t,\"default\",{value:r,enumerable:!0}):t,r)),Ar=r=>pt(de({},\"__esModule\",{value:!0}),r);var jt=ut(W=>{\"use strict\";Object.defineProperty(W,\"__esModule\",{value:!0});function L(r){let e=r||\"\";return function(){throw new Error(\"this method \"+e+\" is abstract! (it has no implementation in class \"+this.constructor.name+\")\")}}function U(r,e){if(!r)throw new Error(e||\"Assertion failed\")}function Ve(r,e,t){let n;Object.defineProperty(r,e,{get(){return n||(n=t.call(this)),n}})}function _r(r){return r&&Object.assign({},r)}function At(r,e){let t=[];for(;e-- >0;)t.push(r());return t}function _t(r,e){return new Array(e+1).join(r)}function Ee(r,e){return At(()=>r,e)}function je(r){let e=[];for(let t=0;t<r.length;t++){let n=r[t];r.lastIndexOf(n)!==t&&e.indexOf(n)<0&&e.push(n)}return e}function bt(r){let e=[];return r.forEach(t=>{e.indexOf(t)<0&&e.push(t)}),e}function K(r){let e=r[0];return e===e.toUpperCase()}function Pt(r){return!K(r)}function Nt(r,e,t){let n=t||\" \";return r.length<e?_t(n,e-r.length)+r:r}function Y(){this.strings=[]}Y.prototype.append=function(r){this.strings.push(r)};Y.prototype.contents=function(){return this.strings.join(\"\")};var ke=r=>String.fromCodePoint(parseInt(r,16));function Ot(r){if(r.charAt(0)===\"\\\\\")switch(r.charAt(1)){case\"b\":return\"\\b\";case\"f\":return\"\\f\";case\"n\":return`\n`;case\"r\":return\"\\r\";case\"t\":return\"\t\";case\"v\":return\"\\v\";case\"x\":return ke(r.slice(2,4));case\"u\":return r.charAt(2)===\"{\"?ke(r.slice(3,-1)):ke(r.slice(2,6));default:return r.charAt(1)}else return r}function Ye(r){if(r==null)return String(r);let e=Object.prototype.toString.call(r);try{let t;return r.constructor&&r.constructor.name?t=r.constructor.name:e.indexOf(\"[object \")===0?t=e.slice(8,-1):t=typeof r,t+\": \"+JSON.stringify(String(r))}catch{return e}}var br=Object.freeze({__proto__:null,abstract:L,assert:U,defineLazyProperty:Ve,clone:_r,repeatFn:At,repeatStr:_t,repeat:Ee,getDuplicates:je,copyWithoutDuplicates:bt,isSyntactic:K,isLexical:Pt,padLeft:Nt,StringBuffer:Y,unescapeCodePoint:Ot,unexpectedObjToString:Ye}),Pr={Lu:/\\p{Lu}/u,Ll:/\\p{Ll}/u,Lt:/\\p{Lt}/u,Lm:/\\p{Lm}/u,Lo:/\\p{Lo}/u,Nl:/\\p{Nl}/u,Nd:/\\p{Nd}/u,Mn:/\\p{Mn}/u,Mc:/\\p{Mc}/u,Pc:/\\p{Pc}/u,Zs:/\\p{Zs}/u,L:/\\p{Letter}/u,Ltmo:/\\p{Lt}|\\p{Lm}|\\p{Lo}/u},d=class r{constructor(){if(this.constructor===r)throw new Error(\"PExpr cannot be instantiated -- it's abstract\")}withSource(e){return e&&(this.source=e.trimmed()),this}},C=Object.create(d.prototype),F=Object.create(d.prototype),S=class extends d{constructor(e){super(),this.obj=e}},A=class extends d{constructor(e,t){super(),this.from=e,this.to=t,this.matchCodePoint=e.length>1||t.length>1}},_=class extends d{constructor(e){super(),this.index=e}},I=class extends d{constructor(e){super(),this.terms=e}},z=class extends I{constructor(e,t,n){let s=e.rules[t].body;super([n,s]),this.superGrammar=e,this.name=t,this.body=n}},Q=class extends I{constructor(e,t,n,s){let i=e.rules[t].body;super([...n,i,...s]),this.superGrammar=e,this.ruleName=t,this.expansionPos=n.length}},y=class extends d{constructor(e){super(),this.factors=e}},b=class extends d{constructor(e){super(),this.expr=e}},B=class extends b{},V=class extends b{},D=class extends b{};B.prototype.operator=\"*\";V.prototype.operator=\"+\";D.prototype.operator=\"?\";B.prototype.minNumMatches=0;V.prototype.minNumMatches=1;D.prototype.minNumMatches=0;B.prototype.maxNumMatches=Number.POSITIVE_INFINITY;V.prototype.maxNumMatches=Number.POSITIVE_INFINITY;D.prototype.maxNumMatches=1;var P=class extends d{constructor(e){super(),this.expr=e}},N=class extends d{constructor(e){super(),this.expr=e}},w=class extends d{constructor(e){super(),this.expr=e}},f=class extends d{constructor(e,t=[]){super(),this.ruleName=e,this.args=t}isSyntactic(){return K(this.ruleName)}toMemoKey(){return this._memoKey||Object.defineProperty(this,\"_memoKey\",{value:this.toString()}),this._memoKey}},x=class extends d{constructor(e){super(),this.category=e,this.pattern=Pr[e]}};function v(r,e){let t;return e?(t=new Error(e.getLineAndColumnMessage()+r),t.shortMessage=r,t.interval=e):t=new Error(r),t}function Ge(){return v(\"Interval sources don't match\")}function Nr(r){let e=new Error;return Object.defineProperty(e,\"message\",{enumerable:!0,get(){return r.message}}),Object.defineProperty(e,\"shortMessage\",{enumerable:!0,get(){return\"Expected \"+r.getExpectedText()}}),e.interval=r.getInterval(),e}function Or(r,e,t){let n=e?`Grammar ${r} is not declared in namespace '${e}'`:\"Undeclared grammar \"+r;return v(n,t)}function wr(r,e){return v(\"Grammar \"+r.name+\" is already declared in this namespace\")}function Cr(r){return v(`Grammar '${r.name}' does not support incremental parsing`)}function wt(r,e,t){return v(\"Rule \"+r+\" is not declared in grammar \"+e,t)}function Fr(r,e,t){return v(\"Cannot override rule \"+r+\" because it is not declared in \"+e,t)}function Lr(r,e,t){return v(\"Cannot extend rule \"+r+\" because it is not declared in \"+e,t)}function ht(r,e,t,n){let s=\"Duplicate declaration for rule '\"+r+\"' in grammar '\"+e+\"'\";return e!==t&&(s+=\" (originally declared in '\"+t+\"')\"),v(s,n)}function Ct(r,e,t,n){return v(\"Wrong number of parameters for rule \"+r+\" (expected \"+e+\", got \"+t+\")\",n)}function Tr(r,e,t,n){return v(\"Wrong number of arguments for rule \"+r+\" (expected \"+e+\", got \"+t+\")\",n)}function mt(r,e,t){return v(\"Duplicate parameter names in rule \"+r+\": \"+e.join(\", \"),t)}function qr(r,e){return v(\"Invalid parameter to rule \"+r+\": \"+e+\" has arity \"+e.getArity()+\", but parameter expressions must have arity 1\",e.source)}var Rr=\"NOTE: A _syntactic rule_ is a rule whose name begins with a capital letter. See https://ohmjs.org/d/svl for more details.\";function Mr(r,e){return v(\"Cannot apply syntactic rule \"+r+\" from here (inside a lexical context)\",e.source)}function Dr(r){let{ruleName:e}=r;return v(`applySyntactic is for syntactic rules, but '${e}' is a lexical rule. `+Rr,r.source)}function kr(r){return v(\"applySyntactic is not required here (in a syntactic context)\",r.source)}function dt(r,e){return v(\"Incorrect argument type: expected \"+r,e.source)}function Br(r){return v(\"'...' can appear at most once in a rule body\",r.source)}function Wr(r){let e=r._node;U(e&&e.isNonterminal()&&e.ctorName===\"escapeChar_unicodeCodePoint\");let t=r.children.slice(1,-1).map(s=>s.source),n=t[0].coverageWith(...t.slice(1));return v(`U+${n.contents} is not a valid Unicode code point`,n)}function Ft(r,e){let t=e.length>0?e[e.length-1].args:[],s=\"Nullable expression \"+r.expr.substituteParams(t)+\" is not allowed inside '\"+r.operator+\"' (possible infinite loop)\";if(e.length>0){let i=e.map(o=>new f(o.ruleName,o.args)).join(`\n`);s+=`\nApplication stack (most recent application last):\n`+i}return v(s,r.expr.source)}function Lt(r,e,t,n){return v(\"Rule \"+r+\" involves an alternation which has inconsistent arity (expected \"+e+\", got \"+t+\")\",n.source)}function Vr(r){let e=r.map(t=>t.message);return v([\"Errors:\"].concat(e).join(`\n- `),r[0].interval)}function jr(r,e,t,n){let s=n.slice(0,-1).map(a=>{let p=\" \"+a[0].name+\" > \"+a[1];return a.length===3?p+\" for '\"+a[2]+\"'\":p}).join(`\n`);s+=`\n `+e+\" > \"+r;let i=\"\";r===\"_iter\"&&(i=[`\nNOTE: as of Ohm v16, there is no default action for iteration nodes \\u2014 see `,\" https://ohmjs.org/d/dsa for details.\"].join(`\n`));let o=[`Missing semantic action for '${r}' in ${t} '${e}'.${i}`,\"Action stack (most recent call last):\",s].join(`\n`),l=v(o);return l.name=\"missingSemanticAction\",l}function Gr(r){if(r.length===1)throw r[0];if(r.length>1)throw Vr(r)}function Ur(r){let e=0;return r.map(n=>{let s=n.toString();return e=Math.max(e,s.length),s}).map(n=>Nt(n,e))}function ft(r,e,t){let n=r.length,s=r.slice(0,t),i=r.slice(t+e.length);return(s+e+i).substr(0,n)}function Hr(...r){let e=this,{offset:t}=e,{repeatStr:n}=br,s=new Y;s.append(\"Line \"+e.lineNum+\", col \"+e.colNum+`:\n`);let i=Ur([e.prevLine==null?0:e.lineNum-1,e.lineNum,e.nextLine==null?0:e.lineNum+1]),o=(c,u,h)=>{s.append(h+i[c]+\" | \"+u+`\n`)};e.prevLine!=null&&o(0,e.prevLine,\" \"),o(1,e.line,\"> \");let l=e.line.length,a=n(\" \",l+1);for(let c=0;c<r.length;++c){let u=r[c][0],h=r[c][1];U(u>=0&&u<=h,\"range start must be >= 0 and <= end\");let m=t-e.colNum+1;u=Math.max(0,u-m),h=Math.min(h-m,l),a=ft(a,n(\"~\",h-u),u)}let p=2+i[1].length+3;return s.append(n(\" \",p)),a=ft(a,\"^\",e.colNum-1),s.append(a.replace(/ +$/,\"\")+`\n`),e.nextLine!=null&&o(2,e.nextLine,\" \"),s.contents()}var Ue=[];function Tt(r){Ue.push(r)}function $r(r){Ue.forEach(e=>{e(r)}),Ue=null}function Xe(r,e){let t=1,n=1,s=0,i=0,o=null,l=null,a=-1;for(;s<e;){let u=r.charAt(s++);u===`\n`?(t++,n=1,a=i,i=s):u!==\"\\r\"&&n++}let p=r.indexOf(`\n`,i);if(p===-1)p=r.length;else{let u=r.indexOf(`\n`,p+1);o=u===-1?r.slice(p):r.slice(p,u),o=o.replace(/^\\r?\\n/,\"\").replace(/\\r$/,\"\")}a>=0&&(l=r.slice(a,i).replace(/\\r?\\n$/,\"\"));let c=r.slice(i,p).replace(/\\r$/,\"\");return{offset:e,lineNum:t,colNum:n,line:c,prevLine:l,nextLine:o,toString:Hr}}function et(r,e,...t){return Xe(r,e).toString(...t)}var gt=(()=>{let r=0;return e=>\"\"+e+r++})(),J=class r{constructor(e,t,n){this.sourceString=e,this.startIdx=t,this.endIdx=n}get contents(){return this._contents===void 0&&(this._contents=this.sourceString.slice(this.startIdx,this.endIdx)),this._contents}get length(){return this.endIdx-this.startIdx}coverageWith(...e){return r.coverage(...e,this)}collapsedLeft(){return new r(this.sourceString,this.startIdx,this.startIdx)}collapsedRight(){return new r(this.sourceString,this.endIdx,this.endIdx)}getLineAndColumn(){return Xe(this.sourceString,this.startIdx)}getLineAndColumnMessage(){let e=[this.startIdx,this.endIdx];return et(this.sourceString,this.startIdx,e)}minus(e){if(this.sourceString!==e.sourceString)throw Ge();return this.startIdx===e.startIdx&&this.endIdx===e.endIdx?[]:this.startIdx<e.startIdx&&e.endIdx<this.endIdx?[new r(this.sourceString,this.startIdx,e.startIdx),new r(this.sourceString,e.endIdx,this.endIdx)]:this.startIdx<e.endIdx&&e.endIdx<this.endIdx?[new r(this.sourceString,e.endIdx,this.endIdx)]:this.startIdx<e.startIdx&&e.startIdx<this.endIdx?[new r(this.sourceString,this.startIdx,e.startIdx)]:[this]}relativeTo(e){if(this.sourceString!==e.sourceString)throw Ge();return U(this.startIdx>=e.startIdx&&this.endIdx<=e.endIdx,\"other interval does not cover this one\"),new r(this.sourceString,this.startIdx-e.startIdx,this.endIdx-e.startIdx)}trimmed(){let{contents:e}=this,t=this.startIdx+e.match(/^\\s*/)[0].length,n=this.endIdx-e.match(/\\s*$/)[0].length;return new r(this.sourceString,t,n)}subInterval(e,t){let n=this.startIdx+e;return new r(this.sourceString,n,n+t)}};J.coverage=function(r,...e){let{startIdx:t,endIdx:n}=r;for(let s of e){if(s.sourceString!==r.sourceString)throw Ge();t=Math.min(t,s.startIdx),n=Math.max(n,s.endIdx)}return new J(r.sourceString,t,n)};var Kr=65535,re=class{constructor(e){this.source=e,this.pos=0,this.examinedLength=0}atEnd(){let e=this.pos>=this.source.length;return this.examinedLength=Math.max(this.examinedLength,this.pos+1),e}next(){let e=this.source[this.pos++];return this.examinedLength=Math.max(this.examinedLength,this.pos),e}nextCharCode(){let e=this.next();return e&&e.charCodeAt(0)}nextCodePoint(){let e=this.source.slice(this.pos++).codePointAt(0);return e>Kr&&(this.pos+=1),this.examinedLength=Math.max(this.examinedLength,this.pos),e}matchString(e,t){let n;if(t){for(n=0;n<e.length;n++){let s=this.next(),i=e[n];if(s==null||s.toUpperCase()!==i.toUpperCase())return!1}return!0}for(n=0;n<e.length;n++)if(this.next()!==e[n])return!1;return!0}sourceSlice(e,t){return this.source.slice(e,t)}interval(e,t){return new J(this.source,e,t||this.pos)}},fe=class{constructor(e,t,n,s,i,o,l){this.matcher=e,this.input=t,this.startExpr=n,this._cst=s,this._cstOffset=i,this._rightmostFailurePosition=o,this._rightmostFailures=l,this.failed()&&(Ve(this,\"message\",function(){let a=\"Expected \"+this.getExpectedText();return et(this.input,this.getRightmostFailurePosition())+a}),Ve(this,\"shortMessage\",function(){let a=\"expected \"+this.getExpectedText(),p=Xe(this.input,this.getRightmostFailurePosition());return\"Line \"+p.lineNum+\", col \"+p.colNum+\": \"+a}))}succeeded(){return!!this._cst}failed(){return!this.succeeded()}getRightmostFailurePosition(){return this._rightmostFailurePosition}getRightmostFailures(){if(!this._rightmostFailures){this.matcher.setInput(this.input);let e=this.matcher._match(this.startExpr,{tracing:!1,positionToRecordFailures:this.getRightmostFailurePosition()});this._rightmostFailures=e.getRightmostFailures()}return this._rightmostFailures}toString(){return this.succeeded()?\"[match succeeded]\":\"[match failed at position \"+this.getRightmostFailurePosition()+\"]\"}getExpectedText(){if(this.succeeded())throw new Error(\"cannot get expected text of a successful MatchResult\");let e=new Y,t=this.getRightmostFailures();t=t.filter(n=>!n.isFluffy());for(let n=0;n<t.length;n++)n>0&&(n===t.length-1?e.append(t.length>2?\", or \":\" or \"):e.append(\", \")),e.append(t[n].toString());return e.contents()}getInterval(){let e=this.getRightmostFailurePosition();return new J(this.input,e,e)}},He=class{constructor(){this.applicationMemoKeyStack=[],this.memo={},this.maxExaminedLength=0,this.maxRightmostFailureOffset=-1,this.currentLeftRecursion=void 0}isActive(e){return this.applicationMemoKeyStack.indexOf(e.toMemoKey())>=0}enter(e){this.applicationMemoKeyStack.push(e.toMemoKey())}exit(){this.applicationMemoKeyStack.pop()}startLeftRecursion(e,t){t.isLeftRecursion=!0,t.headApplication=e,t.nextLeftRecursion=this.currentLeftRecursion,this.currentLeftRecursion=t;let{applicationMemoKeyStack:n}=this,s=n.indexOf(e.toMemoKey())+1,i=n.slice(s);t.isInvolved=function(o){return i.indexOf(o)>=0},t.updateInvolvedApplicationMemoKeys=function(){for(let o=s;o<n.length;o++){let l=n[o];this.isInvolved(l)||i.push(l)}}}endLeftRecursion(){this.currentLeftRecursion=this.currentLeftRecursion.nextLeftRecursion}shouldUseMemoizedResult(e){if(!e.isLeftRecursion)return!0;let{applicationMemoKeyStack:t}=this;for(let n=0;n<t.length;n++){let s=t[n];if(e.isInvolved(s))return!1}return!0}memoize(e,t){return this.memo[e]=t,this.maxExaminedLength=Math.max(this.maxExaminedLength,t.examinedLength),this.maxRightmostFailureOffset=Math.max(this.maxRightmostFailureOffset,t.rightmostFailureOffset),t}clearObsoleteEntries(e,t){if(e+this.maxExaminedLength<=t)return;let{memo:n}=this;this.maxExaminedLength=0,this.maxRightmostFailureOffset=-1,Object.keys(n).forEach(s=>{let i=n[s];e+i.examinedLength>t?delete n[s]:(this.maxExaminedLength=Math.max(this.maxExaminedLength,i.examinedLength),this.maxRightmostFailureOffset=Math.max(this.maxRightmostFailureOffset,i.rightmostFailureOffset))})}},zr=\"\\u2717\",Qr=\"\\u2713\",Jr=\"\\u22C5\",Zr=\"\\u21D2\",Yr=\"\\u2409\",Xr=\"\\u240A\",en=\"\\u240D\",$e={succeeded:1,isRootNode:2,isImplicitSpaces:4,isMemoized:8,isHeadOfLeftRecursion:16,terminatesLR:32};function tn(r){return Ee(\" \",r).join(\"\")}function rn(r,e,t){let n=qt(r.slice(e,e+t));return n.length<t?n+Ee(\" \",t-n.length).join(\"\"):n}function qt(r){return typeof r==\"string\"?r.replace(/ /g,Jr).replace(/\\t/g,Yr).replace(/\\n/g,Xr).replace(/\\r/g,en):String(r)}var ne=class r{constructor(e,t,n,s,i,o,l){this.input=e,this.pos=this.pos1=t,this.pos2=n,this.source=new J(e,t,n),this.expr=s,this.bindings=o,this.children=l||[],this.terminatingLREntry=null,this._flags=i?$e.succeeded:0}get displayString(){return this.expr.toDisplayString()}clone(){return this.cloneWithExpr(this.expr)}cloneWithExpr(e){let t=new r(this.input,this.pos,this.pos2,e,this.succeeded,this.bindings,this.children);return t.isHeadOfLeftRecursion=this.isHeadOfLeftRecursion,t.isImplicitSpaces=this.isImplicitSpaces,t.isMemoized=this.isMemoized,t.isRootNode=this.isRootNode,t.terminatesLR=this.terminatesLR,t.terminatingLREntry=this.terminatingLREntry,t}recordLRTermination(e,t){this.terminatingLREntry=new r(this.input,this.pos,this.pos2,this.expr,!1,[t],[e]),this.terminatingLREntry.terminatesLR=!0}walk(e,t){let n=e;typeof n==\"function\"&&(n={enter:n});function s(i,o,l){let a=!0;n.enter&&n.enter.call(t,i,o,l)===r.prototype.SKIP&&(a=!1),a&&(i.children.forEach(p=>{s(p,i,l+1)}),n.exit&&n.exit.call(t,i,o,l))}this.isRootNode?this.children.forEach(i=>{s(i,null,0)}):s(this,null,0)}toString(){let e=new Y;return this.walk((t,n,s)=>{if(!t)return this.SKIP;if(t.expr.constructor.name!==\"Alt\"){if(e.append(rn(t.input,t.pos,10)+tn(s*2+1)),e.append((t.succeeded?Qr:zr)+\" \"+t.displayString),t.isHeadOfLeftRecursion&&e.append(\" (LR)\"),t.succeeded){let o=qt(t.source.contents);e.append(\" \"+Zr+\" \"),e.append(typeof o==\"string\"?'\"'+o+'\"':o)}e.append(`\n`)}}),e.contents()}};ne.prototype.SKIP={};Object.keys($e).forEach(r=>{let e=$e[r];Object.defineProperty(ne.prototype,r,{get(){return(this._flags&e)!==0},set(t){t?this._flags|=e:this._flags&=~e}})});d.prototype.allowsSkippingPrecedingSpace=L(\"allowsSkippingPrecedingSpace\");C.allowsSkippingPrecedingSpace=F.allowsSkippingPrecedingSpace=f.prototype.allowsSkippingPrecedingSpace=S.prototype.allowsSkippingPrecedingSpace=A.prototype.allowsSkippingPrecedingSpace=x.prototype.allowsSkippingPrecedingSpace=function(){return!0};I.prototype.allowsSkippingPrecedingSpace=b.prototype.allowsSkippingPrecedingSpace=w.prototype.allowsSkippingPrecedingSpace=N.prototype.allowsSkippingPrecedingSpace=P.prototype.allowsSkippingPrecedingSpace=_.prototype.allowsSkippingPrecedingSpace=y.prototype.allowsSkippingPrecedingSpace=function(){return!1};var ce;Tt(r=>{ce=r});var ge;d.prototype.assertAllApplicationsAreValid=function(r,e){ge=0,this._assertAllApplicationsAreValid(r,e)};d.prototype._assertAllApplicationsAreValid=L(\"_assertAllApplicationsAreValid\");C._assertAllApplicationsAreValid=F._assertAllApplicationsAreValid=S.prototype._assertAllApplicationsAreValid=A.prototype._assertAllApplicationsAreValid=_.prototype._assertAllApplicationsAreValid=x.prototype._assertAllApplicationsAreValid=function(r,e){};w.prototype._assertAllApplicationsAreValid=function(r,e){ge++,this.expr._assertAllApplicationsAreValid(r,e),ge--};I.prototype._assertAllApplicationsAreValid=function(r,e){for(let t=0;t<this.terms.length;t++)this.terms[t]._assertAllApplicationsAreValid(r,e)};y.prototype._assertAllApplicationsAreValid=function(r,e){for(let t=0;t<this.factors.length;t++)this.factors[t]._assertAllApplicationsAreValid(r,e)};b.prototype._assertAllApplicationsAreValid=P.prototype._assertAllApplicationsAreValid=N.prototype._assertAllApplicationsAreValid=function(r,e){this.expr._assertAllApplicationsAreValid(r,e)};f.prototype._assertAllApplicationsAreValid=function(r,e,t=!1){let n=e.rules[this.ruleName],s=K(r)&&ge===0;if(!n)throw wt(this.ruleName,e.name,this.source);if(!t&&K(this.ruleName)&&!s)throw Mr(this.ruleName,this);let i=this.args.length,o=n.formals.length;if(i!==o)throw Tr(this.ruleName,o,i,this.source);let l=ce&&n===ce.rules.applySyntactic;if(ce&&n===ce.rules.caseInsensitive&&!(this.args[0]instanceof S))throw dt('a Terminal (e.g. \"abc\")',this.args[0]);if(l){let p=this.args[0];if(!(p instanceof f))throw dt(\"a syntactic rule application\",p);if(!K(p.ruleName))throw Dr(p);if(s)throw kr(this)}this.args.forEach(p=>{if(p._assertAllApplicationsAreValid(r,e,l),p.getArity()!==1)throw qr(this.ruleName,p)})};d.prototype.assertChoicesHaveUniformArity=L(\"assertChoicesHaveUniformArity\");C.assertChoicesHaveUniformArity=F.assertChoicesHaveUniformArity=S.prototype.assertChoicesHaveUniformArity=A.prototype.assertChoicesHaveUniformArity=_.prototype.assertChoicesHaveUniformArity=w.prototype.assertChoicesHaveUniformArity=x.prototype.assertChoicesHaveUniformArity=function(r){};I.prototype.assertChoicesHaveUniformArity=function(r){if(this.terms.length===0)return;let e=this.terms[0].getArity();for(let t=0;t<this.terms.length;t++){let n=this.terms[t];n.assertChoicesHaveUniformArity();let s=n.getArity();if(e!==s)throw Lt(r,e,s,n)}};z.prototype.assertChoicesHaveUniformArity=function(r){let e=this.terms[0].getArity(),t=this.terms[1].getArity();if(e!==t)throw Lt(r,t,e,this.terms[0])};y.prototype.assertChoicesHaveUniformArity=function(r){for(let e=0;e<this.factors.length;e++)this.factors[e].assertChoicesHaveUniformArity(r)};b.prototype.assertChoicesHaveUniformArity=function(r){this.expr.assertChoicesHaveUniformArity(r)};P.prototype.assertChoicesHaveUniformArity=function(r){};N.prototype.assertChoicesHaveUniformArity=function(r){this.expr.assertChoicesHaveUniformArity(r)};f.prototype.assertChoicesHaveUniformArity=function(r){};d.prototype.assertIteratedExprsAreNotNullable=L(\"assertIteratedExprsAreNotNullable\");C.assertIteratedExprsAreNotNullable=F.assertIteratedExprsAreNotNullable=S.prototype.assertIteratedExprsAreNotNullable=A.prototype.assertIteratedExprsAreNotNullable=_.prototype.assertIteratedExprsAreNotNullable=x.prototype.assertIteratedExprsAreNotNullable=function(r){};I.prototype.assertIteratedExprsAreNotNullable=function(r){for(let e=0;e<this.terms.length;e++)this.terms[e].assertIteratedExprsAreNotNullable(r)};y.prototype.assertIteratedExprsAreNotNullable=function(r){for(let e=0;e<this.factors.length;e++)this.factors[e].assertIteratedExprsAreNotNullable(r)};b.prototype.assertIteratedExprsAreNotNullable=function(r){if(this.expr.assertIteratedExprsAreNotNullable(r),this.expr.isNullable(r))throw Ft(this,[])};D.prototype.assertIteratedExprsAreNotNullable=P.prototype.assertIteratedExprsAreNotNullable=N.prototype.assertIteratedExprsAreNotNullable=w.prototype.assertIteratedExprsAreNotNullable=function(r){this.expr.assertIteratedExprsAreNotNullable(r)};f.prototype.assertIteratedExprsAreNotNullable=function(r){this.args.forEach(e=>{e.assertIteratedExprsAreNotNullable(r)})};var pe=class{constructor(e){this.matchLength=e}get ctorName(){throw new Error(\"subclass responsibility\")}numChildren(){return this.children?this.children.length:0}childAt(e){if(this.children)return this.children[e]}indexOfChild(e){return this.children.indexOf(e)}hasChildren(){return this.numChildren()>0}hasNoChildren(){return!this.hasChildren()}onlyChild(){if(this.numChildren()!==1)throw new Error(\"cannot get only child of a node of type \"+this.ctorName+\" (it has \"+this.numChildren()+\" children)\");return this.firstChild()}firstChild(){if(this.hasNoChildren())throw new Error(\"cannot get first child of a \"+this.ctorName+\" node, which has no children\");return this.childAt(0)}lastChild(){if(this.hasNoChildren())throw new Error(\"cannot get last child of a \"+this.ctorName+\" node, which has no children\");return this.childAt(this.numChildren()-1)}childBefore(e){let t=this.indexOfChild(e);if(t<0)throw new Error(\"Node.childBefore() called w/ an argument that is not a child\");if(t===0)throw new Error(\"cannot get child before first child\");return this.childAt(t-1)}childAfter(e){let t=this.indexOfChild(e);if(t<0)throw new Error(\"Node.childAfter() called w/ an argument that is not a child\");if(t===this.numChildren()-1)throw new Error(\"cannot get child after last child\");return this.childAt(t+1)}isTerminal(){return!1}isNonterminal(){return!1}isIteration(){return!1}isOptional(){return!1}},j=class extends pe{get ctorName(){return\"_terminal\"}isTerminal(){return!0}get primitiveValue(){throw new Error(\"The `primitiveValue` property was removed in Ohm v17.\")}},Ke=class extends pe{constructor(e,t,n,s){super(s),this.ruleName=e,this.children=t,this.childOffsets=n}get ctorName(){return this.ruleName}isNonterminal(){return!0}isLexical(){return Pt(this.ctorName)}isSyntactic(){return K(this.ctorName)}},Ie=class extends pe{constructor(e,t,n,s){super(n),this.children=e,this.childOffsets=t,this.optional=s}get ctorName(){return\"_iter\"}isIteration(){return!0}isOptional(){return this.optional}};d.prototype.eval=L(\"eval\");C.eval=function(r){let{inputStream:e}=r,t=e.pos,n=e.nextCodePoint();return n!==void 0?(r.pushBinding(new j(String.fromCodePoint(n).length),t),!0):(r.processFailure(t,this),!1)};F.eval=function(r){let{inputStream:e}=r,t=e.pos;return e.atEnd()?(r.pushBinding(new j(0),t),!0):(r.processFailure(t,this),!1)};S.prototype.eval=function(r){let{inputStream:e}=r,t=e.pos;return e.matchString(this.obj)?(r.pushBinding(new j(this.obj.length),t),!0):(r.processFailure(t,this),!1)};A.prototype.eval=function(r){let{inputStream:e}=r,t=e.pos,n=this.matchCodePoint?e.nextCodePoint():e.nextCharCode();return n!==void 0&&this.from.codePointAt(0)<=n&&n<=this.to.codePointAt(0)?(r.pushBinding(new j(String.fromCodePoint(n).length),t),!0):(r.processFailure(t,this),!1)};_.prototype.eval=function(r){return r.eval(r.currentApplication().args[this.index])};w.prototype.eval=function(r){r.enterLexifiedContext();let e=r.eval(this.expr);return r.exitLexifiedContext(),e};I.prototype.eval=function(r){for(let e=0;e<this.terms.length;e++)if(r.eval(this.terms[e]))return!0;return!1};y.prototype.eval=function(r){for(let e=0;e<this.factors.length;e++){let t=this.factors[e];if(!r.eval(t))return!1}return!0};b.prototype.eval=function(r){let{inputStream:e}=r,t=e.pos,n=this.getArity(),s=[],i=[];for(;s.length<n;)s.push([]),i.push([]);let o=0,l=t,a;for(;o<this.maxNumMatches&&r.eval(this.expr);){if(e.pos===l)throw Ft(this,r._applicationStack);l=e.pos,o++;let h=r._bindings.splice(r._bindings.length-n,n),m=r._bindingOffsets.splice(r._bindingOffsets.length-n,n);for(a=0;a<h.length;a++)s[a].push(h[a]),i[a].push(m[a])}if(o<this.minNumMatches)return!1;let p=r.posToOffset(t),c=0;if(o>0){let h=s[n-1],m=i[n-1],g=m[m.length-1]+h[h.length-1].matchLength;p=i[0][0],c=g-p}let u=this instanceof D;for(a=0;a<s.length;a++)r._bindings.push(new Ie(s[a],i[a],c,u)),r._bindingOffsets.push(p);return!0};P.prototype.eval=function(r){let{inputStream:e}=r,t=e.pos;r.pushFailuresInfo();let n=r.eval(this.expr);return r.popFailuresInfo(),n?(r.processFailure(t,this),!1):(e.pos=t,!0)};N.prototype.eval=function(r){let{inputStream:e}=r,t=e.pos;return r.eval(this.expr)?(e.pos=t,!0):!1};f.prototype.eval=function(r){let e=r.currentApplication(),t=e?e.args:[],n=this.substituteParams(t),s=r.getCurrentPosInfo();if(s.isActive(n))return n.handleCycle(r);let i=n.toMemoKey(),o=s.memo[i];if(o&&s.shouldUseMemoizedResult(o)){if(r.hasNecessaryInfo(o))return r.useMemoizedResult(r.inputStream.pos,o);delete s.memo[i]}return n.reallyEval(r)};f.prototype.handleCycle=function(r){let e=r.getCurrentPosInfo(),{currentLeftRecursion:t}=e,n=this.toMemoKey(),s=e.memo[n];return t&&t.headApplication.toMemoKey()===n?s.updateInvolvedApplicationMemoKeys():s||(s=e.memoize(n,{matchLength:0,examinedLength:0,value:!1,rightmostFailureOffset:-1}),e.startLeftRecursion(this,s)),r.useMemoizedResult(r.inputStream.pos,s)};f.prototype.reallyEval=function(r){let{inputStream:e}=r,t=e.pos,n=r.getCurrentPosInfo(),s=r.grammar.rules[this.ruleName],{body:i}=s,{description:o}=s;r.enterApplication(n,this),o&&r.pushFailuresInfo();let l=e.examinedLength;e.examinedLength=0;let a=this.evalOnce(i,r),p=n.currentLeftRecursion,c=this.toMemoKey(),u=p&&p.headApplication.toMemoKey()===c,h;r.doNotMemoize?r.doNotMemoize=!1:u?(a=this.growSeedResult(i,r,t,p,a),n.endLeftRecursion(),h=p,h.examinedLength=e.examinedLength-t,h.rightmostFailureOffset=r._getRightmostFailureOffset(),n.memoize(c,h)):(!p||!p.isInvolved(c))&&(h=n.memoize(c,{matchLength:e.pos-t,examinedLength:e.examinedLength-t,value:a,failuresAtRightmostPosition:r.cloneRecordedFailures(),rightmostFailureOffset:r._getRightmostFailureOffset()}));let m=!!a;if(o&&(r.popFailuresInfo(),m||r.processFailure(t,this),h&&(h.failuresAtRightmostPosition=r.cloneRecordedFailures())),r.isTracing()&&h){let g=r.getTraceEntry(t,this,m,m?[a]:[]);u&&(U(g.terminatingLREntry!=null||!m),g.isHeadOfLeftRecursion=!0),h.traceEntry=g}return e.examinedLength=Math.max(e.examinedLength,l),r.exitApplication(n,a),m};f.prototype.evalOnce=function(r,e){let{inputStream:t}=e,n=t.pos;if(e.eval(r)){let s=r.getArity(),i=e._bindings.splice(e._bindings.length-s,s),o=e._bindingOffsets.splice(e._bindingOffsets.length-s,s),l=t.pos-n;return new Ke(this.ruleName,i,o,l)}else return!1};f.prototype.growSeedResult=function(r,e,t,n,s){if(!s)return!1;let{inputStream:i}=e;for(;;){if(n.matchLength=i.pos-t,n.value=s,n.failuresAtRightmostPosition=e.cloneRecordedFailures(),e.isTracing()){let o=e.trace[e.trace.length-1];n.traceEntry=new ne(e.input,t,i.pos,this,!0,[s],[o.clone()])}if(i.pos=t,s=this.evalOnce(r,e),i.pos-t<=n.matchLength)break;e.isTracing()&&e.trace.splice(-2,1)}return e.isTracing()&&n.traceEntry.recordLRTermination(e.trace.pop(),s),i.pos=t+n.matchLength,n.value};x.prototype.eval=function(r){let{inputStream:e}=r,t=e.pos,n=e.next();return n&&this.pattern.test(n)?(r.pushBinding(new j(n.length),t),!0):(r.processFailure(t,this),!1)};d.prototype.getArity=L(\"getArity\");C.getArity=F.getArity=S.prototype.getArity=A.prototype.getArity=_.prototype.getArity=f.prototype.getArity=x.prototype.getArity=function(){return 1};I.prototype.getArity=function(){return this.terms.length===0?0:this.terms[0].getArity()};y.prototype.getArity=function(){let r=0;for(let e=0;e<this.factors.length;e++)r+=this.factors[e].getArity();return r};b.prototype.getArity=function(){return this.expr.getArity()};P.prototype.getArity=function(){return 0};N.prototype.getArity=w.prototype.getArity=function(){return this.expr.getArity()};function k(r,e){let t={};if(r.source&&e){let n=r.source.relativeTo(e);t.sourceInterval=[n.startIdx,n.endIdx]}return t}d.prototype.outputRecipe=L(\"outputRecipe\");C.outputRecipe=function(r,e){return[\"any\",k(this,e)]};F.outputRecipe=function(r,e){return[\"end\",k(this,e)]};S.prototype.outputRecipe=function(r,e){return[\"terminal\",k(this,e),this.obj]};A.prototype.outputRecipe=function(r,e){return[\"range\",k(this,e),this.from,this.to]};_.prototype.outputRecipe=function(r,e){return[\"param\",k(this,e),this.index]};I.prototype.outputRecipe=function(r,e){return[\"alt\",k(this,e)].concat(this.terms.map(t=>t.outputRecipe(r,e)))};z.prototype.outputRecipe=function(r,e){return this.terms[0].outputRecipe(r,e)};Q.prototype.outputRecipe=function(r,e){let t=this.terms.slice(0,this.expansionPos),n=this.terms.slice(this.expansionPos+1);return[\"splice\",k(this,e),t.map(s=>s.outputRecipe(r,e)),n.map(s=>s.outputRecipe(r,e))]};y.prototype.outputRecipe=function(r,e){return[\"seq\",k(this,e)].concat(this.factors.map(t=>t.outputRecipe(r,e)))};B.prototype.outputRecipe=V.prototype.outputRecipe=D.prototype.outputRecipe=P.prototype.outputRecipe=N.prototype.outputRecipe=w.prototype.outputRecipe=function(r,e){return[this.constructor.name.toLowerCase(),k(this,e),this.expr.outputRecipe(r,e)]};f.prototype.outputRecipe=function(r,e){return[\"app\",k(this,e),this.ruleName,this.args.map(t=>t.outputRecipe(r,e))]};x.prototype.outputRecipe=function(r,e){return[\"unicodeChar\",k(this,e),this.category]};d.prototype.introduceParams=L(\"introduceParams\");C.introduceParams=F.introduceParams=S.prototype.introduceParams=A.prototype.introduceParams=_.prototype.introduceParams=x.prototype.introduceParams=function(r){return this};I.prototype.introduceParams=function(r){return this.terms.forEach((e,t,n)=>{n[t]=e.introduceParams(r)}),this};y.prototype.introduceParams=function(r){return this.factors.forEach((e,t,n)=>{n[t]=e.introduceParams(r)}),this};b.prototype.introduceParams=P.prototype.introduceParams=N.prototype.introduceParams=w.prototype.introduceParams=function(r){return this.expr=this.expr.introduceParams(r),this};f.prototype.introduceParams=function(r){let e=r.indexOf(this.ruleName);if(e>=0){if(this.args.length>0)throw new Error(\"Parameterized rules cannot be passed as arguments to another rule.\");return new _(e).withSource(this.source)}else return this.args.forEach((t,n,s)=>{s[n]=t.introduceParams(r)}),this};d.prototype.isNullable=function(r){return this._isNullable(r,Object.create(null))};d.prototype._isNullable=L(\"_isNullable\");C._isNullable=A.prototype._isNullable=_.prototype._isNullable=V.prototype._isNullable=x.prototype._isNullable=function(r,e){return!1};F._isNullable=function(r,e){return!0};S.prototype._isNullable=function(r,e){return typeof this.obj==\"string\"?this.obj===\"\":!1};I.prototype._isNullable=function(r,e){return this.terms.length===0||this.terms.some(t=>t._isNullable(r,e))};y.prototype._isNullable=function(r,e){return this.factors.every(t=>t._isNullable(r,e))};B.prototype._isNullable=D.prototype._isNullable=P.prototype._isNullable=N.prototype._isNullable=function(r,e){return!0};w.prototype._isNullable=function(r,e){return this.expr._isNullable(r,e)};f.prototype._isNullable=function(r,e){let t=this.toMemoKey();if(!Object.prototype.hasOwnProperty.call(e,t)){let{body:n}=r.rules[this.ruleName],s=n.substituteParams(this.args);e[t]=!1,e[t]=s._isNullable(r,e)}return e[t]};d.prototype.substituteParams=L(\"substituteParams\");C.substituteParams=F.substituteParams=S.prototype.substituteParams=A.prototype.substituteParams=x.prototype.substituteParams=function(r){return this};_.prototype.substituteParams=function(r){return r[this.index]};I.prototype.substituteParams=function(r){return new I(this.terms.map(e=>e.substituteParams(r)))};y.prototype.substituteParams=function(r){return new y(this.factors.map(e=>e.substituteParams(r)))};b.prototype.substituteParams=P.prototype.substituteParams=N.prototype.substituteParams=w.prototype.substituteParams=function(r){return new this.constructor(this.expr.substituteParams(r))};f.prototype.substituteParams=function(r){if(this.args.length===0)return this;{let e=this.args.map(t=>t.substituteParams(r));return new f(this.ruleName,e)}};function It(r){return/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(r)}function tt(r){let e=Object.create(null);r.forEach(t=>{e[t]=(e[t]||0)+1}),Object.keys(e).forEach(t=>{if(e[t]<=1)return;let n=1;r.forEach((s,i)=>{s===t&&(r[i]=s+\"_\"+n++)})})}d.prototype.toArgumentNameList=L(\"toArgumentNameList\");C.toArgumentNameList=function(r,e){return[\"any\"]};F.toArgumentNameList=function(r,e){return[\"end\"]};S.prototype.toArgumentNameList=function(r,e){return typeof this.obj==\"string\"&&/^[_a-zA-Z0-9]+$/.test(this.obj)?[\"_\"+this.obj]:[\"$\"+r]};A.prototype.toArgumentNameList=function(r,e){let t=this.from+\"_to_\"+this.to;return It(t)||(t=\"_\"+t),It(t)||(t=\"$\"+r),[t]};I.prototype.toArgumentNameList=function(r,e){let t=this.terms.map(i=>i.toArgumentNameList(r,!0)),n=[],s=t[0].length;for(let i=0;i<s;i++){let o=[];for(let a=0;a<this.terms.length;a++)o.push(t[a][i]);let l=bt(o);n.push(l.join(\"_or_\"))}return e||tt(n),n};y.prototype.toArgumentNameList=function(r,e){let t=[];return this.factors.forEach(n=>{let s=n.toArgumentNameList(r,!0);t=t.concat(s),r+=s.length}),e||tt(t),t};b.prototype.toArgumentNameList=function(r,e){let t=this.expr.toArgumentNameList(r,e).map(n=>n[n.length-1]===\"s\"?n+\"es\":n+\"s\");return e||tt(t),t};D.prototype.toArgumentNameList=function(r,e){return this.expr.toArgumentNameList(r,e).map(t=>\"opt\"+t[0].toUpperCase()+t.slice(1))};P.prototype.toArgumentNameList=function(r,e){return[]};N.prototype.toArgumentNameList=w.prototype.toArgumentNameList=function(r,e){return this.expr.toArgumentNameList(r,e)};f.prototype.toArgumentNameList=function(r,e){return[this.ruleName]};x.prototype.toArgumentNameList=function(r,e){return[\"$\"+r]};_.prototype.toArgumentNameList=function(r,e){return[\"param\"+this.index]};d.prototype.toDisplayString=L(\"toDisplayString\");I.prototype.toDisplayString=y.prototype.toDisplayString=function(){return this.source?this.source.trimmed().contents:\"[\"+this.constructor.name+\"]\"};C.toDisplayString=F.toDisplayString=b.prototype.toDisplayString=P.prototype.toDisplayString=N.prototype.toDisplayString=w.prototype.toDisplayString=S.prototype.toDisplayString=A.prototype.toDisplayString=_.prototype.toDisplayString=function(){return this.toString()};f.prototype.toDisplayString=function(){if(this.args.length>0){let r=this.args.map(e=>e.toDisplayString());return this.ruleName+\"<\"+r.join(\",\")+\">\"}else return this.ruleName};x.prototype.toDisplayString=function(){return\"Unicode [\"+this.category+\"] character\"};function nn(r){return r===\"description\"||r===\"string\"||r===\"code\"}var M=class r{constructor(e,t,n){if(!nn(n))throw new Error(\"invalid Failure type: \"+n);this.pexpr=e,this.text=t,this.type=n,this.fluffy=!1}getPExpr(){return this.pexpr}getText(){return this.text}getType(){return this.type}isDescription(){return this.type===\"description\"}isStringTerminal(){return this.type===\"string\"}isCode(){return this.type===\"code\"}isFluffy(){return this.fluffy}makeFluffy(){this.fluffy=!0}clearFluffy(){this.fluffy=!1}subsumes(e){return this.getText()===e.getText()&&this.type===e.type&&(!this.isFluffy()||this.isFluffy()&&e.isFluffy())}toString(){return this.type===\"string\"?JSON.stringify(this.getText()):this.getText()}clone(){let e=new r(this.pexpr,this.text,this.type);return this.isFluffy()&&e.makeFluffy(),e}toKey(){return this.toString()+\"#\"+this.type}};d.prototype.toFailure=L(\"toFailure\");C.toFailure=function(r){return new M(this,\"any object\",\"description\")};F.toFailure=function(r){return new M(this,\"end of input\",\"description\")};S.prototype.toFailure=function(r){return new M(this,this.obj,\"string\")};A.prototype.toFailure=function(r){return new M(this,JSON.stringify(this.from)+\"..\"+JSON.stringify(this.to),\"code\")};P.prototype.toFailure=function(r){let e=this.expr===C?\"nothing\":\"not \"+this.expr.toFailure(r);return new M(this,e,\"description\")};N.prototype.toFailure=function(r){return this.expr.toFailure(r)};f.prototype.toFailure=function(r){let{description:e}=r.rules[this.ruleName];return e||(e=(/^[aeiouAEIOU]/.test(this.ruleName)?\"an\":\"a\")+\" \"+this.ruleName),new M(this,e,\"description\")};x.prototype.toFailure=function(r){return new M(this,\"a Unicode [\"+this.category+\"] character\",\"description\")};I.prototype.toFailure=function(r){let t=\"(\"+this.terms.map(n=>n.toFailure(r)).join(\" or \")+\")\";return new M(this,t,\"description\")};y.prototype.toFailure=function(r){let t=\"(\"+this.factors.map(n=>n.toFailure(r)).join(\" \")+\")\";return new M(this,t,\"description\")};b.prototype.toFailure=function(r){let e=\"(\"+this.expr.toFailure(r)+this.operator+\")\";return new M(this,e,\"description\")};d.prototype.toString=L(\"toString\");C.toString=function(){return\"any\"};F.toString=function(){return\"end\"};S.prototype.toString=function(){return JSON.stringify(this.obj)};A.prototype.toString=function(){return JSON.stringify(this.from)+\"..\"+JSON.stringify(this.to)};_.prototype.toString=function(){return\"$\"+this.index};w.prototype.toString=function(){return\"#(\"+this.expr.toString()+\")\"};I.prototype.toString=function(){return this.terms.length===1?this.terms[0].toString():\"(\"+this.terms.map(r=>r.toString()).join(\" | \")+\")\"};y.prototype.toString=function(){return this.factors.length===1?this.factors[0].toString():\"(\"+this.factors.map(r=>r.toString()).join(\" \")+\")\"};b.prototype.toString=function(){return this.expr+this.operator};P.prototype.toString=function(){return\"~\"+this.expr};N.prototype.toString=function(){return\"&\"+this.expr};f.prototype.toString=function(){if(this.args.length>0){let r=this.args.map(e=>e.toString());return this.ruleName+\"<\"+r.join(\",\")+\">\"}else return this.ruleName};x.prototype.toString=function(){return\"\\\\p{\"+this.category+\"}\"};var ve=class r extends d{constructor(e){super(),this.obj=e}_getString(e){let t=e.currentApplication().args[this.obj.index];return U(t instanceof S,\"expected a Terminal expression\"),t.obj}allowsSkippingPrecedingSpace(){return!0}eval(e){let{inputStream:t}=e,n=t.pos,s=this._getString(e);return t.matchString(s,!0)?(e.pushBinding(new j(s.length),n),!0):(e.processFailure(n,this),!1)}getArity(){return 1}substituteParams(e){return new r(this.obj.substituteParams(e))}toDisplayString(){return this.obj.toDisplayString()+\" (case-insensitive)\"}toFailure(e){return new M(this,this.obj.toFailure(e)+\" (case-insensitive)\",\"description\")}_isNullable(e,t){return this.obj._isNullable(e,t)}},sn=Object.freeze({__proto__:null,CaseInsensitiveTerminal:ve,PExpr:d,any:C,end:F,Terminal:S,Range:A,Param:_,Alt:I,Extend:z,Splice:Q,Seq:y,Iter:b,Star:B,Plus:V,Opt:D,Not:P,Lookahead:N,Lex:w,Apply:f,UnicodeChar:x}),Rt;Tt(r=>{Rt=r.rules.applySyntactic.body});var Be=new f(\"spaces\"),ze=class{constructor(e,t,n){this.matcher=e,this.startExpr=t,this.grammar=e.grammar,this.input=e.getInput(),this.inputStream=new re(this.input),this.memoTable=e._memoTable,this.userData=void 0,this.doNotMemoize=!1,this._bindings=[],this._bindingOffsets=[],this._applicationStack=[],this._posStack=[0],this.inLexifiedContextStack=[!1],this.rightmostFailurePosition=-1,this._rightmostFailurePositionStack=[],this._recordedFailuresStack=[],n!==void 0&&(this.positionToRecordFailures=n,this.recordedFailures=Object.create(null))}posToOffset(e){return e-this._posStack[this._posStack.length-1]}enterApplication(e,t){this._posStack.push(this.inputStream.pos),this._applicationStack.push(t),this.inLexifiedContextStack.push(!1),e.enter(t),this._rightmostFailurePositionStack.push(this.rightmostFailurePosition),this.rightmostFailurePosition=-1}exitApplication(e,t){let n=this._posStack.pop();this._applicationStack.pop(),this.inLexifiedContextStack.pop(),e.exit(),this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,this._rightmostFailurePositionStack.pop()),t&&this.pushBinding(t,n)}enterLexifiedContext(){this.inLexifiedContextStack.push(!0)}exitLexifiedContext(){this.inLexifiedContextStack.pop()}currentApplication(){return this._applicationStack[this._applicationStack.length-1]}inSyntacticContext(){let e=this.currentApplication();return e?e.isSyntactic()&&!this.inLexifiedContext():this.startExpr.factors[0].isSyntactic()}inLexifiedContext(){return this.inLexifiedContextStack[this.inLexifiedContextStack.length-1]}skipSpaces(){return this.pushFailuresInfo(),this.eval(Be),this.popBinding(),this.popFailuresInfo(),this.inputStream.pos}skipSpacesIfInSyntacticContext(){return this.inSyntacticContext()?this.skipSpaces():this.inputStream.pos}maybeSkipSpacesBefore(e){return e.allowsSkippingPrecedingSpace()&&e!==Be?this.skipSpacesIfInSyntacticContext():this.inputStream.pos}pushBinding(e,t){this._bindings.push(e),this._bindingOffsets.push(this.posToOffset(t))}popBinding(){this._bindings.pop(),this._bindingOffsets.pop()}numBindings(){return this._bindings.length}truncateBindings(e){for(;this._bindings.length>e;)this.popBinding()}getCurrentPosInfo(){return this.getPosInfo(this.inputStream.pos)}getPosInfo(e){let t=this.memoTable[e];return t||(t=this.memoTable[e]=new He),t}processFailure(e,t){if(this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,e),this.recordedFailures&&e===this.positionToRecordFailures){let n=this.currentApplication();n&&(t=t.substituteParams(n.args)),this.recordFailure(t.toFailure(this.grammar),!1)}}recordFailure(e,t){let n=e.toKey();this.recordedFailures[n]?this.recordedFailures[n].isFluffy()&&!e.isFluffy()&&this.recordedFailures[n].clearFluffy():this.recordedFailures[n]=t?e.clone():e}recordFailures(e,t){Object.keys(e).forEach(n=>{this.recordFailure(e[n],t)})}cloneRecordedFailures(){if(!this.recordedFailures)return;let e=Object.create(null);return Object.keys(this.recordedFailures).forEach(t=>{e[t]=this.recordedFailures[t].clone()}),e}getRightmostFailurePosition(){return this.rightmostFailurePosition}_getRightmostFailureOffset(){return this.rightmostFailurePosition>=0?this.posToOffset(this.rightmostFailurePosition):-1}getMemoizedTraceEntry(e,t){let n=this.memoTable[e];if(n&&t instanceof f){let s=n.memo[t.toMemoKey()];if(s&&s.traceEntry){let i=s.traceEntry.cloneWithExpr(t);return i.isMemoized=!0,i}}return null}getTraceEntry(e,t,n,s){if(t instanceof f){let i=this.currentApplication(),o=i?i.args:[];t=t.substituteParams(o)}return this.getMemoizedTraceEntry(e,t)||new ne(this.input,e,this.inputStream.pos,t,n,s,this.trace)}isTracing(){return!!this.trace}hasNecessaryInfo(e){return this.trace&&!e.traceEntry?!1:this.recordedFailures&&this.inputStream.pos+e.rightmostFailureOffset===this.positionToRecordFailures?!!e.failuresAtRightmostPosition:!0}useMemoizedResult(e,t){this.trace&&this.trace.push(t.traceEntry);let n=this.inputStream.pos+t.rightmostFailureOffset;return this.rightmostFailurePosition=Math.max(this.rightmostFailurePosition,n),this.recordedFailures&&this.positionToRecordFailures===n&&t.failuresAtRightmostPosition&&this.recordFailures(t.failuresAtRightmostPosition,!0),this.inputStream.examinedLength=Math.max(this.inputStream.examinedLength,t.examinedLength+e),t.value?(this.inputStream.pos+=t.matchLength,this.pushBinding(t.value,e),!0):!1}eval(e){let{inputStream:t}=this,n=this._bindings.length,s=this.userData,i;this.recordedFailures&&(i=this.recordedFailures,this.recordedFailures=Object.create(null));let o=t.pos,l=this.maybeSkipSpacesBefore(e),a;this.trace&&(a=this.trace,this.trace=[]);let p=e.eval(this);if(this.trace){let c=this._bindings.slice(n),u=this.getTraceEntry(l,e,p,c);u.isImplicitSpaces=e===Be,u.isRootNode=e===this.startExpr,a.push(u),this.trace=a}return p?this.recordedFailures&&t.pos===this.positionToRecordFailures&&Object.keys(this.recordedFailures).forEach(c=>{this.recordedFailures[c].makeFluffy()}):(t.pos=o,this.truncateBindings(n),this.userData=s),this.recordedFailures&&this.recordFailures(i,!1),e===Rt&&this.skipSpaces(),p}getMatchResult(){this.grammar._setUpMatchState(this),this.eval(this.startExpr);let e;this.recordedFailures&&(e=Object.keys(this.recordedFailures).map(n=>this.recordedFailures[n]));let t=this._bindings[0];return t&&(t.grammar=this.grammar),new fe(this.matcher,this.input,this.startExpr,t,this._bindingOffsets[0],this.rightmostFailurePosition,e)}getTrace(){this.trace=[];let e=this.getMatchResult(),t=this.trace[this.trace.length-1];return t.result=e,t}pushFailuresInfo(){this._rightmostFailurePositionStack.push(this.rightmostFailurePosition),this._recordedFailuresStack.push(this.recordedFailures)}popFailuresInfo(){this.rightmostFailurePosition=this._rightmostFailurePositionStack.pop(),this.recordedFailures=this._recordedFailuresStack.pop()}},Qe=class{constructor(e){this.grammar=e,this._memoTable=[],this._input=\"\",this._isMemoTableStale=!1}_resetMemoTable(){this._memoTable=[],this._isMemoTableStale=!1}getInput(){return this._input}setInput(e){return this._input!==e&&this.replaceInputRange(0,this._input.length,e),this}replaceInputRange(e,t,n){let s=this._input,i=this._memoTable;if(e<0||e>s.length||t<0||t>s.length||e>t)throw new Error(\"Invalid indices: \"+e+\" and \"+t);this._input=s.slice(0,e)+n+s.slice(t),this._input!==s&&i.length>0&&(this._isMemoTableStale=!0);let o=i.slice(t);i.length=e;for(let l=0;l<n.length;l++)i.push(void 0);for(let l of o)i.push(l);for(let l=0;l<e;l++){let a=i[l];a&&a.clearObsoleteEntries(l,e)}return this}match(e,t={incremental:!0}){return this._match(this._getStartExpr(e),{incremental:t.incremental,tracing:!1})}trace(e,t={incremental:!0}){return this._match(this._getStartExpr(e),{incremental:t.incremental,tracing:!0})}_match(e,t={}){let n={tracing:!1,incremental:!0,positionToRecordFailures:void 0,...t};if(!n.incremental)this._resetMemoTable();else if(this._isMemoTableStale&&!this.grammar.supportsIncrementalParsing)throw Cr(this.grammar);let s=new ze(this,e,n.positionToRecordFailures);return n.tracing?s.getTrace():s.getMatchResult()}_getStartExpr(e){let t=e||this.grammar.defaultStartRule;if(!t)throw new Error(\"Missing start rule argument -- the grammar has no default start rule.\");let n=this.grammar.parseApplication(t);return new y([n,F])}},ue=[],Je=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),ye=class{constructor(e,t,n){this._node=e,this.source=t,this._baseInterval=n,e.isNonterminal()&&U(t===n),this._childWrappers=[]}_forgetMemoizedResultFor(e){delete this._node[this._semantics.attributeKeys[e]],this.children.forEach(t=>{t._forgetMemoizedResultFor(e)})}child(e){if(!(0<=e&&e<this._node.numChildren()))return;let t=this._childWrappers[e];if(!t){let n=this._node.childAt(e),s=this._node.childOffsets[e],i=this._baseInterval.subInterval(s,n.matchLength),o=n.isNonterminal()?i:this._baseInterval;t=this._childWrappers[e]=this._semantics.wrap(n,i,o)}return t}_children(){for(let e=0;e<this._node.numChildren();e++)this.child(e);return this._childWrappers}isIteration(){return this._node.isIteration()}isTerminal(){return this._node.isTerminal()}isNonterminal(){return this._node.isNonterminal()}isSyntactic(){return this.isNonterminal()&&this._node.isSyntactic()}isLexical(){return this.isNonterminal()&&this._node.isLexical()}isOptional(){return this._node.isOptional()}iteration(e){let t=e||[],n=t.map(o=>o._node),s=new Ie(n,[],-1,!1),i=this._semantics.wrap(s,null,null);return i._childWrappers=t,i}get children(){return this._children()}get ctorName(){return this._node.ctorName}get numChildren(){return this._node.numChildren()}get sourceString(){return this.source.contents}},q=class r{constructor(e,t){let n=this;if(this.grammar=e,this.checkedActionDicts=!1,this.Wrapper=class extends(t?t.Wrapper:ye){constructor(s,i,o){super(s,i,o),n.checkActionDictsIfHaventAlready(),this._semantics=n}toString(){return\"[semantics wrapper for \"+n.grammar.name+\"]\"}},this.super=t,t){if(!(e.equals(this.super.grammar)||e._inheritsFrom(this.super.grammar)))throw new Error(\"Cannot extend a semantics for grammar '\"+this.super.grammar.name+\"' for use with grammar '\"+e.name+\"' (not a sub-grammar)\");this.operations=Object.create(this.super.operations),this.attributes=Object.create(this.super.attributes),this.attributeKeys=Object.create(null);for(let s in this.attributes)Object.defineProperty(this.attributeKeys,s,{value:gt(s)})}else this.operations=Object.create(null),this.attributes=Object.create(null),this.attributeKeys=Object.create(null)}toString(){return\"[semantics for \"+this.grammar.name+\"]\"}checkActionDictsIfHaventAlready(){this.checkedActionDicts||(this.checkActionDicts(),this.checkedActionDicts=!0)}checkActionDicts(){let e;for(e in this.operations)this.operations[e].checkActionDict(this.grammar);for(e in this.attributes)this.attributes[e].checkActionDict(this.grammar)}toRecipe(e){function t(s){return s.super!==r.BuiltInSemantics._getSemantics()}let n=`(function(g) {\n`;if(t(this)){n+=\" var semantics = \"+this.super.toRecipe(!0)+\"(g\";let s=this.super.grammar,i=this.grammar;for(;i!==s;)n+=\".superGrammar\",i=i.superGrammar;n+=`);\n`,n+=\" return g.extendSemantics(semantics)\"}else n+=\" return g.createSemantics()\";return[\"Operation\",\"Attribute\"].forEach(s=>{let i=this[s.toLowerCase()+\"s\"];Object.keys(i).forEach(o=>{let{actionDict:l,formals:a,builtInDefault:p}=i[o],c=o;a.length>0&&(c+=\"(\"+a.join(\", \")+\")\");let u;t(this)&&this.super[s.toLowerCase()+\"s\"][o]?u=\"extend\"+s:u=\"add\"+s,n+=`\n .`+u+\"(\"+JSON.stringify(c)+\", {\";let h=[];Object.keys(l).forEach(m=>{if(l[m]!==p){let g=l[m].toString().trim();g=g.replace(/^.*\\(/,\"function(\"),h.push(`\n `+JSON.stringify(m)+\": \"+g)}}),n+=h.join(\",\")+`\n })`})}),n+=`;\n })`,e||(n=`(function() {\n var grammar = this.fromRecipe(`+this.grammar.toRecipe()+`);\n var semantics = `+n+`(grammar);\n return semantics;\n});\n`),n}addOperationOrAttribute(e,t,n){let s=e+\"s\",i=vt(t,e),{name:o}=i,{formals:l}=i;this.assertNewName(o,e);let a=on(e,o,u),p={_default:a};Object.keys(n).forEach(h=>{p[h]=n[h]});let c=e===\"operation\"?new Z(o,l,p,a):new he(o,p,a);c.checkActionDict(this.grammar),this[s][o]=c;function u(...h){let m=this._semantics[s][o];if(arguments.length!==m.formals.length)throw new Error(\"Invalid number of arguments passed to \"+o+\" \"+e+\" (expected \"+m.formals.length+\", got \"+arguments.length+\")\");let g=Object.create(null);for(let[$,le]of Object.entries(h)){let fr=m.formals[$];g[fr]=le}let E=this.args;this.args=g;let O=m.execute(this._semantics,this);return this.args=E,O}e===\"operation\"?(this.Wrapper.prototype[o]=u,this.Wrapper.prototype[o].toString=function(){return\"[\"+o+\" operation]\"}):(Object.defineProperty(this.Wrapper.prototype,o,{get:u,configurable:!0}),Object.defineProperty(this.attributeKeys,o,{value:gt(o)}))}extendOperationOrAttribute(e,t,n){let s=e+\"s\";if(vt(t,\"attribute\"),!(this.super&&t in this.super[s]))throw new Error(\"Cannot extend \"+e+\" '\"+t+\"': did not inherit an \"+e+\" with that name\");if(Je(this[s],t))throw new Error(\"Cannot extend \"+e+\" '\"+t+\"' again\");let i=this[s][t].formals,o=this[s][t].actionDict,l=Object.create(o);Object.keys(n).forEach(a=>{l[a]=n[a]}),this[s][t]=e===\"operation\"?new Z(t,i,l):new he(t,l),this[s][t].checkActionDict(this.grammar)}assertNewName(e,t){if(Je(ye.prototype,e))throw new Error(\"Cannot add \"+t+\" '\"+e+\"': that's a reserved name\");if(e in this.operations)throw new Error(\"Cannot add \"+t+\" '\"+e+\"': an operation with that name already exists\");if(e in this.attributes)throw new Error(\"Cannot add \"+t+\" '\"+e+\"': an attribute with that name already exists\")}wrap(e,t,n){let s=n||t;return e instanceof this.Wrapper?e:new this.Wrapper(e,t,s)}};function vt(r,e){if(!q.prototypeGrammar)return U(r.indexOf(\"(\")===-1),{name:r,formals:[]};let t=q.prototypeGrammar.match(r,e===\"operation\"?\"OperationSignature\":\"AttributeSignature\");if(t.failed())throw new Error(t.message);return q.prototypeGrammarSemantics(t).parse()}function on(r,e,t){return function(...n){let i=(this._semantics.operations[e]||this._semantics.attributes[e]).formals.map(o=>this.args[o]);if(!this.isIteration()&&n.length===1)return t.apply(n[0],i);throw jr(this.ctorName,e,r,ue)}}q.createSemantics=function(r,e){let t=new q(r,e!==void 0?e:q.BuiltInSemantics._getSemantics()),n=function(i){if(!(i instanceof fe))throw new TypeError(\"Semantics expected a MatchResult, but got \"+Ye(i));if(i.failed())throw new TypeError(\"cannot apply Semantics to \"+i.toString());let o=i._cst;if(o.grammar!==r)throw new Error(\"Cannot use a MatchResult from grammar '\"+o.grammar.name+\"' with a semantics for '\"+r.name+\"'\");let l=new re(i.input);return t.wrap(o,l.interval(i._cstOffset,i.input.length))};return n.addOperation=function(s,i){return t.addOperationOrAttribute(\"operation\",s,i),n},n.extendOperation=function(s,i){return t.extendOperationOrAttribute(\"operation\",s,i),n},n.addAttribute=function(s,i){return t.addOperationOrAttribute(\"attribute\",s,i),n},n.extendAttribute=function(s,i){return t.extendOperationOrAttribute(\"attribute\",s,i),n},n._getActionDict=function(s){let i=t.operations[s]||t.attributes[s];if(!i)throw new Error('\"'+s+'\" is not a valid operation or attribute name in this semantics for \"'+r.name+'\"');return i.actionDict},n._remove=function(s){let i;return s in t.operations?(i=t.operations[s],delete t.operations[s]):s in t.attributes&&(i=t.attributes[s],delete t.attributes[s]),delete t.Wrapper.prototype[s],i},n.getOperationNames=function(){return Object.keys(t.operations)},n.getAttributeNames=function(){return Object.keys(t.attributes)},n.getGrammar=function(){return t.grammar},n.toRecipe=function(s){return t.toRecipe(s)},n.toString=t.toString.bind(t),n._getSemantics=function(){return t},n};var Z=class{constructor(e,t,n,s){this.name=e,this.formals=t,this.actionDict=n,this.builtInDefault=s}checkActionDict(e){e._checkTopDownActionDict(this.typeName,this.name,this.actionDict)}execute(e,t){try{let{ctorName:n}=t._node,s=this.actionDict[n];return s?(ue.push([this,n]),s.apply(t,t._children())):t.isNonterminal()&&(s=this.actionDict._nonterminal,s)?(ue.push([this,\"_nonterminal\",n]),s.apply(t,t._children())):(ue.push([this,\"default action\",n]),this.actionDict._default.apply(t,t._children()))}finally{ue.pop()}}};Z.prototype.typeName=\"operation\";var he=class extends Z{constructor(e,t,n){super(e,[],t,n)}execute(e,t){let n=t._node,s=e.attributeKeys[this.name];return Je(n,s)||(n[s]=Z.prototype.execute.call(this,e,t)),n[s]}};he.prototype.typeName=\"attribute\";var yt=[\"_iter\",\"_terminal\",\"_nonterminal\",\"_default\"];function xt(r){return Object.keys(r.rules).sort().map(e=>r.rules[e])}var an=r=>r.replace(/\\u2028/g,\"\\\\u2028\").replace(/\\u2029/g,\"\\\\u2029\"),Mt,Dt,R=class r{constructor(e,t,n,s){if(this.name=e,this.superGrammar=t,this.rules=n,s){if(!(s in n))throw new Error(\"Invalid start rule: '\"+s+\"' is not a rule in grammar '\"+e+\"'\");this.defaultStartRule=s}this._matchStateInitializer=void 0,this.supportsIncrementalParsing=!0}matcher(){return new Qe(this)}isBuiltIn(){return this===r.ProtoBuiltInRules||this===r.BuiltInRules}equals(e){if(this===e)return!0;if(e==null||this.name!==e.name||this.defaultStartRule!==e.defaultStartRule||!(this.superGrammar===e.superGrammar||this.superGrammar.equals(e.superGrammar)))return!1;let t=xt(this),n=xt(e);return t.length===n.length&&t.every((s,i)=>s.description===n[i].description&&s.formals.join(\",\")===n[i].formals.join(\",\")&&s.body.toString()===n[i].body.toString())}match(e,t){let n=this.matcher();return n.replaceInputRange(0,0,e),n.match(t)}trace(e,t){let n=this.matcher();return n.replaceInputRange(0,0,e),n.trace(t)}createSemantics(){return q.createSemantics(this)}extendSemantics(e){return q.createSemantics(this,e._getSemantics())}_checkTopDownActionDict(e,t,n){let s=[];for(let i in n){let o=n[i];if(!yt.includes(i)&&!(i in this.rules)){s.push(`'${i}' is not a valid semantic action for '${this.name}'`);continue}if(typeof o!=\"function\"){s.push(`'${i}' must be a function in an action dictionary for '${this.name}'`);continue}let a=o.length,p=this._topDownActionArity(i);if(a!==p){let c;i===\"_iter\"||i===\"_nonterminal\"?c=`it should use a rest parameter, e.g. \\`${i}(...children) {}\\`. NOTE: this is new in Ohm v16 \\u2014 see https://ohmjs.org/d/ati for details.`:c=`expected ${p}, got ${a}`,s.push(`Semantic action '${i}' has the wrong arity: ${c}`)}}if(s.length>0){let i=s.map(l=>\"- \"+l),o=new Error([`Found errors in the action dictionary of the '${t}' ${e}:`,...i].join(`\n`));throw o.problems=s,o}}_topDownActionArity(e){return yt.includes(e)?0:this.rules[e].body.getArity()}_inheritsFrom(e){let t=this.superGrammar;for(;t;){if(t.equals(e,!0))return!0;t=t.superGrammar}return!1}toRecipe(e=void 0){let t={};this.source&&(t.source=this.source.contents);let n=null;this.defaultStartRule&&(n=this.defaultStartRule);let s={};Object.keys(this.rules).forEach(l=>{let a=this.rules[l],{body:p}=a,c=!this.superGrammar||!this.superGrammar.rules[l],u;c?u=\"define\":u=p instanceof z?\"extend\":\"override\";let h={};if(a.source&&this.source){let E=a.source.relativeTo(this.source);h.sourceInterval=[E.startIdx,E.endIdx]}let m=c?a.description:null,g=p.outputRecipe(a.formals,this.source);s[l]=[u,h,m,a.formals,g]});let i=\"null\";e?i=e:this.superGrammar&&!this.superGrammar.isBuiltIn()&&(i=this.superGrammar.toRecipe());let o=[...[\"grammar\",t,this.name].map(JSON.stringify),i,...[n,s].map(JSON.stringify)];return an(`[${o.join(\",\")}]`)}toOperationActionDictionaryTemplate(){return this._toOperationOrAttributeActionDictionaryTemplate()}toAttributeActionDictionaryTemplate(){return this._toOperationOrAttributeActionDictionaryTemplate()}_toOperationOrAttributeActionDictionaryTemplate(){let e=new Y;e.append(\"{\");let t=!0;for(let n in this.rules){let{body:s}=this.rules[n];t?t=!1:e.append(\",\"),e.append(`\n`),e.append(\" \"),this.addSemanticActionTemplate(n,s,e)}return e.append(`\n}`),e.contents()}addSemanticActionTemplate(e,t,n){n.append(e),n.append(\": function(\");let s=this._topDownActionArity(e);n.append(Ee(\"_\",s).join(\", \")),n.append(`) {\n`),n.append(\" }\")}parseApplication(e){let t;if(e.indexOf(\"<\")===-1)t=new f(e);else{let s=Mt.match(e,\"Base_application\");t=Dt(s,{})}if(!(t.ruleName in this.rules))throw wt(t.ruleName,this.name);let{formals:n}=this.rules[t.ruleName];if(n.length!==t.args.length){let{source:s}=this.rules[t.ruleName];throw Ct(t.ruleName,n.length,t.args.length,s)}return t}_setUpMatchState(e){this._matchStateInitializer&&this._matchStateInitializer(e)}};R.ProtoBuiltInRules=new R(\"ProtoBuiltInRules\",void 0,{any:{body:C,formals:[],description:\"any character\",primitive:!0},end:{body:F,formals:[],description:\"end of input\",primitive:!0},caseInsensitive:{body:new ve(new _(0)),formals:[\"str\"],primitive:!0},lower:{body:new x(\"Ll\"),formals:[],description:\"a lowercase letter\",primitive:!0},upper:{body:new x(\"Lu\"),formals:[],description:\"an uppercase letter\",primitive:!0},unicodeLtmo:{body:new x(\"Ltmo\"),formals:[],description:\"a Unicode character in Lt, Lm, or Lo\",primitive:!0},spaces:{body:new B(new f(\"space\")),formals:[]},space:{body:new A(\"\\0\",\" \"),formals:[],description:\"a space\"}});R.initApplicationParser=function(r,e){Mt=r,Dt=e};var xe=class{constructor(e){this.name=e}sourceInterval(e,t){return this.source.subInterval(e,t-e)}ensureSuperGrammar(){return this.superGrammar||this.withSuperGrammar(this.name===\"BuiltInRules\"?R.ProtoBuiltInRules:R.BuiltInRules),this.superGrammar}ensureSuperGrammarRuleForOverriding(e,t){let n=this.ensureSuperGrammar().rules[e];if(!n)throw Fr(e,this.superGrammar.name,t);return n}installOverriddenOrExtendedRule(e,t,n,s){let i=je(t);if(i.length>0)throw mt(e,i,s);let o=this.ensureSuperGrammar().rules[e],l=o.formals,a=l?l.length:0;if(t.length!==a)throw Ct(e,a,t.length,s);return this.install(e,t,n,o.description,s)}install(e,t,n,s,i,o=!1){return this.rules[e]={body:n.introduceParams(t),formals:t,description:s,source:i,primitive:o},this}withSuperGrammar(e){if(this.superGrammar)throw new Error(\"the super grammar of a GrammarDecl cannot be set more than once\");return this.superGrammar=e,this.rules=Object.create(e.rules),e.isBuiltIn()||(this.defaultStartRule=e.defaultStartRule),this}withDefaultStartRule(e){return this.defaultStartRule=e,this}withSource(e){return this.source=new re(e).interval(0,e.length),this}build(){let e=new R(this.name,this.ensureSuperGrammar(),this.rules,this.defaultStartRule);e._matchStateInitializer=e.superGrammar._matchStateInitializer,e.supportsIncrementalParsing=e.superGrammar.supportsIncrementalParsing;let t=[],n=!1;return Object.keys(e.rules).forEach(s=>{let{body:i}=e.rules[s];try{i.assertChoicesHaveUniformArity(s)}catch(o){t.push(o)}try{i.assertAllApplicationsAreValid(s,e)}catch(o){t.push(o),n=!0}}),n||Object.keys(e.rules).forEach(s=>{let{body:i}=e.rules[s];try{i.assertIteratedExprsAreNotNullable(e,[])}catch(o){t.push(o)}}),t.length>0&&Gr(t),this.source&&(e.source=this.source),e}define(e,t,n,s,i,o){if(this.ensureSuperGrammar(),this.superGrammar.rules[e])throw ht(e,this.name,this.superGrammar.name,i);if(this.rules[e])throw ht(e,this.name,this.name,i);let l=je(t);if(l.length>0)throw mt(e,l,i);return this.install(e,t,n,s,i,o)}override(e,t,n,s,i){return this.ensureSuperGrammarRuleForOverriding(e,i),this.installOverriddenOrExtendedRule(e,t,n,i),this}extend(e,t,n,s,i){if(!this.ensureSuperGrammar().rules[e])throw Lr(e,this.superGrammar.name,i);let l=new z(this.superGrammar,e,n);return l.source=n.source,this.installOverriddenOrExtendedRule(e,t,l,i),this}},se=class{constructor(){this.currentDecl=null,this.currentRuleName=null}newGrammar(e){return new xe(e)}grammar(e,t,n,s,i){let o=new xe(t);return n&&o.withSuperGrammar(n instanceof R?n:this.fromRecipe(n)),s&&o.withDefaultStartRule(s),e&&e.source&&o.withSource(e.source),this.currentDecl=o,Object.keys(i).forEach(l=>{this.currentRuleName=l;let a=i[l],p=a[0],c=a[1],u=a[2],h=a[3],m=this.fromRecipe(a[4]),g;o.source&&c&&c.sourceInterval&&(g=o.source.subInterval(c.sourceInterval[0],c.sourceInterval[1]-c.sourceInterval[0])),o[p](l,h,m,u,g)}),this.currentRuleName=this.currentDecl=null,o.build()}terminal(e){return new S(e)}range(e,t){return new A(e,t)}param(e){return new _(e)}alt(...e){let t=[];for(let n of e)n instanceof d||(n=this.fromRecipe(n)),n instanceof I?t=t.concat(n.terms):t.push(n);return t.length===1?t[0]:new I(t)}seq(...e){let t=[];for(let n of e)n instanceof d||(n=this.fromRecipe(n)),n instanceof y?t=t.concat(n.factors):t.push(n);return t.length===1?t[0]:new y(t)}star(e){return e instanceof d||(e=this.fromRecipe(e)),new B(e)}plus(e){return e instanceof d||(e=this.fromRecipe(e)),new V(e)}opt(e){return e instanceof d||(e=this.fromRecipe(e)),new D(e)}not(e){return e instanceof d||(e=this.fromRecipe(e)),new P(e)}lookahead(e){return e instanceof d||(e=this.fromRecipe(e)),new N(e)}lex(e){return e instanceof d||(e=this.fromRecipe(e)),new w(e)}app(e,t){return t&&t.length>0&&(t=t.map(function(n){return n instanceof d?n:this.fromRecipe(n)},this)),new f(e,t)}splice(e,t){return new Q(this.currentDecl.superGrammar,this.currentRuleName,e.map(n=>this.fromRecipe(n)),t.map(n=>this.fromRecipe(n)))}fromRecipe(e){let t=e[0]===\"grammar\"?e.slice(1):e.slice(2),n=this[e[0]](...t),s=e[1];return s&&s.sourceInterval&&this.currentDecl&&n.withSource(this.currentDecl.sourceInterval(...s.sourceInterval)),n}};function Ae(r){return typeof r==\"function\"?r.call(new se):(typeof r==\"string\"&&(r=JSON.parse(r)),new se().fromRecipe(r))}var rt=Ae([\"grammar\",{source:`BuiltInRules {\n\n alnum (an alpha-numeric character)\n = letter\n | digit\n\n letter (a letter)\n = lower\n | upper\n | unicodeLtmo\n\n digit (a digit)\n = \"0\"..\"9\"\n\n hexDigit (a hexadecimal digit)\n = digit\n | \"a\"..\"f\"\n | \"A\"..\"F\"\n\n ListOf<elem, sep>\n = NonemptyListOf<elem, sep>\n | EmptyListOf<elem, sep>\n\n NonemptyListOf<elem, sep>\n = elem (sep elem)*\n\n EmptyListOf<elem, sep>\n = /* nothing */\n\n listOf<elem, sep>\n = nonemptyListOf<elem, sep>\n | emptyListOf<elem, sep>\n\n nonemptyListOf<elem, sep>\n = elem (sep elem)*\n\n emptyListOf<elem, sep>\n = /* nothing */\n\n // Allows a syntactic rule application within a lexical context.\n applySyntactic<app> = app\n}`},\"BuiltInRules\",null,null,{alnum:[\"define\",{sourceInterval:[18,78]},\"an alpha-numeric character\",[],[\"alt\",{sourceInterval:[60,78]},[\"app\",{sourceInterval:[60,66]},\"letter\",[]],[\"app\",{sourceInterval:[73,78]},\"digit\",[]]]],letter:[\"define\",{sourceInterval:[82,142]},\"a letter\",[],[\"alt\",{sourceInterval:[107,142]},[\"app\",{sourceInterval:[107,112]},\"lower\",[]],[\"app\",{sourceInterval:[119,124]},\"upper\",[]],[\"app\",{sourceInterval:[131,142]},\"unicodeLtmo\",[]]]],digit:[\"define\",{sourceInterval:[146,177]},\"a digit\",[],[\"range\",{sourceInterval:[169,177]},\"0\",\"9\"]],hexDigit:[\"define\",{sourceInterval:[181,254]},\"a hexadecimal digit\",[],[\"alt\",{sourceInterval:[219,254]},[\"app\",{sourceInterval:[219,224]},\"digit\",[]],[\"range\",{sourceInterval:[231,239]},\"a\",\"f\"],[\"range\",{sourceInterval:[246,254]},\"A\",\"F\"]]],ListOf:[\"define\",{sourceInterval:[258,336]},null,[\"elem\",\"sep\"],[\"alt\",{sourceInterval:[282,336]},[\"app\",{sourceInterval:[282,307]},\"NonemptyListOf\",[[\"param\",{sourceInterval:[297,301]},0],[\"param\",{sourceInterval:[303,306]},1]]],[\"app\",{sourceInterval:[314,336]},\"EmptyListOf\",[[\"param\",{sourceInterval:[326,330]},0],[\"param\",{sourceInterval:[332,335]},1]]]]],NonemptyListOf:[\"define\",{sourceInterval:[340,388]},null,[\"elem\",\"sep\"],[\"seq\",{sourceInterval:[372,388]},[\"param\",{sourceInterval:[372,376]},0],[\"star\",{sourceInterval:[377,388]},[\"seq\",{sourceInterval:[378,386]},[\"param\",{sourceInterval:[378,381]},1],[\"param\",{sourceInterval:[382,386]},0]]]]],EmptyListOf:[\"define\",{sourceInterval:[392,434]},null,[\"elem\",\"sep\"],[\"seq\",{sourceInterval:[438,438]}]],listOf:[\"define\",{sourceInterval:[438,516]},null,[\"elem\",\"sep\"],[\"alt\",{sourceInterval:[462,516]},[\"app\",{sourceInterval:[462,487]},\"nonemptyListOf\",[[\"param\",{sourceInterval:[477,481]},0],[\"param\",{sourceInterval:[483,486]},1]]],[\"app\",{sourceInterval:[494,516]},\"emptyListOf\",[[\"param\",{sourceInterval:[506,510]},0],[\"param\",{sourceInterval:[512,515]},1]]]]],nonemptyListOf:[\"define\",{sourceInterval:[520,568]},null,[\"elem\",\"sep\"],[\"seq\",{sourceInterval:[552,568]},[\"param\",{sourceInterval:[552,556]},0],[\"star\",{sourceInterval:[557,568]},[\"seq\",{sourceInterval:[558,566]},[\"param\",{sourceInterval:[558,561]},1],[\"param\",{sourceInterval:[562,566]},0]]]]],emptyListOf:[\"define\",{sourceInterval:[572,682]},null,[\"elem\",\"sep\"],[\"seq\",{sourceInterval:[685,685]}]],applySyntactic:[\"define\",{sourceInterval:[685,710]},null,[\"app\"],[\"param\",{sourceInterval:[707,710]},0]]}]);R.BuiltInRules=rt;$r(R.BuiltInRules);var _e=Ae([\"grammar\",{source:`Ohm {\n\n Grammars\n = Grammar*\n\n Grammar\n = ident SuperGrammar? \"{\" Rule* \"}\"\n\n SuperGrammar\n = \"<:\" ident\n\n Rule\n = ident Formals? ruleDescr? \"=\" RuleBody -- define\n | ident Formals? \":=\" OverrideRuleBody -- override\n | ident Formals? \"+=\" RuleBody -- extend\n\n RuleBody\n = \"|\"? NonemptyListOf<TopLevelTerm, \"|\">\n\n TopLevelTerm\n = Seq caseName -- inline\n | Seq\n\n OverrideRuleBody\n = \"|\"? NonemptyListOf<OverrideTopLevelTerm, \"|\">\n\n OverrideTopLevelTerm\n = \"...\" -- superSplice\n | TopLevelTerm\n\n Formals\n = \"<\" ListOf<ident, \",\"> \">\"\n\n Params\n = \"<\" ListOf<Seq, \",\"> \">\"\n\n Alt\n = NonemptyListOf<Seq, \"|\">\n\n Seq\n = Iter*\n\n Iter\n = Pred \"*\" -- star\n | Pred \"+\" -- plus\n | Pred \"?\" -- opt\n | Pred\n\n Pred\n = \"~\" Lex -- not\n | \"&\" Lex -- lookahead\n | Lex\n\n Lex\n = \"#\" Base -- lex\n | Base\n\n Base\n = ident Params? ~(ruleDescr? \"=\" | \":=\" | \"+=\") -- application\n | oneCharTerminal \"..\" oneCharTerminal -- range\n | terminal -- terminal\n | \"(\" Alt \")\" -- paren\n\n ruleDescr (a rule description)\n = \"(\" ruleDescrText \")\"\n\n ruleDescrText\n = (~\")\" any)*\n\n caseName\n = \"--\" (~\"\\\\n\" space)* name (~\"\\\\n\" space)* (\"\\\\n\" | &\"}\")\n\n name (a name)\n = nameFirst nameRest*\n\n nameFirst\n = \"_\"\n | letter\n\n nameRest\n = \"_\"\n | alnum\n\n ident (an identifier)\n = name\n\n terminal\n = \"\\\\\"\" terminalChar* \"\\\\\"\"\n\n oneCharTerminal\n = \"\\\\\"\" terminalChar \"\\\\\"\"\n\n terminalChar\n = escapeChar\n | ~\"\\\\\\\\\" ~\"\\\\\"\" ~\"\\\\n\" \"\\\\u{0}\"..\"\\\\u{10FFFF}\"\n\n escapeChar (an escape sequence)\n = \"\\\\\\\\\\\\\\\\\" -- backslash\n | \"\\\\\\\\\\\\\"\" -- doubleQuote\n | \"\\\\\\\\\\\\'\" -- singleQuote\n | \"\\\\\\\\b\" -- backspace\n | \"\\\\\\\\n\" -- lineFeed\n | \"\\\\\\\\r\" -- carriageReturn\n | \"\\\\\\\\t\" -- tab\n | \"\\\\\\\\u{\" hexDigit hexDigit? hexDigit?\n hexDigit? hexDigit? hexDigit? \"}\" -- unicodeCodePoint\n | \"\\\\\\\\u\" hexDigit hexDigit hexDigit hexDigit -- unicodeEscape\n | \"\\\\\\\\x\" hexDigit hexDigit -- hexEscape\n\n space\n += comment\n\n comment\n = \"//\" (~\"\\\\n\" any)* &(\"\\\\n\" | end) -- singleLine\n | \"/*\" (~\"*/\" any)* \"*/\" -- multiLine\n\n tokens = token*\n\n token = caseName | comment | ident | operator | punctuation | terminal | any\n\n operator = \"<:\" | \"=\" | \":=\" | \"+=\" | \"*\" | \"+\" | \"?\" | \"~\" | \"&\"\n\n punctuation = \"<\" | \">\" | \",\" | \"--\"\n}`},\"Ohm\",null,\"Grammars\",{Grammars:[\"define\",{sourceInterval:[9,32]},null,[],[\"star\",{sourceInterval:[24,32]},[\"app\",{sourceInterval:[24,31]},\"Grammar\",[]]]],Grammar:[\"define\",{sourceInterval:[36,83]},null,[],[\"seq\",{sourceInterval:[50,83]},[\"app\",{sourceInterval:[50,55]},\"ident\",[]],[\"opt\",{sourceInterval:[56,69]},[\"app\",{sourceInterval:[56,68]},\"SuperGrammar\",[]]],[\"terminal\",{sourceInterval:[70,73]},\"{\"],[\"star\",{sourceInterval:[74,79]},[\"app\",{sourceInterval:[74,78]},\"Rule\",[]]],[\"terminal\",{sourceInterval:[80,83]},\"}\"]]],SuperGrammar:[\"define\",{sourceInterval:[87,116]},null,[],[\"seq\",{sourceInterval:[106,116]},[\"terminal\",{sourceInterval:[106,110]},\"<:\"],[\"app\",{sourceInterval:[111,116]},\"ident\",[]]]],Rule_define:[\"define\",{sourceInterval:[131,181]},null,[],[\"seq\",{sourceInterval:[131,170]},[\"app\",{sourceInterval:[131,136]},\"ident\",[]],[\"opt\",{sourceInterval:[137,145]},[\"app\",{sourceInterval:[137,144]},\"Formals\",[]]],[\"opt\",{sourceInterval:[146,156]},[\"app\",{sourceInterval:[146,155]},\"ruleDescr\",[]]],[\"terminal\",{sourceInterval:[157,160]},\"=\"],[\"app\",{sourceInterval:[162,170]},\"RuleBody\",[]]]],Rule_override:[\"define\",{sourceInterval:[188,248]},null,[],[\"seq\",{sourceInterval:[188,235]},[\"app\",{sourceInterval:[188,193]},\"ident\",[]],[\"opt\",{sourceInterval:[194,202]},[\"app\",{sourceInterval:[194,201]},\"Formals\",[]]],[\"terminal\",{sourceInterval:[214,218]},\":=\"],[\"app\",{sourceInterval:[219,235]},\"OverrideRuleBody\",[]]]],Rule_extend:[\"define\",{sourceInterval:[255,305]},null,[],[\"seq\",{sourceInterval:[255,294]},[\"app\",{sourceInterval:[255,260]},\"ident\",[]],[\"opt\",{sourceInterval:[261,269]},[\"app\",{sourceInterval:[261,268]},\"Formals\",[]]],[\"terminal\",{sourceInterval:[281,285]},\"+=\"],[\"app\",{sourceInterval:[286,294]},\"RuleBody\",[]]]],Rule:[\"define\",{sourceInterval:[120,305]},null,[],[\"alt\",{sourceInterval:[131,305]},[\"app\",{sourceInterval:[131,170]},\"Rule_define\",[]],[\"app\",{sourceInterval:[188,235]},\"Rule_override\",[]],[\"app\",{sourceInterval:[255,294]},\"Rule_extend\",[]]]],RuleBody:[\"define\",{sourceInterval:[309,362]},null,[],[\"seq\",{sourceInterval:[324,362]},[\"opt\",{sourceInterval:[324,328]},[\"terminal\",{sourceInterval:[324,327]},\"|\"]],[\"app\",{sourceInterval:[329,362]},\"NonemptyListOf\",[[\"app\",{sourceInterval:[344,356]},\"TopLevelTerm\",[]],[\"terminal\",{sourceInterval:[358,361]},\"|\"]]]]],TopLevelTerm_inline:[\"define\",{sourceInterval:[385,408]},null,[],[\"seq\",{sourceInterval:[385,397]},[\"app\",{sourceInterval:[385,388]},\"Seq\",[]],[\"app\",{sourceInterval:[389,397]},\"caseName\",[]]]],TopLevelTerm:[\"define\",{sourceInterval:[366,418]},null,[],[\"alt\",{sourceInterval:[385,418]},[\"app\",{sourceInterval:[385,397]},\"TopLevelTerm_inline\",[]],[\"app\",{sourceInterval:[415,418]},\"Seq\",[]]]],OverrideRuleBody:[\"define\",{sourceInterval:[422,491]},null,[],[\"seq\",{sourceInterval:[445,491]},[\"opt\",{sourceInterval:[445,449]},[\"terminal\",{sourceInterval:[445,448]},\"|\"]],[\"app\",{sourceInterval:[450,491]},\"NonemptyListOf\",[[\"app\",{sourceInterval:[465,485]},\"OverrideTopLevelTerm\",[]],[\"terminal\",{sourceInterval:[487,490]},\"|\"]]]]],OverrideTopLevelTerm_superSplice:[\"define\",{sourceInterval:[522,543]},null,[],[\"terminal\",{sourceInterval:[522,527]},\"...\"]],OverrideTopLevelTerm:[\"define\",{sourceInterval:[495,562]},null,[],[\"alt\",{sourceInterval:[522,562]},[\"app\",{sourceInterval:[522,527]},\"OverrideTopLevelTerm_superSplice\",[]],[\"app\",{sourceInterval:[550,562]},\"TopLevelTerm\",[]]]],Formals:[\"define\",{sourceInterval:[566,606]},null,[],[\"seq\",{sourceInterval:[580,606]},[\"terminal\",{sourceInterval:[580,583]},\"<\"],[\"app\",{sourceInterval:[584,602]},\"ListOf\",[[\"app\",{sourceInterval:[591,596]},\"ident\",[]],[\"terminal\",{sourceInterval:[598,601]},\",\"]]],[\"terminal\",{sourceInterval:[603,606]},\">\"]]],Params:[\"define\",{sourceInterval:[610,647]},null,[],[\"seq\",{sourceInterval:[623,647]},[\"terminal\",{sourceInterval:[623,626]},\"<\"],[\"app\",{sourceInterval:[627,643]},\"ListOf\",[[\"app\",{sourceInterval:[634,637]},\"Seq\",[]],[\"terminal\",{sourceInterval:[639,642]},\",\"]]],[\"terminal\",{sourceInterval:[644,647]},\">\"]]],Alt:[\"define\",{sourceInterval:[651,685]},null,[],[\"app\",{sourceInterval:[661,685]},\"NonemptyListOf\",[[\"app\",{sourceInterval:[676,679]},\"Seq\",[]],[\"terminal\",{sourceInterval:[681,684]},\"|\"]]]],Seq:[\"define\",{sourceInterval:[689,704]},null,[],[\"star\",{sourceInterval:[699,704]},[\"app\",{sourceInterval:[699,703]},\"Iter\",[]]]],Iter_star:[\"define\",{sourceInterval:[719,736]},null,[],[\"seq\",{sourceInterval:[719,727]},[\"app\",{sourceInterval:[719,723]},\"Pred\",[]],[\"terminal\",{sourceInterval:[724,727]},\"*\"]]],Iter_plus:[\"define\",{sourceInterval:[743,760]},null,[],[\"seq\",{sourceInterval:[743,751]},[\"app\",{sourceInterval:[743,747]},\"Pred\",[]],[\"terminal\",{sourceInterval:[748,751]},\"+\"]]],Iter_opt:[\"define\",{sourceInterval:[767,783]},null,[],[\"seq\",{sourceInterval:[767,775]},[\"app\",{sourceInterval:[767,771]},\"Pred\",[]],[\"terminal\",{sourceInterval:[772,775]},\"?\"]]],Iter:[\"define\",{sourceInterval:[708,794]},null,[],[\"alt\",{sourceInterval:[719,794]},[\"app\",{sourceInterval:[719,727]},\"Iter_star\",[]],[\"app\",{sourceInterval:[743,751]},\"Iter_plus\",[]],[\"app\",{sourceInterval:[767,775]},\"Iter_opt\",[]],[\"app\",{sourceInterval:[790,794]},\"Pred\",[]]]],Pred_not:[\"define\",{sourceInterval:[809,824]},null,[],[\"seq\",{sourceInterval:[809,816]},[\"terminal\",{sourceInterval:[809,812]},\"~\"],[\"app\",{sourceInterval:[813,816]},\"Lex\",[]]]],Pred_lookahead:[\"define\",{sourceInterval:[831,852]},null,[],[\"seq\",{sourceInterval:[831,838]},[\"terminal\",{sourceInterval:[831,834]},\"&\"],[\"app\",{sourceInterval:[835,838]},\"Lex\",[]]]],Pred:[\"define\",{sourceInterval:[798,862]},null,[],[\"alt\",{sourceInterval:[809,862]},[\"app\",{sourceInterval:[809,816]},\"Pred_not\",[]],[\"app\",{sourceInterval:[831,838]},\"Pred_lookahead\",[]],[\"app\",{sourceInterval:[859,862]},\"Lex\",[]]]],Lex_lex:[\"define\",{sourceInterval:[876,892]},null,[],[\"seq\",{sourceInterval:[876,884]},[\"terminal\",{sourceInterval:[876,879]},\"#\"],[\"app\",{sourceInterval:[880,884]},\"Base\",[]]]],Lex:[\"define\",{sourceInterval:[866,903]},null,[],[\"alt\",{sourceInterval:[876,903]},[\"app\",{sourceInterval:[876,884]},\"Lex_lex\",[]],[\"app\",{sourceInterval:[899,903]},\"Base\",[]]]],Base_application:[\"define\",{sourceInterval:[918,979]},null,[],[\"seq\",{sourceInterval:[918,963]},[\"app\",{sourceInterval:[918,923]},\"ident\",[]],[\"opt\",{sourceInterval:[924,931]},[\"app\",{sourceInterval:[924,930]},\"Params\",[]]],[\"not\",{sourceInterval:[932,963]},[\"alt\",{sourceInterval:[934,962]},[\"seq\",{sourceInterval:[934,948]},[\"opt\",{sourceInterval:[934,944]},[\"app\",{sourceInterval:[934,943]},\"ruleDescr\",[]]],[\"terminal\",{sourceInterval:[945,948]},\"=\"]],[\"terminal\",{sourceInterval:[951,955]},\":=\"],[\"terminal\",{sourceInterval:[958,962]},\"+=\"]]]]],Base_range:[\"define\",{sourceInterval:[986,1041]},null,[],[\"seq\",{sourceInterval:[986,1022]},[\"app\",{sourceInterval:[986,1001]},\"oneCharTerminal\",[]],[\"terminal\",{sourceInterval:[1002,1006]},\"..\"],[\"app\",{sourceInterval:[1007,1022]},\"oneCharTerminal\",[]]]],Base_terminal:[\"define\",{sourceInterval:[1048,1106]},null,[],[\"app\",{sourceInterval:[1048,1056]},\"terminal\",[]]],Base_paren:[\"define\",{sourceInterval:[1113,1168]},null,[],[\"seq\",{sourceInterval:[1113,1124]},[\"terminal\",{sourceInterval:[1113,1116]},\"(\"],[\"app\",{sourceInterval:[1117,1120]},\"Alt\",[]],[\"terminal\",{sourceInterval:[1121,1124]},\")\"]]],Base:[\"define\",{sourceInterval:[907,1168]},null,[],[\"alt\",{sourceInterval:[918,1168]},[\"app\",{sourceInterval:[918,963]},\"Base_application\",[]],[\"app\",{sourceInterval:[986,1022]},\"Base_range\",[]],[\"app\",{sourceInterval:[1048,1056]},\"Base_terminal\",[]],[\"app\",{sourceInterval:[1113,1124]},\"Base_paren\",[]]]],ruleDescr:[\"define\",{sourceInterval:[1172,1231]},\"a rule description\",[],[\"seq\",{sourceInterval:[1210,1231]},[\"terminal\",{sourceInterval:[1210,1213]},\"(\"],[\"app\",{sourceInterval:[1214,1227]},\"ruleDescrText\",[]],[\"terminal\",{sourceInterval:[1228,1231]},\")\"]]],ruleDescrText:[\"define\",{sourceInterval:[1235,1266]},null,[],[\"star\",{sourceInterval:[1255,1266]},[\"seq\",{sourceInterval:[1256,1264]},[\"not\",{sourceInterval:[1256,1260]},[\"terminal\",{sourceInterval:[1257,1260]},\")\"]],[\"app\",{sourceInterval:[1261,1264]},\"any\",[]]]]],caseName:[\"define\",{sourceInterval:[1270,1338]},null,[],[\"seq\",{sourceInterval:[1285,1338]},[\"terminal\",{sourceInterval:[1285,1289]},\"--\"],[\"star\",{sourceInterval:[1290,1304]},[\"seq\",{sourceInterval:[1291,1302]},[\"not\",{sourceInterval:[1291,1296]},[\"terminal\",{sourceInterval:[1292,1296]},`\n`]],[\"app\",{sourceInterval:[1297,1302]},\"space\",[]]]],[\"app\",{sourceInterval:[1305,1309]},\"name\",[]],[\"star\",{sourceInterval:[1310,1324]},[\"seq\",{sourceInterval:[1311,1322]},[\"not\",{sourceInterval:[1311,1316]},[\"terminal\",{sourceInterval:[1312,1316]},`\n`]],[\"app\",{sourceInterval:[1317,1322]},\"space\",[]]]],[\"alt\",{sourceInterval:[1326,1337]},[\"terminal\",{sourceInterval:[1326,1330]},`\n`],[\"lookahead\",{sourceInterval:[1333,1337]},[\"terminal\",{sourceInterval:[1334,1337]},\"}\"]]]]],name:[\"define\",{sourceInterval:[1342,1382]},\"a name\",[],[\"seq\",{sourceInterval:[1363,1382]},[\"app\",{sourceInterval:[1363,1372]},\"nameFirst\",[]],[\"star\",{sourceInterval:[1373,1382]},[\"app\",{sourceInterval:[1373,1381]},\"nameRest\",[]]]]],nameFirst:[\"define\",{sourceInterval:[1386,1418]},null,[],[\"alt\",{sourceInterval:[1402,1418]},[\"terminal\",{sourceInterval:[1402,1405]},\"_\"],[\"app\",{sourceInterval:[1412,1418]},\"letter\",[]]]],nameRest:[\"define\",{sourceInterval:[1422,1452]},null,[],[\"alt\",{sourceInterval:[1437,1452]},[\"terminal\",{sourceInterval:[1437,1440]},\"_\"],[\"app\",{sourceInterval:[1447,1452]},\"alnum\",[]]]],ident:[\"define\",{sourceInterval:[1456,1489]},\"an identifier\",[],[\"app\",{sourceInterval:[1485,1489]},\"name\",[]]],terminal:[\"define\",{sourceInterval:[1493,1531]},null,[],[\"seq\",{sourceInterval:[1508,1531]},[\"terminal\",{sourceInterval:[1508,1512]},'\"'],[\"star\",{sourceInterval:[1513,1526]},[\"app\",{sourceInterval:[1513,1525]},\"terminalChar\",[]]],[\"terminal\",{sourceInterval:[1527,1531]},'\"']]],oneCharTerminal:[\"define\",{sourceInterval:[1535,1579]},null,[],[\"seq\",{sourceInterval:[1557,1579]},[\"terminal\",{sourceInterval:[1557,1561]},'\"'],[\"app\",{sourceInterval:[1562,1574]},\"terminalChar\",[]],[\"terminal\",{sourceInterval:[1575,1579]},'\"']]],terminalChar:[\"define\",{sourceInterval:[1583,1660]},null,[],[\"alt\",{sourceInterval:[1602,1660]},[\"app\",{sourceInterval:[1602,1612]},\"escapeChar\",[]],[\"seq\",{sourceInterval:[1621,1660]},[\"not\",{sourceInterval:[1621,1626]},[\"terminal\",{sourceInterval:[1622,1626]},\"\\\\\"]],[\"not\",{sourceInterval:[1627,1632]},[\"terminal\",{sourceInterval:[1628,1632]},'\"']],[\"not\",{sourceInterval:[1633,1638]},[\"terminal\",{sourceInterval:[1634,1638]},`\n`]],[\"range\",{sourceInterval:[1639,1660]},\"\\0\",\"\\u{10FFFF}\"]]]],escapeChar_backslash:[\"define\",{sourceInterval:[1703,1758]},null,[],[\"terminal\",{sourceInterval:[1703,1709]},\"\\\\\\\\\"]],escapeChar_doubleQuote:[\"define\",{sourceInterval:[1765,1822]},null,[],[\"terminal\",{sourceInterval:[1765,1771]},'\\\\\"']],escapeChar_singleQuote:[\"define\",{sourceInterval:[1829,1886]},null,[],[\"terminal\",{sourceInterval:[1829,1835]},\"\\\\'\"]],escapeChar_backspace:[\"define\",{sourceInterval:[1893,1948]},null,[],[\"terminal\",{sourceInterval:[1893,1898]},\"\\\\b\"]],escapeChar_lineFeed:[\"define\",{sourceInterval:[1955,2009]},null,[],[\"terminal\",{sourceInterval:[1955,1960]},\"\\\\n\"]],escapeChar_carriageReturn:[\"define\",{sourceInterval:[2016,2076]},null,[],[\"terminal\",{sourceInterval:[2016,2021]},\"\\\\r\"]],escapeChar_tab:[\"define\",{sourceInterval:[2083,2132]},null,[],[\"terminal\",{sourceInterval:[2083,2088]},\"\\\\t\"]],escapeChar_unicodeCodePoint:[\"define\",{sourceInterval:[2139,2243]},null,[],[\"seq\",{sourceInterval:[2139,2221]},[\"terminal\",{sourceInterval:[2139,2145]},\"\\\\u{\"],[\"app\",{sourceInterval:[2146,2154]},\"hexDigit\",[]],[\"opt\",{sourceInterval:[2155,2164]},[\"app\",{sourceInterval:[2155,2163]},\"hexDigit\",[]]],[\"opt\",{sourceInterval:[2165,2174]},[\"app\",{sourceInterval:[2165,2173]},\"hexDigit\",[]]],[\"opt\",{sourceInterval:[2188,2197]},[\"app\",{sourceInterval:[2188,2196]},\"hexDigit\",[]]],[\"opt\",{sourceInterval:[2198,2207]},[\"app\",{sourceInterval:[2198,2206]},\"hexDigit\",[]]],[\"opt\",{sourceInterval:[2208,2217]},[\"app\",{sourceInterval:[2208,2216]},\"hexDigit\",[]]],[\"terminal\",{sourceInterval:[2218,2221]},\"}\"]]],escapeChar_unicodeEscape:[\"define\",{sourceInterval:[2250,2309]},null,[],[\"seq\",{sourceInterval:[2250,2291]},[\"terminal\",{sourceInterval:[2250,2255]},\"\\\\u\"],[\"app\",{sourceInterval:[2256,2264]},\"hexDigit\",[]],[\"app\",{sourceInterval:[2265,2273]},\"hexDigit\",[]],[\"app\",{sourceInterval:[2274,2282]},\"hexDigit\",[]],[\"app\",{sourceInterval:[2283,2291]},\"hexDigit\",[]]]],escapeChar_hexEscape:[\"define\",{sourceInterval:[2316,2371]},null,[],[\"seq\",{sourceInterval:[2316,2339]},[\"terminal\",{sourceInterval:[2316,2321]},\"\\\\x\"],[\"app\",{sourceInterval:[2322,2330]},\"hexDigit\",[]],[\"app\",{sourceInterval:[2331,2339]},\"hexDigit\",[]]]],escapeChar:[\"define\",{sourceInterval:[1664,2371]},\"an escape sequence\",[],[\"alt\",{sourceInterval:[1703,2371]},[\"app\",{sourceInterval:[1703,1709]},\"escapeChar_backslash\",[]],[\"app\",{sourceInterval:[1765,1771]},\"escapeChar_doubleQuote\",[]],[\"app\",{sourceInterval:[1829,1835]},\"escapeChar_singleQuote\",[]],[\"app\",{sourceInterval:[1893,1898]},\"escapeChar_backspace\",[]],[\"app\",{sourceInterval:[1955,1960]},\"escapeChar_lineFeed\",[]],[\"app\",{sourceInterval:[2016,2021]},\"escapeChar_carriageReturn\",[]],[\"app\",{sourceInterval:[2083,2088]},\"escapeChar_tab\",[]],[\"app\",{sourceInterval:[2139,2221]},\"escapeChar_unicodeCodePoint\",[]],[\"app\",{sourceInterval:[2250,2291]},\"escapeChar_unicodeEscape\",[]],[\"app\",{sourceInterval:[2316,2339]},\"escapeChar_hexEscape\",[]]]],space:[\"extend\",{sourceInterval:[2375,2394]},null,[],[\"app\",{sourceInterval:[2387,2394]},\"comment\",[]]],comment_singleLine:[\"define\",{sourceInterval:[2412,2458]},null,[],[\"seq\",{sourceInterval:[2412,2443]},[\"terminal\",{sourceInterval:[2412,2416]},\"//\"],[\"star\",{sourceInterval:[2417,2429]},[\"seq\",{sourceInterval:[2418,2427]},[\"not\",{sourceInterval:[2418,2423]},[\"terminal\",{sourceInterval:[2419,2423]},`\n`]],[\"app\",{sourceInterval:[2424,2427]},\"any\",[]]]],[\"lookahead\",{sourceInterval:[2430,2443]},[\"alt\",{sourceInterval:[2432,2442]},[\"terminal\",{sourceInterval:[2432,2436]},`\n`],[\"app\",{sourceInterval:[2439,2442]},\"end\",[]]]]]],comment_multiLine:[\"define\",{sourceInterval:[2465,2501]},null,[],[\"seq\",{sourceInterval:[2465,2487]},[\"terminal\",{sourceInterval:[2465,2469]},\"/*\"],[\"star\",{sourceInterval:[2470,2482]},[\"seq\",{sourceInterval:[2471,2480]},[\"not\",{sourceInterval:[2471,2476]},[\"terminal\",{sourceInterval:[2472,2476]},\"*/\"]],[\"app\",{sourceInterval:[2477,2480]},\"any\",[]]]],[\"terminal\",{sourceInterval:[2483,2487]},\"*/\"]]],comment:[\"define\",{sourceInterval:[2398,2501]},null,[],[\"alt\",{sourceInterval:[2412,2501]},[\"app\",{sourceInterval:[2412,2443]},\"comment_singleLine\",[]],[\"app\",{sourceInterval:[2465,2487]},\"comment_multiLine\",[]]]],tokens:[\"define\",{sourceInterval:[2505,2520]},null,[],[\"star\",{sourceInterval:[2514,2520]},[\"app\",{sourceInterval:[2514,2519]},\"token\",[]]]],token:[\"define\",{sourceInterval:[2524,2600]},null,[],[\"alt\",{sourceInterval:[2532,2600]},[\"app\",{sourceInterval:[2532,2540]},\"caseName\",[]],[\"app\",{sourceInterval:[2543,2550]},\"comment\",[]],[\"app\",{sourceInterval:[2553,2558]},\"ident\",[]],[\"app\",{sourceInterval:[2561,2569]},\"operator\",[]],[\"app\",{sourceInterval:[2572,2583]},\"punctuation\",[]],[\"app\",{sourceInterval:[2586,2594]},\"terminal\",[]],[\"app\",{sourceInterval:[2597,2600]},\"any\",[]]]],operator:[\"define\",{sourceInterval:[2604,2669]},null,[],[\"alt\",{sourceInterval:[2615,2669]},[\"terminal\",{sourceInterval:[2615,2619]},\"<:\"],[\"terminal\",{sourceInterval:[2622,2625]},\"=\"],[\"terminal\",{sourceInterval:[2628,2632]},\":=\"],[\"terminal\",{sourceInterval:[2635,2639]},\"+=\"],[\"terminal\",{sourceInterval:[2642,2645]},\"*\"],[\"terminal\",{sourceInterval:[2648,2651]},\"+\"],[\"terminal\",{sourceInterval:[2654,2657]},\"?\"],[\"terminal\",{sourceInterval:[2660,2663]},\"~\"],[\"terminal\",{sourceInterval:[2666,2669]},\"&\"]]],punctuation:[\"define\",{sourceInterval:[2673,2709]},null,[],[\"alt\",{sourceInterval:[2687,2709]},[\"terminal\",{sourceInterval:[2687,2690]},\"<\"],[\"terminal\",{sourceInterval:[2693,2696]},\">\"],[\"terminal\",{sourceInterval:[2699,2702]},\",\"],[\"terminal\",{sourceInterval:[2705,2709]},\"--\"]]]}]),We=Object.create(d.prototype);function St(r,e){for(let t in r)if(t===e)return!0;return!1}function nt(r,e,t){let n=new se,s,i,o,l=!1;return(t||_e).createSemantics().addOperation(\"visit\",{Grammars(c){return c.children.map(u=>u.visit())},Grammar(c,u,h,m,g){let E=c.visit();s=n.newGrammar(E),u.child(0)&&u.child(0).visit(),m.children.map($=>$.visit());let O=s.build();if(O.source=this.source.trimmed(),St(e,E))throw wr(O);return e[E]=O,O},SuperGrammar(c,u){let h=u.visit();if(h===\"null\")s.withSuperGrammar(null);else{if(!e||!St(e,h))throw Or(h,e,u.source);s.withSuperGrammar(e[h])}},Rule_define(c,u,h,m,g){i=c.visit(),o=u.children.map(le=>le.visit())[0]||[],!s.defaultStartRule&&s.ensureSuperGrammar()!==R.ProtoBuiltInRules&&s.withDefaultStartRule(i);let E=g.visit(),O=h.children.map(le=>le.visit())[0],$=this.source.trimmed();return s.define(i,o,E,O,$)},Rule_override(c,u,h,m){i=c.visit(),o=u.children.map(O=>O.visit())[0]||[];let g=this.source.trimmed();s.ensureSuperGrammarRuleForOverriding(i,g),l=!0;let E=m.visit();return l=!1,s.override(i,o,E,null,g)},Rule_extend(c,u,h,m){i=c.visit(),o=u.children.map(O=>O.visit())[0]||[];let g=m.visit(),E=this.source.trimmed();return s.extend(i,o,g,null,E)},RuleBody(c,u){return n.alt(...u.visit()).withSource(this.source)},OverrideRuleBody(c,u){let h=u.visit(),m=h.indexOf(We);if(m>=0){let g=h.slice(0,m),E=h.slice(m+1);return E.forEach(O=>{if(O===We)throw Br(O)}),new Q(s.superGrammar,i,g,E).withSource(this.source)}else return n.alt(...h).withSource(this.source)},Formals(c,u,h){return u.visit()},Params(c,u,h){return u.visit()},Alt(c){return n.alt(...c.visit()).withSource(this.source)},TopLevelTerm_inline(c,u){let h=i+\"_\"+u.visit(),m=c.visit(),g=this.source.trimmed(),E=!(s.superGrammar&&s.superGrammar.rules[h]);l&&!E?s.override(h,o,m,null,g):s.define(h,o,m,null,g);let O=o.map($=>n.app($));return n.app(h,O).withSource(m.source)},OverrideTopLevelTerm_superSplice(c){return We},Seq(c){return n.seq(...c.children.map(u=>u.visit())).withSource(this.source)},Iter_star(c,u){return n.star(c.visit()).withSource(this.source)},Iter_plus(c,u){return n.plus(c.visit()).withSource(this.source)},Iter_opt(c,u){return n.opt(c.visit()).withSource(this.source)},Pred_not(c,u){return n.not(u.visit()).withSource(this.source)},Pred_lookahead(c,u){return n.lookahead(u.visit()).withSource(this.source)},Lex_lex(c,u){return n.lex(u.visit()).withSource(this.source)},Base_application(c,u){let h=u.children.map(m=>m.visit())[0]||[];return n.app(c.visit(),h).withSource(this.source)},Base_range(c,u,h){return n.range(c.visit(),h.visit()).withSource(this.source)},Base_terminal(c){return n.terminal(c.visit()).withSource(this.source)},Base_paren(c,u,h){return u.visit()},ruleDescr(c,u,h){return u.visit()},ruleDescrText(c){return this.sourceString.trim()},caseName(c,u,h,m,g){return h.visit()},name(c,u){return this.sourceString},nameFirst(c){},nameRest(c){},terminal(c,u,h){return u.children.map(m=>m.visit()).join(\"\")},oneCharTerminal(c,u,h){return u.visit()},escapeChar(c){try{return Ot(this.sourceString)}catch(u){throw u instanceof RangeError&&u.message.startsWith(\"Invalid code point \")?Wr(c):u}},NonemptyListOf(c,u,h){return[c.visit()].concat(h.children.map(m=>m.visit()))},EmptyListOf(){return[]},_terminal(){return this.sourceString}})(r).visit()}var ln=Ae([\"grammar\",{source:`OperationsAndAttributes {\n\n AttributeSignature =\n name\n\n OperationSignature =\n name Formals?\n\n Formals\n = \"(\" ListOf<name, \",\"> \")\"\n\n name (a name)\n = nameFirst nameRest*\n\n nameFirst\n = \"_\"\n | letter\n\n nameRest\n = \"_\"\n | alnum\n\n}`},\"OperationsAndAttributes\",null,\"AttributeSignature\",{AttributeSignature:[\"define\",{sourceInterval:[29,58]},null,[],[\"app\",{sourceInterval:[54,58]},\"name\",[]]],OperationSignature:[\"define\",{sourceInterval:[62,100]},null,[],[\"seq\",{sourceInterval:[87,100]},[\"app\",{sourceInterval:[87,91]},\"name\",[]],[\"opt\",{sourceInterval:[92,100]},[\"app\",{sourceInterval:[92,99]},\"Formals\",[]]]]],Formals:[\"define\",{sourceInterval:[104,143]},null,[],[\"seq\",{sourceInterval:[118,143]},[\"terminal\",{sourceInterval:[118,121]},\"(\"],[\"app\",{sourceInterval:[122,139]},\"ListOf\",[[\"app\",{sourceInterval:[129,133]},\"name\",[]],[\"terminal\",{sourceInterval:[135,138]},\",\"]]],[\"terminal\",{sourceInterval:[140,143]},\")\"]]],name:[\"define\",{sourceInterval:[147,187]},\"a name\",[],[\"seq\",{sourceInterval:[168,187]},[\"app\",{sourceInterval:[168,177]},\"nameFirst\",[]],[\"star\",{sourceInterval:[178,187]},[\"app\",{sourceInterval:[178,186]},\"nameRest\",[]]]]],nameFirst:[\"define\",{sourceInterval:[191,223]},null,[],[\"alt\",{sourceInterval:[207,223]},[\"terminal\",{sourceInterval:[207,210]},\"_\"],[\"app\",{sourceInterval:[217,223]},\"letter\",[]]]],nameRest:[\"define\",{sourceInterval:[227,257]},null,[],[\"alt\",{sourceInterval:[242,257]},[\"terminal\",{sourceInterval:[242,245]},\"_\"],[\"app\",{sourceInterval:[252,257]},\"alnum\",[]]]]}]);cn(R.BuiltInRules);un(ln);function cn(r){let e={empty(){return this.iteration()},nonEmpty(t,n,s){return this.iteration([t].concat(s.children))}};q.BuiltInSemantics=q.createSemantics(r,null).addOperation(\"asIteration\",{emptyListOf:e.empty,nonemptyListOf:e.nonEmpty,EmptyListOf:e.empty,NonemptyListOf:e.nonEmpty})}function un(r){q.prototypeGrammarSemantics=r.createSemantics().addOperation(\"parse\",{AttributeSignature(e){return{name:e.parse(),formals:[]}},OperationSignature(e,t){return{name:e.parse(),formals:t.children.map(n=>n.parse())[0]||[]}},Formals(e,t,n){return t.asIteration().children.map(s=>s.parse())},name(e,t){return this.sourceString}}),q.prototypeGrammar=r}function pn(r){let e=0,t=[0],n=()=>t[t.length-1],s={},i=/( *).*(?:$|\\r?\\n|\\r)/g,o;for(;(o=i.exec(r))!=null;){let[l,a]=o;if(l.length===0)break;let p=a.length,c=n(),u=e+p;if(p>c)t.push(p),s[u]=1;else if(p<c){let h=t.length;for(;n()!==p;)t.pop();s[u]=-1*(h-t.length)}e+=l.length}return t.length>1&&(s[e]=1-t.length),s}var kt=\"an indented block\",Bt=\"a dedent\",Et=1114111+1,Ze=class extends re{constructor(e){super(e.input),this.state=e}_indentationAt(e){return this.state.userData[e]||0}atEnd(){return super.atEnd()&&this._indentationAt(this.pos)===0}next(){if(this._indentationAt(this.pos)!==0){this.examinedLength=Math.max(this.examinedLength,this.pos);return}return super.next()}nextCharCode(){return this._indentationAt(this.pos)!==0?(this.examinedLength=Math.max(this.examinedLength,this.pos),Et):super.nextCharCode()}nextCodePoint(){return this._indentationAt(this.pos)!==0?(this.examinedLength=Math.max(this.examinedLength,this.pos),Et):super.nextCodePoint()}},Se=class extends d{constructor(e=!0){super(),this.isIndent=e}allowsSkippingPrecedingSpace(){return!0}eval(e){let{inputStream:t}=e,n=e.userData;e.doNotMemoize=!0;let s=t.pos,i=this.isIndent?1:-1;return(n[s]||0)*i>0?(e.userData=Object.create(n),e.userData[s]-=i,e.pushBinding(new j(0),s),!0):(e.processFailure(s,this),!1)}getArity(){return 1}_assertAllApplicationsAreValid(e,t){}_isNullable(e,t){return!1}assertChoicesHaveUniformArity(e){}assertIteratedExprsAreNotNullable(e){}introduceParams(e){return this}substituteParams(e){return this}toString(){return this.isIndent?\"indent\":\"dedent\"}toDisplayString(){return this.toString()}toFailure(e){let t=this.isIndent?kt:Bt;return new M(this,t,\"description\")}},hn=new f(\"indent\"),mn=new f(\"dedent\"),dn=new Q(rt,\"any\",[hn,mn],[]),Wt=new se().newGrammar(\"IndentationSensitive\").withSuperGrammar(rt).define(\"indent\",[],new Se(!0),kt,void 0,!0).define(\"dedent\",[],new Se(!1),Bt,void 0,!0).extend(\"any\",[],dn,\"any character\",void 0).build();Object.assign(Wt,{_matchStateInitializer(r){r.userData=pn(r.input),r.inputStream=new Ze(r)},supportsIncrementalParsing:!1});var fn=\"17.1.0\";R.initApplicationParser(_e,nt);var gn=r=>!!r.constructor&&typeof r.constructor.isBuffer==\"function\"&&r.constructor.isBuffer(r);function In(r,e){let t=_e.match(r,\"Grammars\");if(t.failed())throw Nr(t);return nt(t,e)}function vn(r,e){let t=Vt(r,e),n=Object.keys(t);if(n.length===0)throw new Error(\"Missing grammar definition\");if(n.length>1){let i=t[n[1]].source;throw new Error(et(i.sourceString,i.startIdx)+\"Found more than one grammar definition -- use ohm.grammars() instead.\")}return t[n[0]]}function Vt(r,e){let t=Object.create(e||{});if(typeof r!=\"string\")if(gn(r))r=r.toString();else throw new TypeError(\"Expected string as first argument, got \"+Ye(r));return In(r,t),t}W.ExperimentalIndentationSensitive=Wt;W._buildGrammar=nt;W.grammar=vn;W.grammars=Vt;W.makeRecipe=Ae;W.ohmGrammar=_e;W.pexprs=sn;W.version=fn});var Ut=ut((Bn,Gt)=>{\"use strict\";var{makeRecipe:yn}=jt(),xn=yn([\"grammar\",{source:`Filter {\\r\n Expr \\r\n = FilterWithSelectExpr\\r\n | FilterWithSelectAllExpr\\r\n | FilterWithGroupedAggregedSelectExpr\\r\n | FilterWithAggregatedSelectExpr\\r\n | AggregatedSelectionWithGroups\\r\n | AggregatedSelectionClause\\r\n | FilterExpr\\r\n | PropertiesSelectExpr\\r\n | SelectAllExpr\\r\n\\r\n SelectAllExpr = anyProperty\\r\n\\r\n FilterWithSelectAllExpr = FilterExpr \"->\" anyProperty\\r\n \\r\n FilterWithSelectExpr = FilterExpr \"->\" PropertiesSelectExpr\\r\n\\r\n FilterWithAggregatedSelectExpr = FilterExpr \"->\" AggregatedSelectionClause\\r\n \\r\n FilterWithGroupedAggregedSelectExpr = FilterExpr \"->\" AggregatedSelectionClause groupedBy PropertiesSelectExpr\\r\n\\r\n FilterExpr = BoolOr\\r\n \\r\n BoolOr\\r\n = BoolOr orOperation BoolAnd -- or\\r\n | BoolAnd\\r\n\\r\n BoolAnd \\r\n = BoolAnd andOperation PriExp --and\\r\n | PriExp\\r\n \\r\n PriExp \\r\n = \"(\" FilterExpr \")\" -- paren\\r\n | ComparisonExp\\r\n | NotExpr\\r\n\\r\n ComparisonExp = EqualityExpr | LessThanExpr | MoreThanExpr | LessThanOrEqualExpr | MoreThanOrEqualExpr | NonEqualityExpr \\r\n | PropertiesEqualityExpr | PropertiesLessThanExpr | PropertiesMoreThanExpr | PropertiesLessThanOrEqualExpr \\r\n | PropertiesMoreThanOrEqualExpr | PropertiesNonEqualityExpr \\r\n | StartsWithExpr | EndsWithExpr | InExpr | NotInExpr | exactElement\\r\n\\r\n NotExpr = notOperation \"(\" FilterExpr \")\"\\r\n\\r\n EqualityExpr = propertySequence \"=\" expressionConst | expressionConst \"=\" propertySequence\\r\n \\r\n LessThanExpr = propertySequence \"<\" expressionConst | expressionConst \">\" propertySequence\\r\n \\r\n MoreThanExpr = propertySequence \">\" expressionConst | expressionConst \"<\" propertySequence\\r\n \\r\n LessThanOrEqualExpr = propertySequence \"<=\" expressionConst | expressionConst \">=\" propertySequence\\r\n \\r\n MoreThanOrEqualExpr = propertySequence \">=\" expressionConst | expressionConst \"<=\" propertySequence\\r\n\\r\n NonEqualityExpr = propertySequence nonEqualSign expressionConst | expressionConst nonEqualSign propertySequence\\r\n\\r\n PropertiesEqualityExpr = propertySequence \"=\" propertySequence\\r\n\\r\n PropertiesLessThanExpr = propertySequence \"<\" propertySequence\\r\n\\r\n PropertiesMoreThanExpr = propertySequence \">\" propertySequence\\r\n\\r\n PropertiesLessThanOrEqualExpr = propertySequence \"<=\" propertySequence\\r\n\\r\n PropertiesMoreThanOrEqualExpr = propertySequence \">=\" propertySequence\\r\n\\r\n PropertiesNonEqualityExpr = propertySequence nonEqualSign propertySequence\\r\n\\r\n StartsWithExpr = propertySequence likeWord startsWithConst\\r\n\\r\n EndsWithExpr = propertySequence likeWord endsWithConst\\r\n\\r\n InExpr = propertySequence inWord \"[\" ConstantsListExpr \"]\"\\r\n\\r\n NotInExpr = propertySequence notWord inWord \"[\" ConstantsListExpr \"]\"\\r\n\\r\n AggregatedSelectionWithGroups = AggregatedSelectionClause groupedBy PropertiesSelectExpr\\r\n\\r\n AggregatedSelectionClause = AggregatedFuncsExpr | AnyAggregatedFuncExpr\\r\n\\r\n AggregatedFuncsExpr = AnyAggregatedFuncExpr (\",\" AnyAggregatedFuncExpr)*\\r\n\\r\n AnyAggregatedFuncExpr = AggregatedNamedFuncExpr | AggregatedFuncExpr\\r\n\\r\n AggregatedNamedFuncExpr = AggregatedFuncExpr asWord propertyNameIdentifier\\r\n\\r\n AggregatedFuncExpr = AggregatedCountExpr | AggregatedSumExpr | AggregatedMinExpr | AggregatedMaxExpr | AggregatedAvgExpr\\r\n\\r\n AggregatedCountExpr = countWord \"()\"\\r\n\\r\n AggregatedSumExpr = sumWord \"(\" propertySequence \")\"\\r\n\\r\n AggregatedMinExpr = minWord \"(\" propertySequence \")\"\\r\n\\r\n AggregatedMaxExpr = maxWord \"(\" propertySequence \")\"\\r\n\\r\n AggregatedAvgExpr = avgWord \"(\" propertySequence \")\"\\r\n\\r\n PropertiesSelectExpr = PropertiesExpr | PropertyIdentifierExpr\\r\n\\r\n PropertiesExpr = PropertyIdentifierExpr (\",\" PropertyIdentifierExpr)*\\r\n\\r\n ConstantsListExpr = expressionConst (\",\" expressionConst)*\\r\n\\r\n PropertyIdentifierExpr\\r\n = NamedPropertyExpr\\r\n | propertySequence\\r\n\\r\n NamedPropertyExpr = propertySequence asWord propertyNameIdentifier\\r\n\\r\n propertyNameIdentifier = (letter | digit | \"_\")+\\r\n\\r\n propertySequence = property | directProperty\\r\n \\r\n property \\r\n = propertySequence \".\" categoryOrProperty --ofPropertySequence\\r\n | directAnyPropertySequence \".\" categoryOrProperty --ofDirectAnyPropertySequence\\r\n | directAnyProperty \".\" categoryOrProperty --ofDirectAny\\r\n \\r\n directProperty \\r\n = categoryOrProperty \".\" categoryOrProperty --ofCategory\\r\n | anyProperty \".\" categoryOrProperty --ofAnyProperty\\r\n \\r\n directAnyPropertySequence = propertySequence \".\" anyProperty\\r\n \\r\n directAnyProperty = directAnyProperty \".\" anyProperty --sequenced\\r\n | categoryOrProperty \".\" anyProperty --ofCategory\\r\n | anyProperty \".\" anyProperty --ofAny\\r\n \\r\n exactElement = propertySequence \"!\" --ofPropertySequence\\r\n | categoryOrProperty \"!\" --ofCategory\\r\n \\r\n categoryOrProperty (element category or property)\\r\n = \"[\" identificator \"]\" --inBrackets \\r\n | alnum+ --value\\r\n\\r\n groupedBy = caseInsensitive<\"group by\">\\r\n\\r\n avgWord = caseInsensitive<\"avg\">\\r\n\\r\n maxWord = caseInsensitive<\"max\">\\r\n\\r\n minWord = caseInsensitive<\"min\">\\r\n\\r\n sumWord = caseInsensitive<\"sum\">\\r\n\\r\n countWord = caseInsensitive<\"count\">\\r\n\\r\n asWord = caseInsensitive<\"as\">\\r\n\\r\n nonEqualSign = \"<>\" | \"!=\"\\r\n \\r\n andOperation = andWord | \"&&\" | \"&\"\\r\n\\r\n andWord = caseInsensitive<\"and\">\\r\n \\r\n orOperation = orWord | \"||\" | \"|\"\\r\n\\r\n orWord = caseInsensitive<\"or\">\\r\n\\r\n likeWord = caseInsensitive<\"like\">\\r\n\\r\n notOperation = notWord | \"!\"\\r\n\\r\n notWord = caseInsensitive<\"not\">\\r\n\\r\n inWord = caseInsensitive<\"in\">\\r\n \\r\n anyProperty = \"*\"\\r\n \\r\n identificator = (~\"]\" ~\"[\" any)+\\r\n \\r\n expressionConst = textConst | number\\r\n\\r\n startsWithConst\\r\n = \"\\\\\"\" likeTextValue \"%\\\\\"\"\\r\n\\r\n endsWithConst\\r\n = \"\\\\\"%\" likeTextValue \"\\\\\"\"\\r\n \\r\n textConst (target text value)\\r\n = \"\\\\\"\" textValue \"\\\\\"\"\\r\n \\r\n textValue = textChar*\\r\n\\r\n likeTextValue = likeTextChar*\\r\n \\r\n textChar\\r\n = \"\\\\\\\\\\\\\"\"\\r\n | (~\"\\\\\"\" any)\\r\n\\r\n likeTextChar\\r\n = \"\\\\\\\\\\\\\"\"\\r\n | \"\\\\\\\\%\"\\r\n | (~(\"\\\\\"\" | \"%\") any)\\r\n \\r\n number\\r\n = positiveNumber\\r\n | negativeNumber\\r\n \\r\n negativeNumber = \"-\" positiveNumber\\r\n \\r\n positiveNumber = realNumber | integerNumber\\r\n \\r\n integerNumber = digit+\\r\n \\r\n realNumber = digit* \".\" digit+\\r\n}`},\"Filter\",null,\"Expr\",{Expr:[\"define\",{sourceInterval:[14,332]},null,[],[\"alt\",{sourceInterval:[31,332]},[\"app\",{sourceInterval:[31,51]},\"FilterWithSelectExpr\",[]],[\"app\",{sourceInterval:[63,86]},\"FilterWithSelectAllExpr\",[]],[\"app\",{sourceInterval:[98,133]},\"FilterWithGroupedAggregedSelectExpr\",[]],[\"app\",{sourceInterval:[145,175]},\"FilterWithAggregatedSelectExpr\",[]],[\"app\",{sourceInterval:[187,216]},\"AggregatedSelectionWithGroups\",[]],[\"app\",{sourceInterval:[228,253]},\"AggregatedSelectionClause\",[]],[\"app\",{sourceInterval:[265,275]},\"FilterExpr\",[]],[\"app\",{sourceInterval:[287,307]},\"PropertiesSelectExpr\",[]],[\"app\",{sourceInterval:[319,332]},\"SelectAllExpr\",[]]]],SelectAllExpr:[\"define\",{sourceInterval:[340,367]},null,[],[\"app\",{sourceInterval:[356,367]},\"anyProperty\",[]]],FilterWithSelectAllExpr:[\"define\",{sourceInterval:[375,428]},null,[],[\"seq\",{sourceInterval:[401,428]},[\"app\",{sourceInterval:[401,411]},\"FilterExpr\",[]],[\"terminal\",{sourceInterval:[412,416]},\"->\"],[\"app\",{sourceInterval:[417,428]},\"anyProperty\",[]]]],FilterWithSelectExpr:[\"define\",{sourceInterval:[440,499]},null,[],[\"seq\",{sourceInterval:[463,499]},[\"app\",{sourceInterval:[463,473]},\"FilterExpr\",[]],[\"terminal\",{sourceInterval:[474,478]},\"->\"],[\"app\",{sourceInterval:[479,499]},\"PropertiesSelectExpr\",[]]]],FilterWithAggregatedSelectExpr:[\"define\",{sourceInterval:[507,581]},null,[],[\"seq\",{sourceInterval:[540,581]},[\"app\",{sourceInterval:[540,550]},\"FilterExpr\",[]],[\"terminal\",{sourceInterval:[551,555]},\"->\"],[\"app\",{sourceInterval:[556,581]},\"AggregatedSelectionClause\",[]]]],FilterWithGroupedAggregedSelectExpr:[\"define\",{sourceInterval:[593,703]},null,[],[\"seq\",{sourceInterval:[631,703]},[\"app\",{sourceInterval:[631,641]},\"FilterExpr\",[]],[\"terminal\",{sourceInterval:[642,646]},\"->\"],[\"app\",{sourceInterval:[647,672]},\"AggregatedSelectionClause\",[]],[\"app\",{sourceInterval:[673,682]},\"groupedBy\",[]],[\"app\",{sourceInterval:[683,703]},\"PropertiesSelectExpr\",[]]]],FilterExpr:[\"define\",{sourceInterval:[711,730]},null,[],[\"app\",{sourceInterval:[724,730]},\"BoolOr\",[]]],BoolOr_or:[\"define\",{sourceInterval:[760,792]},null,[],[\"seq\",{sourceInterval:[760,786]},[\"app\",{sourceInterval:[760,766]},\"BoolOr\",[]],[\"app\",{sourceInterval:[767,778]},\"orOperation\",[]],[\"app\",{sourceInterval:[779,786]},\"BoolAnd\",[]]]],BoolOr:[\"define\",{sourceInterval:[742,811]},null,[],[\"alt\",{sourceInterval:[760,811]},[\"app\",{sourceInterval:[760,786]},\"BoolOr_or\",[]],[\"app\",{sourceInterval:[804,811]},\"BoolAnd\",[]]]],BoolAnd_and:[\"define\",{sourceInterval:[839,873]},null,[],[\"seq\",{sourceInterval:[839,866]},[\"app\",{sourceInterval:[839,846]},\"BoolAnd\",[]],[\"app\",{sourceInterval:[847,859]},\"andOperation\",[]],[\"app\",{sourceInterval:[860,866]},\"PriExp\",[]]]],BoolAnd:[\"define\",{sourceInterval:[819,891]},null,[],[\"alt\",{sourceInterval:[839,891]},[\"app\",{sourceInterval:[839,866]},\"BoolAnd_and\",[]],[\"app\",{sourceInterval:[885,891]},\"PriExp\",[]]]],PriExp_paren:[\"define\",{sourceInterval:[926,953]},null,[],[\"seq\",{sourceInterval:[926,944]},[\"terminal\",{sourceInterval:[926,929]},\"(\"],[\"app\",{sourceInterval:[930,940]},\"FilterExpr\",[]],[\"terminal\",{sourceInterval:[941,944]},\")\"]]],PriExp:[\"define\",{sourceInterval:[907,997]},null,[],[\"alt\",{sourceInterval:[926,997]},[\"app\",{sourceInterval:[926,944]},\"PriExp_paren\",[]],[\"app\",{sourceInterval:[965,978]},\"ComparisonExp\",[]],[\"app\",{sourceInterval:[990,997]},\"NotExpr\",[]]]],ComparisonExp:[\"define\",{sourceInterval:[1005,1390]},null,[],[\"alt\",{sourceInterval:[1021,1390]},[\"app\",{sourceInterval:[1021,1033]},\"EqualityExpr\",[]],[\"app\",{sourceInterval:[1036,1048]},\"LessThanExpr\",[]],[\"app\",{sourceInterval:[1051,1063]},\"MoreThanExpr\",[]],[\"app\",{sourceInterval:[1066,1085]},\"LessThanOrEqualExpr\",[]],[\"app\",{sourceInterval:[1088,1107]},\"MoreThanOrEqualExpr\",[]],[\"app\",{sourceInterval:[1110,1125]},\"NonEqualityExpr\",[]],[\"app\",{sourceInterval:[1138,1160]},\"PropertiesEqualityExpr\",[]],[\"app\",{sourceInterval:[1163,1185]},\"PropertiesLessThanExpr\",[]],[\"app\",{sourceInterval:[1188,1210]},\"PropertiesMoreThanExpr\",[]],[\"app\",{sourceInterval:[1213,1242]},\"PropertiesLessThanOrEqualExpr\",[]],[\"app\",{sourceInterval:[1255,1284]},\"PropertiesMoreThanOrEqualExpr\",[]],[\"app\",{sourceInterval:[1287,1312]},\"PropertiesNonEqualityExpr\",[]],[\"app\",{sourceInterval:[1325,1339]},\"StartsWithExpr\",[]],[\"app\",{sourceInterval:[1342,1354]},\"EndsWithExpr\",[]],[\"app\",{sourceInterval:[1357,1363]},\"InExpr\",[]],[\"app\",{sourceInterval:[1366,1375]},\"NotInExpr\",[]],[\"app\",{sourceInterval:[1378,1390]},\"exactElement\",[]]]],NotExpr:[\"define\",{sourceInterval:[1398,1439]},null,[],[\"seq\",{sourceInterval:[1408,1439]},[\"app\",{sourceInterval:[1408,1420]},\"notOperation\",[]],[\"terminal\",{sourceInterval:[1421,1424]},\"(\"],[\"app\",{sourceInterval:[1425,1435]},\"FilterExpr\",[]],[\"terminal\",{sourceInterval:[1436,1439]},\")\"]]],EqualityExpr:[\"define\",{sourceInterval:[1447,1537]},null,[],[\"alt\",{sourceInterval:[1462,1537]},[\"seq\",{sourceInterval:[1462,1498]},[\"app\",{sourceInterval:[1462,1478]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[1479,1482]},\"=\"],[\"app\",{sourceInterval:[1483,1498]},\"expressionConst\",[]]],[\"seq\",{sourceInterval:[1501,1537]},[\"app\",{sourceInterval:[1501,1516]},\"expressionConst\",[]],[\"terminal\",{sourceInterval:[1517,1520]},\"=\"],[\"app\",{sourceInterval:[1521,1537]},\"propertySequence\",[]]]]],LessThanExpr:[\"define\",{sourceInterval:[1549,1639]},null,[],[\"alt\",{sourceInterval:[1564,1639]},[\"seq\",{sourceInterval:[1564,1600]},[\"app\",{sourceInterval:[1564,1580]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[1581,1584]},\"<\"],[\"app\",{sourceInterval:[1585,1600]},\"expressionConst\",[]]],[\"seq\",{sourceInterval:[1603,1639]},[\"app\",{sourceInterval:[1603,1618]},\"expressionConst\",[]],[\"terminal\",{sourceInterval:[1619,1622]},\">\"],[\"app\",{sourceInterval:[1623,1639]},\"propertySequence\",[]]]]],MoreThanExpr:[\"define\",{sourceInterval:[1651,1741]},null,[],[\"alt\",{sourceInterval:[1666,1741]},[\"seq\",{sourceInterval:[1666,1702]},[\"app\",{sourceInterval:[1666,1682]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[1683,1686]},\">\"],[\"app\",{sourceInterval:[1687,1702]},\"expressionConst\",[]]],[\"seq\",{sourceInterval:[1705,1741]},[\"app\",{sourceInterval:[1705,1720]},\"expressionConst\",[]],[\"terminal\",{sourceInterval:[1721,1724]},\"<\"],[\"app\",{sourceInterval:[1725,1741]},\"propertySequence\",[]]]]],LessThanOrEqualExpr:[\"define\",{sourceInterval:[1753,1852]},null,[],[\"alt\",{sourceInterval:[1775,1852]},[\"seq\",{sourceInterval:[1775,1812]},[\"app\",{sourceInterval:[1775,1791]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[1792,1796]},\"<=\"],[\"app\",{sourceInterval:[1797,1812]},\"expressionConst\",[]]],[\"seq\",{sourceInterval:[1815,1852]},[\"app\",{sourceInterval:[1815,1830]},\"expressionConst\",[]],[\"terminal\",{sourceInterval:[1831,1835]},\">=\"],[\"app\",{sourceInterval:[1836,1852]},\"propertySequence\",[]]]]],MoreThanOrEqualExpr:[\"define\",{sourceInterval:[1864,1963]},null,[],[\"alt\",{sourceInterval:[1886,1963]},[\"seq\",{sourceInterval:[1886,1923]},[\"app\",{sourceInterval:[1886,1902]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[1903,1907]},\">=\"],[\"app\",{sourceInterval:[1908,1923]},\"expressionConst\",[]]],[\"seq\",{sourceInterval:[1926,1963]},[\"app\",{sourceInterval:[1926,1941]},\"expressionConst\",[]],[\"terminal\",{sourceInterval:[1942,1946]},\"<=\"],[\"app\",{sourceInterval:[1947,1963]},\"propertySequence\",[]]]]],NonEqualityExpr:[\"define\",{sourceInterval:[1971,2082]},null,[],[\"alt\",{sourceInterval:[1989,2082]},[\"seq\",{sourceInterval:[1989,2034]},[\"app\",{sourceInterval:[1989,2005]},\"propertySequence\",[]],[\"app\",{sourceInterval:[2006,2018]},\"nonEqualSign\",[]],[\"app\",{sourceInterval:[2019,2034]},\"expressionConst\",[]]],[\"seq\",{sourceInterval:[2037,2082]},[\"app\",{sourceInterval:[2037,2052]},\"expressionConst\",[]],[\"app\",{sourceInterval:[2053,2065]},\"nonEqualSign\",[]],[\"app\",{sourceInterval:[2066,2082]},\"propertySequence\",[]]]]],PropertiesEqualityExpr:[\"define\",{sourceInterval:[2090,2152]},null,[],[\"seq\",{sourceInterval:[2115,2152]},[\"app\",{sourceInterval:[2115,2131]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[2132,2135]},\"=\"],[\"app\",{sourceInterval:[2136,2152]},\"propertySequence\",[]]]],PropertiesLessThanExpr:[\"define\",{sourceInterval:[2160,2222]},null,[],[\"seq\",{sourceInterval:[2185,2222]},[\"app\",{sourceInterval:[2185,2201]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[2202,2205]},\"<\"],[\"app\",{sourceInterval:[2206,2222]},\"propertySequence\",[]]]],PropertiesMoreThanExpr:[\"define\",{sourceInterval:[2230,2292]},null,[],[\"seq\",{sourceInterval:[2255,2292]},[\"app\",{sourceInterval:[2255,2271]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[2272,2275]},\">\"],[\"app\",{sourceInterval:[2276,2292]},\"propertySequence\",[]]]],PropertiesLessThanOrEqualExpr:[\"define\",{sourceInterval:[2300,2370]},null,[],[\"seq\",{sourceInterval:[2332,2370]},[\"app\",{sourceInterval:[2332,2348]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[2349,2353]},\"<=\"],[\"app\",{sourceInterval:[2354,2370]},\"propertySequence\",[]]]],PropertiesMoreThanOrEqualExpr:[\"define\",{sourceInterval:[2378,2448]},null,[],[\"seq\",{sourceInterval:[2410,2448]},[\"app\",{sourceInterval:[2410,2426]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[2427,2431]},\">=\"],[\"app\",{sourceInterval:[2432,2448]},\"propertySequence\",[]]]],PropertiesNonEqualityExpr:[\"define\",{sourceInterval:[2456,2530]},null,[],[\"seq\",{sourceInterval:[2484,2530]},[\"app\",{sourceInterval:[2484,2500]},\"propertySequence\",[]],[\"app\",{sourceInterval:[2501,2513]},\"nonEqualSign\",[]],[\"app\",{sourceInterval:[2514,2530]},\"propertySequence\",[]]]],StartsWithExpr:[\"define\",{sourceInterval:[2538,2596]},null,[],[\"seq\",{sourceInterval:[2555,2596]},[\"app\",{sourceInterval:[2555,2571]},\"propertySequence\",[]],[\"app\",{sourceInterval:[2572,2580]},\"likeWord\",[]],[\"app\",{sourceInterval:[2581,2596]},\"startsWithConst\",[]]]],EndsWithExpr:[\"define\",{sourceInterval:[2604,2658]},null,[],[\"seq\",{sourceInterval:[2619,2658]},[\"app\",{sourceInterval:[2619,2635]},\"propertySequence\",[]],[\"app\",{sourceInterval:[2636,2644]},\"likeWord\",[]],[\"app\",{sourceInterval:[2645,2658]},\"endsWithConst\",[]]]],InExpr:[\"define\",{sourceInterval:[2666,2724]},null,[],[\"seq\",{sourceInterval:[2675,2724]},[\"app\",{sourceInterval:[2675,2691]},\"propertySequence\",[]],[\"app\",{sourceInterval:[2692,2698]},\"inWord\",[]],[\"terminal\",{sourceInterval:[2699,2702]},\"[\"],[\"app\",{sourceInterval:[2703,2720]},\"ConstantsListExpr\",[]],[\"terminal\",{sourceInterval:[2721,2724]},\"]\"]]],NotInExpr:[\"define\",{sourceInterval:[2732,2801]},null,[],[\"seq\",{sourceInterval:[2744,2801]},[\"app\",{sourceInterval:[2744,2760]},\"propertySequence\",[]],[\"app\",{sourceInterval:[2761,2768]},\"notWord\",[]],[\"app\",{sourceInterval:[2769,2775]},\"inWord\",[]],[\"terminal\",{sourceInterval:[2776,2779]},\"[\"],[\"app\",{sourceInterval:[2780,2797]},\"ConstantsListExpr\",[]],[\"terminal\",{sourceInterval:[2798,2801]},\"]\"]]],AggregatedSelectionWithGroups:[\"define\",{sourceInterval:[2809,2897]},null,[],[\"seq\",{sourceInterval:[2841,2897]},[\"app\",{sourceInterval:[2841,2866]},\"AggregatedSelectionClause\",[]],[\"app\",{sourceInterval:[2867,2876]},\"groupedBy\",[]],[\"app\",{sourceInterval:[2877,2897]},\"PropertiesSelectExpr\",[]]]],AggregatedSelectionClause:[\"define\",{sourceInterval:[2905,2976]},null,[],[\"alt\",{sourceInterval:[2933,2976]},[\"app\",{sourceInterval:[2933,2952]},\"AggregatedFuncsExpr\",[]],[\"app\",{sourceInterval:[2955,2976]},\"AnyAggregatedFuncExpr\",[]]]],AggregatedFuncsExpr:[\"define\",{sourceInterval:[2984,3056]},null,[],[\"seq\",{sourceInterval:[3006,3056]},[\"app\",{sourceInterval:[3006,3027]},\"AnyAggregatedFuncExpr\",[]],[\"star\",{sourceInterval:[3028,3056]},[\"seq\",{sourceInterval:[3029,3054]},[\"terminal\",{sourceInterval:[3029,3032]},\",\"],[\"app\",{sourceInterval:[3033,3054]},\"AnyAggregatedFuncExpr\",[]]]]]],AnyAggregatedFuncExpr:[\"define\",{sourceInterval:[3064,3132]},null,[],[\"alt\",{sourceInterval:[3088,3132]},[\"app\",{sourceInterval:[3088,3111]},\"AggregatedNamedFuncExpr\",[]],[\"app\",{sourceInterval:[3114,3132]},\"AggregatedFuncExpr\",[]]]],AggregatedNamedFuncExpr:[\"define\",{sourceInterval:[3140,3214]},null,[],[\"seq\",{sourceInterval:[3166,3214]},[\"app\",{sourceInterval:[3166,3184]},\"AggregatedFuncExpr\",[]],[\"app\",{sourceInterval:[3185,3191]},\"asWord\",[]],[\"app\",{sourceInterval:[3192,3214]},\"propertyNameIdentifier\",[]]]],AggregatedFuncExpr:[\"define\",{sourceInterval:[3222,3342]},null,[],[\"alt\",{sourceInterval:[3243,3342]},[\"app\",{sourceInterval:[3243,3262]},\"AggregatedCountExpr\",[]],[\"app\",{sourceInterval:[3265,3282]},\"AggregatedSumExpr\",[]],[\"app\",{sourceInterval:[3285,3302]},\"AggregatedMinExpr\",[]],[\"app\",{sourceInterval:[3305,3322]},\"AggregatedMaxExpr\",[]],[\"app\",{sourceInterval:[3325,3342]},\"AggregatedAvgExpr\",[]]]],AggregatedCountExpr:[\"define\",{sourceInterval:[3350,3386]},null,[],[\"seq\",{sourceInterval:[3372,3386]},[\"app\",{sourceInterval:[3372,3381]},\"countWord\",[]],[\"terminal\",{sourceInterval:[3382,3386]},\"()\"]]],AggregatedSumExpr:[\"define\",{sourceInterval:[3394,3446]},null,[],[\"seq\",{sourceInterval:[3414,3446]},[\"app\",{sourceInterval:[3414,3421]},\"sumWord\",[]],[\"terminal\",{sourceInterval:[3422,3425]},\"(\"],[\"app\",{sourceInterval:[3426,3442]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[3443,3446]},\")\"]]],AggregatedMinExpr:[\"define\",{sourceInterval:[3454,3506]},null,[],[\"seq\",{sourceInterval:[3474,3506]},[\"app\",{sourceInterval:[3474,3481]},\"minWord\",[]],[\"terminal\",{sourceInterval:[3482,3485]},\"(\"],[\"app\",{sourceInterval:[3486,3502]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[3503,3506]},\")\"]]],AggregatedMaxExpr:[\"define\",{sourceInterval:[3514,3566]},null,[],[\"seq\",{sourceInterval:[3534,3566]},[\"app\",{sourceInterval:[3534,3541]},\"maxWord\",[]],[\"terminal\",{sourceInterval:[3542,3545]},\"(\"],[\"app\",{sourceInterval:[3546,3562]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[3563,3566]},\")\"]]],AggregatedAvgExpr:[\"define\",{sourceInterval:[3574,3626]},null,[],[\"seq\",{sourceInterval:[3594,3626]},[\"app\",{sourceInterval:[3594,3601]},\"avgWord\",[]],[\"terminal\",{sourceInterval:[3602,3605]},\"(\"],[\"app\",{sourceInterval:[3606,3622]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[3623,3626]},\")\"]]],PropertiesSelectExpr:[\"define\",{sourceInterval:[3634,3696]},null,[],[\"alt\",{sourceInterval:[3657,3696]},[\"app\",{sourceInterval:[3657,3671]},\"PropertiesExpr\",[]],[\"app\",{sourceInterval:[3674,3696]},\"PropertyIdentifierExpr\",[]]]],PropertiesExpr:[\"define\",{sourceInterval:[3704,3773]},null,[],[\"seq\",{sourceInterval:[3721,3773]},[\"app\",{sourceInterval:[3721,3743]},\"PropertyIdentifierExpr\",[]],[\"star\",{sourceInterval:[3744,3773]},[\"seq\",{sourceInterval:[3745,3771]},[\"terminal\",{sourceInterval:[3745,3748]},\",\"],[\"app\",{sourceInterval:[3749,3771]},\"PropertyIdentifierExpr\",[]]]]]],ConstantsListExpr:[\"define\",{sourceInterval:[3781,3839]},null,[],[\"seq\",{sourceInterval:[3801,3839]},[\"app\",{sourceInterval:[3801,3816]},\"expressionConst\",[]],[\"star\",{sourceInterval:[3817,3839]},[\"seq\",{sourceInterval:[3818,3837]},[\"terminal\",{sourceInterval:[3818,3821]},\",\"],[\"app\",{sourceInterval:[3822,3837]},\"expressionConst\",[]]]]]],PropertyIdentifierExpr:[\"define\",{sourceInterval:[3847,3926]},null,[],[\"alt\",{sourceInterval:[3881,3926]},[\"app\",{sourceInterval:[3881,3898]},\"NamedPropertyExpr\",[]],[\"app\",{sourceInterval:[3910,3926]},\"propertySequence\",[]]]],NamedPropertyExpr:[\"define\",{sourceInterval:[3934,4e3]},null,[],[\"seq\",{sourceInterval:[3954,4e3]},[\"app\",{sourceInterval:[3954,3970]},\"propertySequence\",[]],[\"app\",{sourceInterval:[3971,3977]},\"asWord\",[]],[\"app\",{sourceInterval:[3978,4e3]},\"propertyNameIdentifier\",[]]]],propertyNameIdentifier:[\"define\",{sourceInterval:[4008,4056]},null,[],[\"plus\",{sourceInterval:[4033,4056]},[\"alt\",{sourceInterval:[4034,4054]},[\"app\",{sourceInterval:[4034,4040]},\"letter\",[]],[\"app\",{sourceInterval:[4043,4048]},\"digit\",[]],[\"terminal\",{sourceInterval:[4051,4054]},\"_\"]]]],propertySequence:[\"define\",{sourceInterval:[4064,4108]},null,[],[\"alt\",{sourceInterval:[4083,4108]},[\"app\",{sourceInterval:[4083,4091]},\"property\",[]],[\"app\",{sourceInterval:[4094,4108]},\"directProperty\",[]]]],property_ofPropertySequence:[\"define\",{sourceInterval:[4158,4218]},null,[],[\"seq\",{sourceInterval:[4158,4197]},[\"app\",{sourceInterval:[4158,4174]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[4175,4178]},\".\"],[\"app\",{sourceInterval:[4179,4197]},\"categoryOrProperty\",[]]]],property_ofDirectAnyPropertySequence:[\"define\",{sourceInterval:[4230,4308]},null,[],[\"seq\",{sourceInterval:[4230,4278]},[\"app\",{sourceInterval:[4230,4255]},\"directAnyPropertySequence\",[]],[\"terminal\",{sourceInterval:[4256,4259]},\".\"],[\"app\",{sourceInterval:[4260,4278]},\"categoryOrProperty\",[]]]],property_ofDirectAny:[\"define\",{sourceInterval:[4320,4374]},null,[],[\"seq\",{sourceInterval:[4320,4360]},[\"app\",{sourceInterval:[4320,4337]},\"directAnyProperty\",[]],[\"terminal\",{sourceInterval:[4338,4341]},\".\"],[\"app\",{sourceInterval:[4342,4360]},\"categoryOrProperty\",[]]]],property:[\"define\",{sourceInterval:[4136,4374]},null,[],[\"alt\",{sourceInterval:[4158,4374]},[\"app\",{sourceInterval:[4158,4197]},\"property_ofPropertySequence\",[]],[\"app\",{sourceInterval:[4230,4278]},\"property_ofDirectAnyPropertySequence\",[]],[\"app\",{sourceInterval:[4320,4360]},\"property_ofDirectAny\",[]]]],directProperty_ofCategory:[\"define\",{sourceInterval:[4429,4483]},null,[],[\"seq\",{sourceInterval:[4429,4470]},[\"app\",{sourceInterval:[4429,4447]},\"categoryOrProperty\",[]],[\"terminal\",{sourceInterval:[4448,4451]},\".\"],[\"app\",{sourceInterval:[4452,4470]},\"categoryOrProperty\",[]]]],directProperty_ofAnyProperty:[\"define\",{sourceInterval:[4495,4545]},null,[],[\"seq\",{sourceInterval:[4495,4529]},[\"app\",{sourceInterval:[4495,4506]},\"anyProperty\",[]],[\"terminal\",{sourceInterval:[4507,4510]},\".\"],[\"app\",{sourceInterval:[4511,4529]},\"categoryOrProperty\",[]]]],directProperty:[\"define\",{sourceInterval:[4402,4545]},null,[],[\"alt\",{sourceInterval:[4429,4545]},[\"app\",{sourceInterval:[4429,4470]},\"directProperty_ofCategory\",[]],[\"app\",{sourceInterval:[4495,4529]},\"directProperty_ofAnyProperty\",[]]]],directAnyPropertySequence:[\"define\",{sourceInterval:[4561,4621]},null,[],[\"seq\",{sourceInterval:[4589,4621]},[\"app\",{sourceInterval:[4589,4605]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[4606,4609]},\".\"],[\"app\",{sourceInterval:[4610,4621]},\"anyProperty\",[]]]],directAnyProperty_sequenced:[\"define\",{sourceInterval:[4657,4702]},null,[],[\"seq\",{sourceInterval:[4657,4690]},[\"app\",{sourceInterval:[4657,4674]},\"directAnyProperty\",[]],[\"terminal\",{sourceInterval:[4675,4678]},\".\"],[\"app\",{sourceInterval:[4679,4690]},\"anyProperty\",[]]]],directAnyProperty_ofCategory:[\"define\",{sourceInterval:[4714,4761]},null,[],[\"seq\",{sourceInterval:[4714,4748]},[\"app\",{sourceInterval:[4714,4732]},\"categoryOrProperty\",[]],[\"terminal\",{sourceInterval:[4733,4736]},\".\"],[\"app\",{sourceInterval:[4737,4748]},\"anyProperty\",[]]]],directAnyProperty_ofAny:[\"define\",{sourceInterval:[4773,4808]},null,[],[\"seq\",{sourceInterval:[4773,4800]},[\"app\",{sourceInterval:[4773,4784]},\"anyProperty\",[]],[\"terminal\",{sourceInterval:[4785,4788]},\".\"],[\"app\",{sourceInterval:[4789,4800]},\"anyProperty\",[]]]],directAnyProperty:[\"define\",{sourceInterval:[4637,4808]},null,[],[\"alt\",{sourceInterval:[4657,4808]},[\"app\",{sourceInterval:[4657,4690]},\"directAnyProperty_sequenced\",[]],[\"app\",{sourceInterval:[4714,4748]},\"directAnyProperty_ofCategory\",[]],[\"app\",{sourceInterval:[4773,4800]},\"directAnyProperty_ofAny\",[]]]],exactElement_ofPropertySequence:[\"define\",{sourceInterval:[4839,4880]},null,[],[\"seq\",{sourceInterval:[4839,4859]},[\"app\",{sourceInterval:[4839,4855]},\"propertySequence\",[]],[\"terminal\",{sourceInterval:[4856,4859]},\"!\"]]],exactElement_ofCategory:[\"define\",{sourceInterval:[4892,4927]},null,[],[\"seq\",{sourceInterval:[4892,4914]},[\"app\",{sourceInterval:[4892,4910]},\"categoryOrProperty\",[]],[\"terminal\",{sourceInterval:[4911,4914]},\"!\"]]],exactElement:[\"define\",{sourceInterval:[4824,4927]},null,[],[\"alt\",{sourceInterval:[4839,4927]},[\"app\",{sourceInterval:[4839,4859]},\"exactElement_ofPropertySequence\",[]],[\"app\",{sourceInterval:[4892,4914]},\"exactElement_ofCategory\",[]]]],categoryOrProperty_inBrackets:[\"define\",{sourceInterval:[5e3,5034]},null,[],[\"seq\",{sourceInterval:[5e3,5021]},[\"terminal\",{sourceInterval:[5e3,5003]},\"[\"],[\"app\",{sourceInterval:[5004,5017]},\"identificator\",[]],[\"terminal\",{sourceInterval:[5018,5021]},\"]\"]]],categoryOrProperty_value:[\"define\",{sourceInterval:[5047,5061]},null,[],[\"plus\",{sourceInterval:[5047,5053]},[\"app\",{sourceInterval:[5047,5052]},\"alnum\",[]]]],categoryOrProperty:[\"define\",{sourceInterval:[4939,5061]},\"element category or property\",[],[\"alt\",{sourceInterval:[5e3,5061]},[\"app\",{sourceInterval:[5e3,5021]},\"categoryOrProperty_inBrackets\",[]],[\"app\",{sourceInterval:[5047,5053]},\"categoryOrProperty_value\",[]]]],groupedBy:[\"define\",{sourceInterval:[5069,5108]},null,[],[\"app\",{sourceInterval:[5081,5108]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5097,5107]},\"group by\"]]]],avgWord:[\"define\",{sourceInterval:[5116,5148]},null,[],[\"app\",{sourceInterval:[5126,5148]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5142,5147]},\"avg\"]]]],maxWord:[\"define\",{sourceInterval:[5156,5188]},null,[],[\"app\",{sourceInterval:[5166,5188]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5182,5187]},\"max\"]]]],minWord:[\"define\",{sourceInterval:[5196,5228]},null,[],[\"app\",{sourceInterval:[5206,5228]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5222,5227]},\"min\"]]]],sumWord:[\"define\",{sourceInterval:[5236,5268]},null,[],[\"app\",{sourceInterval:[5246,5268]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5262,5267]},\"sum\"]]]],countWord:[\"define\",{sourceInterval:[5276,5312]},null,[],[\"app\",{sourceInterval:[5288,5312]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5304,5311]},\"count\"]]]],asWord:[\"define\",{sourceInterval:[5320,5350]},null,[],[\"app\",{sourceInterval:[5329,5350]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5345,5349]},\"as\"]]]],nonEqualSign:[\"define\",{sourceInterval:[5358,5384]},null,[],[\"alt\",{sourceInterval:[5373,5384]},[\"terminal\",{sourceInterval:[5373,5377]},\"<>\"],[\"terminal\",{sourceInterval:[5380,5384]},\"!=\"]]],andOperation:[\"define\",{sourceInterval:[5400,5435]},null,[],[\"alt\",{sourceInterval:[5415,5435]},[\"app\",{sourceInterval:[5415,5422]},\"andWord\",[]],[\"terminal\",{sourceInterval:[5425,5429]},\"&&\"],[\"terminal\",{sourceInterval:[5432,5435]},\"&\"]]],andWord:[\"define\",{sourceInterval:[5443,5475]},null,[],[\"app\",{sourceInterval:[5453,5475]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5469,5474]},\"and\"]]]],orOperation:[\"define\",{sourceInterval:[5487,5520]},null,[],[\"alt\",{sourceInterval:[5501,5520]},[\"app\",{sourceInterval:[5501,5507]},\"orWord\",[]],[\"terminal\",{sourceInterval:[5510,5514]},\"||\"],[\"terminal\",{sourceInterval:[5517,5520]},\"|\"]]],orWord:[\"define\",{sourceInterval:[5528,5558]},null,[],[\"app\",{sourceInterval:[5537,5558]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5553,5557]},\"or\"]]]],likeWord:[\"define\",{sourceInterval:[5566,5600]},null,[],[\"app\",{sourceInterval:[5577,5600]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5593,5599]},\"like\"]]]],notOperation:[\"define\",{sourceInterval:[5608,5636]},null,[],[\"alt\",{sourceInterval:[5623,5636]},[\"app\",{sourceInterval:[5623,5630]},\"notWord\",[]],[\"terminal\",{sourceInterval:[5633,5636]},\"!\"]]],notWord:[\"define\",{sourceInterval:[5644,5676]},null,[],[\"app\",{sourceInterval:[5654,5676]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5670,5675]},\"not\"]]]],inWord:[\"define\",{sourceInterval:[5684,5714]},null,[],[\"app\",{sourceInterval:[5693,5714]},\"caseInsensitive\",[[\"terminal\",{sourceInterval:[5709,5713]},\"in\"]]]],anyProperty:[\"define\",{sourceInterval:[5726,5743]},null,[],[\"terminal\",{sourceInterval:[5740,5743]},\"*\"]],identificator:[\"define\",{sourceInterval:[5755,5787]},null,[],[\"plus\",{sourceInterval:[5771,5787]},[\"seq\",{sourceInterval:[5772,5785]},[\"not\",{sourceInterval:[5772,5776]},[\"terminal\",{sourceInterval:[5773,5776]},\"]\"]],[\"not\",{sourceInterval:[5777,5781]},[\"terminal\",{sourceInterval:[5778,5781]},\"[\"]],[\"app\",{sourceInterval:[5782,5785]},\"any\",[]]]]],expressionConst:[\"define\",{sourceInterval:[5799,5835]},null,[],[\"alt\",{sourceInterval:[5817,5835]},[\"app\",{sourceInterval:[5817,5826]},\"textConst\",[]],[\"app\",{sourceInterval:[5829,5835]},\"number\",[]]]],startsWithConst:[\"define\",{sourceInterval:[5843,5894]},null,[],[\"seq\",{sourceInterval:[5870,5894]},[\"terminal\",{sourceInterval:[5870,5874]},'\"'],[\"app\",{sourceInterval:[5875,5888]},\"likeTextValue\",[]],[\"terminal\",{sourceInterval:[5889,5894]},'%\"']]],endsWithConst:[\"define\",{sourceInterval:[5902,5951]},null,[],[\"seq\",{sourceInterval:[5927,5951]},[\"terminal\",{sourceInterval:[5927,5932]},'\"%'],[\"app\",{sourceInterval:[5933,5946]},\"likeTextValue\",[]],[\"terminal\",{sourceInterval:[5947,5951]},'\"']]],textConst:[\"define\",{sourceInterval:[5963,6023]},\"target text value\",[],[\"seq\",{sourceInterval:[6004,6023]},[\"terminal\",{sourceInterval:[6004,6008]},'\"'],[\"app\",{sourceInterval:[6009,6018]},\"textValue\",[]],[\"terminal\",{sourceInterval:[6019,6023]},'\"']]],textValue:[\"define\",{sourceInterval:[6039,6060]},null,[],[\"star\",{sourceInterval:[6051,6060]},[\"app\",{sourceInterval:[6051,6059]},\"textChar\",[]]]],likeTextValue:[\"define\",{sourceInterval:[6068,6097]},null,[],[\"star\",{sourceInterval:[6084,6097]},[\"app\",{sourceInterval:[6084,6096]},\"likeTextChar\",[]]]],textChar:[\"define\",{sourceInterval:[6109,6158]},null,[],[\"alt\",{sourceInterval:[6129,6158]},[\"terminal\",{sourceInterval:[6129,6135]},'\\\\\"'],[\"seq\",{sourceInterval:[6147,6158]},[\"not\",{sourceInterval:[6148,6153]},[\"terminal\",{sourceInterval:[6149,6153]},'\"']],[\"app\",{sourceInterval:[6154,6157]},\"any\",[]]]]],likeTextChar:[\"define\",{sourceInterval:[6166,6244]},null,[],[\"alt\",{sourceInterval:[6190,6244]},[\"terminal\",{sourceInterval:[6190,6196]},'\\\\\"'],[\"terminal\",{sourceInterval:[6208,6213]},\"\\\\%\"],[\"seq\",{sourceInterval:[6225,6244]},[\"not\",{sourceInterval:[6226,6239]},[\"alt\",{sourceInterval:[6228,6238]},[\"terminal\",{sourceInterval:[6228,6232]},'\"'],[\"terminal\",{sourceInterval:[6235,6238]},\"%\"]]],[\"app\",{sourceInterval:[6240,6243]},\"any\",[]]]]],number:[\"define\",{sourceInterval:[6260,6314]},null,[],[\"alt\",{sourceInterval:[6276,6314]},[\"app\",{sourceInterval:[6276,6290]},\"positiveNumber\",[]],[\"app\",{sourceInterval:[6300,6314]},\"negativeNumber\",[]]]],negativeNumber:[\"define\",{sourceInterval:[6328,6363]},null,[],[\"seq\",{sourceInterval:[6345,6363]},[\"terminal\",{sourceInterval:[6345,6348]},\"-\"],[\"app\",{sourceInterval:[6349,6363]},\"positiveNumber\",[]]]],positiveNumber:[\"define\",{sourceInterval:[6375,6418]},null,[],[\"alt\",{sourceInterval:[6392,6418]},[\"app\",{sourceInterval:[6392,6402]},\"realNumber\",[]],[\"app\",{sourceInterval:[6405,6418]},\"integerNumber\",[]]]],integerNumber:[\"define\",{sourceInterval:[6432,6454]},null,[],[\"plus\",{sourceInterval:[6448,6454]},[\"app\",{sourceInterval:[6448,6453]},\"digit\",[]]]],realNumber:[\"define\",{sourceInterval:[6466,6496]},null,[],[\"seq\",{sourceInterval:[6479,6496]},[\"star\",{sourceInterval:[6479,6485]},[\"app\",{sourceInterval:[6479,6484]},\"digit\",[]]],[\"terminal\",{sourceInterval:[6486,6489]},\".\"],[\"plus\",{sourceInterval:[6490,6496]},[\"app\",{sourceInterval:[6490,6495]},\"digit\",[]]]]]}]);Gt.exports=xn});var Rn={};Sr(Rn,{filterElements:()=>qn});var ct=Er(Ut());var st=(r,e)=>{if(r.length>e)throw new Error(\"Template categories count should not exceed target categories array\");let t=[];return me(t,[],r,0,e),t.sort($t)},ie=(r,e)=>{let t=[];for(let n=e;n>=r.length;--n)t=t.concat(st(r,n).sort($t));return t},me=(r,e,t,n,s)=>{if(e.length===s){n===t.length&&r.push(e);return}if(n<t.length&&t[n]!==\"*\"){e.push(t[n]),me(r,e,t,n+1,s);return}if(n>=t.length){e.push(\"*\"),me(r,e,t,n,s);return}if(t[n]===\"*\"){let i=s-e.length;for(let o=2;o<i;++o){let l=[...e];for(let a=0;a<o;++a)l.push(\"*\");me(r,l,t,n+1,s)}e.push(\"*\"),me(r,e,t,n+1,s)}},$t=(r,e)=>Ht(r)-Ht(e),Ht=r=>r.map((e,t)=>e===\"*\"?t:0).reduce((e,t)=>e+t,0);var X=(r,e)=>{if(e.length>r.length)return!1;let t=st(e,r.length);for(let n of t)if(Sn(r,n))return!0;return!1},Sn=(r,e)=>{for(let t=0;t<e.length;t++)if(e[t]!==\"*\"&&r[t]!==e[t])return!1;return!0};function zt(r,e,t,n,s,i){if(r=Kt(r),e=Kt(e),t=t||1,i=i||72,r===e&&t===1)return n;let o=T,l=En;var a=1;switch(e){case o.MILLIMETER:a=1/l[o.MILLIMETER];break;case o.CENTIMETER:a=1/l[o.CENTIMETER];break;case o.METER:a=1;break;case o.INCH:a=1/l[o.INCH];break;case o.FOOT:a=1/l[o.FOOT];break;case\"ft-and-fractional-in\":a=1/l[o.FOOT];break;case\"ft-and-decimal-in\":a=1/l[o.FOOT];break;case\"decimal-in\":a=1/l[o.INCH];break;case\"decimal-ft\":a=1/l[o.FOOT];break;case\"fractional-in\":a=1/l[o.INCH];break;case\"m-and-cm\":a=1;break;case o.POINT:a=1/l[o.INCH]*i;break}var p=1;switch(r){case o.MILLIMETER:p=l[o.MILLIMETER];break;case o.CENTIMETER:p=l[o.CENTIMETER];break;case o.METER:p=l[o.METER];break;case o.INCH:p=l[o.INCH];break;case o.FOOT:p=l[o.FOOT];break;case\"ft-and-fractional-in\":p=l[o.FOOT];break;case\"ft-and-decimal-in\":p=l[o.FOOT];break;case\"decimal-in\":p=l[o.INCH];break;case\"decimal-ft\":p=l[o.FOOT];break;case\"fractional-in\":p=l[o.INCH];break;case\"m-and-cm\":p=1;break;case o.POINT:p=l[o.INCH]/i;break}return s===\"square\"?n?n*Math.pow(a*p*t,2):0:s===\"cube\"?n?n*Math.pow(a*p*t,3):0:n?n*a*p*t:0}function Kt(r){var e;switch(r=(e=r)===null||e===void 0?void 0:e.toLowerCase(),r){case\"meter\":case\"meters\":case\"m\":return T.METER;case\"foot\":case\"feet\":case\"ft\":return T.FOOT;case\"feet and inches\":case\"inch\":case\"inches\":case\"in\":return T.INCH;case\"centimeter\":case\"centimeters\":case\"cm\":return T.CENTIMETER;case\"millimeter\":case\"millimeters\":case\"mm\":return T.MILLIMETER;case\"point\":case\"points\":case\"pt\":return T.POINT;default:return r}}var T={METER:\"m\",CENTIMETER:\"cm\",MILLIMETER:\"mm\",FOOT:\"ft\",INCH:\"in\",POINT:\"pt\"},En={[T.METER]:1,[T.CENTIMETER]:.01,[T.MILLIMETER]:.001,[T.FOOT]:.3048,[T.INCH]:.0254,[T.POINT]:.0254/72};var ee=(r,e)=>{let t=r.attribute;if(!t)return r.value;let n=Nn(t);if(n===null)return r.value;let s=T[n.modelUnitType],i=bn(r,e)?zt(s,e.displayUnits,1,r.value*(n.factor||1),n.modificator):r.value;return An(i,e,t.precision)},te=r=>typeof r.value==\"number\",An=(r,e,t)=>{let n=_n(e,t);return new Number(r.toFixed(n)).valueOf()},_n=(r,e)=>typeof r.displayUnitsPrecision==\"number\"?r.displayUnitsPrecision:e,bn=(r,e)=>!!r.attribute&&(r.attribute.dataType===2||r.attribute.dataType===3)&&!!r.attribute.dataTypeContext&&e.displayUnits!==\"\",Pn={centimeters:{modelUnitType:\"CENTIMETER\",system:\"metric\"},cubicCentimeters:{modelUnitType:\"CENTIMETER\",modificator:\"cube\",system:\"metric\"},cubicFeet:{modelUnitType:\"FOOT\",modificator:\"cube\",system:\"imperial\"},cubicInches:{modelUnitType:\"FOOT\",modificator:\"cube\",system:\"imperial\"},cubicMeters:{modelUnitType:\"METER\",modificator:\"cube\",system:\"metric\"},cubicMillimeters:{modelUnitType:\"MILLIMETER\",modificator:\"cube\",system:\"metric\"},decimeters:{modelUnitType:\"METER\",factor:10,system:\"metric\"},feet:{modelUnitType:\"FOOT\",system:\"imperial\"},inches:{modelUnitType:\"INCH\",system:\"imperial\"},kilometers:{modelUnitType:\"METER\",factor:1e3,system:\"metric\"},liters:{modelUnitType:\"METER\",modificator:\"cube\",factor:.001,system:\"metric\"},meters:{modelUnitType:\"METER\",system:\"metric\"},millimeters:{modelUnitType:\"MILLIMETER\",system:\"metric\"},squareCentimeters:{modelUnitType:\"CENTIMETER\",modificator:\"square\",system:\"metric\"},squareFeet:{modelUnitType:\"FOOT\",modificator:\"square\",system:\"imperial\"},squareInches:{modelUnitType:\"INCH\",modificator:\"square\",system:\"imperial\"},squareMeters:{modelUnitType:\"METER\",modificator:\"square\",system:\"metric\"},squareMillimeters:{modelUnitType:\"MILLIMETER\",modificator:\"square\",system:\"metric\"},feetFractionalInches:{modelUnitType:\"FOOT\",system:\"imperial\"},fractionalInches:{modelUnitType:\"INCH\",system:\"imperial\"},metersCentimeters:{modelUnitType:\"METER\",system:\"metric\"},stationingFeet:{modelUnitType:\"FOOT\",system:\"imperial\"},stationingMeters:{modelUnitType:\"METER\",system:\"metric\"}},Nn=r=>{let e=r.dataTypeContext;if(!e||!e.startsWith(\"autodesk.unit.unit:\"))return null;let n=e.split(\":\")[1].split(\"-\")[0];return Pn[n]||null};var G=(r,e,t=1e-5)=>Math.abs(r-e)<t,Qt=(r,e,t=1e-5)=>r<e&&!G(r,e,t),Jt=(r,e,t=1e-5)=>r>e&&!G(r,e,t),Zt=(r,e,t=1e-5)=>r<e||G(r,e,t),Yt=(r,e,t=1e-5)=>r>e||G(r,e,t);var On=r=>r.type===\"number\",wn=r=>r.type===\"property-value\",Cn=r=>r.type===\"simple\"||r.type===\"number\",at=r=>typeof r==\"string\",lt=(r,e)=>(t,n)=>On(n)?(s,i)=>X(i.categoriesList,t.categories)?ie(t.categories,i.categoriesList.length).map(l=>i.getPropertyValue(t.propertyName,l)).filter(te).map(l=>ee(l,s)).reduce((l,a)=>l||r(a,n.value,s),!1):!1:(s,i)=>{if(!X(i.categoriesList,t.categories))return!1;let o=ie(t.categories,i.categoriesList.length),l=s.stringCaseSensitive?n.value:n.value.toLocaleLowerCase();return o.map(a=>i.getPropertyValue(t.propertyName,a).value).filter(at).map(a=>s.stringCaseSensitive?a:a.toLocaleLowerCase()).reduce((a,p)=>a||e(p,l),!1)},Fn=(r,e)=>(t,n)=>(s,i)=>{if(!(X(i.categoriesList,t.categories)&&X(i.categoriesList,n.categories)))return!1;let o=ie(t.categories,i.categoriesList.length).map(a=>i.getPropertyValue(t.propertyName,a)),l=ie(n.categories,i.categoriesList.length).map(a=>i.getPropertyValue(n.propertyName,a));for(let a of o)for(let p of l){if(te(a)&&te(p)){let c=ee(a,s),u=ee(p,s);if(r(c,u,s))return!0}if(at(a.value)&&at(p.value)){let c=s.stringCaseSensitive?a.value:a.value.toLocaleLowerCase(),u=s.stringCaseSensitive?p.value:p.value.toLocaleLowerCase();if(e(c,u))return!0}}return!1},H=(r,e)=>(t,n,s)=>{let i=t.getPropertyDefinition(),o=s.getPropertyDefinition(),l=[i,o].find(u=>wn(u)),a=[i,o].find(u=>Cn(u));if(a!==void 0)return lt(r,e)(l,a);let p=l===i?o:i;return Fn(r,e)(l,p)},Xt=H((r,e,t)=>G(r,e,t.tolerance),(r,e)=>r===e),er=H((r,e,t)=>Qt(r,e,t.tolerance),(r,e)=>r<e),tr=H((r,e,t)=>Zt(r,e,t.tolerance),(r,e)=>r<=e),rr=H((r,e,t)=>Jt(r,e,t.tolerance),(r,e)=>r>e),nr=H((r,e,t)=>Yt(r,e,t.tolerance),(r,e)=>r>=e),sr=(r,e,t)=>{let s=H((i,o,l)=>G(i,o,l.tolerance),(i,o)=>i===o)(r,e,t);return(i,o)=>!s(i,o)},ir={exactElement:r=>{let e=r.getPropertyDefinition();return(t,n)=>X(n.categoriesList,e.categories)},EqualityExpr:Xt,PropertiesEqualityExpr:Xt,LessThanExpr:er,PropertiesLessThanExpr:er,LessThanOrEqualExpr:tr,PropertiesLessThanOrEqualExpr:tr,MoreThanExpr:rr,PropertiesMoreThanExpr:rr,MoreThanOrEqualExpr:nr,PropertiesMoreThanOrEqualExpr:nr,BoolAnd_and:(r,e,t)=>(n,s)=>r.compileFilter()(n,s)&&t.compileFilter()(n,s),BoolOr_or:(r,e,t)=>(n,s)=>r.compileFilter()(n,s)||t.compileFilter()(n,s),PriExp_paren:(r,e,t)=>(n,s)=>e.compileFilter()(n,s),NonEqualityExpr:sr,PropertiesNonEqualityExpr:sr,NotExpr:(r,e,t,n)=>(s,i)=>!t.compileFilter()(s,i),InExpr:(r,e,t,n,s)=>{let i=r.getPropertyDefinition(),o=n.getPropertyDefinition(),l=lt((p,c,u)=>G(p,c,u.tolerance),(p,c)=>p===c),a=o.value.map(p=>typeof p==\"number\"?{type:\"number\",value:p}:{type:\"simple\",value:p}).map(p=>l(i,p));return(p,c)=>a.reduce((u,h)=>u||h(p,c),!1)},NotInExpr:(r,e,t,n,s,i)=>{let o=r.getPropertyDefinition(),l=s.getPropertyDefinition(),a=lt((c,u,h)=>G(c,u,h.tolerance),(c,u)=>c===u),p=l.value.map(c=>typeof c==\"number\"?{type:\"number\",value:c}:{type:\"simple\",value:c}).map(c=>a(o,c));return(c,u)=>p.reduce((h,m)=>h&&!m(c,u),!0)},StartsWithExpr:H((r,e,t)=>!1,(r,e)=>r.startsWith(e)),EndsWithExpr:H((r,e,t)=>!1,(r,e)=>r.endsWith(e)),PropertiesSelectExpr:r=>(e,t)=>!0,AggregatedSelectionClause:r=>(e,t)=>!0,AggregatedSelectionWithGroups:(r,e,t)=>(n,s)=>!0,SelectAllExpr:r=>(e,t)=>!0,FilterWithSelectExpr:(r,e,t)=>r.compileFilter(),FilterWithAggregatedSelectExpr:(r,e,t)=>r.compileFilter(),FilterWithGroupedAggregedSelectExpr:(r,e,t,n,s)=>r.compileFilter(),FilterWithSelectAllExpr:(r,e,t)=>r.compileFilter()},or={FilterExpr:r=>[],AggregatedSelectionClause:r=>[],FilterWithAggregatedSelectExpr:(r,e,t)=>[],SelectAllExpr:r=>[],FilterWithSelectAllExpr:(r,e,t)=>[],FilterWithGroupedAggregedSelectExpr:(r,e,t,n,s)=>s.compileSelect(),FilterWithSelectExpr:(r,e,t)=>t.compileSelect(),AggregatedSelectionWithGroups:(r,e,t)=>t.compileSelect(),PropertiesExpr:(r,e,t)=>{let n=r.compileSelect(),s=t.children.flatMap(i=>i.compileSelect());return n.splice(1,0,...s),n},NamedPropertyExpr:(r,e,t)=>[{fun:oe(r),name:t.sourceString}],propertySequence:r=>[{fun:oe(r)}]},ar={SelectAllExpr:r=>!0,FilterWithSelectAllExpr:(r,e,t)=>!0,FilterWithSelectExpr:(r,e,t)=>!1,FilterWithGroupedAggregedSelectExpr:(r,e,t,n,s)=>!1,FilterWithAggregatedSelectExpr:(r,e,t)=>!1,AggregatedSelectionWithGroups:(r,e,t)=>!1,AggregatedSelectionClause:r=>!1,FilterExpr:r=>!1,PropertiesSelectExpr:r=>!1},lr={FilterWithSelectExpr:(r,e,t)=>[],FilterExpr:r=>[],PropertiesSelectExpr:r=>[],SelectAllExpr:r=>[],FilterWithSelectAllExpr:(r,e,t)=>[],FilterWithAggregatedSelectExpr:(r,e,t)=>t.compileAggregate(),FilterWithGroupedAggregedSelectExpr:(r,e,t,n,s)=>t.compileAggregate(),AggregatedSelectionWithGroups:(r,e,t)=>r.compileAggregate(),AggregatedNamedFuncExpr:(r,e,t)=>[{...r.compileAggregate()[0],name:t.sourceString}],AggregatedFuncsExpr:(r,e,t)=>{let n=r.compileAggregate(),s=t.children.flatMap(i=>i.compileAggregate());return n.splice(1,0,...s),n},AggregatedCountExpr:(r,e)=>[{type:\"count\",elemValueFun:(t,n)=>1}],AggregatedSumExpr:(r,e,t,n)=>[{type:\"sum\",elemValueFun:oe(t)}],AggregatedMinExpr:(r,e,t,n)=>[{type:\"min\",elemValueFun:oe(t)}],AggregatedMaxExpr:(r,e,t,n)=>[{type:\"max\",elemValueFun:oe(t)}],AggregatedAvgExpr:(r,e,t,n)=>[{type:\"avg\",elemValueFun:oe(t)}]},it=(r,e)=>{let t=r.getPropertyDefinition(),n=e.getPropertyDefinition(),s=[...t.categories];return t.type===\"property-value\"&&s.push(t.propertyName),{type:\"property-value\",propertyName:n.value,categories:s}},ot=r=>{let e=r.getPropertyDefinition();if(e.type===\"exact-category\")return e;let t=[...e.categories];return t.push(e.propertyName),{type:\"exact-category\",categories:t}},cr=r=>{let e=r.getPropertyDefinition();if(e.type===\"property-value\")return e;let t=[...e.categories];return{type:\"property-value\",propertyName:t.pop(),categories:t}},be=(r,e)=>({type:\"simple\",value:typeof e==\"function\"?e(r.sourceString):r.sourceString}),ur={ConstantsListExpr:(r,e,t)=>{let n=r.getPropertyDefinition().value,s=t.children.map(i=>i.getPropertyDefinition().value);return s.push(n),{type:\"array\",value:s}},exactElement_ofCategory:(r,e)=>({type:\"exact-category\",categories:[r.getPropertyDefinition().value]}),categoryOrProperty_inBrackets:(r,e,t)=>be(e),categoryOrProperty_value:r=>be(r),exactElement_ofPropertySequence:(r,e)=>ot(r),property_ofPropertySequence:(r,e,t)=>it(r,t),property_ofDirectAny:(r,e,t)=>it(r,t),property_ofDirectAnyPropertySequence:(r,e,t)=>it(r,t),directAnyProperty_ofCategory:(r,e,t)=>({type:\"exact-category\",categories:[r.getPropertyDefinition().value,\"*\"]}),directAnyPropertySequence:(r,e,t)=>ot(r),directAnyProperty_sequenced:(r,e,t)=>{let s=[...ot(r).categories];return s.push(\"*\"),{type:\"exact-category\",categories:s}},propertySequence:r=>cr(r),directProperty_ofCategory:(r,e,t)=>{let n=r.getPropertyDefinition(),s=t.getPropertyDefinition();return{type:\"exact-category\",categories:[n.value,s.value]}},directProperty_ofAnyProperty:(r,e,t)=>({type:\"exact-category\",categories:[\"*\",t.getPropertyDefinition().value]}),number:r=>({type:\"number\",value:parseFloat(r.sourceString)}),textConst:(r,e,t)=>e.getPropertyDefinition(),startsWithConst:(r,e,t)=>e.getPropertyDefinition(),endsWithConst:(r,e,t)=>e.getPropertyDefinition(),textValue:r=>be(r,e=>e.replaceAll('\\\\\"','\"')),likeTextValue:r=>be(r,e=>e.replaceAll('\\\\\"','\"').replaceAll(\"\\\\%\",\"%\"))},oe=r=>{let e=cr(r);return(t,n)=>X(n.categoriesList,e.categories)?ie(e.categories,n.categoriesList.length).map(i=>n.getPropertyValue(e.propertyName,i)).filter(i=>i.value!==void 0).map(i=>te(i)?ee(i,t):i.value).find(i=>i):void 0};var Pe=class extends Error{shortMessage;constructor(e,t){super(e),this.shortMessage=t}};var Ne=class{semantics=ct.default.createSemantics();settings;constructor(e){this.settings=e||{tolerance:1e-5,stringCaseSensitive:!0,displayUnits:\"\",displayUnitsPrecision:\"\"},this.semantics.addOperation(\"getPropertyDefinition\",ur),this.semantics.addOperation(\"compileFilter\",ir),this.semantics.addOperation(\"compileSelect\",or),this.semantics.addOperation(\"compileAggregate\",lr),this.semantics.addOperation(\"compileSelectAll\",ar)}createQuery(e){let t=ct.default.match(e);if(t.failed())throw new Pe(t.message,t.shortMessage);let n=this.semantics(t);return{filter:n.compileFilter().bind(null,this.settings),selectProperties:n.compileSelect(),aggregateProperties:n.compileAggregate(),selectAll:n.compileSelectAll()}}};var Oe=class{attributesCaseSensitive;attributesIdsByName=new Map;attributesById=new Map;internalRefsAttributes=new Set;constructor(e,t){this.attributesCaseSensitive=t;let n=-1,s=-1;e.enumAttributes((i,o)=>{this.attributesById.set(i,o);let l=t?o.name:o.name.toLocaleLowerCase(),a=this.attributesIdsByName.get(l)||[];a.push(i),this.attributesIdsByName.set(l,a),o.name===\"name\"&&o.category===\"__name__\"&&(n=i),o.name===\"instanceof_objid\"&&o.category===\"__instanceof__\"&&o.dataType===11&&(s=i),o.category===\"__internalref__\"&&o.dataType===11&&this.internalRefsAttributes.add(i)}),this.nameAttributeId=n,this.instanceOfAttributeId=s}nameAttributeId;instanceOfAttributeId;findAttributesIdsByName(e){let t=this.attributesCaseSensitive?e:e.toLocaleLowerCase();return this.attributesIdsByName.get(t)||[]}isInternalRefAttribute(e){return this.internalRefsAttributes.has(e)}findAttribute(e){return this.attributesById.get(e)}};var we=class{propertyValuesQueryFactory;categoryNodesDbIds;constructor(e,t){this.propertyValuesQueryFactory=t,this.categoryNodesDbIds=t.getCategories(e),this.categoriesList=this.categoryNodesDbIds.map(n=>this.getNodePropertyValue(n,this.propertyValuesQueryFactory.attributes.nameAttributeId).value)}categoriesList;getPropertyValue(e,t){if(!this.compareCategories(t))return{value:void 0,attribute:void 0};let n=this.categoryNodesDbIds[t.length-1],s=this.propertyValuesQueryFactory.attributes.findAttributesIdsByName(e).map(i=>this.getNodePropertyValue(n,i)).find(i=>i.value!==void 0);return{value:s?.value,attribute:s?.attribute}}getObjectProperties(){let e=[],t=new Set;for(let n=this.categoryNodesDbIds.length-1;n>=0;--n){let s=this.propertyValuesQueryFactory.getObjectProperties(this.categoryNodesDbIds[n]);for(let i of s){let o=i.attribute?.name;!o||t.has(o)||(e.push(i),t.add(o))}}return e}compareCategories(e){for(let t=0;t<e.length;t++)if(e[t]!==\"*\"&&this.categoriesList[t]!==e[t])return!1;return!0}getNodePropertyValue(e,t){return this.propertyValuesQueryFactory.getNodePropertyValue(e,t)}};var hr=(r,e)=>{let t=[],n=r.findRootNodes();for(let s of n){let i=pr(s,r,e),o=r.getNodeNameAndChildren({dbId:s});o.length===1&&i===pr(o[0].dbId,r,e)?t.push(o[0].dbId):t.push(s)}return t},pr=(r,e,t)=>{let n=\"\";return e.enumObjectProperties(r,(s,i)=>{if(s===t.nameAttributeId)return n=e.getAttrValue(s,i),!0}),n};var Ce=class{propertyDatabase;attributes;rootNodes;modelBrowserExcludeRoot;propertiesValuesCache=new Map;constructor(e,t,n,s=!0,i=\"Model\"){if(this.propertyDatabase=e,this.attributes=t,this.rootNodes=n,this.modelBrowserExcludeRoot=s,!s)for(let o of n){let l={value:i,attribute:t.findAttribute(t.nameAttributeId)},a=new Map;a.set(t.nameAttributeId,l),this.propertiesValuesCache.set(o,a)}}getNodePropertyValue(e,t){let n=this.findCachedPropertyValue(e,t);if(n)return n;let s=this.attributes.findAttribute(t),i,o;if(this.propertyDatabase.enumObjectProperties(e,(a,p)=>{if(a===t)return i=this.propertyDatabase.getAttrValue(a,p),!0;i===void 0&&a===this.attributes.instanceOfAttributeId&&(o=this.propertyDatabase.getAttrValue(a,p))}),t!==this.attributes.nameAttributeId&&this.attributes.isInternalRefAttribute(t))if(typeof i==\"number\"){i=this.getNodePropertyValue(i,this.attributes.nameAttributeId).value;let a={value:i,attribute:s};return this.storeInCache(e,t,a),a}else{let a={value:void 0,attribute:s};return this.storeInCache(e,t,a),a}i===void 0&&typeof o==\"number\"&&(i=this.getNodePropertyValue(o,t).value),t===this.attributes.nameAttributeId&&(i=Tn(i));let l={value:i,attribute:s};return this.storeInCache(e,t,l),l}getCategories(e){let t=[],n=e;for(;n!==null&&this.rootNodes.findIndex(s=>s===n)<0;){let s=this.propertyDatabase.findParent(n);s!==null&&t.push(n),n=s}return this.modelBrowserExcludeRoot||t.splice(t.length,0,...this.rootNodes),t.reverse()}getObjectProperties(e){return this.getAllAttributeIds(e).map(t=>this.getNodePropertyValue(e,t))}getAllAttributeIds(e){let t=[],n;if(this.propertyDatabase.enumObjectProperties(e,(s,i)=>{s===this.attributes.instanceOfAttributeId?n=this.propertyDatabase.getAttrValue(s,i):t.push(s)}),typeof n==\"number\"){let s=this.getAllAttributeIds(n);t.splice(t.length,0,...s)}return t}findCachedPropertyValue(e,t){let n=this.propertiesValuesCache.get(e);if(n)return n.get(t)}storeInCache(e,t,n){let s=this.propertiesValuesCache.get(e)||new Map;s.set(t,n),this.propertiesValuesCache.set(e,s)}},Ln=/^(?<name>.*) \\[\\d+\\]$/,Tn=r=>{if(typeof r!=\"string\")return r;let e=r.match(Ln);return e===null?r:e.groups.name};var ae=class{aggregatedValueQuery;settings;totalSum=0;constructor(e,t){this.aggregatedValueQuery=e,this.settings=t}dbIds=[];get name(){return this.aggregatedValueQuery.name}push(e,t){let n=this.aggregatedValueQuery.elemValueFun(this.settings,t);typeof n==\"number\"&&(this.dbIds.push(e),this.totalSum+=n)}compile(){return this.totalSum}};var Fe=class{aggregatedValueQuery;sumFunction;constructor(e,t){this.aggregatedValueQuery=e,this.sumFunction=new ae(e,t)}get dbIds(){return this.sumFunction.dbIds}get name(){return this.aggregatedValueQuery.name}push(e,t){this.sumFunction.push(e,t)}compile(){return this.sumFunction.compile()/this.sumFunction.dbIds.length}};var Le=class{name;totalCount=0;constructor(e){this.name=e}dbIds=[];push(e,t){this.dbIds.push(e),++this.totalCount}compile(){return this.totalCount}};var Te=class{aggregatedValueQuery;settings;totalMax=-1/0;constructor(e,t){this.aggregatedValueQuery=e,this.settings=t}dbIds=[];get name(){return this.aggregatedValueQuery.name}push(e,t){let n=this.aggregatedValueQuery.elemValueFun(this.settings,t);typeof n==\"number\"&&(this.dbIds.push(e),this.totalMax=Math.max(n,this.totalMax))}compile(){return this.totalMax}};var qe=class{aggregatedValueQuery;settings;totalMin=1/0;constructor(e,t){this.aggregatedValueQuery=e,this.settings=t}dbIds=[];get name(){return this.aggregatedValueQuery.name}push(e,t){let n=this.aggregatedValueQuery.elemValueFun(this.settings,t);typeof n==\"number\"&&(this.dbIds.push(e),this.totalMin=Math.min(n,this.totalMin))}compile(){return this.totalMin}};var mr=(r,e)=>{switch(r.type){case\"count\":return new Le(r.name);case\"sum\":return new ae(r,e);case\"min\":return new qe(r,e);case\"max\":return new Te(r,e);case\"avg\":return new Fe(r,e);default:throw new Error(`${r.type} is not supported yet`)}};var Re=class{settings;groupProperties;aggregatedProperties;aggregates=new Map;dbIds=new Map;constructor(e,t,n){this.settings=n,this.groupProperties=e.map((s,i)=>({...s,name:s.name||`$grp_col_${i+1}`})),this.aggregatedProperties=t.map((s,i)=>({...s,name:s.name||`$col_${i+1}`}))}push(e,t){let n=this.getGroupKey(t),s;if(this.aggregates.has(n))s=this.aggregates.get(n);else{s={functions:this.aggregatedProperties.map((o,l)=>mr({...o,name:o.name||`$col_${l+1}`},this.settings)),values:{}};for(let o of this.groupProperties)s.values[o.name]=o.fun(this.settings,t);this.aggregates.set(n,s)}for(let o of s.functions)o.push(e,t);let i=this.dbIds.get(n)||[];i.push(e),this.dbIds.set(n,i)}compile(){let e=[];for(let[t,n]of this.aggregates){let s={dbIds:this.dbIds.get(t),values:n.values};for(let i of n.functions)s.values[i.name]=i.compile();e.push(s)}return e}getColumns(){let e=this.aggregatedProperties.map(t=>t.name);return e.splice(e.length,0,...this.groupProperties.map(t=>t.name)),e}getGroupKey(e){return this.groupProperties.map(t=>`name=${t.name},value=${t.fun(this.settings,e)}`).join(\"#\")}};var Me=class{settings;properties;results=[];constructor(e,t){this.settings=t,this.properties=e.map((n,s)=>({...n,name:n.name||`$col_${s+1}`}))}push(e,t){let n={dbIds:[e],values:{}};for(let s of this.properties)n.values[s.name]=s.fun(this.settings,t);this.results.push(n)}compile(){return this.results}getColumns(){return this.properties.map(e=>e.name)}};var De=class{settings;results=[];columns=new Set;constructor(e){this.settings=e}push(e,t){let n={dbIds:[e],values:{}},s=t.getObjectProperties();for(let i of s){if(!i.attribute)continue;let o=i.attribute.name;n.values[o]=te(i)?ee(i,this.settings):i.value,this.columns.add(o)}this.results.push(n)}compile(){return this.results}getColumns(){return Array.from(this.columns.values())}};var dr=(r,e)=>r.selectAll?new De(e):r.aggregateProperties.length===0?new Me(r.selectProperties,e):new Re(r.selectProperties,r.aggregateProperties,e);var qn=(r,e)=>{try{let t=[],{lmvQuery:n,lmvQueryOptions:s,nodes:i}=e,l=new Ne(s).createQuery(n),a=new Oe(r,s.attributesCaseSensitive),p=hr(r,a),c=new Ce(r,a,p,s.modelBrowserExcludeRoot,s.modelName),u=dr(l,s);for(let h of i){if(s.leafNodesOnly&&r.getNodeNameAndChildren({dbId:h})!==void 0)continue;let m=new we(h,c);l.filter(m)&&(t.push(h),u.push(h,m))}return{dbIds:t,rows:u.compile(),columns:u.getColumns(),error:null}}catch(t){return{dbIds:[],error:t,rows:[],columns:[]}}};return Ar(Rn);}";