orbitchat 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/_baseUniq-BPMphbq5-Ci3F4c-i.js +1 -0
- package/dist/assets/{api-BBbZ-wzb.js → api-CtfRLc4F.js} +1 -1
- package/dist/assets/arc-D9rhTKV0-CroREmq6.js +1 -0
- package/dist/assets/{architectureDiagram-VXUJARFQ-ZhthiBXw-6jLb3PI4.js → architectureDiagram-VXUJARFQ-BiqZtsDe-DyrE6YO2.js} +1 -1
- package/dist/assets/{blockDiagram-VD42YOAC-2RvSKzzb-CekR3NQa.js → blockDiagram-VD42YOAC-zcRIdFTD-Cs5m0yBo.js} +5 -5
- package/dist/assets/{c4Diagram-YG6GDRKO-iYNAbGgt-BwzskMHt.js → c4Diagram-YG6GDRKO-DYXNcDX4-DN_-dJAG.js} +4 -4
- package/dist/assets/channel-CUIutAfm-J8R0v6QY.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-BI1eieHX-BcH4s9g3.js → chunk-4BX2VUAB-DAh9ktmY-DJUd7iky.js} +1 -1
- package/dist/assets/chunk-55IACEB6-Cza7pcpr-CsIEdvZL.js +1 -0
- package/dist/assets/{chunk-B4BG7PRW-B_gbgJ8Z-CmKgjHYB.js → chunk-B4BG7PRW-BTUSpeKy-C84_H2ja.js} +3 -3
- package/dist/assets/{chunk-DI55MBZ5-2NtB5tR9-g5uXuUGc.js → chunk-DI55MBZ5-DKt4WII7-DidpEj2B.js} +3 -3
- package/dist/assets/{chunk-FMBD7UC4-RlKniDBQ-B__CYUwz.js → chunk-FMBD7UC4-DdcCR8w3-BfMdoImH.js} +1 -1
- package/dist/assets/chunk-QN33PNHL-v6AkzOl1-BYUBLlie.js +1 -0
- package/dist/assets/{chunk-QZHKN3VN-1GW3GHKe-C9vGZ5SL.js → chunk-QZHKN3VN-DVJOrqBZ-CMUptYKe.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-BTJEzWgP-DqiAu4KT.js → chunk-TZMSLE5B-G2jJHqli-DMA5IQKp.js} +1 -1
- package/dist/assets/classDiagram-2ON5EDUG-CxmgTanh-sy4W7YBV.js +1 -0
- package/dist/assets/classDiagram-v2-WZHVMYZB-CxmgTanh-sy4W7YBV.js +1 -0
- package/dist/assets/clone-CsNB4mMi-CjijztFi.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-LTD5cwdk-BcWDZjn0.js → cose-bilkent-S5V4N54A-BRr2Y6dg-BApR6rBr.js} +1 -1
- package/dist/assets/{dagre-6UL2VRFP-oAHH3NGz-C-dq50GC.js → dagre-6UL2VRFP-DX8gNHmJ-COuhp_WH.js} +2 -2
- package/dist/assets/{diagram-PSM6KHXK-CE9xld4H-mRc14ET5.js → diagram-PSM6KHXK-DNX818To-DZwizlXL.js} +1 -1
- package/dist/assets/diagram-QEK2KX5R-BDO6hKtm-TIVfhOXf.js +43 -0
- package/dist/assets/diagram-S2PKOQOG-IEqaDwzi-CKibEs0x.js +24 -0
- package/dist/assets/{erDiagram-Q2GNP2WA-Cjwgn5O1-_ffXliWU.js → erDiagram-Q2GNP2WA-DbLpN8Jp-Be1aw4xN.js} +5 -5
- package/dist/assets/{flowDiagram-NV44I4VS-DhL_LF5y-DRuINGle.js → flowDiagram-NV44I4VS-pJlHae8Y-DbXF_vZM.js} +6 -6
- package/dist/assets/{ganttDiagram-JELNMOA3-B9BkzPjc-BXIfYkGx.js → ganttDiagram-JELNMOA3-J0Tkq5TR-Dea0K9q1.js} +4 -4
- package/dist/assets/{gitGraphDiagram-NY62KEGX-BMn7vaQV-Bfy7yuMv.js → gitGraphDiagram-NY62KEGX-DgYonpsZ-7lxSMqF0.js} +10 -10
- package/dist/assets/{graph-DO7yB5fn-iHvIIoGD.js → graph-BpcfrHXY-BH81qtTI.js} +1 -1
- package/dist/assets/index-CS9omSqb.js +978 -0
- package/dist/assets/{index-BqpsNXVI-BztRLboM.js → index-DvNpGWs7-Dgb0lDIY.js} +1 -1
- package/dist/assets/infoDiagram-WHAUD3N6-C3JLOAnb-D99rN4Tp.js +2 -0
- package/dist/assets/{journeyDiagram-XKPGCS4Q-CKTjKgpD-DCt-FJ9q.js → journeyDiagram-XKPGCS4Q-CfjB2Qdf-wB3u3y_Q.js} +4 -4
- package/dist/assets/{kanban-definition-3W4ZIXB7-CavBl09t-D5mhKSSQ.js → kanban-definition-3W4ZIXB7-CrW8yVmd-CQRjSMnx.js} +7 -7
- package/dist/assets/{layout-kX0D0crf-x5N-fcnG.js → layout-bsfAhWjc-xFXmwmRe.js} +1 -1
- package/dist/assets/min-C2aDz5ZK-B9D8sW79.js +1 -0
- package/dist/assets/{mindmap-definition-VGOIOE7T-atjBunOF-DuLlAK7g.js → mindmap-definition-VGOIOE7T-Dj37RkY_-DyDCU6bd.js} +5 -5
- package/dist/assets/pieDiagram-ADFJNKIX-BiQvDx8I-Ba7lEuym.js +30 -0
- package/dist/assets/{quadrantDiagram-AYHSOK5B-CDM1Rm_m-CEOhVdQI.js → quadrantDiagram-AYHSOK5B-D4b-YFzI-DdkdBS88.js} +4 -4
- package/dist/assets/{requirementDiagram-UZGBJVZJ-oAoTJrMw-Co7f_Whe.js → requirementDiagram-UZGBJVZJ-km07nlVd-p1bGk1YD.js} +4 -4
- package/dist/assets/sankeyDiagram-TZEHDZUN-LfuSRRbf-CViEN22a.js +10 -0
- package/dist/assets/{sequenceDiagram-WL72ISMW-DfYfiNEc-DAem8LrU.js → sequenceDiagram-WL72ISMW-CQ4J-0_7-BdxRbQ7B.js} +11 -11
- package/dist/assets/stateDiagram-FKZM4ZOC-JtogJwt6-Bwfh0qFf.js +1 -0
- package/dist/assets/stateDiagram-v2-4FDKWEC3-DuQ7UaeU-DOrYQe5I.js +1 -0
- package/dist/assets/{timeline-definition-IT6M3QCI-D-4DkSGs-igqgXYJA.js → timeline-definition-IT6M3QCI-Cs3NnF2M-DkWnrDas.js} +5 -5
- package/dist/assets/{treemap-KMMF4GRG-D_CgoaQq-1cg8_rRW.js → treemap-KMMF4GRG-CkW25-tn-CpmtOl1S.js} +31 -31
- package/dist/assets/{xychartDiagram-PRI3JC2R-Cs63yrks-CcEeZ1Qx.js → xychartDiagram-PRI3JC2R-JzAaXa5z-qm9b5yhA.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/_baseUniq-D5Eo-o17-Dkf2eEoL.js +0 -1
- package/dist/assets/arc-C_KK8p3_-DPqj8zOp.js +0 -1
- package/dist/assets/channel-pHWSbwHm-CxOaJbm2.js +0 -1
- package/dist/assets/chunk-55IACEB6-BpoJKKfJ-bOzouDoX.js +0 -1
- package/dist/assets/chunk-QN33PNHL-DFknLKOq-B_TRwG-U.js +0 -1
- package/dist/assets/classDiagram-2ON5EDUG-dl-fP_NJ-DmLd9UEu.js +0 -1
- package/dist/assets/classDiagram-v2-WZHVMYZB-dl-fP_NJ-DmLd9UEu.js +0 -1
- package/dist/assets/clone-CYv9ip75-CjM9sz61.js +0 -1
- package/dist/assets/diagram-QEK2KX5R-BueFGLn5-BlCxBbOv.js +0 -43
- package/dist/assets/diagram-S2PKOQOG-C1iE4SNs-z2q-4hhl.js +0 -24
- package/dist/assets/index-Ga9tZhFZ.js +0 -1234
- package/dist/assets/infoDiagram-WHAUD3N6-Cb76h7mD-s5ySGBI1.js +0 -2
- package/dist/assets/min-rCpHWDFS-Bpi4dGNR.js +0 -1
- package/dist/assets/pieDiagram-ADFJNKIX-vuHwyssH-CjkF3vHE.js +0 -30
- package/dist/assets/sankeyDiagram-TZEHDZUN-BcBwWOvE-NUCVToCj.js +0 -10
- package/dist/assets/stateDiagram-FKZM4ZOC-Bc8gN8qV-tvcraH7m.js +0 -1
- package/dist/assets/stateDiagram-v2-4FDKWEC3-D_sncagZ-BEb1odG9.js +0 -1
package/dist/assets/{treemap-KMMF4GRG-D_CgoaQq-1cg8_rRW.js → treemap-KMMF4GRG-CkW25-tn-CpmtOl1S.js}
RENAMED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import{_ as Ft,bB as Ip}from"./index-Ga9tZhFZ.js";import{M as ot,L as _p,k as Cp}from"./min-rCpHWDFS-Bpi4dGNR.js";import{Y as bu,q as Ua,Z as Np,B as Op,J as Lp,a as Pp}from"./_baseUniq-D5Eo-o17-Dkf2eEoL.js";var Mp=Object.defineProperty,Dp=(t,e,r)=>e in t?Mp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gt=(t,e,r)=>Dp(t,typeof e!="symbol"?e+"":e,r);function jp(t,e){return Op(ot(t,e))}function Up(t,e){return t&&t.length?Lp(t,Pp(e)):[]}function le(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function He(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function Fp(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function fi(t){return typeof t=="object"&&t!==null&&le(t.container)&&He(t.reference)&&typeof t.message=="string"}class Pf{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,r){return le(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.computeIsSubtype(e,r);return n[r]=a,a}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}}function Tn(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Mf(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Df(t){return Tn(t)&&typeof t.fullText=="string"}class ne{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new ne(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Ae})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Gp(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new ne(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Ae:{done:!1,value:e(i)}})}filter(e){return new ne(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Ae})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new ne(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Si(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Ae})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new ne(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Si(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Ae})}head(){const e=this.iterator().next();if(!e.done)return e.value}tail(e=1){return new ne(()=>{const r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new ne(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Ae:this.nextFn(r.state)))}distinct(e){return new ne(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Ae})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}}function Gp(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Si(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Bp=new ne(()=>{},()=>Ae),Ae=Object.freeze({done:!0,value:void 0});function ie(...t){if(t.length===1){const e=t[0];if(e instanceof ne)return e;if(Si(e))return new ne(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new ne(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Ae)}return t.length>1?new ne(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const r=t[e.collIndex++];Si(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Ae}):Bp}class Io extends ne{constructor(e,r,n){super(()=>({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(r(a.value)[Symbol.iterator]()),a}return Ae})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Ms;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}t.max=i})(Ms||(Ms={}));function Ds(t){return new Io(t,e=>Tn(e)?e.content:[],{includeRoot:!0})}function Kp(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function js(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function wi(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var at;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(at||(at={}));function Vp(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return at.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return at.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?at.Inside:r?at.OverlapBack:n?at.OverlapFront:at.Outside}function zp(t,e){return Vp(t,e)>at.After}const Hp=/^[\w\p{L}]$/u;function Wp(t,e){if(t){const r=Yp(t,!0);if(r&&Su(r,e))return r;if(Df(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(Su(a,e))return a}}}}function Su(t,e){return Mf(t)&&e.includes(t.tokenType.name)}function Yp(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}class jf extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function wn(t){throw new Error("Error! The input value was not handled.")}const Gn="AbstractRule",Bn="AbstractType",Fa="Condition",wu="TypeDefinition",Ga="ValueLiteral",Or="AbstractElement";function qp(t){return j.isInstance(t,Or)}const Kn="ArrayLiteral",Vn="ArrayType",Lr="BooleanLiteral";function Xp(t){return j.isInstance(t,Lr)}const Pr="Conjunction";function Zp(t){return j.isInstance(t,Pr)}const Mr="Disjunction";function Qp(t){return j.isInstance(t,Mr)}const zn="Grammar",Ba="GrammarImport",Dr="InferredType";function Uf(t){return j.isInstance(t,Dr)}const jr="Interface";function Ff(t){return j.isInstance(t,jr)}const Ka="NamedArgument",Ur="Negation";function Jp(t){return j.isInstance(t,Ur)}const Hn="NumberLiteral",Wn="Parameter",Fr="ParameterReference";function em(t){return j.isInstance(t,Fr)}const Gr="ParserRule";function Ce(t){return j.isInstance(t,Gr)}const Yn="ReferenceType",di="ReturnType";function tm(t){return j.isInstance(t,di)}const Br="SimpleType";function rm(t){return j.isInstance(t,Br)}const qn="StringLiteral",fr="TerminalRule";function Jt(t){return j.isInstance(t,fr)}const Kr="Type";function Gf(t){return j.isInstance(t,Kr)}const Va="TypeAttribute",Xn="UnionType",Vr="Action";function ra(t){return j.isInstance(t,Vr)}const zr="Alternatives";function Bf(t){return j.isInstance(t,zr)}const Hr="Assignment";function zt(t){return j.isInstance(t,Hr)}const Wr="CharacterRange";function nm(t){return j.isInstance(t,Wr)}const Yr="CrossReference";function _o(t){return j.isInstance(t,Yr)}const qr="EndOfFile";function im(t){return j.isInstance(t,qr)}const Xr="Group";function Co(t){return j.isInstance(t,Xr)}const Zr="Keyword";function Ht(t){return j.isInstance(t,Zr)}const Qr="NegatedToken";function am(t){return j.isInstance(t,Qr)}const Jr="RegexToken";function sm(t){return j.isInstance(t,Jr)}const en="RuleCall";function Wt(t){return j.isInstance(t,en)}const tn="TerminalAlternatives";function om(t){return j.isInstance(t,tn)}const rn="TerminalGroup";function um(t){return j.isInstance(t,rn)}const nn="TerminalRuleCall";function lm(t){return j.isInstance(t,nn)}const an="UnorderedGroup";function Kf(t){return j.isInstance(t,an)}const sn="UntilToken";function cm(t){return j.isInstance(t,sn)}const on="Wildcard";function fm(t){return j.isInstance(t,on)}class Vf extends Pf{getAllTypes(){return[Or,Gn,Bn,Vr,zr,Kn,Vn,Hr,Lr,Wr,Fa,Pr,Yr,Mr,qr,zn,Ba,Xr,Dr,jr,Zr,Ka,Qr,Ur,Hn,Wn,Fr,Gr,Yn,Jr,di,en,Br,qn,tn,rn,fr,nn,Kr,Va,wu,Xn,an,sn,Ga,on]}computeIsSubtype(e,r){switch(e){case Vr:case zr:case Hr:case Wr:case Yr:case qr:case Xr:case Zr:case Qr:case Jr:case en:case tn:case rn:case nn:case an:case sn:case on:return this.isSubtype(Or,r);case Kn:case Hn:case qn:return this.isSubtype(Ga,r);case Vn:case Yn:case Br:case Xn:return this.isSubtype(wu,r);case Lr:return this.isSubtype(Fa,r)||this.isSubtype(Ga,r);case Pr:case Mr:case Ur:case Fr:return this.isSubtype(Fa,r);case Dr:case jr:case Kr:return this.isSubtype(Bn,r);case Gr:return this.isSubtype(Gn,r)||this.isSubtype(Bn,r);case fr:return this.isSubtype(Gn,r);default:return!1}}getReferenceType(e){const r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Bn;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Gn;case"Grammar:usedGrammars":return zn;case"NamedArgument:parameter":case"ParameterReference:parameter":return Wn;case"TerminalRuleCall:rule":return fr;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Or:return{name:Or,properties:[{name:"cardinality"},{name:"lookahead"}]};case Kn:return{name:Kn,properties:[{name:"elements",defaultValue:[]}]};case Vn:return{name:Vn,properties:[{name:"elementType"}]};case Lr:return{name:Lr,properties:[{name:"true",defaultValue:!1}]};case Pr:return{name:Pr,properties:[{name:"left"},{name:"right"}]};case Mr:return{name:Mr,properties:[{name:"left"},{name:"right"}]};case zn:return{name:zn,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case Ba:return{name:Ba,properties:[{name:"path"}]};case Dr:return{name:Dr,properties:[{name:"name"}]};case jr:return{name:jr,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Ka:return{name:Ka,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Ur:return{name:Ur,properties:[{name:"value"}]};case Hn:return{name:Hn,properties:[{name:"value"}]};case Wn:return{name:Wn,properties:[{name:"name"}]};case Fr:return{name:Fr,properties:[{name:"parameter"}]};case Gr:return{name:Gr,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Yn:return{name:Yn,properties:[{name:"referenceType"}]};case di:return{name:di,properties:[{name:"name"}]};case Br:return{name:Br,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case qn:return{name:qn,properties:[{name:"value"}]};case fr:return{name:fr,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Kr:return{name:Kr,properties:[{name:"name"},{name:"type"}]};case Va:return{name:Va,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Xn:return{name:Xn,properties:[{name:"types",defaultValue:[]}]};case Vr:return{name:Vr,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case zr:return{name:zr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Hr:return{name:Hr,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Wr:return{name:Wr,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Yr:return{name:Yr,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case qr:return{name:qr,properties:[{name:"cardinality"},{name:"lookahead"}]};case Xr:return{name:Xr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Zr:return{name:Zr,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case Qr:return{name:Qr,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Jr:return{name:Jr,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case en:return{name:en,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case tn:return{name:tn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case rn:return{name:rn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case nn:return{name:nn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case an:return{name:an,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case sn:return{name:sn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case on:return{name:on,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const j=new Vf;function dm(t){for(const[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{le(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):le(r)&&(r.$container=t,r.$containerProperty=e))}function na(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function Et(t){const e=Us(t).$document;if(!e)throw new Error("AST node has no document.");return e}function Us(t){for(;t.$container;)t=t.$container;return t}function No(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){const i=n.keys[n.keyIndex];if(!i.startsWith("$")){const a=t[i];if(le(a)){if(n.keyIndex++,Iu(a,r))return{done:!1,value:a}}else if(Array.isArray(a)){for(;n.arrayIndex<a.length;){const s=n.arrayIndex++,o=a[s];if(le(o)&&Iu(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return Ae})}function In(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Io(t,r=>No(r,e))}function hr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Io(t,r=>No(r,e),{includeRoot:!0})}function Iu(t,e){var r;if(!e)return!0;const n=(r=t.$cstNode)===null||r===void 0?void 0:r.range;return n?zp(n,e):!1}function zf(t){return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const r=e.keys[e.keyIndex];if(!r.startsWith("$")){const n=t[r];if(He(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){const i=e.arrayIndex++,a=n[i];if(He(a))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ae})}function hm(t,e){const r=t.getTypeMetaData(e.$type),n=e;for(const i of r.properties)i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=Hf(i.defaultValue))}function Hf(t){return Array.isArray(t)?[...t.map(Hf)]:t}function I(t){return t.charCodeAt(0)}function za(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function wr(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function cr(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function pm(){throw Error("Internal Error - Should never get here!")}function _u(t){return t.type==="Character"}const Ii=[];for(let t=I("0");t<=I("9");t++)Ii.push(t);const _i=[I("_")].concat(Ii);for(let t=I("a");t<=I("z");t++)_i.push(t);for(let t=I("A");t<=I("Z");t++)_i.push(t);const Cu=[I(" "),I("\f"),I(`
|
|
1
|
+
import{_ as Ut,bB as Ip}from"./index-CS9omSqb.js";import{M as ot,L as _p,k as Cp}from"./min-C2aDz5ZK-B9D8sW79.js";import{Y as bu,q as Fa,Z as Np,B as Op,J as Lp,a as Pp}from"./_baseUniq-BPMphbq5-Ci3F4c-i.js";var Mp=Object.defineProperty,Dp=(t,e,r)=>e in t?Mp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Gt=(t,e,r)=>Dp(t,typeof e!="symbol"?e+"":e,r);function jp(t,e){return Op(ot(t,e))}function Fp(t,e){return t&&t.length?Lp(t,Pp(e)):[]}function le(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function ze(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function Up(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function fi(t){return typeof t=="object"&&t!==null&&le(t.container)&&ze(t.reference)&&typeof t.message=="string"}class Pf{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,r){return le(e)&&this.isSubtype(e.$type,r)}isSubtype(e,r){if(e===r)return!0;let n=this.subtypes[e];n||(n=this.subtypes[e]={});const i=n[r];if(i!==void 0)return i;{const a=this.computeIsSubtype(e,r);return n[r]=a,a}}getAllSubTypes(e){const r=this.allSubtypes[e];if(r)return r;{const n=this.getAllTypes(),i=[];for(const a of n)this.isSubtype(a,e)&&i.push(a);return this.allSubtypes[e]=i,i}}}function Tn(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Mf(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Df(t){return Tn(t)&&typeof t.fullText=="string"}class ne{constructor(e,r){this.startFn=e,this.nextFn=r}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let r=0,n=e.next();for(;!n.done;)r++,n=e.next();return r}toArray(){const e=[],r=this.iterator();let n;do n=r.next(),n.value!==void 0&&e.push(n.value);while(!n.done);return e}toSet(){return new Set(this)}toMap(e,r){const n=this.map(i=>[e?e(i):i,r?r(i):i]);return new Map(n)}toString(){return this.join()}concat(e){return new ne(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),r=>{let n;if(!r.firstDone){do if(n=this.nextFn(r.first),!n.done)return n;while(!n.done);r.firstDone=!0}do if(n=r.iterator.next(),!n.done)return n;while(!n.done);return Ae})}join(e=","){const r=this.iterator();let n="",i,a=!1;do i=r.next(),i.done||(a&&(n+=e),n+=Gp(i.value)),a=!0;while(!i.done);return n}indexOf(e,r=0){const n=this.iterator();let i=0,a=n.next();for(;!a.done;){if(i>=r&&a.value===e)return i;a=n.next(),i++}return-1}every(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(!e(n.value))return!1;n=r.next()}return!0}some(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return!0;n=r.next()}return!1}forEach(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;)e(i.value,n),i=r.next(),n++}map(e){return new ne(this.startFn,r=>{const{done:n,value:i}=this.nextFn(r);return n?Ae:{done:!1,value:e(i)}})}filter(e){return new ne(this.startFn,r=>{let n;do if(n=this.nextFn(r),!n.done&&e(n.value))return n;while(!n.done);return Ae})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,r){const n=this.iterator();let i=r,a=n.next();for(;!a.done;)i===void 0?i=a.value:i=e(i,a.value),a=n.next();return i}reduceRight(e,r){return this.recursiveReduce(this.iterator(),e,r)}recursiveReduce(e,r,n){const i=e.next();if(i.done)return n;const a=this.recursiveReduce(e,r,n);return a===void 0?i.value:r(a,i.value)}find(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(e(n.value))return n.value;n=r.next()}}findIndex(e){const r=this.iterator();let n=0,i=r.next();for(;!i.done;){if(e(i.value))return n;i=r.next(),n++}return-1}includes(e){const r=this.iterator();let n=r.next();for(;!n.done;){if(n.value===e)return!0;n=r.next()}return!1}flatMap(e){return new ne(()=>({this:this.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:n,value:i}=this.nextFn(r.this);if(!n){const a=e(i);if(Si(a))r.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}}while(r.iterator);return Ae})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const r=e>1?this.flat(e-1):this;return new ne(()=>({this:r.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:i,value:a}=r.nextFn(n.this);if(!i)if(Si(a))n.iterator=a[Symbol.iterator]();else return{done:!1,value:a}}while(n.iterator);return Ae})}head(){const e=this.iterator().next();if(!e.done)return e.value}tail(e=1){return new ne(()=>{const r=this.startFn();for(let n=0;n<e;n++)if(this.nextFn(r).done)return r;return r},this.nextFn)}limit(e){return new ne(()=>({size:0,state:this.startFn()}),r=>(r.size++,r.size>e?Ae:this.nextFn(r.state)))}distinct(e){return new ne(()=>({set:new Set,internalState:this.startFn()}),r=>{let n;do if(n=this.nextFn(r.internalState),!n.done){const i=e?e(n.value):n.value;if(!r.set.has(i))return r.set.add(i),n}while(!n.done);return Ae})}exclude(e,r){const n=new Set;for(const i of e){const a=r?r(i):i;n.add(a)}return this.filter(i=>{const a=r?r(i):i;return!n.has(a)})}}function Gp(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Si(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Bp=new ne(()=>{},()=>Ae),Ae=Object.freeze({done:!0,value:void 0});function ie(...t){if(t.length===1){const e=t[0];if(e instanceof ne)return e;if(Si(e))return new ne(()=>e[Symbol.iterator](),r=>r.next());if(typeof e.length=="number")return new ne(()=>({index:0}),r=>r.index<e.length?{done:!1,value:e[r.index++]}:Ae)}return t.length>1?new ne(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const r=e.iterator.next();if(!r.done)return r;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const r=t[e.collIndex++];Si(r)?e.iterator=r[Symbol.iterator]():r&&typeof r.length=="number"&&(e.array=r)}}while(e.iterator||e.array||e.collIndex<t.length);return Ae}):Bp}class Io extends ne{constructor(e,r,n){super(()=>({iterators:n!=null&&n.includeRoot?[[e][Symbol.iterator]()]:[r(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(r(a.value)[Symbol.iterator]()),a}return Ae})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Ms;(function(t){function e(a){return a.reduce((s,o)=>s+o,0)}t.sum=e;function r(a){return a.reduce((s,o)=>s*o,0)}t.product=r;function n(a){return a.reduce((s,o)=>Math.min(s,o))}t.min=n;function i(a){return a.reduce((s,o)=>Math.max(s,o))}t.max=i})(Ms||(Ms={}));function Ds(t){return new Io(t,e=>Tn(e)?e.content:[],{includeRoot:!0})}function Kp(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function js(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function wi(t){if(!t)return;const{offset:e,end:r,range:n}=t;return{range:n,offset:e,end:r,length:r-e}}var at;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(at||(at={}));function Vp(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return at.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return at.After;const r=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,n=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return r&&n?at.Inside:r?at.OverlapBack:n?at.OverlapFront:at.Outside}function Hp(t,e){return Vp(t,e)>at.After}const zp=/^[\w\p{L}]$/u;function Wp(t,e){if(t){const r=Yp(t,!0);if(r&&Su(r,e))return r;if(Df(t)){const n=t.content.findIndex(i=>!i.hidden);for(let i=n-1;i>=0;i--){const a=t.content[i];if(Su(a,e))return a}}}}function Su(t,e){return Mf(t)&&e.includes(t.tokenType.name)}function Yp(t,e=!0){for(;t.container;){const r=t.container;let n=r.content.indexOf(t);for(;n>0;){n--;const i=r.content[n];if(e||!i.hidden)return i}t=r}}class jf extends Error{constructor(e,r){super(e?`${r} at ${e.range.start.line}:${e.range.start.character}`:r)}}function wn(t){throw new Error("Error! The input value was not handled.")}const Gn="AbstractRule",Bn="AbstractType",Ua="Condition",wu="TypeDefinition",Ga="ValueLiteral",Or="AbstractElement";function qp(t){return j.isInstance(t,Or)}const Kn="ArrayLiteral",Vn="ArrayType",Lr="BooleanLiteral";function Xp(t){return j.isInstance(t,Lr)}const Pr="Conjunction";function Zp(t){return j.isInstance(t,Pr)}const Mr="Disjunction";function Qp(t){return j.isInstance(t,Mr)}const Hn="Grammar",Ba="GrammarImport",Dr="InferredType";function Ff(t){return j.isInstance(t,Dr)}const jr="Interface";function Uf(t){return j.isInstance(t,jr)}const Ka="NamedArgument",Fr="Negation";function Jp(t){return j.isInstance(t,Fr)}const zn="NumberLiteral",Wn="Parameter",Ur="ParameterReference";function em(t){return j.isInstance(t,Ur)}const Gr="ParserRule";function Ce(t){return j.isInstance(t,Gr)}const Yn="ReferenceType",di="ReturnType";function tm(t){return j.isInstance(t,di)}const Br="SimpleType";function rm(t){return j.isInstance(t,Br)}const qn="StringLiteral",fr="TerminalRule";function Jt(t){return j.isInstance(t,fr)}const Kr="Type";function Gf(t){return j.isInstance(t,Kr)}const Va="TypeAttribute",Xn="UnionType",Vr="Action";function ra(t){return j.isInstance(t,Vr)}const Hr="Alternatives";function Bf(t){return j.isInstance(t,Hr)}const zr="Assignment";function Ht(t){return j.isInstance(t,zr)}const Wr="CharacterRange";function nm(t){return j.isInstance(t,Wr)}const Yr="CrossReference";function _o(t){return j.isInstance(t,Yr)}const qr="EndOfFile";function im(t){return j.isInstance(t,qr)}const Xr="Group";function Co(t){return j.isInstance(t,Xr)}const Zr="Keyword";function zt(t){return j.isInstance(t,Zr)}const Qr="NegatedToken";function am(t){return j.isInstance(t,Qr)}const Jr="RegexToken";function sm(t){return j.isInstance(t,Jr)}const en="RuleCall";function Wt(t){return j.isInstance(t,en)}const tn="TerminalAlternatives";function om(t){return j.isInstance(t,tn)}const rn="TerminalGroup";function um(t){return j.isInstance(t,rn)}const nn="TerminalRuleCall";function lm(t){return j.isInstance(t,nn)}const an="UnorderedGroup";function Kf(t){return j.isInstance(t,an)}const sn="UntilToken";function cm(t){return j.isInstance(t,sn)}const on="Wildcard";function fm(t){return j.isInstance(t,on)}class Vf extends Pf{getAllTypes(){return[Or,Gn,Bn,Vr,Hr,Kn,Vn,zr,Lr,Wr,Ua,Pr,Yr,Mr,qr,Hn,Ba,Xr,Dr,jr,Zr,Ka,Qr,Fr,zn,Wn,Ur,Gr,Yn,Jr,di,en,Br,qn,tn,rn,fr,nn,Kr,Va,wu,Xn,an,sn,Ga,on]}computeIsSubtype(e,r){switch(e){case Vr:case Hr:case zr:case Wr:case Yr:case qr:case Xr:case Zr:case Qr:case Jr:case en:case tn:case rn:case nn:case an:case sn:case on:return this.isSubtype(Or,r);case Kn:case zn:case qn:return this.isSubtype(Ga,r);case Vn:case Yn:case Br:case Xn:return this.isSubtype(wu,r);case Lr:return this.isSubtype(Ua,r)||this.isSubtype(Ga,r);case Pr:case Mr:case Fr:case Ur:return this.isSubtype(Ua,r);case Dr:case jr:case Kr:return this.isSubtype(Bn,r);case Gr:return this.isSubtype(Gn,r)||this.isSubtype(Bn,r);case fr:return this.isSubtype(Gn,r);default:return!1}}getReferenceType(e){const r=`${e.container.$type}:${e.property}`;switch(r){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Bn;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Gn;case"Grammar:usedGrammars":return Hn;case"NamedArgument:parameter":case"ParameterReference:parameter":return Wn;case"TerminalRuleCall:rule":return fr;default:throw new Error(`${r} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Or:return{name:Or,properties:[{name:"cardinality"},{name:"lookahead"}]};case Kn:return{name:Kn,properties:[{name:"elements",defaultValue:[]}]};case Vn:return{name:Vn,properties:[{name:"elementType"}]};case Lr:return{name:Lr,properties:[{name:"true",defaultValue:!1}]};case Pr:return{name:Pr,properties:[{name:"left"},{name:"right"}]};case Mr:return{name:Mr,properties:[{name:"left"},{name:"right"}]};case Hn:return{name:Hn,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case Ba:return{name:Ba,properties:[{name:"path"}]};case Dr:return{name:Dr,properties:[{name:"name"}]};case jr:return{name:jr,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Ka:return{name:Ka,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Fr:return{name:Fr,properties:[{name:"value"}]};case zn:return{name:zn,properties:[{name:"value"}]};case Wn:return{name:Wn,properties:[{name:"name"}]};case Ur:return{name:Ur,properties:[{name:"parameter"}]};case Gr:return{name:Gr,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Yn:return{name:Yn,properties:[{name:"referenceType"}]};case di:return{name:di,properties:[{name:"name"}]};case Br:return{name:Br,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case qn:return{name:qn,properties:[{name:"value"}]};case fr:return{name:fr,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Kr:return{name:Kr,properties:[{name:"name"},{name:"type"}]};case Va:return{name:Va,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Xn:return{name:Xn,properties:[{name:"types",defaultValue:[]}]};case Vr:return{name:Vr,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Hr:return{name:Hr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case zr:return{name:zr,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Wr:return{name:Wr,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Yr:return{name:Yr,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case qr:return{name:qr,properties:[{name:"cardinality"},{name:"lookahead"}]};case Xr:return{name:Xr,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case Zr:return{name:Zr,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case Qr:return{name:Qr,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Jr:return{name:Jr,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case en:return{name:en,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case tn:return{name:tn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case rn:return{name:rn,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case nn:return{name:nn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case an:return{name:an,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case sn:return{name:sn,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case on:return{name:on,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const j=new Vf;function dm(t){for(const[e,r]of Object.entries(t))e.startsWith("$")||(Array.isArray(r)?r.forEach((n,i)=>{le(n)&&(n.$container=t,n.$containerProperty=e,n.$containerIndex=i)}):le(r)&&(r.$container=t,r.$containerProperty=e))}function na(t,e){let r=t;for(;r;){if(e(r))return r;r=r.$container}}function Et(t){const e=Fs(t).$document;if(!e)throw new Error("AST node has no document.");return e}function Fs(t){for(;t.$container;)t=t.$container;return t}function No(t,e){if(!t)throw new Error("Node must be an AstNode.");const r=e==null?void 0:e.range;return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),n=>{for(;n.keyIndex<n.keys.length;){const i=n.keys[n.keyIndex];if(!i.startsWith("$")){const a=t[i];if(le(a)){if(n.keyIndex++,Iu(a,r))return{done:!1,value:a}}else if(Array.isArray(a)){for(;n.arrayIndex<a.length;){const s=n.arrayIndex++,o=a[s];if(le(o)&&Iu(o,r))return{done:!1,value:o}}n.arrayIndex=0}}n.keyIndex++}return Ae})}function In(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Io(t,r=>No(r,e))}function hr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Io(t,r=>No(r,e),{includeRoot:!0})}function Iu(t,e){var r;if(!e)return!0;const n=(r=t.$cstNode)===null||r===void 0?void 0:r.range;return n?Hp(n,e):!1}function Hf(t){return new ne(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const r=e.keys[e.keyIndex];if(!r.startsWith("$")){const n=t[r];if(ze(n))return e.keyIndex++,{done:!1,value:{reference:n,container:t,property:r}};if(Array.isArray(n)){for(;e.arrayIndex<n.length;){const i=e.arrayIndex++,a=n[i];if(ze(a))return{done:!1,value:{reference:a,container:t,property:r,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Ae})}function hm(t,e){const r=t.getTypeMetaData(e.$type),n=e;for(const i of r.properties)i.defaultValue!==void 0&&n[i.name]===void 0&&(n[i.name]=zf(i.defaultValue))}function zf(t){return Array.isArray(t)?[...t.map(zf)]:t}function I(t){return t.charCodeAt(0)}function Ha(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function wr(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function cr(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function pm(){throw Error("Internal Error - Should never get here!")}function _u(t){return t.type==="Character"}const Ii=[];for(let t=I("0");t<=I("9");t++)Ii.push(t);const _i=[I("_")].concat(Ii);for(let t=I("a");t<=I("z");t++)_i.push(t);for(let t=I("A");t<=I("Z");t++)_i.push(t);const Cu=[I(" "),I("\f"),I(`
|
|
2
2
|
`),I("\r"),I(" "),I("\v"),I(" "),I(" "),I(" "),I(" "),I(" "),I(" "),I(" "),I(" "),I(" "),I(" "),I(" "),I(" "),I(" "),I(" "),I("\u2028"),I("\u2029"),I(" "),I(" "),I(" "),I("\uFEFF")],mm=/[0-9a-fA-F]/,Zn=/[0-9]/,gm=/[1-9]/;class Wf{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const r=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":wr(n,"global");break;case"i":wr(n,"ignoreCase");break;case"m":wr(n,"multiLine");break;case"u":wr(n,"unicode");break;case"y":wr(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){const e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){const e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}cr(r);const n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return pm()}quantifier(e=!1){let r;const n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let a;this.isDigit()?(a=this.integerIncludingZero(),r={atLeast:i,atMost:a}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;cr(r);break}if(!(e===!0&&r===void 0)&&cr(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e;const r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),cr(e))return e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[I(`
|
|
3
3
|
`),I("\r"),I("\u2028"),I("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Ii;break;case"D":e=Ii,r=!0;break;case"s":e=Cu;break;case"S":e=Cu,r=!0;break;case"w":e=_i;break;case"W":e=_i,r=!0;break}if(cr(e))return{type:"Set",value:e,complement:r}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=I("\f");break;case"n":e=I(`
|
|
4
4
|
`);break;case"r":e=I("\r");break;case"t":e=I(" ");break;case"v":e=I("\v");break}if(cr(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:I("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:I(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
-
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:I(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,_u(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,_u(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:I(e)}}}characterClass(){const e=[];let r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,_u(n)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,_u(i)){if(i.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:i.value})}else Ha(n.value,e),e.push(I("-")),Ha(i.value,e)}else Ha(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
6
|
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:I("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const r=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(gm.test(e)===!1)throw Error("Expecting a positive integer");for(;Zn.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Zn.test(e)===!1)throw Error("Expecting an integer");for(;Zn.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
7
7
|
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:I(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Zn.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
8
8
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
9
|
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let n=0;n<e;n++){const i=this.popChar();if(mm.test(i)===!1)throw Error("Expecting a HexDecimal digits");r+=i}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class ia{visitChildren(e){for(const r in e){const n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const ym=/\r?\n/gm,vm=new Wf;class Tm extends ia{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const r=String.fromCharCode(e.value);if(!this.multiline&&r===`
|
|
10
10
|
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=aa(r);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitSet(e){if(!this.multiline){const r=this.regex.substring(e.loc.begin,e.loc.end),n=new RegExp(r);this.multiline=!!`
|
|
11
|
-
`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const
|
|
12
|
-
\r \v \u2028\u2029 \uFEFF`.split("");function Fs(t){const e=typeof t=="string"?new RegExp(t):t;return Em.some(r=>e.test(r))}function aa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Am(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:aa(e)).join("")}function $m(t,e){const r=km(t),n=e.match(r);return!!n&&n[0].length>0}function km(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(l){a+=r.substr(n,l),n+=l}function u(l){a+="(?:"+r.substr(n,l)+"|$)",n+=l}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":u(3);break;case"x":u(4);break;case"u":e.unicode?r[n+2]==="{"?u(r.indexOf("}",n)-n+1):u(6):u(2);break;case"p":case"P":e.unicode?u(r.indexOf("}",n)-n+1):u(2);break;case"k":u(r.indexOf(">",n)-n+1);break;default:u(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],u(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):u(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:u(1);break}return a}return new RegExp(i(),t.flags)}function xm(t){return t.rules.find(e=>Ce(e)&&e.entry)}function bm(t){return t.rules.filter(e=>Jt(e)&&e.hidden)}function Yf(t,e){const r=new Set,n=xm(t);if(!n)return new Set(t.rules);const i=[n].concat(bm(t));for(const s of i)qf(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Jt(s)&&s.hidden)&&a.add(s);return a}function qf(t,e,r){e.add(t.name),In(t).forEach(n=>{if(Wt(n)||r){const i=n.rule.ref;i&&!e.has(i.name)&&qf(i,e,r)}})}function Sm(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Zf(t.type.ref);return e==null?void 0:e.terminal}}function wm(t){return t.hidden&&!Fs(Mo(t))}function Im(t,e){return!t||!e?[]:Oo(t,e,t.astNode,!0)}function Xf(t,e,r){if(!t||!e)return;const n=Oo(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Oo(t,e,r,n){if(!n){const i=na(t.grammarSource,zt);if(i&&i.feature===e)return[t]}return Tn(t)&&t.astNode===r?t.content.flatMap(i=>Oo(i,e,r,!1)):[]}function _m(t,e,r){if(!t)return;const n=Cm(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Cm(t,e,r){if(t.astNode!==r)return[];if(Ht(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Ds(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?Ht(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function Nm(t){var e;const r=t.astNode;for(;r===((e=t.container)===null||e===void 0?void 0:e.astNode);){const n=na(t.grammarSource,zt);if(n)return n;t=t.container}}function Zf(t){let e=t;return Uf(e)&&(ra(e.$container)?e=e.$container.$container:Ce(e.$container)?e=e.$container:wn(e.$container)),Qf(t,e,new Map)}function Qf(t,e,r){var n;function i(a,s){let o;return na(a,zt)||(o=Qf(s,s,r)),r.set(t,o),o}if(r.has(t))return r.get(t);r.set(t,void 0);for(const a of In(e)){if(zt(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Wt(a)&&Ce(a.rule.ref))return i(a,a.rule.ref);if(rm(a)&&!((n=a.typeRef)===null||n===void 0)&&n.ref)return i(a,a.typeRef.ref)}}function Jf(t){return ed(t,new Set)}function ed(t,e){if(e.has(t))return!0;e.add(t);for(const r of In(t))if(Wt(r)){if(!r.rule.ref||Ce(r.rule.ref)&&!ed(r.rule.ref,e))return!1}else if(zt(r)||ra(r))return!1;return!!t.definition}function Lo(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e&&(Ce(e)||Ff(e)||Gf(e)))return e.name}}function Po(t){var e;if(Ce(t))return Jf(t)?t.name:(e=Lo(t))!==null&&e!==void 0?e:t.name;if(Ff(t)||Gf(t)||tm(t))return t.name;if(ra(t)){const r=Om(t);if(r)return r}else if(Uf(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function Om(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return Po(t.type.ref)}function Lm(t){var e,r,n;return Jt(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":(n=Lo(t))!==null&&n!==void 0?n:t.name}function Mo(t){const e={s:!1,i:!1,u:!1},r=kr(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}const Do=/[\s\S]/.source;function kr(t,e){if(om(t))return Pm(t);if(um(t))return Mm(t);if(nm(t))return Um(t);if(lm(t)){const r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return ut(kr(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(am(t))return jm(t);if(cm(t))return Dm(t);if(sm(t)){const r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ut(n,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(fm(t))return ut(Do,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}`)}}}function Pm(t){return ut(t.elements.map(e=>kr(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function Mm(t){return ut(t.elements.map(e=>kr(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function Dm(t){return ut(`${Do}*?${kr(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function jm(t){return ut(`(?!${kr(t.terminal)})${Do}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function Um(t){return t.right?ut(`[${Wa(t.left)}-${Wa(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ut(Wa(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function Wa(t){return aa(t.value)}function ut(t,e){var r;return(e.wrap!==!1||e.lookahead)&&(t=`(${(r=e.lookahead)!==null&&r!==void 0?r:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function Fm(t){const e=[],r=t.Grammar;for(const n of r.rules)Jt(n)&&wm(n)&&Rm(Mo(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:Hp}}var td=typeof global=="object"&&global&&global.Object===Object&&global,Gm=typeof self=="object"&&self&&self.Object===Object&&self,qe=td||Gm||Function("return this")(),Ne=qe.Symbol,rd=Object.prototype,Bm=rd.hasOwnProperty,Km=rd.toString,Ir=Ne?Ne.toStringTag:void 0;function Vm(t){var e=Bm.call(t,Ir),r=t[Ir];try{t[Ir]=void 0;var n=!0}catch{}var i=Km.call(t);return n&&(e?t[Ir]=r:delete t[Ir]),i}var zm=Object.prototype,Hm=zm.toString;function Wm(t){return Hm.call(t)}var Ym="[object Null]",qm="[object Undefined]",Nu=Ne?Ne.toStringTag:void 0;function _t(t){return t==null?t===void 0?qm:Ym:Nu&&Nu in Object(t)?Vm(t):Wm(t)}function Fe(t){return t!=null&&typeof t=="object"}var Xm="[object Symbol]";function sa(t){return typeof t=="symbol"||Fe(t)&&_t(t)==Xm}function oa(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var M=Array.isArray,Ou=Ne?Ne.prototype:void 0,Lu=Ou?Ou.toString:void 0;function nd(t){if(typeof t=="string")return t;if(M(t))return oa(t,nd)+"";if(sa(t))return Lu?Lu.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var Zm=/\s/;function Qm(t){for(var e=t.length;e--&&Zm.test(t.charAt(e)););return e}var Jm=/^\s+/;function eg(t){return t&&t.slice(0,Qm(t)+1).replace(Jm,"")}function Oe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Pu=NaN,tg=/^[-+]0x[0-9a-f]+$/i,rg=/^0b[01]+$/i,ng=/^0o[0-7]+$/i,ig=parseInt;function ag(t){if(typeof t=="number")return t;if(sa(t))return Pu;if(Oe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Oe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=eg(t);var r=rg.test(t);return r||ng.test(t)?ig(t.slice(2),r?2:8):tg.test(t)?Pu:+t}var Mu=1/0,sg=17976931348623157e292;function og(t){if(!t)return t===0?t:0;if(t=ag(t),t===Mu||t===-Mu){var e=t<0?-1:1;return e*sg}return t===t?t:0}function ua(t){var e=og(t),r=e%1;return e===e?r?e-r:e:0}function gr(t){return t}var ug="[object AsyncFunction]",lg="[object Function]",cg="[object GeneratorFunction]",fg="[object Proxy]";function ht(t){if(!Oe(t))return!1;var e=_t(t);return e==lg||e==cg||e==ug||e==fg}var Ya=qe["__core-js_shared__"],Du=function(){var t=/[^.]+$/.exec(Ya&&Ya.keys&&Ya.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function dg(t){return!!Du&&Du in t}var hg=Function.prototype,pg=hg.toString;function er(t){if(t!=null){try{return pg.call(t)}catch{}try{return t+""}catch{}}return""}var mg=/[\\^$.*+?()[\]{}|]/g,gg=/^\[object .+?Constructor\]$/,yg=Function.prototype,vg=Object.prototype,Tg=yg.toString,Rg=vg.hasOwnProperty,Eg=RegExp("^"+Tg.call(Rg).replace(mg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ag(t){if(!Oe(t)||dg(t))return!1;var e=ht(t)?Eg:gg;return e.test(er(t))}function $g(t,e){return t==null?void 0:t[e]}function tr(t,e){var r=$g(t,e);return Ag(r)?r:void 0}var Gs=tr(qe,"WeakMap"),ju=Object.create,kg=function(){function t(){}return function(e){if(!Oe(e))return{};if(ju)return ju(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function xg(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Z(){}function bg(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Sg=800,wg=16,Ig=Date.now;function _g(t){var e=0,r=0;return function(){var n=Ig(),i=wg-(n-r);if(r=n,i>0){if(++e>=Sg)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Cg(t){return function(){return t}}var Ci=function(){try{var t=tr(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ng=Ci?function(t,e){return Ci(t,"toString",{configurable:!0,enumerable:!1,value:Cg(e),writable:!0})}:gr,Og=_g(Ng);function id(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function ad(t,e,r,n){for(var i=t.length,a=r+-1;++a<i;)if(e(t[a],a,t))return a;return-1}function Lg(t){return t!==t}function Pg(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function jo(t,e,r){return e===e?Pg(t,e,r):ad(t,Lg,r)}function sd(t,e){var r=t==null?0:t.length;return!!r&&jo(t,e,0)>-1}var Mg=9007199254740991,Dg=/^(?:0|[1-9]\d*)$/;function la(t,e){var r=typeof t;return e=e??Mg,!!e&&(r=="number"||r!="symbol"&&Dg.test(t))&&t>-1&&t%1==0&&t<e}function Uo(t,e,r){e=="__proto__"&&Ci?Ci(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function _n(t,e){return t===e||t!==t&&e!==e}var jg=Object.prototype,Ug=jg.hasOwnProperty;function ca(t,e,r){var n=t[e];(!(Ug.call(t,e)&&_n(n,r))||r===void 0&&!(e in t))&&Uo(t,e,r)}function Fo(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],u=void 0;u===void 0&&(u=t[o]),i?Uo(r,o,u):ca(r,o,u)}return r}var Uu=Math.max;function Fg(t,e,r){return e=Uu(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=Uu(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),xg(t,this,o)}}function Go(t,e){return Og(Fg(t,e,gr),t+"")}var Gg=9007199254740991;function Bo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Gg}function Xe(t){return t!=null&&Bo(t.length)&&!ht(t)}function od(t,e,r){if(!Oe(r))return!1;var n=typeof e;return(n=="number"?Xe(r)&&la(e,r.length):n=="string"&&e in r)?_n(r[e],t):!1}function Bg(t){return Go(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&od(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}var Kg=Object.prototype;function Cn(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Kg;return t===r}function Vg(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var zg="[object Arguments]";function Fu(t){return Fe(t)&&_t(t)==zg}var ud=Object.prototype,Hg=ud.hasOwnProperty,Wg=ud.propertyIsEnumerable,fa=Fu(function(){return arguments}())?Fu:function(t){return Fe(t)&&Hg.call(t,"callee")&&!Wg.call(t,"callee")};function Yg(){return!1}var ld=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gu=ld&&typeof module=="object"&&module&&!module.nodeType&&module,qg=Gu&&Gu.exports===ld,Bu=qg?qe.Buffer:void 0,Xg=Bu?Bu.isBuffer:void 0,Rn=Xg||Yg,Zg="[object Arguments]",Qg="[object Array]",Jg="[object Boolean]",ey="[object Date]",ty="[object Error]",ry="[object Function]",ny="[object Map]",iy="[object Number]",ay="[object Object]",sy="[object RegExp]",oy="[object Set]",uy="[object String]",ly="[object WeakMap]",cy="[object ArrayBuffer]",fy="[object DataView]",dy="[object Float32Array]",hy="[object Float64Array]",py="[object Int8Array]",my="[object Int16Array]",gy="[object Int32Array]",yy="[object Uint8Array]",vy="[object Uint8ClampedArray]",Ty="[object Uint16Array]",Ry="[object Uint32Array]",G={};G[dy]=G[hy]=G[py]=G[my]=G[gy]=G[yy]=G[vy]=G[Ty]=G[Ry]=!0;G[Zg]=G[Qg]=G[cy]=G[Jg]=G[fy]=G[ey]=G[ty]=G[ry]=G[ny]=G[iy]=G[ay]=G[sy]=G[oy]=G[uy]=G[ly]=!1;function Ey(t){return Fe(t)&&Bo(t.length)&&!!G[_t(t)]}function da(t){return function(e){return t(e)}}var cd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gn=cd&&typeof module=="object"&&module&&!module.nodeType&&module,Ay=gn&&gn.exports===cd,qa=Ay&&td.process,At=function(){try{var t=gn&&gn.require&&gn.require("util").types;return t||qa&&qa.binding&&qa.binding("util")}catch{}}(),Ku=At&&At.isTypedArray,Ko=Ku?da(Ku):Ey,$y=Object.prototype,ky=$y.hasOwnProperty;function fd(t,e){var r=M(t),n=!r&&fa(t),i=!r&&!n&&Rn(t),a=!r&&!n&&!i&&Ko(t),s=r||n||i||a,o=s?Vg(t.length,String):[],u=o.length;for(var l in t)(e||ky.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||la(l,u)))&&o.push(l);return o}function dd(t,e){return function(r){return t(e(r))}}var xy=dd(Object.keys,Object),by=Object.prototype,Sy=by.hasOwnProperty;function hd(t){if(!Cn(t))return xy(t);var e=[];for(var r in Object(t))Sy.call(t,r)&&r!="constructor"&&e.push(r);return e}function Le(t){return Xe(t)?fd(t):hd(t)}var wy=Object.prototype,Iy=wy.hasOwnProperty,Bs=Bg(function(t,e){if(Cn(e)||Xe(e)){Fo(e,Le(e),t);return}for(var r in e)Iy.call(e,r)&&ca(t,r,e[r])});function _y(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Cy=Object.prototype,Ny=Cy.hasOwnProperty;function Oy(t){if(!Oe(t))return _y(t);var e=Cn(t),r=[];for(var n in t)n=="constructor"&&(e||!Ny.call(t,n))||r.push(n);return r}function pd(t){return Xe(t)?fd(t,!0):Oy(t)}var Ly=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Py=/^\w*$/;function Vo(t,e){if(M(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||sa(t)?!0:Py.test(t)||!Ly.test(t)||e!=null&&t in Object(e)}var En=tr(Object,"create");function My(){this.__data__=En?En(null):{},this.size=0}function Dy(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var jy="__lodash_hash_undefined__",Uy=Object.prototype,Fy=Uy.hasOwnProperty;function Gy(t){var e=this.__data__;if(En){var r=e[t];return r===jy?void 0:r}return Fy.call(e,t)?e[t]:void 0}var By=Object.prototype,Ky=By.hasOwnProperty;function Vy(t){var e=this.__data__;return En?e[t]!==void 0:Ky.call(e,t)}var zy="__lodash_hash_undefined__";function Hy(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=En&&e===void 0?zy:e,this}function Yt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Yt.prototype.clear=My;Yt.prototype.delete=Dy;Yt.prototype.get=Gy;Yt.prototype.has=Vy;Yt.prototype.set=Hy;function Wy(){this.__data__=[],this.size=0}function ha(t,e){for(var r=t.length;r--;)if(_n(t[r][0],e))return r;return-1}var Yy=Array.prototype,qy=Yy.splice;function Xy(t){var e=this.__data__,r=ha(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():qy.call(e,r,1),--this.size,!0}function Zy(t){var e=this.__data__,r=ha(e,t);return r<0?void 0:e[r][1]}function Qy(t){return ha(this.__data__,t)>-1}function Jy(t,e){var r=this.__data__,n=ha(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function pt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}pt.prototype.clear=Wy;pt.prototype.delete=Xy;pt.prototype.get=Zy;pt.prototype.has=Qy;pt.prototype.set=Jy;var An=tr(qe,"Map");function ev(){this.size=0,this.__data__={hash:new Yt,map:new(An||pt),string:new Yt}}function tv(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function pa(t,e){var r=t.__data__;return tv(e)?r[typeof e=="string"?"string":"hash"]:r.map}function rv(t){var e=pa(this,t).delete(t);return this.size-=e?1:0,e}function nv(t){return pa(this,t).get(t)}function iv(t){return pa(this,t).has(t)}function av(t,e){var r=pa(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function mt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}mt.prototype.clear=ev;mt.prototype.delete=rv;mt.prototype.get=nv;mt.prototype.has=iv;mt.prototype.set=av;var sv="Expected a function";function zo(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(sv);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(zo.Cache||mt),r}zo.Cache=mt;var ov=500;function uv(t){var e=zo(t,function(n){return r.size===ov&&r.clear(),n}),r=e.cache;return e}var lv=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cv=/\\(\\)?/g,fv=uv(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(lv,function(r,n,i,a){e.push(i?a.replace(cv,"$1"):n||r)}),e});function dv(t){return t==null?"":nd(t)}function ma(t,e){return M(t)?t:Vo(t,e)?[t]:fv(dv(t))}function Nn(t){if(typeof t=="string"||sa(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Ho(t,e){e=ma(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Nn(e[r++])];return r&&r==n?t:void 0}function hv(t,e,r){var n=t==null?void 0:Ho(t,e);return n===void 0?r:n}function Wo(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Vu=Ne?Ne.isConcatSpreadable:void 0;function pv(t){return M(t)||fa(t)||!!(Vu&&t&&t[Vu])}function Yo(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=pv),i||(i=[]);++a<s;){var o=t[a];r(o)?Wo(i,o):n||(i[i.length]=o)}return i}function Ue(t){var e=t==null?0:t.length;return e?Yo(t):[]}var md=dd(Object.getPrototypeOf,Object);function gd(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=t[n+e];return a}function mv(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}function gv(){this.__data__=new pt,this.size=0}function yv(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function vv(t){return this.__data__.get(t)}function Tv(t){return this.__data__.has(t)}var Rv=200;function Ev(t,e){var r=this.__data__;if(r instanceof pt){var n=r.__data__;if(!An||n.length<Rv-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new mt(n)}return r.set(t,e),this.size=r.size,this}function We(t){var e=this.__data__=new pt(t);this.size=e.size}We.prototype.clear=gv;We.prototype.delete=yv;We.prototype.get=vv;We.prototype.has=Tv;We.prototype.set=Ev;function Av(t,e){return t&&Fo(e,Le(e),t)}var yd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,zu=yd&&typeof module=="object"&&module&&!module.nodeType&&module,$v=zu&&zu.exports===yd,Hu=$v?qe.Buffer:void 0,Wu=Hu?Hu.allocUnsafe:void 0;function kv(t,e){var r=t.length,n=Wu?Wu(r):new t.constructor(r);return t.copy(n),n}function qo(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}function vd(){return[]}var xv=Object.prototype,bv=xv.propertyIsEnumerable,Yu=Object.getOwnPropertySymbols,Xo=Yu?function(t){return t==null?[]:(t=Object(t),qo(Yu(t),function(e){return bv.call(t,e)}))}:vd;function Sv(t,e){return Fo(t,Xo(t),e)}var wv=Object.getOwnPropertySymbols,Iv=wv?function(t){for(var e=[];t;)Wo(e,Xo(t)),t=md(t);return e}:vd;function Td(t,e,r){var n=e(t);return M(t)?n:Wo(n,r(t))}function Ks(t){return Td(t,Le,Xo)}function _v(t){return Td(t,pd,Iv)}var Vs=tr(qe,"DataView"),zs=tr(qe,"Promise"),pr=tr(qe,"Set"),qu="[object Map]",Cv="[object Object]",Xu="[object Promise]",Zu="[object Set]",Qu="[object WeakMap]",Ju="[object DataView]",Nv=er(Vs),Ov=er(An),Lv=er(zs),Pv=er(pr),Mv=er(Gs),Ie=_t;(Vs&&Ie(new Vs(new ArrayBuffer(1)))!=Ju||An&&Ie(new An)!=qu||zs&&Ie(zs.resolve())!=Xu||pr&&Ie(new pr)!=Zu||Gs&&Ie(new Gs)!=Qu)&&(Ie=function(t){var e=_t(t),r=e==Cv?t.constructor:void 0,n=r?er(r):"";if(n)switch(n){case Nv:return Ju;case Ov:return qu;case Lv:return Xu;case Pv:return Zu;case Mv:return Qu}return e});var Dv=Object.prototype,jv=Dv.hasOwnProperty;function Uv(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&jv.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Ni=qe.Uint8Array;function Fv(t){var e=new t.constructor(t.byteLength);return new Ni(e).set(new Ni(t)),e}function Gv(t,e){var r=t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Bv=/\w*$/;function Kv(t){var e=new t.constructor(t.source,Bv.exec(t));return e.lastIndex=t.lastIndex,e}var el=Ne?Ne.prototype:void 0,tl=el?el.valueOf:void 0;function Vv(t){return tl?Object(tl.call(t)):{}}function zv(t,e){var r=t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Hv="[object Boolean]",Wv="[object Date]",Yv="[object Map]",qv="[object Number]",Xv="[object RegExp]",Zv="[object Set]",Qv="[object String]",Jv="[object Symbol]",eT="[object ArrayBuffer]",tT="[object DataView]",rT="[object Float32Array]",nT="[object Float64Array]",iT="[object Int8Array]",aT="[object Int16Array]",sT="[object Int32Array]",oT="[object Uint8Array]",uT="[object Uint8ClampedArray]",lT="[object Uint16Array]",cT="[object Uint32Array]";function fT(t,e,r){var n=t.constructor;switch(e){case eT:return Fv(t);case Hv:case Wv:return new n(+t);case tT:return Gv(t);case rT:case nT:case iT:case aT:case sT:case oT:case uT:case lT:case cT:return zv(t);case Yv:return new n;case qv:case Qv:return new n(t);case Xv:return Kv(t);case Zv:return new n;case Jv:return Vv(t)}}function dT(t){return typeof t.constructor=="function"&&!Cn(t)?kg(md(t)):{}}var hT="[object Map]";function pT(t){return Fe(t)&&Ie(t)==hT}var rl=At&&At.isMap,mT=rl?da(rl):pT,gT="[object Set]";function yT(t){return Fe(t)&&Ie(t)==gT}var nl=At&&At.isSet,vT=nl?da(nl):yT,Rd="[object Arguments]",TT="[object Array]",RT="[object Boolean]",ET="[object Date]",AT="[object Error]",Ed="[object Function]",$T="[object GeneratorFunction]",kT="[object Map]",xT="[object Number]",Ad="[object Object]",bT="[object RegExp]",ST="[object Set]",wT="[object String]",IT="[object Symbol]",_T="[object WeakMap]",CT="[object ArrayBuffer]",NT="[object DataView]",OT="[object Float32Array]",LT="[object Float64Array]",PT="[object Int8Array]",MT="[object Int16Array]",DT="[object Int32Array]",jT="[object Uint8Array]",UT="[object Uint8ClampedArray]",FT="[object Uint16Array]",GT="[object Uint32Array]",U={};U[Rd]=U[TT]=U[CT]=U[NT]=U[RT]=U[ET]=U[OT]=U[LT]=U[PT]=U[MT]=U[DT]=U[kT]=U[xT]=U[Ad]=U[bT]=U[ST]=U[wT]=U[IT]=U[jT]=U[UT]=U[FT]=U[GT]=!0;U[AT]=U[Ed]=U[_T]=!1;function hi(t,e,r,n,i,a){var s;if(s!==void 0)return s;if(!Oe(t))return t;var o=M(t);if(o)return s=Uv(t),bg(t,s);var u=Ie(t),l=u==Ed||u==$T;if(Rn(t))return kv(t);if(u==Ad||u==Rd||l&&!i)return s=l?{}:dT(t),Sv(t,Av(s,t));if(!U[u])return i?t:{};s=fT(t,u),a||(a=new We);var c=a.get(t);if(c)return c;a.set(t,s),vT(t)?t.forEach(function(h){s.add(hi(h,e,r,h,t,a))}):mT(t)&&t.forEach(function(h,m){s.set(m,hi(h,e,r,m,t,a))});var f=Ks,d=o?void 0:f(t);return id(d||t,function(h,m){d&&(m=h,h=t[m]),ca(s,m,hi(h,e,r,m,t,a))}),s}var BT=4;function se(t){return hi(t,BT)}function On(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var a=t[e];a&&(i[n++]=a)}return i}var KT="__lodash_hash_undefined__";function VT(t){return this.__data__.set(t,KT),this}function zT(t){return this.__data__.has(t)}function yr(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new mt;++e<r;)this.add(t[e])}yr.prototype.add=yr.prototype.push=VT;yr.prototype.has=zT;function $d(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Zo(t,e){return t.has(e)}var HT=1,WT=2;function kd(t,e,r,n,i,a){var s=r&HT,o=t.length,u=e.length;if(o!=u&&!(s&&u>o))return!1;var l=a.get(t),c=a.get(e);if(l&&c)return l==e&&c==t;var f=-1,d=!0,h=r&WT?new yr:void 0;for(a.set(t,e),a.set(e,t);++f<o;){var m=t[f],g=e[f];if(n)var E=s?n(g,m,f,e,t,a):n(m,g,f,t,e,a);if(E!==void 0){if(E)continue;d=!1;break}if(h){if(!$d(e,function(v,R){if(!Zo(h,R)&&(m===v||i(m,v,r,n,a)))return h.push(R)})){d=!1;break}}else if(!(m===g||i(m,g,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function YT(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function Qo(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var qT=1,XT=2,ZT="[object Boolean]",QT="[object Date]",JT="[object Error]",eR="[object Map]",tR="[object Number]",rR="[object RegExp]",nR="[object Set]",iR="[object String]",aR="[object Symbol]",sR="[object ArrayBuffer]",oR="[object DataView]",il=Ne?Ne.prototype:void 0,Xa=il?il.valueOf:void 0;function uR(t,e,r,n,i,a,s){switch(r){case oR:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case sR:return!(t.byteLength!=e.byteLength||!a(new Ni(t),new Ni(e)));case ZT:case QT:case tR:return _n(+t,+e);case JT:return t.name==e.name&&t.message==e.message;case rR:case iR:return t==e+"";case eR:var o=YT;case nR:var u=n&qT;if(o||(o=Qo),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=XT,s.set(t,e);var c=kd(o(t),o(e),n,i,a,s);return s.delete(t),c;case aR:if(Xa)return Xa.call(t)==Xa.call(e)}return!1}var lR=1,cR=Object.prototype,fR=cR.hasOwnProperty;function dR(t,e,r,n,i,a){var s=r&lR,o=Ks(t),u=o.length,l=Ks(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var d=o[f];if(!(s?d in e:fR.call(e,d)))return!1}var h=a.get(t),m=a.get(e);if(h&&m)return h==e&&m==t;var g=!0;a.set(t,e),a.set(e,t);for(var E=s;++f<u;){d=o[f];var v=t[d],R=e[d];if(n)var T=s?n(R,v,d,e,t,a):n(v,R,d,t,e,a);if(!(T===void 0?v===R||i(v,R,r,n,a):T)){g=!1;break}E||(E=d=="constructor")}if(g&&!E){var $=t.constructor,P=e.constructor;$!=P&&"constructor"in t&&"constructor"in e&&!(typeof $=="function"&&$ instanceof $&&typeof P=="function"&&P instanceof P)&&(g=!1)}return a.delete(t),a.delete(e),g}var hR=1,al="[object Arguments]",sl="[object Array]",Qn="[object Object]",pR=Object.prototype,ol=pR.hasOwnProperty;function mR(t,e,r,n,i,a){var s=M(t),o=M(e),u=s?sl:Ie(t),l=o?sl:Ie(e);u=u==al?Qn:u,l=l==al?Qn:l;var c=u==Qn,f=l==Qn,d=u==l;if(d&&Rn(t)){if(!Rn(e))return!1;s=!0,c=!1}if(d&&!c)return a||(a=new We),s||Ko(t)?kd(t,e,r,n,i,a):uR(t,e,u,r,n,i,a);if(!(r&hR)){var h=c&&ol.call(t,"__wrapped__"),m=f&&ol.call(e,"__wrapped__");if(h||m){var g=h?t.value():t,E=m?e.value():e;return a||(a=new We),i(g,E,r,n,a)}}return d?(a||(a=new We),dR(t,e,r,n,i,a)):!1}function Jo(t,e,r,n,i){return t===e?!0:t==null||e==null||!Fe(t)&&!Fe(e)?t!==t&&e!==e:mR(t,e,r,n,Jo,i)}var gR=1,yR=2;function vR(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var o=s[0],u=t[o],l=s[1];if(s[2]){if(u===void 0&&!(o in t))return!1}else{var c=new We,f;if(!(f===void 0?Jo(l,u,gR|yR,n,c):f))return!1}}return!0}function xd(t){return t===t&&!Oe(t)}function TR(t){for(var e=Le(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,xd(i)]}return e}function bd(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function RR(t){var e=TR(t);return e.length==1&&e[0][2]?bd(e[0][0],e[0][1]):function(r){return r===t||vR(r,t,e)}}function ER(t,e){return t!=null&&e in Object(t)}function Sd(t,e,r){e=ma(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=Nn(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&Bo(i)&&la(s,i)&&(M(t)||fa(t)))}function AR(t,e){return t!=null&&Sd(t,e,ER)}var $R=1,kR=2;function xR(t,e){return Vo(t)&&xd(e)?bd(Nn(t),e):function(r){var n=hv(r,t);return n===void 0&&n===e?AR(r,t):Jo(e,n,$R|kR)}}function bR(t){return function(e){return e==null?void 0:e[t]}}function SR(t){return function(e){return Ho(e,t)}}function wR(t){return Vo(t)?bR(Nn(t)):SR(t)}function Ze(t){return typeof t=="function"?t:t==null?gr:typeof t=="object"?M(t)?xR(t[0],t[1]):RR(t):wR(t)}function IR(t,e,r,n){for(var i=-1,a=t==null?0:t.length;++i<a;){var s=t[i];e(n,s,r(s),t)}return n}function _R(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var u=s[++i];if(r(a[u],u,a)===!1)break}return e}}var CR=_R();function NR(t,e){return t&&CR(t,e,Le)}function OR(t,e){return function(r,n){if(r==null)return r;if(!Xe(r))return t(r,n);for(var i=r.length,a=-1,s=Object(r);++a<i&&n(s[a],a,s)!==!1;);return r}}var rr=OR(NR);function LR(t,e,r,n){return rr(t,function(i,a,s){e(n,i,r(i),s)}),n}function PR(t,e){return function(r,n){var i=M(r)?IR:LR,a={};return i(r,t,Ze(n),a)}}var wd=Object.prototype,MR=wd.hasOwnProperty,eu=Go(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&od(e[0],e[1],i)&&(n=1);++r<n;)for(var a=e[r],s=pd(a),o=-1,u=s.length;++o<u;){var l=s[o],c=t[l];(c===void 0||_n(c,wd[l])&&!MR.call(t,l))&&(t[l]=a[l])}return t});function ul(t){return Fe(t)&&Xe(t)}var DR=200;function jR(t,e,r,n){var i=-1,a=sd,s=!0,o=t.length,u=[],l=e.length;if(!o)return u;e.length>=DR&&(a=Zo,s=!1,e=new yr(e));e:for(;++i<o;){var c=t[i],f=c;if(c=c!==0?c:0,s&&f===f){for(var d=l;d--;)if(e[d]===f)continue e;u.push(c)}else a(e,f,n)||u.push(c)}return u}var ga=Go(function(t,e){return ul(t)?jR(t,Yo(e,1,ul,!0)):[]});function vr(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function re(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:ua(e),gd(t,e<0?0:e,n)):[]}function $n(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:ua(e),e=n-e,gd(t,0,e<0?0:e)):[]}function UR(t){return typeof t=="function"?t:gr}function _(t,e){var r=M(t)?id:rr;return r(t,UR(e))}function FR(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function GR(t,e){var r=!0;return rr(t,function(n,i,a){return r=!!e(n,i,a),r}),r}function Ye(t,e,r){var n=M(t)?FR:GR;return n(t,Ze(e))}function Id(t,e){var r=[];return rr(t,function(n,i,a){e(n,i,a)&&r.push(n)}),r}function Pe(t,e){var r=M(t)?qo:Id;return r(t,Ze(e))}function BR(t){return function(e,r,n){var i=Object(e);if(!Xe(e)){var a=Ze(r);e=Le(e),r=function(o){return a(i[o],o,i)}}var s=t(e,r,n);return s>-1?i[a?e[s]:s]:void 0}}var KR=Math.max;function VR(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:ua(r);return i<0&&(i=KR(n+i,0)),ad(t,Ze(e),i)}var Tr=BR(VR);function Ge(t){return t&&t.length?t[0]:void 0}function zR(t,e){var r=-1,n=Xe(t)?Array(t.length):[];return rr(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function S(t,e){var r=M(t)?oa:zR;return r(t,Ze(e))}function _e(t,e){return Yo(S(t,e))}var HR=Object.prototype,WR=HR.hasOwnProperty,YR=PR(function(t,e,r){WR.call(t,r)?t[r].push(e):Uo(t,r,[e])}),qR=Object.prototype,XR=qR.hasOwnProperty;function ZR(t,e){return t!=null&&XR.call(t,e)}function w(t,e){return t!=null&&Sd(t,e,ZR)}var QR="[object String]";function Be(t){return typeof t=="string"||!M(t)&&Fe(t)&&_t(t)==QR}function JR(t,e){return oa(e,function(r){return t[r]})}function Q(t){return t==null?[]:JR(t,Le(t))}var eE=Math.max;function ge(t,e,r,n){t=Xe(t)?t:Q(t),r=r?ua(r):0;var i=t.length;return r<0&&(r=eE(i+r,0)),Be(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&jo(t,e,r)>-1}function ll(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=0;return jo(t,e,i)}var tE="[object Map]",rE="[object Set]",nE=Object.prototype,iE=nE.hasOwnProperty;function F(t){if(t==null)return!0;if(Xe(t)&&(M(t)||typeof t=="string"||typeof t.splice=="function"||Rn(t)||Ko(t)||fa(t)))return!t.length;var e=Ie(t);if(e==tE||e==rE)return!t.size;if(Cn(t))return!hd(t).length;for(var r in t)if(iE.call(t,r))return!1;return!0}var aE="[object RegExp]";function sE(t){return Fe(t)&&_t(t)==aE}var cl=At&&At.isRegExp,$t=cl?da(cl):sE;function ct(t){return t===void 0}var oE="Expected a function";function uE(t){if(typeof t!="function")throw new TypeError(oE);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function lE(t,e,r,n){if(!Oe(t))return t;e=ma(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var u=Nn(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=o[u];l=void 0,l===void 0&&(l=Oe(c)?c:la(e[i+1])?[]:{})}ca(o,u,l),o=o[u]}return t}function cE(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=Ho(t,s);r(o,s)&&lE(a,ma(s,t),o)}return a}function fE(t,e){if(t==null)return{};var r=oa(_v(t),function(n){return[n]});return e=Ze(e),cE(t,r,function(n,i){return e(n,i[0])})}function dE(t,e,r,n,i){return i(t,function(a,s,o){r=n?(n=!1,a):e(r,a,s,o)}),r}function ke(t,e,r){var n=M(t)?mv:dE,i=arguments.length<3;return n(t,Ze(e),r,i,rr)}function ya(t,e){var r=M(t)?qo:Id;return r(t,uE(Ze(e)))}function hE(t,e){var r;return rr(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}function pE(t,e,r){var n=M(t)?$d:hE;return n(t,Ze(e))}var mE=1/0,gE=pr&&1/Qo(new pr([,-0]))[1]==mE?function(t){return new pr(t)}:Z,yE=200;function vE(t,e,r){var n=-1,i=sd,a=t.length,s=!0,o=[],u=o;if(a>=yE){var l=gE(t);if(l)return Qo(l);s=!1,i=Zo,u=new yr}else u=o;e:for(;++n<a;){var c=t[n],f=c;if(c=c!==0?c:0,s&&f===f){for(var d=u.length;d--;)if(u[d]===f)continue e;o.push(c)}else i(u,f,r)||(u!==o&&u.push(f),o.push(c))}return o}function tu(t){return t&&t.length?vE(t):[]}function Hs(t){console&&console.error&&console.error(`Error: ${t}`)}function _d(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Cd(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Nd(t){function e(){}e.prototype=t;const r=new e;function n(){return typeof r.bar}return n(),n(),t}var Od=typeof global=="object"&&global&&global.Object===Object&&global,TE=typeof self=="object"&&self&&self.Object===Object&&self,gt=Od||TE||Function("return this")(),kt=gt.Symbol,Ld=Object.prototype,RE=Ld.hasOwnProperty,EE=Ld.toString,_r=kt?kt.toStringTag:void 0;function AE(t){var e=RE.call(t,_r),r=t[_r];try{t[_r]=void 0;var n=!0}catch{}var i=EE.call(t);return n&&(e?t[_r]=r:delete t[_r]),i}var $E=Object.prototype,kE=$E.toString;function xE(t){return kE.call(t)}var bE="[object Null]",SE="[object Undefined]",fl=kt?kt.toStringTag:void 0;function Ct(t){return t==null?t===void 0?SE:bE:fl&&fl in Object(t)?AE(t):xE(t)}function xt(t){return t!=null&&typeof t=="object"}var wE="[object Symbol]";function va(t){return typeof t=="symbol"||xt(t)&&Ct(t)==wE}function Ta(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var pe=Array.isArray,dl=kt?kt.prototype:void 0,hl=dl?dl.toString:void 0;function Pd(t){if(typeof t=="string")return t;if(pe(t))return Ta(t,Pd)+"";if(va(t))return hl?hl.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var IE=/\s/;function _E(t){for(var e=t.length;e--&&IE.test(t.charAt(e)););return e}var CE=/^\s+/;function NE(t){return t&&t.slice(0,_E(t)+1).replace(CE,"")}function ft(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pl=NaN,OE=/^[-+]0x[0-9a-f]+$/i,LE=/^0b[01]+$/i,PE=/^0o[0-7]+$/i,ME=parseInt;function DE(t){if(typeof t=="number")return t;if(va(t))return pl;if(ft(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=ft(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=NE(t);var r=LE.test(t);return r||PE.test(t)?ME(t.slice(2),r?2:8):OE.test(t)?pl:+t}var ml=1/0,jE=17976931348623157e292;function UE(t){if(!t)return t===0?t:0;if(t=DE(t),t===ml||t===-ml){var e=t<0?-1:1;return e*jE}return t===t?t:0}function FE(t){var e=UE(t),r=e%1;return e===e?r?e-r:e:0}function Ra(t){return t}var GE="[object AsyncFunction]",BE="[object Function]",KE="[object GeneratorFunction]",VE="[object Proxy]";function Md(t){if(!ft(t))return!1;var e=Ct(t);return e==BE||e==KE||e==GE||e==VE}var Za=gt["__core-js_shared__"],gl=function(){var t=/[^.]+$/.exec(Za&&Za.keys&&Za.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function zE(t){return!!gl&&gl in t}var HE=Function.prototype,WE=HE.toString;function nr(t){if(t!=null){try{return WE.call(t)}catch{}try{return t+""}catch{}}return""}var YE=/[\\^$.*+?()[\]{}|]/g,qE=/^\[object .+?Constructor\]$/,XE=Function.prototype,ZE=Object.prototype,QE=XE.toString,JE=ZE.hasOwnProperty,eA=RegExp("^"+QE.call(JE).replace(YE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tA(t){if(!ft(t)||zE(t))return!1;var e=Md(t)?eA:qE;return e.test(nr(t))}function rA(t,e){return t==null?void 0:t[e]}function ir(t,e){var r=rA(t,e);return tA(r)?r:void 0}var Ws=ir(gt,"WeakMap");function nA(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var iA=800,aA=16,sA=Date.now;function oA(t){var e=0,r=0;return function(){var n=sA(),i=aA-(n-r);if(r=n,i>0){if(++e>=iA)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function uA(t){return function(){return t}}var Oi=function(){try{var t=ir(Object,"defineProperty");return t({},"",{}),t}catch{}}(),lA=Oi?function(t,e){return Oi(t,"toString",{configurable:!0,enumerable:!1,value:uA(e),writable:!0})}:Ra,cA=oA(lA);function fA(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function dA(t,e,r,n){for(var i=t.length,a=r+-1;++a<i;)if(e(t[a],a,t))return a;return-1}function hA(t){return t!==t}function pA(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function mA(t,e,r){return e===e?pA(t,e,r):dA(t,hA,r)}var gA=9007199254740991,yA=/^(?:0|[1-9]\d*)$/;function Ea(t,e){var r=typeof t;return e=e??gA,!!e&&(r=="number"||r!="symbol"&&yA.test(t))&&t>-1&&t%1==0&&t<e}function Dd(t,e,r){e=="__proto__"&&Oi?Oi(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Aa(t,e){return t===e||t!==t&&e!==e}var vA=Object.prototype,TA=vA.hasOwnProperty;function ru(t,e,r){var n=t[e];(!(TA.call(t,e)&&Aa(n,r))||r===void 0&&!(e in t))&&Dd(t,e,r)}function RA(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],u=void 0;u===void 0&&(u=t[o]),i?Dd(r,o,u):ru(r,o,u)}return r}var yl=Math.max;function EA(t,e,r){return e=yl(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=yl(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),nA(t,this,o)}}function AA(t,e){return cA(EA(t,e,Ra),t+"")}var $A=9007199254740991;function nu(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$A}function ar(t){return t!=null&&nu(t.length)&&!Md(t)}function kA(t,e,r){if(!ft(r))return!1;var n=typeof e;return(n=="number"?ar(r)&&Ea(e,r.length):n=="string"&&e in r)?Aa(r[e],t):!1}function xA(t){return AA(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&kA(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}var bA=Object.prototype;function iu(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||bA;return t===r}function SA(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var wA="[object Arguments]";function vl(t){return xt(t)&&Ct(t)==wA}var jd=Object.prototype,IA=jd.hasOwnProperty,_A=jd.propertyIsEnumerable,Ud=vl(function(){return arguments}())?vl:function(t){return xt(t)&&IA.call(t,"callee")&&!_A.call(t,"callee")};function CA(){return!1}var Fd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tl=Fd&&typeof module=="object"&&module&&!module.nodeType&&module,NA=Tl&&Tl.exports===Fd,Rl=NA?gt.Buffer:void 0,OA=Rl?Rl.isBuffer:void 0,Ys=OA||CA,LA="[object Arguments]",PA="[object Array]",MA="[object Boolean]",DA="[object Date]",jA="[object Error]",UA="[object Function]",FA="[object Map]",GA="[object Number]",BA="[object Object]",KA="[object RegExp]",VA="[object Set]",zA="[object String]",HA="[object WeakMap]",WA="[object ArrayBuffer]",YA="[object DataView]",qA="[object Float32Array]",XA="[object Float64Array]",ZA="[object Int8Array]",QA="[object Int16Array]",JA="[object Int32Array]",e$="[object Uint8Array]",t$="[object Uint8ClampedArray]",r$="[object Uint16Array]",n$="[object Uint32Array]",B={};B[qA]=B[XA]=B[ZA]=B[QA]=B[JA]=B[e$]=B[t$]=B[r$]=B[n$]=!0;B[LA]=B[PA]=B[WA]=B[MA]=B[YA]=B[DA]=B[jA]=B[UA]=B[FA]=B[GA]=B[BA]=B[KA]=B[VA]=B[zA]=B[HA]=!1;function i$(t){return xt(t)&&nu(t.length)&&!!B[Ct(t)]}function Gd(t){return function(e){return t(e)}}var Bd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yn=Bd&&typeof module=="object"&&module&&!module.nodeType&&module,a$=yn&&yn.exports===Bd,Qa=a$&&Od.process,Li=function(){try{var t=yn&&yn.require&&yn.require("util").types;return t||Qa&&Qa.binding&&Qa.binding("util")}catch{}}(),El=Li&&Li.isTypedArray,Kd=El?Gd(El):i$,s$=Object.prototype,o$=s$.hasOwnProperty;function Vd(t,e){var r=pe(t),n=!r&&Ud(t),i=!r&&!n&&Ys(t),a=!r&&!n&&!i&&Kd(t),s=r||n||i||a,o=s?SA(t.length,String):[],u=o.length;for(var l in t)(e||o$.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Ea(l,u)))&&o.push(l);return o}function zd(t,e){return function(r){return t(e(r))}}var u$=zd(Object.keys,Object),l$=Object.prototype,c$=l$.hasOwnProperty;function f$(t){if(!iu(t))return u$(t);var e=[];for(var r in Object(t))c$.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ln(t){return ar(t)?Vd(t):f$(t)}var d$=Object.prototype,h$=d$.hasOwnProperty,Qe=xA(function(t,e){if(iu(e)||ar(e)){RA(e,Ln(e),t);return}for(var r in e)h$.call(e,r)&&ru(t,r,e[r])});function p$(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var m$=Object.prototype,g$=m$.hasOwnProperty;function y$(t){if(!ft(t))return p$(t);var e=iu(t),r=[];for(var n in t)n=="constructor"&&(e||!g$.call(t,n))||r.push(n);return r}function v$(t){return ar(t)?Vd(t,!0):y$(t)}var T$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R$=/^\w*$/;function au(t,e){if(pe(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||va(t)?!0:R$.test(t)||!T$.test(t)||e!=null&&t in Object(e)}var kn=ir(Object,"create");function E$(){this.__data__=kn?kn(null):{},this.size=0}function A$(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var $$="__lodash_hash_undefined__",k$=Object.prototype,x$=k$.hasOwnProperty;function b$(t){var e=this.__data__;if(kn){var r=e[t];return r===$$?void 0:r}return x$.call(e,t)?e[t]:void 0}var S$=Object.prototype,w$=S$.hasOwnProperty;function I$(t){var e=this.__data__;return kn?e[t]!==void 0:w$.call(e,t)}var _$="__lodash_hash_undefined__";function C$(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=kn&&e===void 0?_$:e,this}function qt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}qt.prototype.clear=E$;qt.prototype.delete=A$;qt.prototype.get=b$;qt.prototype.has=I$;qt.prototype.set=C$;function N$(){this.__data__=[],this.size=0}function $a(t,e){for(var r=t.length;r--;)if(Aa(t[r][0],e))return r;return-1}var O$=Array.prototype,L$=O$.splice;function P$(t){var e=this.__data__,r=$a(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():L$.call(e,r,1),--this.size,!0}function M$(t){var e=this.__data__,r=$a(e,t);return r<0?void 0:e[r][1]}function D$(t){return $a(this.__data__,t)>-1}function j$(t,e){var r=this.__data__,n=$a(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function yt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}yt.prototype.clear=N$;yt.prototype.delete=P$;yt.prototype.get=M$;yt.prototype.has=D$;yt.prototype.set=j$;var xn=ir(gt,"Map");function U$(){this.size=0,this.__data__={hash:new qt,map:new(xn||yt),string:new qt}}function F$(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ka(t,e){var r=t.__data__;return F$(e)?r[typeof e=="string"?"string":"hash"]:r.map}function G$(t){var e=ka(this,t).delete(t);return this.size-=e?1:0,e}function B$(t){return ka(this,t).get(t)}function K$(t){return ka(this,t).has(t)}function V$(t,e){var r=ka(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function vt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}vt.prototype.clear=U$;vt.prototype.delete=G$;vt.prototype.get=B$;vt.prototype.has=K$;vt.prototype.set=V$;var z$="Expected a function";function su(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(z$);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(su.Cache||vt),r}su.Cache=vt;var H$=500;function W$(t){var e=su(t,function(n){return r.size===H$&&r.clear(),n}),r=e.cache;return e}var Y$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q$=/\\(\\)?/g,X$=W$(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Y$,function(r,n,i,a){e.push(i?a.replace(q$,"$1"):n||r)}),e});function Z$(t){return t==null?"":Pd(t)}function xa(t,e){return pe(t)?t:au(t,e)?[t]:X$(Z$(t))}function Pn(t){if(typeof t=="string"||va(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ou(t,e){e=xa(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Pn(e[r++])];return r&&r==n?t:void 0}function Q$(t,e,r){var n=t==null?void 0:ou(t,e);return n===void 0?r:n}function Hd(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var J$=zd(Object.getPrototypeOf,Object);function ek(){this.__data__=new yt,this.size=0}function tk(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function rk(t){return this.__data__.get(t)}function nk(t){return this.__data__.has(t)}var ik=200;function ak(t,e){var r=this.__data__;if(r instanceof yt){var n=r.__data__;if(!xn||n.length<ik-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new vt(n)}return r.set(t,e),this.size=r.size,this}function lt(t){var e=this.__data__=new yt(t);this.size=e.size}lt.prototype.clear=ek;lt.prototype.delete=tk;lt.prototype.get=rk;lt.prototype.has=nk;lt.prototype.set=ak;function sk(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}function Wd(){return[]}var ok=Object.prototype,uk=ok.propertyIsEnumerable,Al=Object.getOwnPropertySymbols,Yd=Al?function(t){return t==null?[]:(t=Object(t),sk(Al(t),function(e){return uk.call(t,e)}))}:Wd,lk=Object.getOwnPropertySymbols,ck=lk?function(t){for(var e=[];t;)Hd(e,Yd(t)),t=J$(t);return e}:Wd;function qd(t,e,r){var n=e(t);return pe(t)?n:Hd(n,r(t))}function $l(t){return qd(t,Ln,Yd)}function fk(t){return qd(t,v$,ck)}var qs=ir(gt,"DataView"),Xs=ir(gt,"Promise"),Zs=ir(gt,"Set"),kl="[object Map]",dk="[object Object]",xl="[object Promise]",bl="[object Set]",Sl="[object WeakMap]",wl="[object DataView]",hk=nr(qs),pk=nr(xn),mk=nr(Xs),gk=nr(Zs),yk=nr(Ws),Rt=Ct;(qs&&Rt(new qs(new ArrayBuffer(1)))!=wl||xn&&Rt(new xn)!=kl||Xs&&Rt(Xs.resolve())!=xl||Zs&&Rt(new Zs)!=bl||Ws&&Rt(new Ws)!=Sl)&&(Rt=function(t){var e=Ct(t),r=e==dk?t.constructor:void 0,n=r?nr(r):"";if(n)switch(n){case hk:return wl;case pk:return kl;case mk:return xl;case gk:return bl;case yk:return Sl}return e});var Il=gt.Uint8Array,vk="__lodash_hash_undefined__";function Tk(t){return this.__data__.set(t,vk),this}function Rk(t){return this.__data__.has(t)}function Pi(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new vt;++e<r;)this.add(t[e])}Pi.prototype.add=Pi.prototype.push=Tk;Pi.prototype.has=Rk;function Xd(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Ek(t,e){return t.has(e)}var Ak=1,$k=2;function Zd(t,e,r,n,i,a){var s=r&Ak,o=t.length,u=e.length;if(o!=u&&!(s&&u>o))return!1;var l=a.get(t),c=a.get(e);if(l&&c)return l==e&&c==t;var f=-1,d=!0,h=r&$k?new Pi:void 0;for(a.set(t,e),a.set(e,t);++f<o;){var m=t[f],g=e[f];if(n)var E=s?n(g,m,f,e,t,a):n(m,g,f,t,e,a);if(E!==void 0){if(E)continue;d=!1;break}if(h){if(!Xd(e,function(v,R){if(!Ek(h,R)&&(m===v||i(m,v,r,n,a)))return h.push(R)})){d=!1;break}}else if(!(m===g||i(m,g,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function kk(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function xk(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var bk=1,Sk=2,wk="[object Boolean]",Ik="[object Date]",_k="[object Error]",Ck="[object Map]",Nk="[object Number]",Ok="[object RegExp]",Lk="[object Set]",Pk="[object String]",Mk="[object Symbol]",Dk="[object ArrayBuffer]",jk="[object DataView]",_l=kt?kt.prototype:void 0,Ja=_l?_l.valueOf:void 0;function Uk(t,e,r,n,i,a,s){switch(r){case jk:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Dk:return!(t.byteLength!=e.byteLength||!a(new Il(t),new Il(e)));case wk:case Ik:case Nk:return Aa(+t,+e);case _k:return t.name==e.name&&t.message==e.message;case Ok:case Pk:return t==e+"";case Ck:var o=kk;case Lk:var u=n&bk;if(o||(o=xk),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=Sk,s.set(t,e);var c=Zd(o(t),o(e),n,i,a,s);return s.delete(t),c;case Mk:if(Ja)return Ja.call(t)==Ja.call(e)}return!1}var Fk=1,Gk=Object.prototype,Bk=Gk.hasOwnProperty;function Kk(t,e,r,n,i,a){var s=r&Fk,o=$l(t),u=o.length,l=$l(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var d=o[f];if(!(s?d in e:Bk.call(e,d)))return!1}var h=a.get(t),m=a.get(e);if(h&&m)return h==e&&m==t;var g=!0;a.set(t,e),a.set(e,t);for(var E=s;++f<u;){d=o[f];var v=t[d],R=e[d];if(n)var T=s?n(R,v,d,e,t,a):n(v,R,d,t,e,a);if(!(T===void 0?v===R||i(v,R,r,n,a):T)){g=!1;break}E||(E=d=="constructor")}if(g&&!E){var $=t.constructor,P=e.constructor;$!=P&&"constructor"in t&&"constructor"in e&&!(typeof $=="function"&&$ instanceof $&&typeof P=="function"&&P instanceof P)&&(g=!1)}return a.delete(t),a.delete(e),g}var Vk=1,Cl="[object Arguments]",Nl="[object Array]",Jn="[object Object]",zk=Object.prototype,Ol=zk.hasOwnProperty;function Hk(t,e,r,n,i,a){var s=pe(t),o=pe(e),u=s?Nl:Rt(t),l=o?Nl:Rt(e);u=u==Cl?Jn:u,l=l==Cl?Jn:l;var c=u==Jn,f=l==Jn,d=u==l;if(d&&Ys(t)){if(!Ys(e))return!1;s=!0,c=!1}if(d&&!c)return a||(a=new lt),s||Kd(t)?Zd(t,e,r,n,i,a):Uk(t,e,u,r,n,i,a);if(!(r&Vk)){var h=c&&Ol.call(t,"__wrapped__"),m=f&&Ol.call(e,"__wrapped__");if(h||m){var g=h?t.value():t,E=m?e.value():e;return a||(a=new lt),i(g,E,r,n,a)}}return d?(a||(a=new lt),Kk(t,e,r,n,i,a)):!1}function uu(t,e,r,n,i){return t===e?!0:t==null||e==null||!xt(t)&&!xt(e)?t!==t&&e!==e:Hk(t,e,r,n,uu,i)}var Wk=1,Yk=2;function qk(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var o=s[0],u=t[o],l=s[1];if(s[2]){if(u===void 0&&!(o in t))return!1}else{var c=new lt,f;if(!(f===void 0?uu(l,u,Wk|Yk,n,c):f))return!1}}return!0}function Qd(t){return t===t&&!ft(t)}function Xk(t){for(var e=Ln(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Qd(i)]}return e}function Jd(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Zk(t){var e=Xk(t);return e.length==1&&e[0][2]?Jd(e[0][0],e[0][1]):function(r){return r===t||qk(r,t,e)}}function Qk(t,e){return t!=null&&e in Object(t)}function Jk(t,e,r){e=xa(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=Pn(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&nu(i)&&Ea(s,i)&&(pe(t)||Ud(t)))}function ex(t,e){return t!=null&&Jk(t,e,Qk)}var tx=1,rx=2;function nx(t,e){return au(t)&&Qd(e)?Jd(Pn(t),e):function(r){var n=Q$(r,t);return n===void 0&&n===e?ex(r,t):uu(e,n,tx|rx)}}function ix(t){return function(e){return e==null?void 0:e[t]}}function ax(t){return function(e){return ou(e,t)}}function sx(t){return au(t)?ix(Pn(t)):ax(t)}function ba(t){return typeof t=="function"?t:t==null?Ra:typeof t=="object"?pe(t)?nx(t[0],t[1]):Zk(t):sx(t)}function ox(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var u=s[++i];if(r(a[u],u,a)===!1)break}return e}}var ux=ox();function lx(t,e){return t&&ux(t,e,Ln)}function cx(t,e){return function(r,n){if(r==null)return r;if(!ar(r))return t(r,n);for(var i=r.length,a=-1,s=Object(r);++a<i&&n(s[a],a,s)!==!1;);return r}}var Sa=cx(lx);function fx(t){return typeof t=="function"?t:Ra}function dx(t,e){var r=pe(t)?fA:Sa;return r(t,fx(e))}function hx(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function px(t,e){var r=!0;return Sa(t,function(n,i,a){return r=!!e(n,i,a),r}),r}function mx(t,e,r){var n=pe(t)?hx:px;return n(t,ba(e))}function gx(t,e){var r=-1,n=ar(t)?Array(t.length):[];return Sa(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function eh(t,e){var r=pe(t)?Ta:gx;return r(t,ba(e))}var yx="[object String]";function Mi(t){return typeof t=="string"||!pe(t)&&xt(t)&&Ct(t)==yx}function vx(t,e){return Ta(e,function(r){return t[r]})}function Tx(t){return t==null?[]:vx(t,Ln(t))}var Rx=Math.max;function Ex(t,e,r,n){t=ar(t)?t:Tx(t),r=r?FE(r):0;var i=t.length;return r<0&&(r=Rx(i+r,0)),Mi(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&mA(t,e,r)>-1}var Ax="[object RegExp]";function $x(t){return xt(t)&&Ct(t)==Ax}var Ll=Li&&Li.isRegExp,kx=Ll?Gd(Ll):$x;function xx(t,e,r,n){if(!ft(t))return t;e=xa(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var u=Pn(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=o[u];l=void 0,l===void 0&&(l=ft(c)?c:Ea(e[i+1])?[]:{})}ru(o,u,l),o=o[u]}return t}function bx(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=ou(t,s);r(o,s)&&xx(a,xa(s,t),o)}return a}function Je(t,e){if(t==null)return{};var r=Ta(fk(t),function(n){return[n]});return e=ba(e),bx(t,r,function(n,i){return e(n,i[0])})}function Sx(t,e){var r;return Sa(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}function wx(t,e,r){var n=pe(t)?Xd:Sx;return n(t,ba(e))}function Ix(t){return _x(t)?t.LABEL:t.name}function _x(t){return Mi(t.LABEL)&&t.LABEL!==""}class et{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),dx(this.definition,r=>{r.accept(e)})}}class fe extends et{constructor(e){super([]),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class xr extends et{constructor(e){super(e.definition),this.orgText="",Qe(this,Je(e,r=>r!==void 0))}}class me extends et{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Qe(this,Je(e,r=>r!==void 0))}}let ae=class extends et{constructor(t){super(t.definition),this.idx=1,Qe(this,Je(t,e=>e!==void 0))}};class xe extends et{constructor(e){super(e.definition),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}}class be extends et{constructor(e){super(e.definition),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}}class Y extends et{constructor(e){super(e.definition),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}}class ye extends et{constructor(e){super(e.definition),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}}class ve extends et{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Qe(this,Je(e,r=>r!==void 0))}}class K{constructor(e){this.idx=1,Qe(this,Je(e,r=>r!==void 0))}accept(e){e.visit(this)}}function Cx(t){return eh(t,pi)}function pi(t){function e(r){return eh(r,pi)}if(t instanceof fe){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Mi(t.label)&&(r.label=t.label),r}else{if(t instanceof me)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ae)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof xe)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof be)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:pi(new K({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ye)return{type:"RepetitionWithSeparator",idx:t.idx,separator:pi(new K({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Y)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ve)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof K){const r={type:"Terminal",name:t.terminalType.name,label:Ix(t.terminalType),idx:t.idx};Mi(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=kx(n)?n.source:n),r}else{if(t instanceof xr)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class br{visit(e){const r=e;switch(r.constructor){case fe:return this.visitNonTerminal(r);case me:return this.visitAlternative(r);case ae:return this.visitOption(r);case xe:return this.visitRepetitionMandatory(r);case be:return this.visitRepetitionMandatoryWithSeparator(r);case ye:return this.visitRepetitionWithSeparator(r);case Y:return this.visitRepetition(r);case ve:return this.visitAlternation(r);case K:return this.visitTerminal(r);case xr:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Nx(t){return t instanceof me||t instanceof ae||t instanceof Y||t instanceof xe||t instanceof be||t instanceof ye||t instanceof K||t instanceof xr}function Di(t,e=[]){return t instanceof ae||t instanceof Y||t instanceof ye?!0:t instanceof ve?wx(t.definition,r=>Di(r,e)):t instanceof fe&&Ex(e,t)?!1:t instanceof et?(t instanceof fe&&e.push(t),mx(t.definition,r=>Di(r,e))):!1}function Ox(t){return t instanceof ve}function ze(t){if(t instanceof fe)return"SUBRULE";if(t instanceof ae)return"OPTION";if(t instanceof ve)return"OR";if(t instanceof xe)return"AT_LEAST_ONE";if(t instanceof be)return"AT_LEAST_ONE_SEP";if(t instanceof ye)return"MANY_SEP";if(t instanceof Y)return"MANY";if(t instanceof K)return"CONSUME";throw Error("non exhaustive match")}class wa{walk(e,r=[]){_(e.definition,(n,i)=>{const a=re(e.definition,i+1);if(n instanceof fe)this.walkProdRef(n,a,r);else if(n instanceof K)this.walkTerminal(n,a,r);else if(n instanceof me)this.walkFlat(n,a,r);else if(n instanceof ae)this.walkOption(n,a,r);else if(n instanceof xe)this.walkAtLeastOne(n,a,r);else if(n instanceof be)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ye)this.walkManySep(n,a,r);else if(n instanceof Y)this.walkMany(n,a,r);else if(n instanceof ve)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new ae({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=Pl(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new ae({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=Pl(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);_(e.definition,a=>{const s=new me({definition:[a]});this.walk(s,i)})}}function Pl(t,e,r){return[new ae({definition:[new K({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Mn(t){if(t instanceof fe)return Mn(t.referencedRule);if(t instanceof K)return Mx(t);if(Nx(t))return Lx(t);if(Ox(t))return Px(t);throw Error("non exhaustive match")}function Lx(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=Di(a),e=e.concat(Mn(a)),n=n+1,i=r.length>n;return tu(e)}function Px(t){const e=S(t.definition,r=>Mn(r));return tu(Ue(e))}function Mx(t){return[t.terminalType]}const th="_~IN~_";class Dx extends wa{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=Ux(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new me({definition:a}),o=Mn(s);this.follows[i]=o}}function jx(t){const e={};return _(t,r=>{const n=new Dx(r).startWalking();Bs(e,n)}),e}function Ux(t,e){return t.name+e+th}let mi={};const Fx=new Wf;function Ia(t){const e=t.toString();if(mi.hasOwnProperty(e))return mi[e];{const r=Fx.pattern(e);return mi[e]=r,r}}function Gx(){mi={}}const rh="Complement Sets are not supported for first char optimization",ji=`Unable to use "first char" lexer optimizations:
|
|
11
|
+
`.match(n)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const za=new Tm;function Rm(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),za.reset(t),za.visit(vm.pattern(t)),za.multiline}catch{return!1}}const Em=`\f
|
|
12
|
+
\r \v \u2028\u2029 \uFEFF`.split("");function Us(t){const e=typeof t=="string"?new RegExp(t):t;return Em.some(r=>e.test(r))}function aa(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Am(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:aa(e)).join("")}function $m(t,e){const r=km(t),n=e.match(r);return!!n&&n[0].length>0}function km(t){typeof t=="string"&&(t=new RegExp(t));const e=t,r=t.source;let n=0;function i(){let a="",s;function o(l){a+=r.substr(n,l),n+=l}function u(l){a+="(?:"+r.substr(n,l)+"|$)",n+=l}for(;n<r.length;)switch(r[n]){case"\\":switch(r[n+1]){case"c":u(3);break;case"x":u(4);break;case"u":e.unicode?r[n+2]==="{"?u(r.indexOf("}",n)-n+1):u(6):u(2);break;case"p":case"P":e.unicode?u(r.indexOf("}",n)-n+1):u(2);break;case"k":u(r.indexOf(">",n)-n+1);break;default:u(2);break}break;case"[":s=/\[(?:\\.|.)*?\]/g,s.lastIndex=n,s=s.exec(r)||[],u(s[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":s=/\{\d+,?\d*\}/g,s.lastIndex=n,s=s.exec(r),s?o(s[0].length):u(1);break;case"(":if(r[n+1]==="?")switch(r[n+2]){case":":a+="(?:",n+=3,a+=i()+"|$)";break;case"=":a+="(?=",n+=3,a+=i()+")";break;case"!":s=n,n+=3,i(),a+=r.substr(s,n-s);break;case"<":switch(r[n+3]){case"=":case"!":s=n,n+=4,i(),a+=r.substr(s,n-s);break;default:o(r.indexOf(">",n)-n+1),a+=i()+"|$)";break}break}else o(1),a+=i()+"|$)";break;case")":return++n,a;default:u(1);break}return a}return new RegExp(i(),t.flags)}function xm(t){return t.rules.find(e=>Ce(e)&&e.entry)}function bm(t){return t.rules.filter(e=>Jt(e)&&e.hidden)}function Yf(t,e){const r=new Set,n=xm(t);if(!n)return new Set(t.rules);const i=[n].concat(bm(t));for(const s of i)qf(s,r,e);const a=new Set;for(const s of t.rules)(r.has(s.name)||Jt(s)&&s.hidden)&&a.add(s);return a}function qf(t,e,r){e.add(t.name),In(t).forEach(n=>{if(Wt(n)||r){const i=n.rule.ref;i&&!e.has(i.name)&&qf(i,e,r)}})}function Sm(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Zf(t.type.ref);return e==null?void 0:e.terminal}}function wm(t){return t.hidden&&!Us(Mo(t))}function Im(t,e){return!t||!e?[]:Oo(t,e,t.astNode,!0)}function Xf(t,e,r){if(!t||!e)return;const n=Oo(t,e,t.astNode,!0);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Oo(t,e,r,n){if(!n){const i=na(t.grammarSource,Ht);if(i&&i.feature===e)return[t]}return Tn(t)&&t.astNode===r?t.content.flatMap(i=>Oo(i,e,r,!1)):[]}function _m(t,e,r){if(!t)return;const n=Cm(t,e,t==null?void 0:t.astNode);if(n.length!==0)return r!==void 0?r=Math.max(0,Math.min(r,n.length-1)):r=0,n[r]}function Cm(t,e,r){if(t.astNode!==r)return[];if(zt(t.grammarSource)&&t.grammarSource.value===e)return[t];const n=Ds(t).iterator();let i;const a=[];do if(i=n.next(),!i.done){const s=i.value;s.astNode===r?zt(s.grammarSource)&&s.grammarSource.value===e&&a.push(s):n.prune()}while(!i.done);return a}function Nm(t){var e;const r=t.astNode;for(;r===((e=t.container)===null||e===void 0?void 0:e.astNode);){const n=na(t.grammarSource,Ht);if(n)return n;t=t.container}}function Zf(t){let e=t;return Ff(e)&&(ra(e.$container)?e=e.$container.$container:Ce(e.$container)?e=e.$container:wn(e.$container)),Qf(t,e,new Map)}function Qf(t,e,r){var n;function i(a,s){let o;return na(a,Ht)||(o=Qf(s,s,r)),r.set(t,o),o}if(r.has(t))return r.get(t);r.set(t,void 0);for(const a of In(e)){if(Ht(a)&&a.feature.toLowerCase()==="name")return r.set(t,a),a;if(Wt(a)&&Ce(a.rule.ref))return i(a,a.rule.ref);if(rm(a)&&!((n=a.typeRef)===null||n===void 0)&&n.ref)return i(a,a.typeRef.ref)}}function Jf(t){return ed(t,new Set)}function ed(t,e){if(e.has(t))return!0;e.add(t);for(const r of In(t))if(Wt(r)){if(!r.rule.ref||Ce(r.rule.ref)&&!ed(r.rule.ref,e))return!1}else if(Ht(r)||ra(r))return!1;return!!t.definition}function Lo(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e&&(Ce(e)||Uf(e)||Gf(e)))return e.name}}function Po(t){var e;if(Ce(t))return Jf(t)?t.name:(e=Lo(t))!==null&&e!==void 0?e:t.name;if(Uf(t)||Gf(t)||tm(t))return t.name;if(ra(t)){const r=Om(t);if(r)return r}else if(Ff(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function Om(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return Po(t.type.ref)}function Lm(t){var e,r,n;return Jt(t)?(r=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&r!==void 0?r:"string":(n=Lo(t))!==null&&n!==void 0?n:t.name}function Mo(t){const e={s:!1,i:!1,u:!1},r=kr(t.definition,e),n=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(r,n)}const Do=/[\s\S]/.source;function kr(t,e){if(om(t))return Pm(t);if(um(t))return Mm(t);if(nm(t))return Fm(t);if(lm(t)){const r=t.rule.ref;if(!r)throw new Error("Missing rule reference.");return ut(kr(r.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(am(t))return jm(t);if(cm(t))return Dm(t);if(sm(t)){const r=t.regex.lastIndexOf("/"),n=t.regex.substring(1,r),i=t.regex.substring(r+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ut(n,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(fm(t))return ut(Do,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t==null?void 0:t.$type}`)}}}function Pm(t){return ut(t.elements.map(e=>kr(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function Mm(t){return ut(t.elements.map(e=>kr(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function Dm(t){return ut(`${Do}*?${kr(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function jm(t){return ut(`(?!${kr(t.terminal)})${Do}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function Fm(t){return t.right?ut(`[${Wa(t.left)}-${Wa(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ut(Wa(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function Wa(t){return aa(t.value)}function ut(t,e){var r;return(e.wrap!==!1||e.lookahead)&&(t=`(${(r=e.lookahead)!==null&&r!==void 0?r:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}function Um(t){const e=[],r=t.Grammar;for(const n of r.rules)Jt(n)&&wm(n)&&Rm(Mo(n))&&e.push(n.name);return{multilineCommentRules:e,nameRegexp:zp}}var td=typeof global=="object"&&global&&global.Object===Object&&global,Gm=typeof self=="object"&&self&&self.Object===Object&&self,qe=td||Gm||Function("return this")(),Ne=qe.Symbol,rd=Object.prototype,Bm=rd.hasOwnProperty,Km=rd.toString,Ir=Ne?Ne.toStringTag:void 0;function Vm(t){var e=Bm.call(t,Ir),r=t[Ir];try{t[Ir]=void 0;var n=!0}catch{}var i=Km.call(t);return n&&(e?t[Ir]=r:delete t[Ir]),i}var Hm=Object.prototype,zm=Hm.toString;function Wm(t){return zm.call(t)}var Ym="[object Null]",qm="[object Undefined]",Nu=Ne?Ne.toStringTag:void 0;function _t(t){return t==null?t===void 0?qm:Ym:Nu&&Nu in Object(t)?Vm(t):Wm(t)}function Ue(t){return t!=null&&typeof t=="object"}var Xm="[object Symbol]";function sa(t){return typeof t=="symbol"||Ue(t)&&_t(t)==Xm}function oa(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var M=Array.isArray,Ou=Ne?Ne.prototype:void 0,Lu=Ou?Ou.toString:void 0;function nd(t){if(typeof t=="string")return t;if(M(t))return oa(t,nd)+"";if(sa(t))return Lu?Lu.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var Zm=/\s/;function Qm(t){for(var e=t.length;e--&&Zm.test(t.charAt(e)););return e}var Jm=/^\s+/;function eg(t){return t&&t.slice(0,Qm(t)+1).replace(Jm,"")}function Oe(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Pu=NaN,tg=/^[-+]0x[0-9a-f]+$/i,rg=/^0b[01]+$/i,ng=/^0o[0-7]+$/i,ig=parseInt;function ag(t){if(typeof t=="number")return t;if(sa(t))return Pu;if(Oe(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Oe(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=eg(t);var r=rg.test(t);return r||ng.test(t)?ig(t.slice(2),r?2:8):tg.test(t)?Pu:+t}var Mu=1/0,sg=17976931348623157e292;function og(t){if(!t)return t===0?t:0;if(t=ag(t),t===Mu||t===-Mu){var e=t<0?-1:1;return e*sg}return t===t?t:0}function ua(t){var e=og(t),r=e%1;return e===e?r?e-r:e:0}function gr(t){return t}var ug="[object AsyncFunction]",lg="[object Function]",cg="[object GeneratorFunction]",fg="[object Proxy]";function ht(t){if(!Oe(t))return!1;var e=_t(t);return e==lg||e==cg||e==ug||e==fg}var Ya=qe["__core-js_shared__"],Du=function(){var t=/[^.]+$/.exec(Ya&&Ya.keys&&Ya.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function dg(t){return!!Du&&Du in t}var hg=Function.prototype,pg=hg.toString;function er(t){if(t!=null){try{return pg.call(t)}catch{}try{return t+""}catch{}}return""}var mg=/[\\^$.*+?()[\]{}|]/g,gg=/^\[object .+?Constructor\]$/,yg=Function.prototype,vg=Object.prototype,Tg=yg.toString,Rg=vg.hasOwnProperty,Eg=RegExp("^"+Tg.call(Rg).replace(mg,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ag(t){if(!Oe(t)||dg(t))return!1;var e=ht(t)?Eg:gg;return e.test(er(t))}function $g(t,e){return t==null?void 0:t[e]}function tr(t,e){var r=$g(t,e);return Ag(r)?r:void 0}var Gs=tr(qe,"WeakMap"),ju=Object.create,kg=function(){function t(){}return function(e){if(!Oe(e))return{};if(ju)return ju(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();function xg(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Z(){}function bg(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var Sg=800,wg=16,Ig=Date.now;function _g(t){var e=0,r=0;return function(){var n=Ig(),i=wg-(n-r);if(r=n,i>0){if(++e>=Sg)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Cg(t){return function(){return t}}var Ci=function(){try{var t=tr(Object,"defineProperty");return t({},"",{}),t}catch{}}(),Ng=Ci?function(t,e){return Ci(t,"toString",{configurable:!0,enumerable:!1,value:Cg(e),writable:!0})}:gr,Og=_g(Ng);function id(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function ad(t,e,r,n){for(var i=t.length,a=r+-1;++a<i;)if(e(t[a],a,t))return a;return-1}function Lg(t){return t!==t}function Pg(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function jo(t,e,r){return e===e?Pg(t,e,r):ad(t,Lg,r)}function sd(t,e){var r=t==null?0:t.length;return!!r&&jo(t,e,0)>-1}var Mg=9007199254740991,Dg=/^(?:0|[1-9]\d*)$/;function la(t,e){var r=typeof t;return e=e??Mg,!!e&&(r=="number"||r!="symbol"&&Dg.test(t))&&t>-1&&t%1==0&&t<e}function Fo(t,e,r){e=="__proto__"&&Ci?Ci(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function _n(t,e){return t===e||t!==t&&e!==e}var jg=Object.prototype,Fg=jg.hasOwnProperty;function ca(t,e,r){var n=t[e];(!(Fg.call(t,e)&&_n(n,r))||r===void 0&&!(e in t))&&Fo(t,e,r)}function Uo(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],u=void 0;u===void 0&&(u=t[o]),i?Fo(r,o,u):ca(r,o,u)}return r}var Fu=Math.max;function Ug(t,e,r){return e=Fu(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=Fu(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),xg(t,this,o)}}function Go(t,e){return Og(Ug(t,e,gr),t+"")}var Gg=9007199254740991;function Bo(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Gg}function Xe(t){return t!=null&&Bo(t.length)&&!ht(t)}function od(t,e,r){if(!Oe(r))return!1;var n=typeof e;return(n=="number"?Xe(r)&&la(e,r.length):n=="string"&&e in r)?_n(r[e],t):!1}function Bg(t){return Go(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&od(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}var Kg=Object.prototype;function Cn(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Kg;return t===r}function Vg(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Hg="[object Arguments]";function Uu(t){return Ue(t)&&_t(t)==Hg}var ud=Object.prototype,zg=ud.hasOwnProperty,Wg=ud.propertyIsEnumerable,fa=Uu(function(){return arguments}())?Uu:function(t){return Ue(t)&&zg.call(t,"callee")&&!Wg.call(t,"callee")};function Yg(){return!1}var ld=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Gu=ld&&typeof module=="object"&&module&&!module.nodeType&&module,qg=Gu&&Gu.exports===ld,Bu=qg?qe.Buffer:void 0,Xg=Bu?Bu.isBuffer:void 0,Rn=Xg||Yg,Zg="[object Arguments]",Qg="[object Array]",Jg="[object Boolean]",ey="[object Date]",ty="[object Error]",ry="[object Function]",ny="[object Map]",iy="[object Number]",ay="[object Object]",sy="[object RegExp]",oy="[object Set]",uy="[object String]",ly="[object WeakMap]",cy="[object ArrayBuffer]",fy="[object DataView]",dy="[object Float32Array]",hy="[object Float64Array]",py="[object Int8Array]",my="[object Int16Array]",gy="[object Int32Array]",yy="[object Uint8Array]",vy="[object Uint8ClampedArray]",Ty="[object Uint16Array]",Ry="[object Uint32Array]",G={};G[dy]=G[hy]=G[py]=G[my]=G[gy]=G[yy]=G[vy]=G[Ty]=G[Ry]=!0;G[Zg]=G[Qg]=G[cy]=G[Jg]=G[fy]=G[ey]=G[ty]=G[ry]=G[ny]=G[iy]=G[ay]=G[sy]=G[oy]=G[uy]=G[ly]=!1;function Ey(t){return Ue(t)&&Bo(t.length)&&!!G[_t(t)]}function da(t){return function(e){return t(e)}}var cd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gn=cd&&typeof module=="object"&&module&&!module.nodeType&&module,Ay=gn&&gn.exports===cd,qa=Ay&&td.process,At=function(){try{var t=gn&&gn.require&&gn.require("util").types;return t||qa&&qa.binding&&qa.binding("util")}catch{}}(),Ku=At&&At.isTypedArray,Ko=Ku?da(Ku):Ey,$y=Object.prototype,ky=$y.hasOwnProperty;function fd(t,e){var r=M(t),n=!r&&fa(t),i=!r&&!n&&Rn(t),a=!r&&!n&&!i&&Ko(t),s=r||n||i||a,o=s?Vg(t.length,String):[],u=o.length;for(var l in t)(e||ky.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||la(l,u)))&&o.push(l);return o}function dd(t,e){return function(r){return t(e(r))}}var xy=dd(Object.keys,Object),by=Object.prototype,Sy=by.hasOwnProperty;function hd(t){if(!Cn(t))return xy(t);var e=[];for(var r in Object(t))Sy.call(t,r)&&r!="constructor"&&e.push(r);return e}function Le(t){return Xe(t)?fd(t):hd(t)}var wy=Object.prototype,Iy=wy.hasOwnProperty,Bs=Bg(function(t,e){if(Cn(e)||Xe(e)){Uo(e,Le(e),t);return}for(var r in e)Iy.call(e,r)&&ca(t,r,e[r])});function _y(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Cy=Object.prototype,Ny=Cy.hasOwnProperty;function Oy(t){if(!Oe(t))return _y(t);var e=Cn(t),r=[];for(var n in t)n=="constructor"&&(e||!Ny.call(t,n))||r.push(n);return r}function pd(t){return Xe(t)?fd(t,!0):Oy(t)}var Ly=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Py=/^\w*$/;function Vo(t,e){if(M(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||sa(t)?!0:Py.test(t)||!Ly.test(t)||e!=null&&t in Object(e)}var En=tr(Object,"create");function My(){this.__data__=En?En(null):{},this.size=0}function Dy(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var jy="__lodash_hash_undefined__",Fy=Object.prototype,Uy=Fy.hasOwnProperty;function Gy(t){var e=this.__data__;if(En){var r=e[t];return r===jy?void 0:r}return Uy.call(e,t)?e[t]:void 0}var By=Object.prototype,Ky=By.hasOwnProperty;function Vy(t){var e=this.__data__;return En?e[t]!==void 0:Ky.call(e,t)}var Hy="__lodash_hash_undefined__";function zy(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=En&&e===void 0?Hy:e,this}function Yt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Yt.prototype.clear=My;Yt.prototype.delete=Dy;Yt.prototype.get=Gy;Yt.prototype.has=Vy;Yt.prototype.set=zy;function Wy(){this.__data__=[],this.size=0}function ha(t,e){for(var r=t.length;r--;)if(_n(t[r][0],e))return r;return-1}var Yy=Array.prototype,qy=Yy.splice;function Xy(t){var e=this.__data__,r=ha(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():qy.call(e,r,1),--this.size,!0}function Zy(t){var e=this.__data__,r=ha(e,t);return r<0?void 0:e[r][1]}function Qy(t){return ha(this.__data__,t)>-1}function Jy(t,e){var r=this.__data__,n=ha(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function pt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}pt.prototype.clear=Wy;pt.prototype.delete=Xy;pt.prototype.get=Zy;pt.prototype.has=Qy;pt.prototype.set=Jy;var An=tr(qe,"Map");function ev(){this.size=0,this.__data__={hash:new Yt,map:new(An||pt),string:new Yt}}function tv(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function pa(t,e){var r=t.__data__;return tv(e)?r[typeof e=="string"?"string":"hash"]:r.map}function rv(t){var e=pa(this,t).delete(t);return this.size-=e?1:0,e}function nv(t){return pa(this,t).get(t)}function iv(t){return pa(this,t).has(t)}function av(t,e){var r=pa(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function mt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}mt.prototype.clear=ev;mt.prototype.delete=rv;mt.prototype.get=nv;mt.prototype.has=iv;mt.prototype.set=av;var sv="Expected a function";function Ho(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(sv);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(Ho.Cache||mt),r}Ho.Cache=mt;var ov=500;function uv(t){var e=Ho(t,function(n){return r.size===ov&&r.clear(),n}),r=e.cache;return e}var lv=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,cv=/\\(\\)?/g,fv=uv(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(lv,function(r,n,i,a){e.push(i?a.replace(cv,"$1"):n||r)}),e});function dv(t){return t==null?"":nd(t)}function ma(t,e){return M(t)?t:Vo(t,e)?[t]:fv(dv(t))}function Nn(t){if(typeof t=="string"||sa(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function zo(t,e){e=ma(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Nn(e[r++])];return r&&r==n?t:void 0}function hv(t,e,r){var n=t==null?void 0:zo(t,e);return n===void 0?r:n}function Wo(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Vu=Ne?Ne.isConcatSpreadable:void 0;function pv(t){return M(t)||fa(t)||!!(Vu&&t&&t[Vu])}function Yo(t,e,r,n,i){var a=-1,s=t.length;for(r||(r=pv),i||(i=[]);++a<s;){var o=t[a];r(o)?Wo(i,o):n||(i[i.length]=o)}return i}function Fe(t){var e=t==null?0:t.length;return e?Yo(t):[]}var md=dd(Object.getPrototypeOf,Object);function gd(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=t[n+e];return a}function mv(t,e,r,n){var i=-1,a=t==null?0:t.length;for(n&&a&&(r=t[++i]);++i<a;)r=e(r,t[i],i,t);return r}function gv(){this.__data__=new pt,this.size=0}function yv(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function vv(t){return this.__data__.get(t)}function Tv(t){return this.__data__.has(t)}var Rv=200;function Ev(t,e){var r=this.__data__;if(r instanceof pt){var n=r.__data__;if(!An||n.length<Rv-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new mt(n)}return r.set(t,e),this.size=r.size,this}function We(t){var e=this.__data__=new pt(t);this.size=e.size}We.prototype.clear=gv;We.prototype.delete=yv;We.prototype.get=vv;We.prototype.has=Tv;We.prototype.set=Ev;function Av(t,e){return t&&Uo(e,Le(e),t)}var yd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hu=yd&&typeof module=="object"&&module&&!module.nodeType&&module,$v=Hu&&Hu.exports===yd,zu=$v?qe.Buffer:void 0,Wu=zu?zu.allocUnsafe:void 0;function kv(t,e){var r=t.length,n=Wu?Wu(r):new t.constructor(r);return t.copy(n),n}function qo(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}function vd(){return[]}var xv=Object.prototype,bv=xv.propertyIsEnumerable,Yu=Object.getOwnPropertySymbols,Xo=Yu?function(t){return t==null?[]:(t=Object(t),qo(Yu(t),function(e){return bv.call(t,e)}))}:vd;function Sv(t,e){return Uo(t,Xo(t),e)}var wv=Object.getOwnPropertySymbols,Iv=wv?function(t){for(var e=[];t;)Wo(e,Xo(t)),t=md(t);return e}:vd;function Td(t,e,r){var n=e(t);return M(t)?n:Wo(n,r(t))}function Ks(t){return Td(t,Le,Xo)}function _v(t){return Td(t,pd,Iv)}var Vs=tr(qe,"DataView"),Hs=tr(qe,"Promise"),pr=tr(qe,"Set"),qu="[object Map]",Cv="[object Object]",Xu="[object Promise]",Zu="[object Set]",Qu="[object WeakMap]",Ju="[object DataView]",Nv=er(Vs),Ov=er(An),Lv=er(Hs),Pv=er(pr),Mv=er(Gs),Ie=_t;(Vs&&Ie(new Vs(new ArrayBuffer(1)))!=Ju||An&&Ie(new An)!=qu||Hs&&Ie(Hs.resolve())!=Xu||pr&&Ie(new pr)!=Zu||Gs&&Ie(new Gs)!=Qu)&&(Ie=function(t){var e=_t(t),r=e==Cv?t.constructor:void 0,n=r?er(r):"";if(n)switch(n){case Nv:return Ju;case Ov:return qu;case Lv:return Xu;case Pv:return Zu;case Mv:return Qu}return e});var Dv=Object.prototype,jv=Dv.hasOwnProperty;function Fv(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&jv.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Ni=qe.Uint8Array;function Uv(t){var e=new t.constructor(t.byteLength);return new Ni(e).set(new Ni(t)),e}function Gv(t,e){var r=t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Bv=/\w*$/;function Kv(t){var e=new t.constructor(t.source,Bv.exec(t));return e.lastIndex=t.lastIndex,e}var el=Ne?Ne.prototype:void 0,tl=el?el.valueOf:void 0;function Vv(t){return tl?Object(tl.call(t)):{}}function Hv(t,e){var r=t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var zv="[object Boolean]",Wv="[object Date]",Yv="[object Map]",qv="[object Number]",Xv="[object RegExp]",Zv="[object Set]",Qv="[object String]",Jv="[object Symbol]",eT="[object ArrayBuffer]",tT="[object DataView]",rT="[object Float32Array]",nT="[object Float64Array]",iT="[object Int8Array]",aT="[object Int16Array]",sT="[object Int32Array]",oT="[object Uint8Array]",uT="[object Uint8ClampedArray]",lT="[object Uint16Array]",cT="[object Uint32Array]";function fT(t,e,r){var n=t.constructor;switch(e){case eT:return Uv(t);case zv:case Wv:return new n(+t);case tT:return Gv(t);case rT:case nT:case iT:case aT:case sT:case oT:case uT:case lT:case cT:return Hv(t);case Yv:return new n;case qv:case Qv:return new n(t);case Xv:return Kv(t);case Zv:return new n;case Jv:return Vv(t)}}function dT(t){return typeof t.constructor=="function"&&!Cn(t)?kg(md(t)):{}}var hT="[object Map]";function pT(t){return Ue(t)&&Ie(t)==hT}var rl=At&&At.isMap,mT=rl?da(rl):pT,gT="[object Set]";function yT(t){return Ue(t)&&Ie(t)==gT}var nl=At&&At.isSet,vT=nl?da(nl):yT,Rd="[object Arguments]",TT="[object Array]",RT="[object Boolean]",ET="[object Date]",AT="[object Error]",Ed="[object Function]",$T="[object GeneratorFunction]",kT="[object Map]",xT="[object Number]",Ad="[object Object]",bT="[object RegExp]",ST="[object Set]",wT="[object String]",IT="[object Symbol]",_T="[object WeakMap]",CT="[object ArrayBuffer]",NT="[object DataView]",OT="[object Float32Array]",LT="[object Float64Array]",PT="[object Int8Array]",MT="[object Int16Array]",DT="[object Int32Array]",jT="[object Uint8Array]",FT="[object Uint8ClampedArray]",UT="[object Uint16Array]",GT="[object Uint32Array]",F={};F[Rd]=F[TT]=F[CT]=F[NT]=F[RT]=F[ET]=F[OT]=F[LT]=F[PT]=F[MT]=F[DT]=F[kT]=F[xT]=F[Ad]=F[bT]=F[ST]=F[wT]=F[IT]=F[jT]=F[FT]=F[UT]=F[GT]=!0;F[AT]=F[Ed]=F[_T]=!1;function hi(t,e,r,n,i,a){var s;if(s!==void 0)return s;if(!Oe(t))return t;var o=M(t);if(o)return s=Fv(t),bg(t,s);var u=Ie(t),l=u==Ed||u==$T;if(Rn(t))return kv(t);if(u==Ad||u==Rd||l&&!i)return s=l?{}:dT(t),Sv(t,Av(s,t));if(!F[u])return i?t:{};s=fT(t,u),a||(a=new We);var c=a.get(t);if(c)return c;a.set(t,s),vT(t)?t.forEach(function(h){s.add(hi(h,e,r,h,t,a))}):mT(t)&&t.forEach(function(h,m){s.set(m,hi(h,e,r,m,t,a))});var f=Ks,d=o?void 0:f(t);return id(d||t,function(h,m){d&&(m=h,h=t[m]),ca(s,m,hi(h,e,r,m,t,a))}),s}var BT=4;function se(t){return hi(t,BT)}function On(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var a=t[e];a&&(i[n++]=a)}return i}var KT="__lodash_hash_undefined__";function VT(t){return this.__data__.set(t,KT),this}function HT(t){return this.__data__.has(t)}function yr(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new mt;++e<r;)this.add(t[e])}yr.prototype.add=yr.prototype.push=VT;yr.prototype.has=HT;function $d(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Zo(t,e){return t.has(e)}var zT=1,WT=2;function kd(t,e,r,n,i,a){var s=r&zT,o=t.length,u=e.length;if(o!=u&&!(s&&u>o))return!1;var l=a.get(t),c=a.get(e);if(l&&c)return l==e&&c==t;var f=-1,d=!0,h=r&WT?new yr:void 0;for(a.set(t,e),a.set(e,t);++f<o;){var m=t[f],g=e[f];if(n)var E=s?n(g,m,f,e,t,a):n(m,g,f,t,e,a);if(E!==void 0){if(E)continue;d=!1;break}if(h){if(!$d(e,function(v,R){if(!Zo(h,R)&&(m===v||i(m,v,r,n,a)))return h.push(R)})){d=!1;break}}else if(!(m===g||i(m,g,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function YT(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function Qo(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var qT=1,XT=2,ZT="[object Boolean]",QT="[object Date]",JT="[object Error]",eR="[object Map]",tR="[object Number]",rR="[object RegExp]",nR="[object Set]",iR="[object String]",aR="[object Symbol]",sR="[object ArrayBuffer]",oR="[object DataView]",il=Ne?Ne.prototype:void 0,Xa=il?il.valueOf:void 0;function uR(t,e,r,n,i,a,s){switch(r){case oR:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case sR:return!(t.byteLength!=e.byteLength||!a(new Ni(t),new Ni(e)));case ZT:case QT:case tR:return _n(+t,+e);case JT:return t.name==e.name&&t.message==e.message;case rR:case iR:return t==e+"";case eR:var o=YT;case nR:var u=n&qT;if(o||(o=Qo),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=XT,s.set(t,e);var c=kd(o(t),o(e),n,i,a,s);return s.delete(t),c;case aR:if(Xa)return Xa.call(t)==Xa.call(e)}return!1}var lR=1,cR=Object.prototype,fR=cR.hasOwnProperty;function dR(t,e,r,n,i,a){var s=r&lR,o=Ks(t),u=o.length,l=Ks(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var d=o[f];if(!(s?d in e:fR.call(e,d)))return!1}var h=a.get(t),m=a.get(e);if(h&&m)return h==e&&m==t;var g=!0;a.set(t,e),a.set(e,t);for(var E=s;++f<u;){d=o[f];var v=t[d],R=e[d];if(n)var T=s?n(R,v,d,e,t,a):n(v,R,d,t,e,a);if(!(T===void 0?v===R||i(v,R,r,n,a):T)){g=!1;break}E||(E=d=="constructor")}if(g&&!E){var $=t.constructor,P=e.constructor;$!=P&&"constructor"in t&&"constructor"in e&&!(typeof $=="function"&&$ instanceof $&&typeof P=="function"&&P instanceof P)&&(g=!1)}return a.delete(t),a.delete(e),g}var hR=1,al="[object Arguments]",sl="[object Array]",Qn="[object Object]",pR=Object.prototype,ol=pR.hasOwnProperty;function mR(t,e,r,n,i,a){var s=M(t),o=M(e),u=s?sl:Ie(t),l=o?sl:Ie(e);u=u==al?Qn:u,l=l==al?Qn:l;var c=u==Qn,f=l==Qn,d=u==l;if(d&&Rn(t)){if(!Rn(e))return!1;s=!0,c=!1}if(d&&!c)return a||(a=new We),s||Ko(t)?kd(t,e,r,n,i,a):uR(t,e,u,r,n,i,a);if(!(r&hR)){var h=c&&ol.call(t,"__wrapped__"),m=f&&ol.call(e,"__wrapped__");if(h||m){var g=h?t.value():t,E=m?e.value():e;return a||(a=new We),i(g,E,r,n,a)}}return d?(a||(a=new We),dR(t,e,r,n,i,a)):!1}function Jo(t,e,r,n,i){return t===e?!0:t==null||e==null||!Ue(t)&&!Ue(e)?t!==t&&e!==e:mR(t,e,r,n,Jo,i)}var gR=1,yR=2;function vR(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var o=s[0],u=t[o],l=s[1];if(s[2]){if(u===void 0&&!(o in t))return!1}else{var c=new We,f;if(!(f===void 0?Jo(l,u,gR|yR,n,c):f))return!1}}return!0}function xd(t){return t===t&&!Oe(t)}function TR(t){for(var e=Le(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,xd(i)]}return e}function bd(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function RR(t){var e=TR(t);return e.length==1&&e[0][2]?bd(e[0][0],e[0][1]):function(r){return r===t||vR(r,t,e)}}function ER(t,e){return t!=null&&e in Object(t)}function Sd(t,e,r){e=ma(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=Nn(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&Bo(i)&&la(s,i)&&(M(t)||fa(t)))}function AR(t,e){return t!=null&&Sd(t,e,ER)}var $R=1,kR=2;function xR(t,e){return Vo(t)&&xd(e)?bd(Nn(t),e):function(r){var n=hv(r,t);return n===void 0&&n===e?AR(r,t):Jo(e,n,$R|kR)}}function bR(t){return function(e){return e==null?void 0:e[t]}}function SR(t){return function(e){return zo(e,t)}}function wR(t){return Vo(t)?bR(Nn(t)):SR(t)}function Ze(t){return typeof t=="function"?t:t==null?gr:typeof t=="object"?M(t)?xR(t[0],t[1]):RR(t):wR(t)}function IR(t,e,r,n){for(var i=-1,a=t==null?0:t.length;++i<a;){var s=t[i];e(n,s,r(s),t)}return n}function _R(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var u=s[++i];if(r(a[u],u,a)===!1)break}return e}}var CR=_R();function NR(t,e){return t&&CR(t,e,Le)}function OR(t,e){return function(r,n){if(r==null)return r;if(!Xe(r))return t(r,n);for(var i=r.length,a=-1,s=Object(r);++a<i&&n(s[a],a,s)!==!1;);return r}}var rr=OR(NR);function LR(t,e,r,n){return rr(t,function(i,a,s){e(n,i,r(i),s)}),n}function PR(t,e){return function(r,n){var i=M(r)?IR:LR,a={};return i(r,t,Ze(n),a)}}var wd=Object.prototype,MR=wd.hasOwnProperty,eu=Go(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&od(e[0],e[1],i)&&(n=1);++r<n;)for(var a=e[r],s=pd(a),o=-1,u=s.length;++o<u;){var l=s[o],c=t[l];(c===void 0||_n(c,wd[l])&&!MR.call(t,l))&&(t[l]=a[l])}return t});function ul(t){return Ue(t)&&Xe(t)}var DR=200;function jR(t,e,r,n){var i=-1,a=sd,s=!0,o=t.length,u=[],l=e.length;if(!o)return u;e.length>=DR&&(a=Zo,s=!1,e=new yr(e));e:for(;++i<o;){var c=t[i],f=c;if(c=c!==0?c:0,s&&f===f){for(var d=l;d--;)if(e[d]===f)continue e;u.push(c)}else a(e,f,n)||u.push(c)}return u}var ga=Go(function(t,e){return ul(t)?jR(t,Yo(e,1,ul,!0)):[]});function vr(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function re(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:ua(e),gd(t,e<0?0:e,n)):[]}function $n(t,e,r){var n=t==null?0:t.length;return n?(e=e===void 0?1:ua(e),e=n-e,gd(t,0,e<0?0:e)):[]}function FR(t){return typeof t=="function"?t:gr}function _(t,e){var r=M(t)?id:rr;return r(t,FR(e))}function UR(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function GR(t,e){var r=!0;return rr(t,function(n,i,a){return r=!!e(n,i,a),r}),r}function Ye(t,e,r){var n=M(t)?UR:GR;return n(t,Ze(e))}function Id(t,e){var r=[];return rr(t,function(n,i,a){e(n,i,a)&&r.push(n)}),r}function Pe(t,e){var r=M(t)?qo:Id;return r(t,Ze(e))}function BR(t){return function(e,r,n){var i=Object(e);if(!Xe(e)){var a=Ze(r);e=Le(e),r=function(o){return a(i[o],o,i)}}var s=t(e,r,n);return s>-1?i[a?e[s]:s]:void 0}}var KR=Math.max;function VR(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:ua(r);return i<0&&(i=KR(n+i,0)),ad(t,Ze(e),i)}var Tr=BR(VR);function Ge(t){return t&&t.length?t[0]:void 0}function HR(t,e){var r=-1,n=Xe(t)?Array(t.length):[];return rr(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function S(t,e){var r=M(t)?oa:HR;return r(t,Ze(e))}function _e(t,e){return Yo(S(t,e))}var zR=Object.prototype,WR=zR.hasOwnProperty,YR=PR(function(t,e,r){WR.call(t,r)?t[r].push(e):Fo(t,r,[e])}),qR=Object.prototype,XR=qR.hasOwnProperty;function ZR(t,e){return t!=null&&XR.call(t,e)}function w(t,e){return t!=null&&Sd(t,e,ZR)}var QR="[object String]";function Be(t){return typeof t=="string"||!M(t)&&Ue(t)&&_t(t)==QR}function JR(t,e){return oa(e,function(r){return t[r]})}function Q(t){return t==null?[]:JR(t,Le(t))}var eE=Math.max;function ge(t,e,r,n){t=Xe(t)?t:Q(t),r=r?ua(r):0;var i=t.length;return r<0&&(r=eE(i+r,0)),Be(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&jo(t,e,r)>-1}function ll(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=0;return jo(t,e,i)}var tE="[object Map]",rE="[object Set]",nE=Object.prototype,iE=nE.hasOwnProperty;function U(t){if(t==null)return!0;if(Xe(t)&&(M(t)||typeof t=="string"||typeof t.splice=="function"||Rn(t)||Ko(t)||fa(t)))return!t.length;var e=Ie(t);if(e==tE||e==rE)return!t.size;if(Cn(t))return!hd(t).length;for(var r in t)if(iE.call(t,r))return!1;return!0}var aE="[object RegExp]";function sE(t){return Ue(t)&&_t(t)==aE}var cl=At&&At.isRegExp,$t=cl?da(cl):sE;function ct(t){return t===void 0}var oE="Expected a function";function uE(t){if(typeof t!="function")throw new TypeError(oE);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function lE(t,e,r,n){if(!Oe(t))return t;e=ma(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var u=Nn(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=o[u];l=void 0,l===void 0&&(l=Oe(c)?c:la(e[i+1])?[]:{})}ca(o,u,l),o=o[u]}return t}function cE(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=zo(t,s);r(o,s)&&lE(a,ma(s,t),o)}return a}function fE(t,e){if(t==null)return{};var r=oa(_v(t),function(n){return[n]});return e=Ze(e),cE(t,r,function(n,i){return e(n,i[0])})}function dE(t,e,r,n,i){return i(t,function(a,s,o){r=n?(n=!1,a):e(r,a,s,o)}),r}function ke(t,e,r){var n=M(t)?mv:dE,i=arguments.length<3;return n(t,Ze(e),r,i,rr)}function ya(t,e){var r=M(t)?qo:Id;return r(t,uE(Ze(e)))}function hE(t,e){var r;return rr(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}function pE(t,e,r){var n=M(t)?$d:hE;return n(t,Ze(e))}var mE=1/0,gE=pr&&1/Qo(new pr([,-0]))[1]==mE?function(t){return new pr(t)}:Z,yE=200;function vE(t,e,r){var n=-1,i=sd,a=t.length,s=!0,o=[],u=o;if(a>=yE){var l=gE(t);if(l)return Qo(l);s=!1,i=Zo,u=new yr}else u=o;e:for(;++n<a;){var c=t[n],f=c;if(c=c!==0?c:0,s&&f===f){for(var d=u.length;d--;)if(u[d]===f)continue e;o.push(c)}else i(u,f,r)||(u!==o&&u.push(f),o.push(c))}return o}function tu(t){return t&&t.length?vE(t):[]}function zs(t){console&&console.error&&console.error(`Error: ${t}`)}function _d(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Cd(t){const e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Nd(t){function e(){}e.prototype=t;const r=new e;function n(){return typeof r.bar}return n(),n(),t}var Od=typeof global=="object"&&global&&global.Object===Object&&global,TE=typeof self=="object"&&self&&self.Object===Object&&self,gt=Od||TE||Function("return this")(),kt=gt.Symbol,Ld=Object.prototype,RE=Ld.hasOwnProperty,EE=Ld.toString,_r=kt?kt.toStringTag:void 0;function AE(t){var e=RE.call(t,_r),r=t[_r];try{t[_r]=void 0;var n=!0}catch{}var i=EE.call(t);return n&&(e?t[_r]=r:delete t[_r]),i}var $E=Object.prototype,kE=$E.toString;function xE(t){return kE.call(t)}var bE="[object Null]",SE="[object Undefined]",fl=kt?kt.toStringTag:void 0;function Ct(t){return t==null?t===void 0?SE:bE:fl&&fl in Object(t)?AE(t):xE(t)}function xt(t){return t!=null&&typeof t=="object"}var wE="[object Symbol]";function va(t){return typeof t=="symbol"||xt(t)&&Ct(t)==wE}function Ta(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var pe=Array.isArray,dl=kt?kt.prototype:void 0,hl=dl?dl.toString:void 0;function Pd(t){if(typeof t=="string")return t;if(pe(t))return Ta(t,Pd)+"";if(va(t))return hl?hl.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var IE=/\s/;function _E(t){for(var e=t.length;e--&&IE.test(t.charAt(e)););return e}var CE=/^\s+/;function NE(t){return t&&t.slice(0,_E(t)+1).replace(CE,"")}function ft(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pl=NaN,OE=/^[-+]0x[0-9a-f]+$/i,LE=/^0b[01]+$/i,PE=/^0o[0-7]+$/i,ME=parseInt;function DE(t){if(typeof t=="number")return t;if(va(t))return pl;if(ft(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=ft(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=NE(t);var r=LE.test(t);return r||PE.test(t)?ME(t.slice(2),r?2:8):OE.test(t)?pl:+t}var ml=1/0,jE=17976931348623157e292;function FE(t){if(!t)return t===0?t:0;if(t=DE(t),t===ml||t===-ml){var e=t<0?-1:1;return e*jE}return t===t?t:0}function UE(t){var e=FE(t),r=e%1;return e===e?r?e-r:e:0}function Ra(t){return t}var GE="[object AsyncFunction]",BE="[object Function]",KE="[object GeneratorFunction]",VE="[object Proxy]";function Md(t){if(!ft(t))return!1;var e=Ct(t);return e==BE||e==KE||e==GE||e==VE}var Za=gt["__core-js_shared__"],gl=function(){var t=/[^.]+$/.exec(Za&&Za.keys&&Za.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function HE(t){return!!gl&&gl in t}var zE=Function.prototype,WE=zE.toString;function nr(t){if(t!=null){try{return WE.call(t)}catch{}try{return t+""}catch{}}return""}var YE=/[\\^$.*+?()[\]{}|]/g,qE=/^\[object .+?Constructor\]$/,XE=Function.prototype,ZE=Object.prototype,QE=XE.toString,JE=ZE.hasOwnProperty,eA=RegExp("^"+QE.call(JE).replace(YE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function tA(t){if(!ft(t)||HE(t))return!1;var e=Md(t)?eA:qE;return e.test(nr(t))}function rA(t,e){return t==null?void 0:t[e]}function ir(t,e){var r=rA(t,e);return tA(r)?r:void 0}var Ws=ir(gt,"WeakMap");function nA(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var iA=800,aA=16,sA=Date.now;function oA(t){var e=0,r=0;return function(){var n=sA(),i=aA-(n-r);if(r=n,i>0){if(++e>=iA)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function uA(t){return function(){return t}}var Oi=function(){try{var t=ir(Object,"defineProperty");return t({},"",{}),t}catch{}}(),lA=Oi?function(t,e){return Oi(t,"toString",{configurable:!0,enumerable:!1,value:uA(e),writable:!0})}:Ra,cA=oA(lA);function fA(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}function dA(t,e,r,n){for(var i=t.length,a=r+-1;++a<i;)if(e(t[a],a,t))return a;return-1}function hA(t){return t!==t}function pA(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function mA(t,e,r){return e===e?pA(t,e,r):dA(t,hA,r)}var gA=9007199254740991,yA=/^(?:0|[1-9]\d*)$/;function Ea(t,e){var r=typeof t;return e=e??gA,!!e&&(r=="number"||r!="symbol"&&yA.test(t))&&t>-1&&t%1==0&&t<e}function Dd(t,e,r){e=="__proto__"&&Oi?Oi(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}function Aa(t,e){return t===e||t!==t&&e!==e}var vA=Object.prototype,TA=vA.hasOwnProperty;function ru(t,e,r){var n=t[e];(!(TA.call(t,e)&&Aa(n,r))||r===void 0&&!(e in t))&&Dd(t,e,r)}function RA(t,e,r,n){var i=!r;r||(r={});for(var a=-1,s=e.length;++a<s;){var o=e[a],u=void 0;u===void 0&&(u=t[o]),i?Dd(r,o,u):ru(r,o,u)}return r}var yl=Math.max;function EA(t,e,r){return e=yl(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,a=yl(n.length-e,0),s=Array(a);++i<a;)s[i]=n[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=n[i];return o[e]=r(s),nA(t,this,o)}}function AA(t,e){return cA(EA(t,e,Ra),t+"")}var $A=9007199254740991;function nu(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$A}function ar(t){return t!=null&&nu(t.length)&&!Md(t)}function kA(t,e,r){if(!ft(r))return!1;var n=typeof e;return(n=="number"?ar(r)&&Ea(e,r.length):n=="string"&&e in r)?Aa(r[e],t):!1}function xA(t){return AA(function(e,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(a=t.length>3&&typeof a=="function"?(i--,a):void 0,s&&kA(r[0],r[1],s)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var o=r[n];o&&t(e,o,n,a)}return e})}var bA=Object.prototype;function iu(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||bA;return t===r}function SA(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var wA="[object Arguments]";function vl(t){return xt(t)&&Ct(t)==wA}var jd=Object.prototype,IA=jd.hasOwnProperty,_A=jd.propertyIsEnumerable,Fd=vl(function(){return arguments}())?vl:function(t){return xt(t)&&IA.call(t,"callee")&&!_A.call(t,"callee")};function CA(){return!1}var Ud=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Tl=Ud&&typeof module=="object"&&module&&!module.nodeType&&module,NA=Tl&&Tl.exports===Ud,Rl=NA?gt.Buffer:void 0,OA=Rl?Rl.isBuffer:void 0,Ys=OA||CA,LA="[object Arguments]",PA="[object Array]",MA="[object Boolean]",DA="[object Date]",jA="[object Error]",FA="[object Function]",UA="[object Map]",GA="[object Number]",BA="[object Object]",KA="[object RegExp]",VA="[object Set]",HA="[object String]",zA="[object WeakMap]",WA="[object ArrayBuffer]",YA="[object DataView]",qA="[object Float32Array]",XA="[object Float64Array]",ZA="[object Int8Array]",QA="[object Int16Array]",JA="[object Int32Array]",e$="[object Uint8Array]",t$="[object Uint8ClampedArray]",r$="[object Uint16Array]",n$="[object Uint32Array]",B={};B[qA]=B[XA]=B[ZA]=B[QA]=B[JA]=B[e$]=B[t$]=B[r$]=B[n$]=!0;B[LA]=B[PA]=B[WA]=B[MA]=B[YA]=B[DA]=B[jA]=B[FA]=B[UA]=B[GA]=B[BA]=B[KA]=B[VA]=B[HA]=B[zA]=!1;function i$(t){return xt(t)&&nu(t.length)&&!!B[Ct(t)]}function Gd(t){return function(e){return t(e)}}var Bd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yn=Bd&&typeof module=="object"&&module&&!module.nodeType&&module,a$=yn&&yn.exports===Bd,Qa=a$&&Od.process,Li=function(){try{var t=yn&&yn.require&&yn.require("util").types;return t||Qa&&Qa.binding&&Qa.binding("util")}catch{}}(),El=Li&&Li.isTypedArray,Kd=El?Gd(El):i$,s$=Object.prototype,o$=s$.hasOwnProperty;function Vd(t,e){var r=pe(t),n=!r&&Fd(t),i=!r&&!n&&Ys(t),a=!r&&!n&&!i&&Kd(t),s=r||n||i||a,o=s?SA(t.length,String):[],u=o.length;for(var l in t)(e||o$.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||Ea(l,u)))&&o.push(l);return o}function Hd(t,e){return function(r){return t(e(r))}}var u$=Hd(Object.keys,Object),l$=Object.prototype,c$=l$.hasOwnProperty;function f$(t){if(!iu(t))return u$(t);var e=[];for(var r in Object(t))c$.call(t,r)&&r!="constructor"&&e.push(r);return e}function Ln(t){return ar(t)?Vd(t):f$(t)}var d$=Object.prototype,h$=d$.hasOwnProperty,Qe=xA(function(t,e){if(iu(e)||ar(e)){RA(e,Ln(e),t);return}for(var r in e)h$.call(e,r)&&ru(t,r,e[r])});function p$(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var m$=Object.prototype,g$=m$.hasOwnProperty;function y$(t){if(!ft(t))return p$(t);var e=iu(t),r=[];for(var n in t)n=="constructor"&&(e||!g$.call(t,n))||r.push(n);return r}function v$(t){return ar(t)?Vd(t,!0):y$(t)}var T$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R$=/^\w*$/;function au(t,e){if(pe(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||va(t)?!0:R$.test(t)||!T$.test(t)||e!=null&&t in Object(e)}var kn=ir(Object,"create");function E$(){this.__data__=kn?kn(null):{},this.size=0}function A$(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var $$="__lodash_hash_undefined__",k$=Object.prototype,x$=k$.hasOwnProperty;function b$(t){var e=this.__data__;if(kn){var r=e[t];return r===$$?void 0:r}return x$.call(e,t)?e[t]:void 0}var S$=Object.prototype,w$=S$.hasOwnProperty;function I$(t){var e=this.__data__;return kn?e[t]!==void 0:w$.call(e,t)}var _$="__lodash_hash_undefined__";function C$(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=kn&&e===void 0?_$:e,this}function qt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}qt.prototype.clear=E$;qt.prototype.delete=A$;qt.prototype.get=b$;qt.prototype.has=I$;qt.prototype.set=C$;function N$(){this.__data__=[],this.size=0}function $a(t,e){for(var r=t.length;r--;)if(Aa(t[r][0],e))return r;return-1}var O$=Array.prototype,L$=O$.splice;function P$(t){var e=this.__data__,r=$a(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():L$.call(e,r,1),--this.size,!0}function M$(t){var e=this.__data__,r=$a(e,t);return r<0?void 0:e[r][1]}function D$(t){return $a(this.__data__,t)>-1}function j$(t,e){var r=this.__data__,n=$a(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}function yt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}yt.prototype.clear=N$;yt.prototype.delete=P$;yt.prototype.get=M$;yt.prototype.has=D$;yt.prototype.set=j$;var xn=ir(gt,"Map");function F$(){this.size=0,this.__data__={hash:new qt,map:new(xn||yt),string:new qt}}function U$(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ka(t,e){var r=t.__data__;return U$(e)?r[typeof e=="string"?"string":"hash"]:r.map}function G$(t){var e=ka(this,t).delete(t);return this.size-=e?1:0,e}function B$(t){return ka(this,t).get(t)}function K$(t){return ka(this,t).has(t)}function V$(t,e){var r=ka(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}function vt(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}vt.prototype.clear=F$;vt.prototype.delete=G$;vt.prototype.get=B$;vt.prototype.has=K$;vt.prototype.set=V$;var H$="Expected a function";function su(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(H$);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var s=t.apply(this,n);return r.cache=a.set(i,s)||a,s};return r.cache=new(su.Cache||vt),r}su.Cache=vt;var z$=500;function W$(t){var e=su(t,function(n){return r.size===z$&&r.clear(),n}),r=e.cache;return e}var Y$=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q$=/\\(\\)?/g,X$=W$(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Y$,function(r,n,i,a){e.push(i?a.replace(q$,"$1"):n||r)}),e});function Z$(t){return t==null?"":Pd(t)}function xa(t,e){return pe(t)?t:au(t,e)?[t]:X$(Z$(t))}function Pn(t){if(typeof t=="string"||va(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function ou(t,e){e=xa(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Pn(e[r++])];return r&&r==n?t:void 0}function Q$(t,e,r){var n=t==null?void 0:ou(t,e);return n===void 0?r:n}function zd(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var J$=Hd(Object.getPrototypeOf,Object);function ek(){this.__data__=new yt,this.size=0}function tk(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function rk(t){return this.__data__.get(t)}function nk(t){return this.__data__.has(t)}var ik=200;function ak(t,e){var r=this.__data__;if(r instanceof yt){var n=r.__data__;if(!xn||n.length<ik-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new vt(n)}return r.set(t,e),this.size=r.size,this}function lt(t){var e=this.__data__=new yt(t);this.size=e.size}lt.prototype.clear=ek;lt.prototype.delete=tk;lt.prototype.get=rk;lt.prototype.has=nk;lt.prototype.set=ak;function sk(t,e){for(var r=-1,n=t==null?0:t.length,i=0,a=[];++r<n;){var s=t[r];e(s,r,t)&&(a[i++]=s)}return a}function Wd(){return[]}var ok=Object.prototype,uk=ok.propertyIsEnumerable,Al=Object.getOwnPropertySymbols,Yd=Al?function(t){return t==null?[]:(t=Object(t),sk(Al(t),function(e){return uk.call(t,e)}))}:Wd,lk=Object.getOwnPropertySymbols,ck=lk?function(t){for(var e=[];t;)zd(e,Yd(t)),t=J$(t);return e}:Wd;function qd(t,e,r){var n=e(t);return pe(t)?n:zd(n,r(t))}function $l(t){return qd(t,Ln,Yd)}function fk(t){return qd(t,v$,ck)}var qs=ir(gt,"DataView"),Xs=ir(gt,"Promise"),Zs=ir(gt,"Set"),kl="[object Map]",dk="[object Object]",xl="[object Promise]",bl="[object Set]",Sl="[object WeakMap]",wl="[object DataView]",hk=nr(qs),pk=nr(xn),mk=nr(Xs),gk=nr(Zs),yk=nr(Ws),Rt=Ct;(qs&&Rt(new qs(new ArrayBuffer(1)))!=wl||xn&&Rt(new xn)!=kl||Xs&&Rt(Xs.resolve())!=xl||Zs&&Rt(new Zs)!=bl||Ws&&Rt(new Ws)!=Sl)&&(Rt=function(t){var e=Ct(t),r=e==dk?t.constructor:void 0,n=r?nr(r):"";if(n)switch(n){case hk:return wl;case pk:return kl;case mk:return xl;case gk:return bl;case yk:return Sl}return e});var Il=gt.Uint8Array,vk="__lodash_hash_undefined__";function Tk(t){return this.__data__.set(t,vk),this}function Rk(t){return this.__data__.has(t)}function Pi(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new vt;++e<r;)this.add(t[e])}Pi.prototype.add=Pi.prototype.push=Tk;Pi.prototype.has=Rk;function Xd(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Ek(t,e){return t.has(e)}var Ak=1,$k=2;function Zd(t,e,r,n,i,a){var s=r&Ak,o=t.length,u=e.length;if(o!=u&&!(s&&u>o))return!1;var l=a.get(t),c=a.get(e);if(l&&c)return l==e&&c==t;var f=-1,d=!0,h=r&$k?new Pi:void 0;for(a.set(t,e),a.set(e,t);++f<o;){var m=t[f],g=e[f];if(n)var E=s?n(g,m,f,e,t,a):n(m,g,f,t,e,a);if(E!==void 0){if(E)continue;d=!1;break}if(h){if(!Xd(e,function(v,R){if(!Ek(h,R)&&(m===v||i(m,v,r,n,a)))return h.push(R)})){d=!1;break}}else if(!(m===g||i(m,g,r,n,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function kk(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}function xk(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var bk=1,Sk=2,wk="[object Boolean]",Ik="[object Date]",_k="[object Error]",Ck="[object Map]",Nk="[object Number]",Ok="[object RegExp]",Lk="[object Set]",Pk="[object String]",Mk="[object Symbol]",Dk="[object ArrayBuffer]",jk="[object DataView]",_l=kt?kt.prototype:void 0,Ja=_l?_l.valueOf:void 0;function Fk(t,e,r,n,i,a,s){switch(r){case jk:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Dk:return!(t.byteLength!=e.byteLength||!a(new Il(t),new Il(e)));case wk:case Ik:case Nk:return Aa(+t,+e);case _k:return t.name==e.name&&t.message==e.message;case Ok:case Pk:return t==e+"";case Ck:var o=kk;case Lk:var u=n&bk;if(o||(o=xk),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=Sk,s.set(t,e);var c=Zd(o(t),o(e),n,i,a,s);return s.delete(t),c;case Mk:if(Ja)return Ja.call(t)==Ja.call(e)}return!1}var Uk=1,Gk=Object.prototype,Bk=Gk.hasOwnProperty;function Kk(t,e,r,n,i,a){var s=r&Uk,o=$l(t),u=o.length,l=$l(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var d=o[f];if(!(s?d in e:Bk.call(e,d)))return!1}var h=a.get(t),m=a.get(e);if(h&&m)return h==e&&m==t;var g=!0;a.set(t,e),a.set(e,t);for(var E=s;++f<u;){d=o[f];var v=t[d],R=e[d];if(n)var T=s?n(R,v,d,e,t,a):n(v,R,d,t,e,a);if(!(T===void 0?v===R||i(v,R,r,n,a):T)){g=!1;break}E||(E=d=="constructor")}if(g&&!E){var $=t.constructor,P=e.constructor;$!=P&&"constructor"in t&&"constructor"in e&&!(typeof $=="function"&&$ instanceof $&&typeof P=="function"&&P instanceof P)&&(g=!1)}return a.delete(t),a.delete(e),g}var Vk=1,Cl="[object Arguments]",Nl="[object Array]",Jn="[object Object]",Hk=Object.prototype,Ol=Hk.hasOwnProperty;function zk(t,e,r,n,i,a){var s=pe(t),o=pe(e),u=s?Nl:Rt(t),l=o?Nl:Rt(e);u=u==Cl?Jn:u,l=l==Cl?Jn:l;var c=u==Jn,f=l==Jn,d=u==l;if(d&&Ys(t)){if(!Ys(e))return!1;s=!0,c=!1}if(d&&!c)return a||(a=new lt),s||Kd(t)?Zd(t,e,r,n,i,a):Fk(t,e,u,r,n,i,a);if(!(r&Vk)){var h=c&&Ol.call(t,"__wrapped__"),m=f&&Ol.call(e,"__wrapped__");if(h||m){var g=h?t.value():t,E=m?e.value():e;return a||(a=new lt),i(g,E,r,n,a)}}return d?(a||(a=new lt),Kk(t,e,r,n,i,a)):!1}function uu(t,e,r,n,i){return t===e?!0:t==null||e==null||!xt(t)&&!xt(e)?t!==t&&e!==e:zk(t,e,r,n,uu,i)}var Wk=1,Yk=2;function qk(t,e,r,n){var i=r.length,a=i;if(t==null)return!a;for(t=Object(t);i--;){var s=r[i];if(s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++i<a;){s=r[i];var o=s[0],u=t[o],l=s[1];if(s[2]){if(u===void 0&&!(o in t))return!1}else{var c=new lt,f;if(!(f===void 0?uu(l,u,Wk|Yk,n,c):f))return!1}}return!0}function Qd(t){return t===t&&!ft(t)}function Xk(t){for(var e=Ln(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Qd(i)]}return e}function Jd(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}function Zk(t){var e=Xk(t);return e.length==1&&e[0][2]?Jd(e[0][0],e[0][1]):function(r){return r===t||qk(r,t,e)}}function Qk(t,e){return t!=null&&e in Object(t)}function Jk(t,e,r){e=xa(e,t);for(var n=-1,i=e.length,a=!1;++n<i;){var s=Pn(e[n]);if(!(a=t!=null&&r(t,s)))break;t=t[s]}return a||++n!=i?a:(i=t==null?0:t.length,!!i&&nu(i)&&Ea(s,i)&&(pe(t)||Fd(t)))}function ex(t,e){return t!=null&&Jk(t,e,Qk)}var tx=1,rx=2;function nx(t,e){return au(t)&&Qd(e)?Jd(Pn(t),e):function(r){var n=Q$(r,t);return n===void 0&&n===e?ex(r,t):uu(e,n,tx|rx)}}function ix(t){return function(e){return e==null?void 0:e[t]}}function ax(t){return function(e){return ou(e,t)}}function sx(t){return au(t)?ix(Pn(t)):ax(t)}function ba(t){return typeof t=="function"?t:t==null?Ra:typeof t=="object"?pe(t)?nx(t[0],t[1]):Zk(t):sx(t)}function ox(t){return function(e,r,n){for(var i=-1,a=Object(e),s=n(e),o=s.length;o--;){var u=s[++i];if(r(a[u],u,a)===!1)break}return e}}var ux=ox();function lx(t,e){return t&&ux(t,e,Ln)}function cx(t,e){return function(r,n){if(r==null)return r;if(!ar(r))return t(r,n);for(var i=r.length,a=-1,s=Object(r);++a<i&&n(s[a],a,s)!==!1;);return r}}var Sa=cx(lx);function fx(t){return typeof t=="function"?t:Ra}function dx(t,e){var r=pe(t)?fA:Sa;return r(t,fx(e))}function hx(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}function px(t,e){var r=!0;return Sa(t,function(n,i,a){return r=!!e(n,i,a),r}),r}function mx(t,e,r){var n=pe(t)?hx:px;return n(t,ba(e))}function gx(t,e){var r=-1,n=ar(t)?Array(t.length):[];return Sa(t,function(i,a,s){n[++r]=e(i,a,s)}),n}function eh(t,e){var r=pe(t)?Ta:gx;return r(t,ba(e))}var yx="[object String]";function Mi(t){return typeof t=="string"||!pe(t)&&xt(t)&&Ct(t)==yx}function vx(t,e){return Ta(e,function(r){return t[r]})}function Tx(t){return t==null?[]:vx(t,Ln(t))}var Rx=Math.max;function Ex(t,e,r,n){t=ar(t)?t:Tx(t),r=r?UE(r):0;var i=t.length;return r<0&&(r=Rx(i+r,0)),Mi(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&mA(t,e,r)>-1}var Ax="[object RegExp]";function $x(t){return xt(t)&&Ct(t)==Ax}var Ll=Li&&Li.isRegExp,kx=Ll?Gd(Ll):$x;function xx(t,e,r,n){if(!ft(t))return t;e=xa(e,t);for(var i=-1,a=e.length,s=a-1,o=t;o!=null&&++i<a;){var u=Pn(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=o[u];l=void 0,l===void 0&&(l=ft(c)?c:Ea(e[i+1])?[]:{})}ru(o,u,l),o=o[u]}return t}function bx(t,e,r){for(var n=-1,i=e.length,a={};++n<i;){var s=e[n],o=ou(t,s);r(o,s)&&xx(a,xa(s,t),o)}return a}function Je(t,e){if(t==null)return{};var r=Ta(fk(t),function(n){return[n]});return e=ba(e),bx(t,r,function(n,i){return e(n,i[0])})}function Sx(t,e){var r;return Sa(t,function(n,i,a){return r=e(n,i,a),!r}),!!r}function wx(t,e,r){var n=pe(t)?Xd:Sx;return n(t,ba(e))}function Ix(t){return _x(t)?t.LABEL:t.name}function _x(t){return Mi(t.LABEL)&&t.LABEL!==""}class et{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),dx(this.definition,r=>{r.accept(e)})}}class fe extends et{constructor(e){super([]),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class xr extends et{constructor(e){super(e.definition),this.orgText="",Qe(this,Je(e,r=>r!==void 0))}}class me extends et{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Qe(this,Je(e,r=>r!==void 0))}}let ae=class extends et{constructor(t){super(t.definition),this.idx=1,Qe(this,Je(t,e=>e!==void 0))}};class xe extends et{constructor(e){super(e.definition),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}}class be extends et{constructor(e){super(e.definition),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}}class Y extends et{constructor(e){super(e.definition),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}}class ye extends et{constructor(e){super(e.definition),this.idx=1,Qe(this,Je(e,r=>r!==void 0))}}class ve extends et{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Qe(this,Je(e,r=>r!==void 0))}}class K{constructor(e){this.idx=1,Qe(this,Je(e,r=>r!==void 0))}accept(e){e.visit(this)}}function Cx(t){return eh(t,pi)}function pi(t){function e(r){return eh(r,pi)}if(t instanceof fe){const r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Mi(t.label)&&(r.label=t.label),r}else{if(t instanceof me)return{type:"Alternative",definition:e(t.definition)};if(t instanceof ae)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof xe)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof be)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:pi(new K({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof ye)return{type:"RepetitionWithSeparator",idx:t.idx,separator:pi(new K({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Y)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof ve)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof K){const r={type:"Terminal",name:t.terminalType.name,label:Ix(t.terminalType),idx:t.idx};Mi(t.label)&&(r.terminalLabel=t.label);const n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=kx(n)?n.source:n),r}else{if(t instanceof xr)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class br{visit(e){const r=e;switch(r.constructor){case fe:return this.visitNonTerminal(r);case me:return this.visitAlternative(r);case ae:return this.visitOption(r);case xe:return this.visitRepetitionMandatory(r);case be:return this.visitRepetitionMandatoryWithSeparator(r);case ye:return this.visitRepetitionWithSeparator(r);case Y:return this.visitRepetition(r);case ve:return this.visitAlternation(r);case K:return this.visitTerminal(r);case xr:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Nx(t){return t instanceof me||t instanceof ae||t instanceof Y||t instanceof xe||t instanceof be||t instanceof ye||t instanceof K||t instanceof xr}function Di(t,e=[]){return t instanceof ae||t instanceof Y||t instanceof ye?!0:t instanceof ve?wx(t.definition,r=>Di(r,e)):t instanceof fe&&Ex(e,t)?!1:t instanceof et?(t instanceof fe&&e.push(t),mx(t.definition,r=>Di(r,e))):!1}function Ox(t){return t instanceof ve}function He(t){if(t instanceof fe)return"SUBRULE";if(t instanceof ae)return"OPTION";if(t instanceof ve)return"OR";if(t instanceof xe)return"AT_LEAST_ONE";if(t instanceof be)return"AT_LEAST_ONE_SEP";if(t instanceof ye)return"MANY_SEP";if(t instanceof Y)return"MANY";if(t instanceof K)return"CONSUME";throw Error("non exhaustive match")}class wa{walk(e,r=[]){_(e.definition,(n,i)=>{const a=re(e.definition,i+1);if(n instanceof fe)this.walkProdRef(n,a,r);else if(n instanceof K)this.walkTerminal(n,a,r);else if(n instanceof me)this.walkFlat(n,a,r);else if(n instanceof ae)this.walkOption(n,a,r);else if(n instanceof xe)this.walkAtLeastOne(n,a,r);else if(n instanceof be)this.walkAtLeastOneSep(n,a,r);else if(n instanceof ye)this.walkManySep(n,a,r);else if(n instanceof Y)this.walkMany(n,a,r);else if(n instanceof ve)this.walkOr(n,a,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){const i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){const i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){const i=[new ae({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){const i=Pl(e,r,n);this.walk(e,i)}walkMany(e,r,n){const i=[new ae({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){const i=Pl(e,r,n);this.walk(e,i)}walkOr(e,r,n){const i=r.concat(n);_(e.definition,a=>{const s=new me({definition:[a]});this.walk(s,i)})}}function Pl(t,e,r){return[new ae({definition:[new K({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Mn(t){if(t instanceof fe)return Mn(t.referencedRule);if(t instanceof K)return Mx(t);if(Nx(t))return Lx(t);if(Ox(t))return Px(t);throw Error("non exhaustive match")}function Lx(t){let e=[];const r=t.definition;let n=0,i=r.length>n,a,s=!0;for(;i&&s;)a=r[n],s=Di(a),e=e.concat(Mn(a)),n=n+1,i=r.length>n;return tu(e)}function Px(t){const e=S(t.definition,r=>Mn(r));return tu(Fe(e))}function Mx(t){return[t.terminalType]}const th="_~IN~_";class Dx extends wa{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){const i=Fx(e.referencedRule,e.idx)+this.topProd.name,a=r.concat(n),s=new me({definition:a}),o=Mn(s);this.follows[i]=o}}function jx(t){const e={};return _(t,r=>{const n=new Dx(r).startWalking();Bs(e,n)}),e}function Fx(t,e){return t.name+e+th}let mi={};const Ux=new Wf;function Ia(t){const e=t.toString();if(mi.hasOwnProperty(e))return mi[e];{const r=Ux.pattern(e);return mi[e]=r,r}}function Gx(){mi={}}const rh="Complement Sets are not supported for first char optimization",ji=`Unable to use "first char" lexer optimizations:
|
|
13
13
|
`;function Bx(t,e=!1){try{const r=Ia(t);return Qs(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===rh)e&&_d(`${ji} Unable to optimize: < ${t.toString()} >
|
|
14
14
|
Complement Sets cannot be automatically optimized.
|
|
15
15
|
This will disable the lexer's first char optimizations.
|
|
16
16
|
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
|
|
17
17
|
This will disable the lexer's first char optimizations.
|
|
18
|
-
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),
|
|
18
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),zs(`${ji}
|
|
19
19
|
Failed parsing: < ${t.toString()} >
|
|
20
20
|
Using the @chevrotain/regexp-to-ast library
|
|
21
|
-
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Qs(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Qs(t.value[i],e,r);break;case"Alternative":const n=t.value;for(let i=0;i<n.length;i++){const a=n[i];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const s=a;switch(s.type){case"Character":ei(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(rh);_(s.value,u=>{if(typeof u=="number")ei(u,e,r);else{const l=u;if(r===!0)for(let c=l.from;c<=l.to;c++)ei(c,e,r);else{for(let c=l.from;c<=l.to&&c<ln;c++)ei(c,e,r);if(l.to>=ln){const c=l.from>=ln?l.from:ln,f=l.to,d=bt(c),h=bt(f);for(let m=d;m<=h;m++)e[m]=m}}}});break;case"Group":Qs(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Js(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Q(e)}function ei(t,e,r){const n=bt(t);e[n]=n,r===!0&&Kx(t,e)}function Kx(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=bt(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=bt(i.charCodeAt(0));e[a]=a}}}function Ml(t,e){return Tr(t.value,r=>{if(typeof r=="number")return ge(e,r);{const n=r;return Tr(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function Js(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?M(t.value)?Ye(t.value,Js):Js(t.value):!1}class Vx extends ia{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){ge(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Ml(e,this.targetCharCodes)===void 0&&(this.found=!0):Ml(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function lu(t,e){if(e instanceof RegExp){const r=Ia(e),n=new Vx(t);return n.visit(r),n.found}else return Tr(e,r=>ge(t,r.charCodeAt(0)))!==void 0}const Xt="PATTERN",un="defaultMode",ti="modes";let nh=typeof new RegExp("(?:)").sticky=="boolean";function
|
|
22
|
-
`],tracer:(R,T)=>T()});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{pb()});let n;r("Reject Lexer.NA",()=>{n=ya(t,R=>R[Xt]===he.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=S(n,R=>{const T=R[Xt];if($t(T)){const $=T.source;return $.length===1&&$!=="^"&&$!=="$"&&$!=="."&&!T.ignoreCase?$:$.length===2&&$[0]==="\\"&&!ge(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],$[1])?$[1]:e.useSticky?jl(T):Dl(T)}else{if(ht(T))return i=!0,{exec:T};if(typeof T=="object")return i=!0,T;if(typeof T=="string"){if(T.length===1)return T;{const $=T.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),P=new RegExp($);return e.useSticky?jl(P):Dl(P)}}else throw Error("non exhaustive match")}})});let s,o,u,l,c;r("misc mapping",()=>{s=S(n,R=>R.tokenTypeIdx),o=S(n,R=>{const T=R.GROUP;if(T!==he.SKIPPED){if(Be(T))return T;if(ct(T))return!1;throw Error("non exhaustive match")}}),u=S(n,R=>{const T=R.LONGER_ALT;if(T)return M(T)?S(T,$=>ll(n,$)):[ll(n,T)]}),l=S(n,R=>R.PUSH_MODE),c=S(n,R=>w(R,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{const R=sh(e.lineTerminatorCharacters);f=S(n,T=>!1),e.positionTracking!=="onlyOffset"&&(f=S(n,T=>w(T,"LINE_BREAKS")?!!T.LINE_BREAKS:ah(T,R)===!1&&lu(R,T.PATTERN)))});let d,h,m,g;r("Misc Mapping #2",()=>{d=S(n,ih),h=S(a,fb),m=ke(n,(R,T)=>{const $=T.GROUP;return Be($)&&$!==he.SKIPPED&&(R[$]=[]),R},{}),g=S(a,(R,T)=>({pattern:a[T],longerAlt:u[T],canLineTerminator:f[T],isCustom:d[T],short:h[T],group:o[T],push:l[T],pop:c[T],tokenTypeIdx:s[T],tokenType:n[T]}))});let E=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=ke(n,(R,T,$)=>{if(typeof T.PATTERN=="string"){const P=T.PATTERN.charCodeAt(0),oe=bt(P);es(R,oe,g[$])}else if(M(T.START_CHARS_HINT)){let P;_(T.START_CHARS_HINT,oe=>{const Me=typeof oe=="string"?oe.charCodeAt(0):oe,Te=bt(Me);P!==Te&&(P=Te,es(R,Te,g[$]))})}else if($t(T.PATTERN))if(T.PATTERN.unicode)E=!1,e.ensureOptimizations&&
|
|
21
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function Qs(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Qs(t.value[i],e,r);break;case"Alternative":const n=t.value;for(let i=0;i<n.length;i++){const a=n[i];switch(a.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const s=a;switch(s.type){case"Character":ei(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(rh);_(s.value,u=>{if(typeof u=="number")ei(u,e,r);else{const l=u;if(r===!0)for(let c=l.from;c<=l.to;c++)ei(c,e,r);else{for(let c=l.from;c<=l.to&&c<ln;c++)ei(c,e,r);if(l.to>=ln){const c=l.from>=ln?l.from:ln,f=l.to,d=bt(c),h=bt(f);for(let m=d;m<=h;m++)e[m]=m}}}});break;case"Group":Qs(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}const o=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Js(s)===!1||s.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Q(e)}function ei(t,e,r){const n=bt(t);e[n]=n,r===!0&&Kx(t,e)}function Kx(t,e){const r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){const i=bt(n.charCodeAt(0));e[i]=i}else{const i=r.toLowerCase();if(i!==r){const a=bt(i.charCodeAt(0));e[a]=a}}}function Ml(t,e){return Tr(t.value,r=>{if(typeof r=="number")return ge(e,r);{const n=r;return Tr(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function Js(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?M(t.value)?Ye(t.value,Js):Js(t.value):!1}class Vx extends ia{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){ge(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Ml(e,this.targetCharCodes)===void 0&&(this.found=!0):Ml(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function lu(t,e){if(e instanceof RegExp){const r=Ia(e),n=new Vx(t);return n.visit(r),n.found}else return Tr(e,r=>ge(t,r.charCodeAt(0)))!==void 0}const Xt="PATTERN",un="defaultMode",ti="modes";let nh=typeof new RegExp("(?:)").sticky=="boolean";function Hx(t,e){e=eu(e,{useSticky:nh,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
22
|
+
`],tracer:(R,T)=>T()});const r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{pb()});let n;r("Reject Lexer.NA",()=>{n=ya(t,R=>R[Xt]===he.NA)});let i=!1,a;r("Transform Patterns",()=>{i=!1,a=S(n,R=>{const T=R[Xt];if($t(T)){const $=T.source;return $.length===1&&$!=="^"&&$!=="$"&&$!=="."&&!T.ignoreCase?$:$.length===2&&$[0]==="\\"&&!ge(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],$[1])?$[1]:e.useSticky?jl(T):Dl(T)}else{if(ht(T))return i=!0,{exec:T};if(typeof T=="object")return i=!0,T;if(typeof T=="string"){if(T.length===1)return T;{const $=T.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),P=new RegExp($);return e.useSticky?jl(P):Dl(P)}}else throw Error("non exhaustive match")}})});let s,o,u,l,c;r("misc mapping",()=>{s=S(n,R=>R.tokenTypeIdx),o=S(n,R=>{const T=R.GROUP;if(T!==he.SKIPPED){if(Be(T))return T;if(ct(T))return!1;throw Error("non exhaustive match")}}),u=S(n,R=>{const T=R.LONGER_ALT;if(T)return M(T)?S(T,$=>ll(n,$)):[ll(n,T)]}),l=S(n,R=>R.PUSH_MODE),c=S(n,R=>w(R,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{const R=sh(e.lineTerminatorCharacters);f=S(n,T=>!1),e.positionTracking!=="onlyOffset"&&(f=S(n,T=>w(T,"LINE_BREAKS")?!!T.LINE_BREAKS:ah(T,R)===!1&&lu(R,T.PATTERN)))});let d,h,m,g;r("Misc Mapping #2",()=>{d=S(n,ih),h=S(a,fb),m=ke(n,(R,T)=>{const $=T.GROUP;return Be($)&&$!==he.SKIPPED&&(R[$]=[]),R},{}),g=S(a,(R,T)=>({pattern:a[T],longerAlt:u[T],canLineTerminator:f[T],isCustom:d[T],short:h[T],group:o[T],push:l[T],pop:c[T],tokenTypeIdx:s[T],tokenType:n[T]}))});let E=!0,v=[];return e.safeMode||r("First Char Optimization",()=>{v=ke(n,(R,T,$)=>{if(typeof T.PATTERN=="string"){const P=T.PATTERN.charCodeAt(0),oe=bt(P);es(R,oe,g[$])}else if(M(T.START_CHARS_HINT)){let P;_(T.START_CHARS_HINT,oe=>{const Me=typeof oe=="string"?oe.charCodeAt(0):oe,Te=bt(Me);P!==Te&&(P=Te,es(R,Te,g[$]))})}else if($t(T.PATTERN))if(T.PATTERN.unicode)E=!1,e.ensureOptimizations&&zs(`${ji} Unable to analyze < ${T.PATTERN.toString()} > pattern.
|
|
23
23
|
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
24
24
|
This will disable the lexer's first char optimizations.
|
|
25
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const P=Bx(T.PATTERN,e.ensureOptimizations);
|
|
25
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const P=Bx(T.PATTERN,e.ensureOptimizations);U(P)&&(E=!1),_(P,oe=>{es(R,oe,g[$])})}else e.ensureOptimizations&&zs(`${ji} TokenType: <${T.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
26
26
|
This will disable the lexer's first char optimizations.
|
|
27
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),E=!1;return R},[])}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:E}}function
|
|
27
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),E=!1;return R},[])}),{emptyGroups:m,patternIdxToConfig:g,charCodeToPatternIdxToConfig:v,hasCustom:i,canBeOptimized:E}}function zx(t,e){let r=[];const n=Yx(t);r=r.concat(n.errors);const i=qx(n.valid),a=i.valid;return r=r.concat(i.errors),r=r.concat(Wx(a)),r=r.concat(nb(a)),r=r.concat(ib(a,e)),r=r.concat(ab(a)),r}function Wx(t){let e=[];const r=Pe(t,n=>$t(n[Xt]));return e=e.concat(Zx(r)),e=e.concat(eb(r)),e=e.concat(tb(r)),e=e.concat(rb(r)),e=e.concat(Qx(r)),e}function Yx(t){const e=Pe(t,i=>!w(i,Xt)),r=S(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:q.MISSING_PATTERN,tokenTypes:[i]})),n=ga(t,e);return{errors:r,valid:n}}function qx(t){const e=Pe(t,i=>{const a=i[Xt];return!$t(a)&&!ht(a)&&!w(a,"exec")&&!Be(a)}),r=S(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:q.INVALID_PATTERN,tokenTypes:[i]})),n=ga(t,e);return{errors:r,valid:n}}const Xx=/[^\\][$]/;function Zx(t){class e extends ia{constructor(){super(...arguments),this.found=!1}visitEndAnchor(i){this.found=!0}}const r=Pe(t,n=>{const i=n.PATTERN;try{const a=Ia(i),s=new e;return s.visit(a),s.found}catch{return Xx.test(i.source)}});return S(r,n=>({message:`Unexpected RegExp Anchor Error:
|
|
28
28
|
Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
29
29
|
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:q.EOI_ANCHOR_FOUND,tokenTypes:[n]}))}function Qx(t){const e=Pe(t,r=>r.PATTERN.test(""));return S(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:q.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const Jx=/[^\\[][\^]|^\^/;function eb(t){class e extends ia{constructor(){super(...arguments),this.found=!1}visitStartAnchor(i){this.found=!0}}const r=Pe(t,n=>{const i=n.PATTERN;try{const a=Ia(i),s=new e;return s.visit(a),s.found}catch{return Jx.test(i.source)}});return S(r,n=>({message:`Unexpected RegExp Anchor Error:
|
|
30
30
|
Token Type: ->`+n.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
@@ -35,7 +35,7 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.
|
|
|
35
35
|
`,type:q.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),w(t,ti)&&w(t,un)&&!w(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${un}: <${t.defaultMode}>which does not exist
|
|
36
36
|
`,type:q.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),w(t,ti)&&_(t.modes,(i,a)=>{_(i,(s,o)=>{if(ct(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${a}> at index: <${o}>
|
|
37
37
|
`,type:q.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(w(s,"LONGER_ALT")){const u=M(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];_(u,l=>{!ct(l)&&!ge(i,l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${s.name}> outside of mode <${a}>
|
|
38
|
-
`,type:q.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function lb(t,e,r){const n=[];let i=!1;const a=On(
|
|
38
|
+
`,type:q.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function lb(t,e,r){const n=[];let i=!1;const a=On(Fe(Q(t.modes))),s=ya(a,u=>u[Xt]===he.NA),o=sh(r);return e&&_(s,u=>{const l=ah(u,o);if(l!==!1){const c={message:hb(u,l),type:l.issue,tokenType:u};n.push(c)}else w(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):lu(o,u.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
|
|
39
39
|
This Lexer has been defined to track line and column information,
|
|
40
40
|
But none of the Token Types can be identified as matching a line terminator.
|
|
41
41
|
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
@@ -44,23 +44,23 @@ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.
|
|
|
44
44
|
Root cause: ${e.errMsg}.
|
|
45
45
|
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===q.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
46
46
|
The problem is in the <${t.name}> Token Type
|
|
47
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function sh(t){return S(t,e=>Be(e)?e.charCodeAt(0):e)}function es(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}const ln=256;let gi=[];function bt(t){return t<ln?t:gi[t]}function pb(){if(
|
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function sh(t){return S(t,e=>Be(e)?e.charCodeAt(0):e)}function es(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}const ln=256;let gi=[];function bt(t){return t<ln?t:gi[t]}function pb(){if(U(gi)){gi=new Array(65536);for(let t=0;t<65536;t++)gi[t]=t>255?255+~~(t/255):t}}function Dn(t,e){const r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Fi(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let Fl=1;const oh={};function jn(t){const e=mb(t);gb(e),vb(e),yb(e),_(e,r=>{r.isParent=r.categoryMatches.length>0})}function mb(t){let e=se(t),r=t,n=!0;for(;n;){r=On(Fe(S(r,a=>a.CATEGORIES)));const i=ga(r,e);e=e.concat(i),U(i)?n=!1:r=i}return e}function gb(t){_(t,e=>{lh(e)||(oh[Fl]=e,e.tokenTypeIdx=Fl++),Ul(e)&&!M(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),Ul(e)||(e.CATEGORIES=[]),Tb(e)||(e.categoryMatches=[]),Rb(e)||(e.categoryMatchesMap={})})}function yb(t){_(t,e=>{e.categoryMatches=[],_(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(oh[n].tokenTypeIdx)})})}function vb(t){_(t,e=>{uh([],e)})}function uh(t,e){_(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),_(e.CATEGORIES,r=>{const n=t.concat(e);ge(n,r)||uh(n,r)})}function lh(t){return w(t,"tokenTypeIdx")}function Ul(t){return w(t,"CATEGORIES")}function Tb(t){return w(t,"categoryMatches")}function Rb(t){return w(t,"categoryMatchesMap")}function Eb(t){return w(t,"tokenTypeIdx")}const eo={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var q;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(q||(q={}));const cn={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
48
48
|
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:eo,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(cn);class he{constructor(e,r=cn){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,a)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);const{time:o,value:u}=Cd(a),l=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${s}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,u}else return a()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
49
49
|
a boolean 2nd argument is no longer supported`);this.config=Bs({},cn,r);const n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,a=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===cn.lineTerminatorsPattern)this.config.lineTerminatorsPattern=db;else if(this.config.lineTerminatorCharacters===cn.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
50
|
-
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),M(e)?i={modes:{defaultMode:se(e)},defaultMode:un}:(a=!1,i=se(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(ub(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(lb(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},_(i.modes,(o,u)=>{i.modes[u]=ya(o,l=>ct(l))});const s=Le(i.modes);if(_(i.modes,(o,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(
|
|
50
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),M(e)?i={modes:{defaultMode:se(e)},defaultMode:un}:(a=!1,i=se(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(ub(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(lb(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},_(i.modes,(o,u)=>{i.modes[u]=ya(o,l=>ct(l))});const s=Le(i.modes);if(_(i.modes,(o,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(zx(o,s))}),U(this.lexerDefinitionErrors)){jn(o);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=Hx(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=l.charCodeToPatternIdxToConfig,this.emptyGroups=Bs({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!U(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const o=S(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
|
|
51
51
|
`);throw new Error(`Errors detected in definition of Lexer:
|
|
52
|
-
`+o)}_(this.lexerDefinitionWarning,o=>{_d(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(nh?(this.chopInput=gr,this.match=this.matchWithTest):(this.updateLastIndex=Z,this.match=this.matchWithExec),a&&(this.handleModes=Z),this.trackStartLines===!1&&(this.computeNewColumn=gr),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Z),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=ke(this.canModeBeOptimized,(u,l,c)=>(l===!1&&u.push(c),u),[]);if(r.ensureOptimizations&&!
|
|
52
|
+
`+o)}_(this.lexerDefinitionWarning,o=>{_d(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(nh?(this.chopInput=gr,this.match=this.matchWithTest):(this.updateLastIndex=Z,this.match=this.matchWithExec),a&&(this.handleModes=Z),this.trackStartLines===!1&&(this.computeNewColumn=gr),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Z),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=ke(this.canModeBeOptimized,(u,l,c)=>(l===!1&&u.push(c),u),[]);if(r.ensureOptimizations&&!U(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
|
|
53
53
|
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
54
|
-
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Gx()}),this.TRACE_INIT("toFastProperties",()=>{Nd(this)})})}tokenize(e,r=this.defaultMode){if(!
|
|
54
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Gx()}),this.TRACE_INIT("toFastProperties",()=>{Nd(this)})})}tokenize(e,r=this.defaultMode){if(!U(this.lexerDefinitionErrors)){const n=S(this.lexerDefinitionErrors,i=>i.message).join(`-----------------------
|
|
55
55
|
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
56
|
-
`+n)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,u,l,c,f,d,h,m,g,E,v;const R=e,T=R.length;let $=0,P=0;const oe=this.hasCustom?0:Math.floor(e.length/10),Me=new Array(oe),Te=[];let Ve=this.trackStartLines?1:void 0,Se=this.trackStartLines?1:void 0;const k=cb(this.emptyGroups),y=this.trackStartLines,b=this.config.lineTerminatorsPattern;let x=0,O=[],N=[];const C=[],Re=[];Object.freeze(Re);let J;function W(){return O}function jt(ue){const we=bt(ue),lr=N[we];return lr===void 0?Re:lr}const wp=ue=>{if(C.length===1&&ue.tokenType.PUSH_MODE===void 0){const we=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ue);Te.push({offset:ue.startOffset,line:ue.startLine,column:ue.startColumn,length:ue.image.length,message:we})}else{C.pop();const we=vr(C);O=this.patternIdxToConfig[we],N=this.charCodeToPatternIdxToConfig[we],x=O.length;const lr=this.canModeBeOptimized[we]&&this.config.safeMode===!1;N&&lr?J=jt:J=W}};function $u(ue){C.push(ue),N=this.charCodeToPatternIdxToConfig[ue],O=this.patternIdxToConfig[ue],x=O.length,x=O.length;const we=this.canModeBeOptimized[ue]&&this.config.safeMode===!1;N&&we?J=jt:J=W}$u.call(this,r);let De;const ku=this.config.recoveryEnabled;for(;$<T;){u=null;const ue=R.charCodeAt($),we=J(ue),lr=we.length;for(n=0;n<lr;n++){De=we[n];const Ee=De.pattern;l=null;const tt=De.short;if(tt!==!1?ue===tt&&(u=Ee):De.isCustom===!0?(v=Ee.exec(R,$,Me,k),v!==null?(u=v[0],v.payload!==void 0&&(l=v.payload)):u=null):(this.updateLastIndex(Ee,$),u=this.match(Ee,e,$)),u!==null){if(o=De.longerAlt,o!==void 0){const Tt=o.length;for(a=0;a<Tt;a++){const rt=O[o[a]],
|
|
57
|
-
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return w(t,Gl)&&(r.CATEGORIES=t[Gl]),jn([r]),w(t,Bl)&&(r.LABEL=t[Bl]),w(t,Kl)&&(r.GROUP=t[Kl]),w(t,
|
|
56
|
+
`+n)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,a,s,o,u,l,c,f,d,h,m,g,E,v;const R=e,T=R.length;let $=0,P=0;const oe=this.hasCustom?0:Math.floor(e.length/10),Me=new Array(oe),Te=[];let Ve=this.trackStartLines?1:void 0,Se=this.trackStartLines?1:void 0;const k=cb(this.emptyGroups),y=this.trackStartLines,b=this.config.lineTerminatorsPattern;let x=0,O=[],N=[];const C=[],Re=[];Object.freeze(Re);let J;function W(){return O}function jt(ue){const we=bt(ue),lr=N[we];return lr===void 0?Re:lr}const wp=ue=>{if(C.length===1&&ue.tokenType.PUSH_MODE===void 0){const we=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ue);Te.push({offset:ue.startOffset,line:ue.startLine,column:ue.startColumn,length:ue.image.length,message:we})}else{C.pop();const we=vr(C);O=this.patternIdxToConfig[we],N=this.charCodeToPatternIdxToConfig[we],x=O.length;const lr=this.canModeBeOptimized[we]&&this.config.safeMode===!1;N&&lr?J=jt:J=W}};function $u(ue){C.push(ue),N=this.charCodeToPatternIdxToConfig[ue],O=this.patternIdxToConfig[ue],x=O.length,x=O.length;const we=this.canModeBeOptimized[ue]&&this.config.safeMode===!1;N&&we?J=jt:J=W}$u.call(this,r);let De;const ku=this.config.recoveryEnabled;for(;$<T;){u=null;const ue=R.charCodeAt($),we=J(ue),lr=we.length;for(n=0;n<lr;n++){De=we[n];const Ee=De.pattern;l=null;const tt=De.short;if(tt!==!1?ue===tt&&(u=Ee):De.isCustom===!0?(v=Ee.exec(R,$,Me,k),v!==null?(u=v[0],v.payload!==void 0&&(l=v.payload)):u=null):(this.updateLastIndex(Ee,$),u=this.match(Ee,e,$)),u!==null){if(o=De.longerAlt,o!==void 0){const Tt=o.length;for(a=0;a<Tt;a++){const rt=O[o[a]],Ft=rt.pattern;if(c=null,rt.isCustom===!0?(v=Ft.exec(R,$,Me,k),v!==null?(s=v[0],v.payload!==void 0&&(c=v.payload)):s=null):(this.updateLastIndex(Ft,$),s=this.match(Ft,e,$)),s&&s.length>u.length){u=s,l=c,De=rt;break}}}break}}if(u!==null){if(f=u.length,d=De.group,d!==void 0&&(h=De.tokenTypeIdx,m=this.createTokenInstance(u,$,h,De.tokenType,Ve,Se,f),this.handlePayload(m,l),d===!1?P=this.addToken(Me,P,m):k[d].push(m)),e=this.chopInput(e,f),$=$+f,Se=this.computeNewColumn(Se,f),y===!0&&De.canLineTerminator===!0){let Ee=0,tt,Tt;b.lastIndex=0;do tt=b.test(u),tt===!0&&(Tt=b.lastIndex-1,Ee++);while(tt===!0);Ee!==0&&(Ve=Ve+Ee,Se=f-Tt,this.updateTokenEndLineColumnLocation(m,d,Tt,Ee,Ve,Se,f))}this.handleModes(De,wp,$u,m)}else{const Ee=$,tt=Ve,Tt=Se;let rt=ku===!1;for(;rt===!1&&$<T;)for(e=this.chopInput(e,1),$++,i=0;i<x;i++){const Ft=O[i],ja=Ft.pattern,xu=Ft.short;if(xu!==!1?R.charCodeAt($)===xu&&(rt=!0):Ft.isCustom===!0?rt=ja.exec(R,$,Me,k)!==null:(this.updateLastIndex(ja,$),rt=ja.exec(e)!==null),rt===!0)break}if(g=$-Ee,Se=this.computeNewColumn(Se,g),E=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(R,Ee,g,tt,Tt),Te.push({offset:Ee,line:tt,column:Tt,length:g,message:E}),ku===!1)break}}return this.hasCustom||(Me.length=P),{tokens:Me,groups:k,errors:Te}}handleModes(e,r,n,i){if(e.pop===!0){const a=e.push;r(i),a!==void 0&&n.call(this,a)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,a,s,o){let u,l;r!==void 0&&(u=n===o-1,l=u?-1:0,i===1&&u===!0||(e.endLine=a+l,e.endColumn=s-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,a,s){return{image:e,startOffset:r,startLine:a,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:r+o-1,startLine:a,endLine:a,startColumn:s,endColumn:s+o-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){const n=e.exec(r);return n!==null?n[0]:null}}he.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";he.NA=/NOT_APPLICABLE/;function mr(t){return ch(t)?t.LABEL:t.name}function ch(t){return Be(t.LABEL)&&t.LABEL!==""}const Ab="parent",Gl="categories",Bl="label",Kl="group",Vl="push_mode",Hl="pop_mode",zl="longer_alt",Wl="line_breaks",Yl="start_chars_hint";function fh(t){return $b(t)}function $b(t){const e=t.pattern,r={};if(r.name=t.name,ct(e)||(r.PATTERN=e),w(t,Ab))throw`The parent property is no longer supported.
|
|
57
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return w(t,Gl)&&(r.CATEGORIES=t[Gl]),jn([r]),w(t,Bl)&&(r.LABEL=t[Bl]),w(t,Kl)&&(r.GROUP=t[Kl]),w(t,Hl)&&(r.POP_MODE=t[Hl]),w(t,Vl)&&(r.PUSH_MODE=t[Vl]),w(t,zl)&&(r.LONGER_ALT=t[zl]),w(t,Wl)&&(r.LINE_BREAKS=t[Wl]),w(t,Yl)&&(r.START_CHARS_HINT=t[Yl]),r}const St=fh({name:"EOF",pattern:he.NA});jn([St]);function cu(t,e,r,n,i,a,s,o){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:a,startColumn:s,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function dh(t,e){return Dn(t,e)}const dr={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${ch(t)?`--> ${mr(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){const a="Expecting: ",s=`
|
|
58
58
|
but found: '`+Ge(e).image+"'";if(n)return a+n+s;{const o=ke(t,(c,f)=>c.concat(f),[]),u=S(o,c=>`[${S(c,f=>mr(f)).join(", ")}]`),l=`one of these possible Token sequences:
|
|
59
59
|
${S(u,(c,f)=>` ${f+1}. ${c}`).join(`
|
|
60
60
|
`)}`;return a+l+s}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){const i="Expecting: ",a=`
|
|
61
61
|
but found: '`+Ge(e).image+"'";if(r)return i+r+a;{const s=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
62
62
|
<${S(t,o=>`[${S(o,u=>mr(u)).join(",")}]`).join(" ,")}>`;return i+s+a}}};Object.freeze(dr);const kb={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
63
|
-
inside top level rule: ->`+t.name+"<-"}},Vt={buildDuplicateFoundError(t,e){function r(c){return c instanceof K?c.terminalType.name:c instanceof fe?c.nonTerminalName:""}const n=t.name,i=Ge(e),a=i.idx,s=
|
|
63
|
+
inside top level rule: ->`+t.name+"<-"}},Vt={buildDuplicateFoundError(t,e){function r(c){return c instanceof K?c.terminalType.name:c instanceof fe?c.nonTerminalName:""}const n=t.name,i=Ge(e),a=i.idx,s=He(i),o=r(i),u=a>0;let l=`->${s}${u?a:""}<- ${o?`with argument: ->${o}<-`:""}
|
|
64
64
|
appears more than once (${e.length} times) in the top level rule: ->${n}<-.
|
|
65
65
|
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
66
66
|
`;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
|
|
@@ -75,7 +75,7 @@ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFI
|
|
|
75
75
|
For Further details.`},buildAlternationAmbiguityError(t){const e=S(t.prefixPath,i=>mr(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
|
|
76
76
|
<${e}> may appears as a prefix path in all these alternatives.
|
|
77
77
|
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
78
|
-
For Further details.`,n},buildEmptyRepetitionError(t){let e=
|
|
78
|
+
For Further details.`,n},buildEmptyRepetitionError(t){let e=He(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
79
79
|
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
80
80
|
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
81
81
|
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
@@ -84,37 +84,37 @@ rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
|
84
84
|
without consuming any Tokens. The grammar path that causes this is:
|
|
85
85
|
${n}
|
|
86
86
|
To fix this refactor your grammar to remove the left recursion.
|
|
87
|
-
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof xr?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function xb(t,e){const r=new bb(t,e);return r.resolveRefs(),r.errors}class bb extends br{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){_(Q(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:de.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Sb extends wa{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=se(this.path.ruleStack).reverse(),this.occurrenceStack=se(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){F(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class wb extends Sb{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new me({definition:i});this.possibleTokTypes=Mn(a),this.found=!0}}}class _a extends wa{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class Ib extends _a{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Ge(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof K&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}}class ql extends _a{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Ge(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof K&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}}class _b extends _a{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Ge(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof K&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}}class Xl extends _a{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Ge(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof K&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}}function to(t,e,r=[]){r=se(r);let n=[],i=0;function a(o){return o.concat(re(t,i+1))}function s(o){const u=to(a(o),e,r);return n.concat(u)}for(;r.length<e&&i<t.length;){const o=t[i];if(o instanceof me||o instanceof fe)return s(o.definition);if(o instanceof ae)n=s(o.definition);else if(o instanceof xe){const u=o.definition.concat([new Y({definition:o.definition})]);return s(u)}else if(o instanceof be){const u=[new me({definition:o.definition}),new Y({definition:[new K({terminalType:o.separator})].concat(o.definition)})];return s(u)}else if(o instanceof ye){const u=o.definition.concat([new Y({definition:[new K({terminalType:o.separator})].concat(o.definition)})]);n=s(u)}else if(o instanceof Y){const u=o.definition.concat([new Y({definition:o.definition})]);n=s(u)}else{if(o instanceof ve)return _(o.definition,u=>{F(u.definition)===!1&&(n=s(u.definition))}),n;if(o instanceof K)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:re(t,i)}),n}function hh(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!F(f);){const d=f.pop();if(d===s){o&&vr(f).idx<=l&&f.pop();continue}const h=d.def,m=d.idx,g=d.ruleStack,E=d.occurrenceStack;if(F(h))continue;const v=h[0];if(v===i){const R={idx:m,def:re(h),ruleStack:$n(g),occurrenceStack:$n(E)};f.push(R)}else if(v instanceof K)if(m<u-1){const R=m+1,T=e[R];if(r(T,v.terminalType)){const $={idx:R,def:re(h),ruleStack:g,occurrenceStack:E};f.push($)}}else if(m===u-1)c.push({nextTokenType:v.terminalType,nextTokenOccurrence:v.idx,ruleStack:g,occurrenceStack:E}),o=!0;else throw Error("non exhaustive match");else if(v instanceof fe){const R=se(g);R.push(v.nonTerminalName);const T=se(E);T.push(v.idx);const $={idx:m,def:v.definition.concat(a,re(h)),ruleStack:R,occurrenceStack:T};f.push($)}else if(v instanceof ae){const R={idx:m,def:re(h),ruleStack:g,occurrenceStack:E};f.push(R),f.push(s);const T={idx:m,def:v.definition.concat(re(h)),ruleStack:g,occurrenceStack:E};f.push(T)}else if(v instanceof xe){const R=new Y({definition:v.definition,idx:v.idx}),T=v.definition.concat([R],re(h)),$={idx:m,def:T,ruleStack:g,occurrenceStack:E};f.push($)}else if(v instanceof be){const R=new K({terminalType:v.separator}),T=new Y({definition:[R].concat(v.definition),idx:v.idx}),$=v.definition.concat([T],re(h)),P={idx:m,def:$,ruleStack:g,occurrenceStack:E};f.push(P)}else if(v instanceof ye){const R={idx:m,def:re(h),ruleStack:g,occurrenceStack:E};f.push(R),f.push(s);const T=new K({terminalType:v.separator}),$=new Y({definition:[T].concat(v.definition),idx:v.idx}),P=v.definition.concat([$],re(h)),oe={idx:m,def:P,ruleStack:g,occurrenceStack:E};f.push(oe)}else if(v instanceof Y){const R={idx:m,def:re(h),ruleStack:g,occurrenceStack:E};f.push(R),f.push(s);const T=new Y({definition:v.definition,idx:v.idx}),$=v.definition.concat([T],re(h)),P={idx:m,def:$,ruleStack:g,occurrenceStack:E};f.push(P)}else if(v instanceof ve)for(let R=v.definition.length-1;R>=0;R--){const T=v.definition[R],$={idx:m,def:T.definition.concat(re(h)),ruleStack:g,occurrenceStack:E};f.push($),f.push(s)}else if(v instanceof me)f.push({idx:m,def:v.definition.concat(re(h)),ruleStack:g,occurrenceStack:E});else if(v instanceof xr)f.push(Cb(v,m,g,E));else throw Error("non exhaustive match")}return c}function Cb(t,e,r,n){const i=se(r);i.push(t.name);const a=se(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var z;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(z||(z={}));function fu(t){if(t instanceof ae||t==="Option")return z.OPTION;if(t instanceof Y||t==="Repetition")return z.REPETITION;if(t instanceof xe||t==="RepetitionMandatory")return z.REPETITION_MANDATORY;if(t instanceof be||t==="RepetitionMandatoryWithSeparator")return z.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ye||t==="RepetitionWithSeparator")return z.REPETITION_WITH_SEPARATOR;if(t instanceof ve||t==="Alternation")return z.ALTERNATION;throw Error("non exhaustive match")}function Zl(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=fu(n);return a===z.ALTERNATION?Ca(e,r,i):Na(e,r,a,i)}function Nb(t,e,r,n,i,a){const s=Ca(t,e,r),o=gh(s)?Ui:Dn;return a(s,n,o,i)}function Ob(t,e,r,n,i,a){const s=Na(t,e,i,r),o=gh(s)?Ui:Dn;return a(s[0],o,n)}function Lb(t,e,r,n){const i=t.length,a=Ye(t,s=>Ye(s,o=>o.length===1));if(e)return function(s){const o=S(s,u=>u.GATE);for(let u=0;u<i;u++){const l=t[u],c=l.length,f=o[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let d=0;d<c;d++){const h=l[d],m=h.length;for(let g=0;g<m;g++){const E=this.LA(g+1);if(r(E,h[g])===!1)continue e}return u}}};if(a&&!n){const s=S(t,u=>Ue(u)),o=ke(s,(u,l,c)=>(_(l,f=>{w(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),_(f.categoryMatches,d=>{w(u,d)||(u[d]=c)})}),u),{});return function(){const u=this.LA(1);return o[u.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){const o=t[s],u=o.length;e:for(let l=0;l<u;l++){const c=o[l],f=c.length;for(let d=0;d<f;d++){const h=this.LA(d+1);if(r(h,c[d])===!1)continue e}return s}}}}function Pb(t,e,r){const n=Ye(t,a=>a.length===1),i=t.length;if(n&&!r){const a=Ue(t);if(a.length===1&&F(a[0].categoryMatches)){const s=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{const s=ke(a,(o,u,l)=>(o[u.tokenTypeIdx]=!0,_(u.categoryMatches,c=>{o[c]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;a<i;a++){const s=t[a],o=s.length;for(let u=0;u<o;u++){const l=this.LA(u+1);if(e(l,s[u])===!1)continue e}return!0}return!1}}class Mb extends wa{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,z.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,z.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,z.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,z.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,z.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}}class ph extends br{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,z.OPTION)}visitRepetition(e){this.checkIsTarget(e,z.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,z.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,z.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,z.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,z.ALTERNATION)}}function Ql(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function ts(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let a=0;a<e.length;a++){const s=e[a];i.push(s+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){const u="_"+n.categoryMatches[o];i.push(s+u)}}e=i}return e}function Db(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let a=0;a<e.length;a++){const s=e[a];if(i[s]===!0)return!1}}return!0}function mh(t,e){const r=S(t,s=>to([s],1)),n=Ql(r.length),i=S(r,s=>{const o={};return _(s,u=>{const l=ts(u.partialPath);_(l,c=>{o[c]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=Ql(o.length);for(let u=0;u<o.length;u++){const l=o[u];for(let c=0;c<l.length;c++){const f=l[c].partialPath,d=l[c].suffixDef,h=ts(f);if(Db(i,h,u)||F(d)||f.length===e){const m=n[u];if(ro(m,f)===!1){m.push(f);for(let g=0;g<h.length;g++){const E=h[g];i[u][E]=!0}}}else{const m=to(d,s+1,f);a[u]=a[u].concat(m),_(m,g=>{const E=ts(g.partialPath);_(E,v=>{i[u][v]=!0})})}}}}return n}function Ca(t,e,r,n){const i=new ph(t,z.ALTERNATION,n);return e.accept(i),mh(i.result,r)}function Na(t,e,r,n){const i=new ph(t,r);e.accept(i);const a=i.result,s=new Mb(e,t,r).startWalking(),o=new me({definition:a}),u=new me({definition:s});return mh([o,u],n)}function ro(t,e){e:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){const a=e[i],s=n[i];if(!(a===s||s.categoryMatchesMap[a.tokenTypeIdx]!==void 0))continue e}return!0}}return!1}function jb(t,e){return t.length<e.length&&Ye(t,(r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function gh(t){return Ye(t,e=>Ye(e,r=>Ye(r,n=>F(n.categoryMatches))))}function Ub(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return S(e,r=>Object.assign({type:de.CUSTOM_LOOKAHEAD_VALIDATION},r))}function Fb(t,e,r,n){const i=_e(t,u=>Gb(u,r)),a=Jb(t,e,r),s=_e(t,u=>qb(u,r)),o=_e(t,u=>Vb(u,t,n,r));return i.concat(a,s,o)}function Gb(t,e){const r=new Kb;t.accept(r);const n=r.allProductions,i=YR(n,Bb),a=fE(i,s=>s.length>1);return S(Q(a),s=>{const o=Ge(s),u=e.buildDuplicateFoundError(t,s),l=ze(o),c={message:u,type:de.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:o.idx},f=yh(o);return f&&(c.parameter=f),c})}function Bb(t){return`${ze(t)}_#_${t.idx}_#_${yh(t)}`}function yh(t){return t instanceof K?t.terminalType.name:t instanceof fe?t.nonTerminalName:""}class Kb extends br{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function Vb(t,e,r,n){const i=[];if(ke(e,(a,s)=>s.name===t.name?a+1:a,0)>1){const a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:de.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function zb(t,e,r){const n=[];let i;return ge(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:de.INVALID_RULE_OVERRIDE,ruleName:t})),n}function vh(t,e,r,n=[]){const i=[],a=yi(e.definition);if(F(a))return[];{const s=t.name;ge(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:de.LEFT_RECURSION,ruleName:s});const o=ga(a,n.concat([t])),u=_e(o,l=>{const c=se(n);return c.push(l),vh(t,l,r,c)});return i.concat(u)}}function yi(t){let e=[];if(F(t))return e;const r=Ge(t);if(r instanceof fe)e.push(r.referencedRule);else if(r instanceof me||r instanceof ae||r instanceof xe||r instanceof be||r instanceof ye||r instanceof Y)e=e.concat(yi(r.definition));else if(r instanceof ve)e=Ue(S(r.definition,a=>yi(a.definition)));else if(!(r instanceof K))throw Error("non exhaustive match");const n=Di(r),i=t.length>1;if(n&&i){const a=re(t);return e.concat(yi(a))}else return e}class du extends br{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function Hb(t,e){const r=new du;t.accept(r);const n=r.alternations;return _e(n,i=>{const a=$n(i.definition);return _e(a,(s,o)=>{const u=hh([s],[],Dn,1);return F(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:i,emptyChoiceIdx:o}),type:de.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:i.idx,alternative:o+1}]:[]})})}function Wb(t,e,r){const n=new du;t.accept(n);let i=n.alternations;return i=ya(i,a=>a.ignoreAmbiguities===!0),_e(i,a=>{const s=a.idx,o=a.maxLookahead||e,u=Ca(s,t,o,a),l=Zb(u,a,t,r),c=Qb(u,a,t,r);return l.concat(c)})}class Yb extends br{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function qb(t,e){const r=new du;t.accept(r);const n=r.alternations;return _e(n,i=>i.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:i}),type:de.TOO_MANY_ALTS,ruleName:t.name,occurrence:i.idx}]:[])}function Xb(t,e,r){const n=[];return _(t,i=>{const a=new Yb;i.accept(a);const s=a.allProductions;_(s,o=>{const u=fu(o),l=o.maxLookahead||e,c=o.idx,f=Na(c,i,u,l)[0];if(F(Ue(f))){const d=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:d,type:de.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function Zb(t,e,r,n){const i=[],a=ke(t,(s,o,u)=>(e.definition[u].ignoreAmbiguities===!0||_(o,l=>{const c=[u];_(t,(f,d)=>{u!==d&&ro(f,l)&&e.definition[d].ignoreAmbiguities!==!0&&c.push(d)}),c.length>1&&!ro(i,l)&&(i.push(l),s.push({alts:c,path:l}))}),s),[]);return S(a,s=>{const o=S(s.alts,u=>u+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:o,prefixPath:s.path}),type:de.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:s.alts}})}function Qb(t,e,r,n){const i=ke(t,(a,s,o)=>{const u=S(s,l=>({idx:o,path:l}));return a.concat(u)},[]);return On(_e(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const s=a.idx,o=a.path,u=Pe(i,l=>e.definition[l.idx].ignoreAmbiguities!==!0&&l.idx<s&&jb(l.path,o));return S(u,l=>{const c=[l.idx+1,s+1],f=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:l.path}),type:de.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:f,alternatives:c}})}))}function Jb(t,e,r){const n=[],i=S(e,a=>a.name);return _(t,a=>{const s=a.name;if(ge(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:de.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function eS(t){const e=eu(t,{errMsgProvider:kb}),r={};return _(t.rules,n=>{r[n.name]=n}),xb(r,e.errMsgProvider)}function tS(t){return t=eu(t,{errMsgProvider:Vt}),Fb(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const Th="MismatchedTokenException",Rh="NoViableAltException",Eh="EarlyExitException",Ah="NotAllInputParsedException",$h=[Th,Rh,Eh,Ah];Object.freeze($h);function Fi(t){return ge($h,t.name)}class Oa extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class kh extends Oa{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Th}}class rS extends Oa{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Rh}}class nS extends Oa{constructor(e,r){super(e,r),this.name=Ah}}class iS extends Oa{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Eh}}const rs={},xh="InRuleRecoveryException";class aS extends Error{constructor(e){super(e),this.name=xh}}class sS{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=w(e,"recoveryEnabled")?e.recoveryEnabled:dt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=oS)}getTokenToInsert(e){const r=cu(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let u=!1;const l=this.LA(1);let c=this.LA(1);const f=()=>{const d=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:d,ruleName:this.getCurrRuleFullName()}),m=new kh(h,l,this.LA(0));m.resyncedTokens=$n(o),this.SAVE_ERROR(m)};for(;!u;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,a)?u=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new aS("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||F(r))return!1;const n=this.LA(1);return Tr(r,i=>this.tokenMatcher(n,i))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return ge(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=Tr(e,a=>dh(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return rs;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return S(e,(n,i)=>i===0?rs:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=S(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Ue(e)}getFollowSetFromFollowKey(e){if(e===rs)return[St];const r=e.ruleName+e.idxInCallingRule+th+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,St)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return $n(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=se(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return S(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function oS(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let u=this.firstAfterRepMap[o];if(u===void 0){const d=this.getCurrRuleFullName(),h=this.getGAstProductions()[d];u=new a(h,i).startWalking(),this.firstAfterRepMap[o]=u}let l=u.token,c=u.occurrence;const f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=St,c=1),!(l===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,c,s)&&this.tryInRepetitionRecovery(t,e,r,l)}const uS=4,Nt=8,bh=1<<Nt,Sh=2<<Nt,no=3<<Nt,io=4<<Nt,ao=5<<Nt,vi=6<<Nt;function ns(t,e,r){return r|e|t}class hu{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:dt.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(F(r)){const n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...a]}return r}validateNoLeftRecursion(e){return _e(e,r=>vh(r,r,Vt))}validateEmptyOrAlternatives(e){return _e(e,r=>Hb(r,Vt))}validateAmbiguousAlternationAlternatives(e,r){return _e(e,n=>Wb(n,r,Vt))}validateSomeNonEmptyLookaheadPath(e,r){return Xb(e,r,Vt)}buildLookaheadForAlternation(e){return Nb(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Lb)}buildLookaheadForOptional(e){return Ob(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,fu(e.prodType),Pb)}}class lS{initLooksAhead(e){this.dynamicTokensEnabled=w(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:dt.dynamicTokensEnabled,this.maxLookahead=w(e,"maxLookahead")?e.maxLookahead:dt.maxLookahead,this.lookaheadStrategy=w(e,"lookaheadStrategy")?e.lookaheadStrategy:new hu({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){_(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:u}=fS(r);_(n,l=>{const c=l.idx===0?"":l.idx;this.TRACE_INIT(`${ze(l)}${c}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=ns(this.fullRuleNameToShort[r.name],bh,l.idx);this.setLaFuncCache(d,f)})}),_(i,l=>{this.computeLookaheadFunc(r,l.idx,no,"Repetition",l.maxLookahead,ze(l))}),_(a,l=>{this.computeLookaheadFunc(r,l.idx,Sh,"Option",l.maxLookahead,ze(l))}),_(s,l=>{this.computeLookaheadFunc(r,l.idx,io,"RepetitionMandatory",l.maxLookahead,ze(l))}),_(o,l=>{this.computeLookaheadFunc(r,l.idx,vi,"RepetitionMandatoryWithSeparator",l.maxLookahead,ze(l))}),_(u,l=>{this.computeLookaheadFunc(r,l.idx,ao,"RepetitionWithSeparator",l.maxLookahead,ze(l))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=ns(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return ns(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}}class cS extends br{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const ri=new cS;function fS(t){ri.reset(),t.accept(ri);const e=ri.dslMethods;return ri.reset(),e}function Jl(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function ec(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function dS(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function hS(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}const pS="name";function wh(t,e){Object.defineProperty(t,pS,{enumerable:!1,configurable:!0,writable:!1,value:e})}function mS(t,e){const r=Le(t),n=r.length;for(let i=0;i<n;i++){const a=r[i],s=t[a],o=s.length;for(let u=0;u<o;u++){const l=s[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function gS(t,e){const r=function(){};wh(r,t+"BaseSemantics");const n={visit:function(i,a){if(M(i)&&(i=i[0]),!ct(i))return this[i.name](i.children,a)},validateVisitor:function(){const i=vS(this,e);if(!F(i)){const a=S(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
87
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof xr?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function xb(t,e){const r=new bb(t,e);return r.resolveRefs(),r.errors}class bb extends br{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){_(Q(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{const n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:de.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class Sb extends wa{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=se(this.path.ruleStack).reverse(),this.occurrenceStack=se(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){U(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class wb extends Sb{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=r.concat(n),a=new me({definition:i});this.possibleTokTypes=Mn(a),this.found=!0}}}class _a extends wa{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class Ib extends _a{walkMany(e,r,n){if(e.idx===this.occurrence){const i=Ge(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof K&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}}class ql extends _a{walkManySep(e,r,n){if(e.idx===this.occurrence){const i=Ge(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof K&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}}class _b extends _a{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){const i=Ge(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof K&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}}class Xl extends _a{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){const i=Ge(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof K&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}}function to(t,e,r=[]){r=se(r);let n=[],i=0;function a(o){return o.concat(re(t,i+1))}function s(o){const u=to(a(o),e,r);return n.concat(u)}for(;r.length<e&&i<t.length;){const o=t[i];if(o instanceof me||o instanceof fe)return s(o.definition);if(o instanceof ae)n=s(o.definition);else if(o instanceof xe){const u=o.definition.concat([new Y({definition:o.definition})]);return s(u)}else if(o instanceof be){const u=[new me({definition:o.definition}),new Y({definition:[new K({terminalType:o.separator})].concat(o.definition)})];return s(u)}else if(o instanceof ye){const u=o.definition.concat([new Y({definition:[new K({terminalType:o.separator})].concat(o.definition)})]);n=s(u)}else if(o instanceof Y){const u=o.definition.concat([new Y({definition:o.definition})]);n=s(u)}else{if(o instanceof ve)return _(o.definition,u=>{U(u.definition)===!1&&(n=s(u.definition))}),n;if(o instanceof K)r.push(o.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:re(t,i)}),n}function hh(t,e,r,n){const i="EXIT_NONE_TERMINAL",a=[i],s="EXIT_ALTERNATIVE";let o=!1;const u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!U(f);){const d=f.pop();if(d===s){o&&vr(f).idx<=l&&f.pop();continue}const h=d.def,m=d.idx,g=d.ruleStack,E=d.occurrenceStack;if(U(h))continue;const v=h[0];if(v===i){const R={idx:m,def:re(h),ruleStack:$n(g),occurrenceStack:$n(E)};f.push(R)}else if(v instanceof K)if(m<u-1){const R=m+1,T=e[R];if(r(T,v.terminalType)){const $={idx:R,def:re(h),ruleStack:g,occurrenceStack:E};f.push($)}}else if(m===u-1)c.push({nextTokenType:v.terminalType,nextTokenOccurrence:v.idx,ruleStack:g,occurrenceStack:E}),o=!0;else throw Error("non exhaustive match");else if(v instanceof fe){const R=se(g);R.push(v.nonTerminalName);const T=se(E);T.push(v.idx);const $={idx:m,def:v.definition.concat(a,re(h)),ruleStack:R,occurrenceStack:T};f.push($)}else if(v instanceof ae){const R={idx:m,def:re(h),ruleStack:g,occurrenceStack:E};f.push(R),f.push(s);const T={idx:m,def:v.definition.concat(re(h)),ruleStack:g,occurrenceStack:E};f.push(T)}else if(v instanceof xe){const R=new Y({definition:v.definition,idx:v.idx}),T=v.definition.concat([R],re(h)),$={idx:m,def:T,ruleStack:g,occurrenceStack:E};f.push($)}else if(v instanceof be){const R=new K({terminalType:v.separator}),T=new Y({definition:[R].concat(v.definition),idx:v.idx}),$=v.definition.concat([T],re(h)),P={idx:m,def:$,ruleStack:g,occurrenceStack:E};f.push(P)}else if(v instanceof ye){const R={idx:m,def:re(h),ruleStack:g,occurrenceStack:E};f.push(R),f.push(s);const T=new K({terminalType:v.separator}),$=new Y({definition:[T].concat(v.definition),idx:v.idx}),P=v.definition.concat([$],re(h)),oe={idx:m,def:P,ruleStack:g,occurrenceStack:E};f.push(oe)}else if(v instanceof Y){const R={idx:m,def:re(h),ruleStack:g,occurrenceStack:E};f.push(R),f.push(s);const T=new Y({definition:v.definition,idx:v.idx}),$=v.definition.concat([T],re(h)),P={idx:m,def:$,ruleStack:g,occurrenceStack:E};f.push(P)}else if(v instanceof ve)for(let R=v.definition.length-1;R>=0;R--){const T=v.definition[R],$={idx:m,def:T.definition.concat(re(h)),ruleStack:g,occurrenceStack:E};f.push($),f.push(s)}else if(v instanceof me)f.push({idx:m,def:v.definition.concat(re(h)),ruleStack:g,occurrenceStack:E});else if(v instanceof xr)f.push(Cb(v,m,g,E));else throw Error("non exhaustive match")}return c}function Cb(t,e,r,n){const i=se(r);i.push(t.name);const a=se(n);return a.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:a}}var H;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(H||(H={}));function fu(t){if(t instanceof ae||t==="Option")return H.OPTION;if(t instanceof Y||t==="Repetition")return H.REPETITION;if(t instanceof xe||t==="RepetitionMandatory")return H.REPETITION_MANDATORY;if(t instanceof be||t==="RepetitionMandatoryWithSeparator")return H.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof ye||t==="RepetitionWithSeparator")return H.REPETITION_WITH_SEPARATOR;if(t instanceof ve||t==="Alternation")return H.ALTERNATION;throw Error("non exhaustive match")}function Zl(t){const{occurrence:e,rule:r,prodType:n,maxLookahead:i}=t,a=fu(n);return a===H.ALTERNATION?Ca(e,r,i):Na(e,r,a,i)}function Nb(t,e,r,n,i,a){const s=Ca(t,e,r),o=gh(s)?Fi:Dn;return a(s,n,o,i)}function Ob(t,e,r,n,i,a){const s=Na(t,e,i,r),o=gh(s)?Fi:Dn;return a(s[0],o,n)}function Lb(t,e,r,n){const i=t.length,a=Ye(t,s=>Ye(s,o=>o.length===1));if(e)return function(s){const o=S(s,u=>u.GATE);for(let u=0;u<i;u++){const l=t[u],c=l.length,f=o[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let d=0;d<c;d++){const h=l[d],m=h.length;for(let g=0;g<m;g++){const E=this.LA(g+1);if(r(E,h[g])===!1)continue e}return u}}};if(a&&!n){const s=S(t,u=>Fe(u)),o=ke(s,(u,l,c)=>(_(l,f=>{w(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),_(f.categoryMatches,d=>{w(u,d)||(u[d]=c)})}),u),{});return function(){const u=this.LA(1);return o[u.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){const o=t[s],u=o.length;e:for(let l=0;l<u;l++){const c=o[l],f=c.length;for(let d=0;d<f;d++){const h=this.LA(d+1);if(r(h,c[d])===!1)continue e}return s}}}}function Pb(t,e,r){const n=Ye(t,a=>a.length===1),i=t.length;if(n&&!r){const a=Fe(t);if(a.length===1&&U(a[0].categoryMatches)){const s=a[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{const s=ke(a,(o,u,l)=>(o[u.tokenTypeIdx]=!0,_(u.categoryMatches,c=>{o[c]=!0}),o),[]);return function(){const o=this.LA(1);return s[o.tokenTypeIdx]===!0}}}else return function(){e:for(let a=0;a<i;a++){const s=t[a],o=s.length;for(let u=0;u<o;u++){const l=this.LA(u+1);if(e(l,s[u])===!1)continue e}return!0}return!1}}class Mb extends wa{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,H.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,H.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,H.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,H.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,H.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}}class ph extends br{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,H.OPTION)}visitRepetition(e){this.checkIsTarget(e,H.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,H.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,H.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,H.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,H.ALTERNATION)}}function Ql(t){const e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function ts(t){let e=[""];for(let r=0;r<t.length;r++){const n=t[r],i=[];for(let a=0;a<e.length;a++){const s=e[a];i.push(s+"_"+n.tokenTypeIdx);for(let o=0;o<n.categoryMatches.length;o++){const u="_"+n.categoryMatches[o];i.push(s+u)}}e=i}return e}function Db(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;const i=t[n];for(let a=0;a<e.length;a++){const s=e[a];if(i[s]===!0)return!1}}return!0}function mh(t,e){const r=S(t,s=>to([s],1)),n=Ql(r.length),i=S(r,s=>{const o={};return _(s,u=>{const l=ts(u.partialPath);_(l,c=>{o[c]=!0})}),o});let a=r;for(let s=1;s<=e;s++){const o=a;a=Ql(o.length);for(let u=0;u<o.length;u++){const l=o[u];for(let c=0;c<l.length;c++){const f=l[c].partialPath,d=l[c].suffixDef,h=ts(f);if(Db(i,h,u)||U(d)||f.length===e){const m=n[u];if(ro(m,f)===!1){m.push(f);for(let g=0;g<h.length;g++){const E=h[g];i[u][E]=!0}}}else{const m=to(d,s+1,f);a[u]=a[u].concat(m),_(m,g=>{const E=ts(g.partialPath);_(E,v=>{i[u][v]=!0})})}}}}return n}function Ca(t,e,r,n){const i=new ph(t,H.ALTERNATION,n);return e.accept(i),mh(i.result,r)}function Na(t,e,r,n){const i=new ph(t,r);e.accept(i);const a=i.result,s=new Mb(e,t,r).startWalking(),o=new me({definition:a}),u=new me({definition:s});return mh([o,u],n)}function ro(t,e){e:for(let r=0;r<t.length;r++){const n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){const a=e[i],s=n[i];if(!(a===s||s.categoryMatchesMap[a.tokenTypeIdx]!==void 0))continue e}return!0}}return!1}function jb(t,e){return t.length<e.length&&Ye(t,(r,n)=>{const i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function gh(t){return Ye(t,e=>Ye(e,r=>Ye(r,n=>U(n.categoryMatches))))}function Fb(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return S(e,r=>Object.assign({type:de.CUSTOM_LOOKAHEAD_VALIDATION},r))}function Ub(t,e,r,n){const i=_e(t,u=>Gb(u,r)),a=Jb(t,e,r),s=_e(t,u=>qb(u,r)),o=_e(t,u=>Vb(u,t,n,r));return i.concat(a,s,o)}function Gb(t,e){const r=new Kb;t.accept(r);const n=r.allProductions,i=YR(n,Bb),a=fE(i,s=>s.length>1);return S(Q(a),s=>{const o=Ge(s),u=e.buildDuplicateFoundError(t,s),l=He(o),c={message:u,type:de.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:o.idx},f=yh(o);return f&&(c.parameter=f),c})}function Bb(t){return`${He(t)}_#_${t.idx}_#_${yh(t)}`}function yh(t){return t instanceof K?t.terminalType.name:t instanceof fe?t.nonTerminalName:""}class Kb extends br{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function Vb(t,e,r,n){const i=[];if(ke(e,(a,s)=>s.name===t.name?a+1:a,0)>1){const a=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:a,type:de.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function Hb(t,e,r){const n=[];let i;return ge(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:de.INVALID_RULE_OVERRIDE,ruleName:t})),n}function vh(t,e,r,n=[]){const i=[],a=yi(e.definition);if(U(a))return[];{const s=t.name;ge(a,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:de.LEFT_RECURSION,ruleName:s});const o=ga(a,n.concat([t])),u=_e(o,l=>{const c=se(n);return c.push(l),vh(t,l,r,c)});return i.concat(u)}}function yi(t){let e=[];if(U(t))return e;const r=Ge(t);if(r instanceof fe)e.push(r.referencedRule);else if(r instanceof me||r instanceof ae||r instanceof xe||r instanceof be||r instanceof ye||r instanceof Y)e=e.concat(yi(r.definition));else if(r instanceof ve)e=Fe(S(r.definition,a=>yi(a.definition)));else if(!(r instanceof K))throw Error("non exhaustive match");const n=Di(r),i=t.length>1;if(n&&i){const a=re(t);return e.concat(yi(a))}else return e}class du extends br{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function zb(t,e){const r=new du;t.accept(r);const n=r.alternations;return _e(n,i=>{const a=$n(i.definition);return _e(a,(s,o)=>{const u=hh([s],[],Dn,1);return U(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:i,emptyChoiceIdx:o}),type:de.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:i.idx,alternative:o+1}]:[]})})}function Wb(t,e,r){const n=new du;t.accept(n);let i=n.alternations;return i=ya(i,a=>a.ignoreAmbiguities===!0),_e(i,a=>{const s=a.idx,o=a.maxLookahead||e,u=Ca(s,t,o,a),l=Zb(u,a,t,r),c=Qb(u,a,t,r);return l.concat(c)})}class Yb extends br{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function qb(t,e){const r=new du;t.accept(r);const n=r.alternations;return _e(n,i=>i.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:i}),type:de.TOO_MANY_ALTS,ruleName:t.name,occurrence:i.idx}]:[])}function Xb(t,e,r){const n=[];return _(t,i=>{const a=new Yb;i.accept(a);const s=a.allProductions;_(s,o=>{const u=fu(o),l=o.maxLookahead||e,c=o.idx,f=Na(c,i,u,l)[0];if(U(Fe(f))){const d=r.buildEmptyRepetitionError({topLevelRule:i,repetition:o});n.push({message:d,type:de.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function Zb(t,e,r,n){const i=[],a=ke(t,(s,o,u)=>(e.definition[u].ignoreAmbiguities===!0||_(o,l=>{const c=[u];_(t,(f,d)=>{u!==d&&ro(f,l)&&e.definition[d].ignoreAmbiguities!==!0&&c.push(d)}),c.length>1&&!ro(i,l)&&(i.push(l),s.push({alts:c,path:l}))}),s),[]);return S(a,s=>{const o=S(s.alts,u=>u+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:o,prefixPath:s.path}),type:de.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:s.alts}})}function Qb(t,e,r,n){const i=ke(t,(a,s,o)=>{const u=S(s,l=>({idx:o,path:l}));return a.concat(u)},[]);return On(_e(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const s=a.idx,o=a.path,u=Pe(i,l=>e.definition[l.idx].ignoreAmbiguities!==!0&&l.idx<s&&jb(l.path,o));return S(u,l=>{const c=[l.idx+1,s+1],f=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:c,prefixPath:l.path}),type:de.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:f,alternatives:c}})}))}function Jb(t,e,r){const n=[],i=S(e,a=>a.name);return _(t,a=>{const s=a.name;if(ge(i,s)){const o=r.buildNamespaceConflictError(a);n.push({message:o,type:de.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function eS(t){const e=eu(t,{errMsgProvider:kb}),r={};return _(t.rules,n=>{r[n.name]=n}),xb(r,e.errMsgProvider)}function tS(t){return t=eu(t,{errMsgProvider:Vt}),Ub(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const Th="MismatchedTokenException",Rh="NoViableAltException",Eh="EarlyExitException",Ah="NotAllInputParsedException",$h=[Th,Rh,Eh,Ah];Object.freeze($h);function Ui(t){return ge($h,t.name)}class Oa extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class kh extends Oa{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Th}}class rS extends Oa{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Rh}}class nS extends Oa{constructor(e,r){super(e,r),this.name=Ah}}class iS extends Oa{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=Eh}}const rs={},xh="InRuleRecoveryException";class aS extends Error{constructor(e){super(e),this.name=xh}}class sS{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=w(e,"recoveryEnabled")?e.recoveryEnabled:dt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=oS)}getTokenToInsert(e){const r=cu(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){const a=this.findReSyncTokenType(),s=this.exportLexerState(),o=[];let u=!1;const l=this.LA(1);let c=this.LA(1);const f=()=>{const d=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:d,ruleName:this.getCurrRuleFullName()}),m=new kh(h,l,this.LA(0));m.resyncedTokens=$n(o),this.SAVE_ERROR(m)};for(;!u;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,a)?u=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,o));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){const n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new aS("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||U(r))return!1;const n=this.LA(1);return Tr(r,i=>this.tokenMatcher(n,i))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return ge(n,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let r=this.LA(1),n=2;for(;;){const i=Tr(e,a=>dh(r,a));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return rs;const e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return S(e,(n,i)=>i===0?rs:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=S(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return Fe(e)}getFollowSetFromFollowKey(e){if(e===rs)return[St];const r=e.ruleName+e.idxInCallingRule+th+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,St)||r.push(e),r}reSyncTo(e){const r=[];let n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return $n(r)}attemptInRepetitionRecovery(e,r,n,i,a,s,o){}getCurrentGrammarPath(e,r){const n=this.getHumanReadableRuleStack(),i=se(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return S(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function oS(t,e,r,n,i,a,s){const o=this.getKeyForAutomaticLookahead(n,i);let u=this.firstAfterRepMap[o];if(u===void 0){const d=this.getCurrRuleFullName(),h=this.getGAstProductions()[d];u=new a(h,i).startWalking(),this.firstAfterRepMap[o]=u}let l=u.token,c=u.occurrence;const f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=St,c=1),!(l===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,c,s)&&this.tryInRepetitionRecovery(t,e,r,l)}const uS=4,Nt=8,bh=1<<Nt,Sh=2<<Nt,no=3<<Nt,io=4<<Nt,ao=5<<Nt,vi=6<<Nt;function ns(t,e,r){return r|e|t}class hu{constructor(e){var r;this.maxLookahead=(r=e==null?void 0:e.maxLookahead)!==null&&r!==void 0?r:dt.maxLookahead}validate(e){const r=this.validateNoLeftRecursion(e.rules);if(U(r)){const n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),a=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...a]}return r}validateNoLeftRecursion(e){return _e(e,r=>vh(r,r,Vt))}validateEmptyOrAlternatives(e){return _e(e,r=>zb(r,Vt))}validateAmbiguousAlternationAlternatives(e,r){return _e(e,n=>Wb(n,r,Vt))}validateSomeNonEmptyLookaheadPath(e,r){return Xb(e,r,Vt)}buildLookaheadForAlternation(e){return Nb(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Lb)}buildLookaheadForOptional(e){return Ob(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,fu(e.prodType),Pb)}}class lS{initLooksAhead(e){this.dynamicTokensEnabled=w(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:dt.dynamicTokensEnabled,this.maxLookahead=w(e,"maxLookahead")?e.maxLookahead:dt.maxLookahead,this.lookaheadStrategy=w(e,"lookaheadStrategy")?e.lookaheadStrategy:new hu({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){_(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{const{alternation:n,repetition:i,option:a,repetitionMandatory:s,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:u}=fS(r);_(n,l=>{const c=l.idx===0?"":l.idx;this.TRACE_INIT(`${He(l)}${c}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=ns(this.fullRuleNameToShort[r.name],bh,l.idx);this.setLaFuncCache(d,f)})}),_(i,l=>{this.computeLookaheadFunc(r,l.idx,no,"Repetition",l.maxLookahead,He(l))}),_(a,l=>{this.computeLookaheadFunc(r,l.idx,Sh,"Option",l.maxLookahead,He(l))}),_(s,l=>{this.computeLookaheadFunc(r,l.idx,io,"RepetitionMandatory",l.maxLookahead,He(l))}),_(o,l=>{this.computeLookaheadFunc(r,l.idx,vi,"RepetitionMandatoryWithSeparator",l.maxLookahead,He(l))}),_(u,l=>{this.computeLookaheadFunc(r,l.idx,ao,"RepetitionWithSeparator",l.maxLookahead,He(l))})})})}computeLookaheadFunc(e,r,n,i,a,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:a||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=ns(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,o)})}getKeyForAutomaticLookahead(e,r){const n=this.getLastExplicitRuleShortName();return ns(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}}class cS extends br{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const ri=new cS;function fS(t){ri.reset(),t.accept(ri);const e=ri.dslMethods;return ri.reset(),e}function Jl(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function ec(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function dS(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function hS(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}const pS="name";function wh(t,e){Object.defineProperty(t,pS,{enumerable:!1,configurable:!0,writable:!1,value:e})}function mS(t,e){const r=Le(t),n=r.length;for(let i=0;i<n;i++){const a=r[i],s=t[a],o=s.length;for(let u=0;u<o;u++){const l=s[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function gS(t,e){const r=function(){};wh(r,t+"BaseSemantics");const n={visit:function(i,a){if(M(i)&&(i=i[0]),!ct(i))return this[i.name](i.children,a)},validateVisitor:function(){const i=vS(this,e);if(!U(i)){const a=S(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
88
88
|
${a.join(`
|
|
89
89
|
|
|
90
90
|
`).replace(/\n/g,`
|
|
91
|
-
`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function yS(t,e,r){const n=function(){};wh(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return _(e,a=>{i[a]=mS}),n.prototype=i,n.prototype.constructor=n,n}var so;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(so||(so={}));function vS(t,e){return TS(t,e)}function TS(t,e){const r=Pe(e,i=>ht(t[i])===!1),n=S(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:so.MISSING_METHOD,methodName:i}));return On(n)}class RS{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=w(e,"nodeLocationTracking")?e.nodeLocationTracking:dt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Z,this.cstFinallyStateUpdate=Z,this.cstPostTerminal=Z,this.cstPostNonTerminal=Z,this.cstPostRule=Z;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ec,this.setNodeLocationFromNode=ec,this.cstPostRule=Z,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Z,this.setNodeLocationFromNode=Z,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Jl,this.setNodeLocationFromNode=Jl,this.cstPostRule=Z,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Z,this.setNodeLocationFromNode=Z,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Z,this.setNodeLocationFromNode=Z,this.cstPostRule=Z,this.setInitialNodeLocation=Z;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];dS(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];hS(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(ct(this.baseCstVisitorConstructor)){const e=gS(this.className,Le(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(ct(this.baseCstVisitorWithDefaultsConstructor)){const e=yS(this.className,Le(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class ES{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Bi}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Bi:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class AS{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Ki){if(ge(this.definedRulesNames,e)){const a={message:Vt.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:de.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Ki){const i=
|
|
91
|
+
`)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function yS(t,e,r){const n=function(){};wh(n,t+"BaseSemanticsWithDefaults");const i=Object.create(r.prototype);return _(e,a=>{i[a]=mS}),n.prototype=i,n.prototype.constructor=n,n}var so;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(so||(so={}));function vS(t,e){return TS(t,e)}function TS(t,e){const r=Pe(e,i=>ht(t[i])===!1),n=S(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:so.MISSING_METHOD,methodName:i}));return On(n)}class RS{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=w(e,"nodeLocationTracking")?e.nodeLocationTracking:dt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Z,this.cstFinallyStateUpdate=Z,this.cstPostTerminal=Z,this.cstPostNonTerminal=Z,this.cstPostRule=Z;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=ec,this.setNodeLocationFromNode=ec,this.cstPostRule=Z,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Z,this.setNodeLocationFromNode=Z,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Jl,this.setNodeLocationFromNode=Jl,this.cstPostRule=Z,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Z,this.setNodeLocationFromNode=Z,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Z,this.setNodeLocationFromNode=Z,this.cstPostRule=Z,this.setInitialNodeLocation=Z;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){const r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];dS(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){const n=this.CST_STACK[this.CST_STACK.length-1];hS(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(ct(this.baseCstVisitorConstructor)){const e=gS(this.className,Le(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(ct(this.baseCstVisitorWithDefaultsConstructor)){const e=yS(this.className,Le(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class ES{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Bi}LA(e){const r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Bi:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class AS{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Ki){if(ge(this.definedRulesNames,e)){const a={message:Vt.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:de.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Ki){const i=Hb(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const a=this.defineRule(e,r,n);return this[e]=a,a}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);const n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(Ui(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Cx(Q(this.gastProductionsCache))}}class $S{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Fi,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},w(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
92
92
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
93
|
-
For Further details.`);if(M(e)){if(
|
|
93
|
+
For Further details.`);if(M(e)){if(U(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
94
94
|
Note that the first argument for the parser constructor
|
|
95
95
|
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
96
96
|
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
97
|
-
For Further details.`)}if(M(e))this.tokensMap=ke(e,(a,s)=>(a[s.name]=s,a),{});else if(w(e,"modes")&&Ye(
|
|
98
|
-
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=w(n,"resyncEnabled")?n.resyncEnabled:Ki.resyncEnabled,a=w(n,"recoveryValueFunc")?n.recoveryValueFunc:Ki.recoveryValueFunc,s=this.ruleShortNameIdx<<uS+Nt;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=function(...u){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,u);const l=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(l),l}catch(l){return this.invokeRuleCatch(l,i,a)}finally{this.ruleFinallyStateUpdate()}}:o=function(...u){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,u)}catch(l){return this.invokeRuleCatch(l,i,a)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){const i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(
|
|
97
|
+
For Further details.`)}if(M(e))this.tokensMap=ke(e,(a,s)=>(a[s.name]=s,a),{});else if(w(e,"modes")&&Ye(Fe(Q(e.modes)),Eb)){const a=Fe(Q(e.modes)),s=tu(a);this.tokensMap=ke(s,(o,u)=>(o[u.name]=u,o),{})}else if(Oe(e))this.tokensMap=se(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=St;const n=w(e,"modes")?Fe(Q(e.modes)):Q(e),i=Ye(n,a=>U(a.categoryMatches));this.tokenMatcher=i?Fi:Dn,jn(Q(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
98
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=w(n,"resyncEnabled")?n.resyncEnabled:Ki.resyncEnabled,a=w(n,"recoveryValueFunc")?n.recoveryValueFunc:Ki.recoveryValueFunc,s=this.ruleShortNameIdx<<uS+Nt;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let o;return this.outputCst===!0?o=function(...u){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,u);const l=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(l),l}catch(l){return this.invokeRuleCatch(l,i,a)}finally{this.ruleFinallyStateUpdate()}}:o=function(...u){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,u)}catch(l){return this.invokeRuleCatch(l,i,a)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){const i=this.RULE_STACK.length===1,a=r&&!this.isBackTracking()&&this.recoveryEnabled;if(Ui(e)){const s=e;if(a){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(s.resyncedTokens=this.reSyncTo(o),this.outputCst){const u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){const u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,s.partialCstResult=u}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){const n=this.getKeyForAutomaticLookahead(Sh,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof e!="function"){a=e.DEF;const s=e.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=e;if(i.call(this)===!0)return a.call(this)}atLeastOneInternal(e,r){const n=this.getKeyForAutomaticLookahead(io,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const s=r.GATE;if(s!==void 0){const o=i;i=()=>s.call(this)&&o.call(this)}}else a=r;if(i.call(this)===!0){let s=this.doSingleRepetition(a);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a)}else throw this.raiseEarlyExitException(e,H.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,io,e,_b)}atLeastOneSepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(vi,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const s=()=>this.tokenMatcher(this.LA(1),a);for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,s,i,Xl],s,vi,e,Xl)}else throw this.raiseEarlyExitException(e,H.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){const n=this.getKeyForAutomaticLookahead(no,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),a;if(typeof r!="function"){a=r.DEF;const o=r.GATE;if(o!==void 0){const u=i;i=()=>o.call(this)&&u.call(this)}}else a=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(a);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,no,e,Ib,s)}manySepFirstInternal(e,r){const n=this.getKeyForAutomaticLookahead(ao,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){const i=r.DEF,a=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);const s=()=>this.tokenMatcher(this.LA(1),a);for(;this.tokenMatcher(this.LA(1),a)===!0;)this.CONSUME(a),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,a,s,i,ql],s,ao,e,ql)}}repetitionSepSecondInternal(e,r,n,i,a){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,a],n,vi,e,a)}doSingleRepetition(e){const r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){const n=this.getKeyForAutomaticLookahead(bh,r),i=M(e)?e:e.DEF,a=this.getLaFuncFromCache(n).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new nS(r,e))}}subruleInternal(e,r,n){let i;try{const a=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,a),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(a){throw this.subruleInternalError(a,n,e.ruleName)}}subruleInternalError(e,r,n){throw Ui(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{const a=this.LA(1);this.tokenMatcher(a,e)===!0?(this.consumeToken(),i=a):this.consumeInternalError(e,a,n)}catch(a){i=this.consumeInternalRecovery(e,r,a)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i;const a=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new kh(i,r,a))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(a){throw a.name===xh?n:a}}else throw n}saveRecogState(){const e=this.errors,r=se(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),St)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class kS{initErrorHandler(e){this._errors=[],this.errorMessageProvider=w(e,"errorMessageProvider")?e.errorMessageProvider:dt.errorMessageProvider}SAVE_ERROR(e){if(Ui(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:se(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return se(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){const i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],s=Na(e,a,r,this.maxLookahead)[0],o=[];for(let l=1;l<=this.maxLookahead;l++)o.push(this.LA(l));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:o,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new iS(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){const n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=Ca(e,i,this.maxLookahead),s=[];for(let l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));const o=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:o,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new rS(u,this.LA(1),o))}}class xS{initContentAssist(){}computeContentAssist(e,r){const n=this.gastProductionsCache[e];if(ct(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return hh([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const r=Ge(e.ruleStack),n=this.getGAstProductions()[r];return new wb(n,e).startWalking()}}const La={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(La);const tc=!0,rc=Math.pow(2,Nt)-1,Ih=fh({name:"RECORDING_PHASE_TOKEN",pattern:he.NA});jn([Ih]);const _h=cu(Ih,`This IToken indicates the Parser is in Recording Phase
|
|
99
99
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(_h);const bS={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
100
100
|
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class SS{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let r=0;r<10;r++){const n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Bi}topLevelRuleRecord(e,r){try{const n=new xr({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
|
|
101
101
|
This error was thrown during the "grammar recording phase" For more info see:
|
|
102
102
|
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Cr.call(this,ae,e,r)}atLeastOneInternalRecord(e,r){Cr.call(this,xe,r,e)}atLeastOneSepFirstInternalRecord(e,r){Cr.call(this,be,r,e,tc)}manyInternalRecord(e,r){Cr.call(this,Y,r,e)}manySepFirstInternalRecord(e,r){Cr.call(this,ye,r,e,tc)}orInternalRecord(e,r){return wS.call(this,e,r)}subruleInternalRecord(e,r,n){if(Gi(r),!e||w(e,"ruleName")===!1){const o=new Error(`<SUBRULE${nc(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
103
103
|
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=vr(this.recordingProdStack),a=e.ruleName,s=new fe({idx:r,nonTerminalName:a,label:n==null?void 0:n.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?bS:La}consumeInternalRecord(e,r,n){if(Gi(r),!lh(e)){const s=new Error(`<CONSUME${nc(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
104
104
|
inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}const i=vr(this.recordingProdStack),a=new K({idx:r,terminalType:e,label:n==null?void 0:n.LABEL});return i.definition.push(a),_h}}function Cr(t,e,r,n=!1){Gi(r);const i=vr(this.recordingProdStack),a=ht(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),w(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),i.definition.push(s),this.recordingProdStack.pop(),La}function wS(t,e){Gi(e);const r=vr(this.recordingProdStack),n=M(t)===!1,i=n===!1?t:t.DEF,a=new ve({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});w(t,"MAX_LOOKAHEAD")&&(a.maxLookahead=t.MAX_LOOKAHEAD);const s=pE(i,o=>ht(o.GATE));return a.hasPredicates=s,r.definition.push(a),_(i,o=>{const u=new me({definition:[]});a.definition.push(u),w(o,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:w(o,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),o.ALT.call(this),this.recordingProdStack.pop()}),La}function nc(t){return t===0?"":`${t}`}function Gi(t){if(t<0||t>rc){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
105
|
-
Idx value must be a none negative value smaller than ${rc+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class IS{initPerformanceTracer(e){if(w(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=dt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);const{time:i,value:a}=Cd(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,a}else return r()}}function _S(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}const Bi=cu(St,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Bi);const dt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:dr,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Ki=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var de;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(de||(de={}));function ic(t=void 0){return function(){return t}}class
|
|
105
|
+
Idx value must be a none negative value smaller than ${rc+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class IS{initPerformanceTracer(e){if(w(e,"traceInitPerf")){const r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=dt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;const n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);const{time:i,value:a}=Cd(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,a}else return r()}}function _S(t,e){e.forEach(r=>{const n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;const a=Object.getOwnPropertyDescriptor(n,i);a&&(a.get||a.set)?Object.defineProperty(t.prototype,i,a):t.prototype[i]=r.prototype[i]})})}const Bi=cu(St,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Bi);const dt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:dr,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Ki=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var de;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(de||(de={}));function ic(t=void 0){return function(){return t}}class Fn{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const r=this.className;this.TRACE_INIT("toFastProps",()=>{Nd(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),_(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let s;this.TRACE_INIT(`${i} Rule`,()=>{s=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=s})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=eS({rules:Q(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(U(n)&&this.skipValidations===!1){const i=tS({rules:Q(this.gastProductionsCache),tokenTypes:Q(this.tokensMap),errMsgProvider:Vt,grammarName:r}),a=Fb({lookaheadStrategy:this.lookaheadStrategy,rules:Q(this.gastProductionsCache),tokenTypes:Q(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,a)}}),U(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=jx(Q(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,a;(a=(i=this.lookaheadStrategy).initialize)===null||a===void 0||a.call(i,{rules:Q(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Q(this.gastProductionsCache))})),!Fn.DEFER_DEFINITION_ERRORS_HANDLING&&!U(this.definitionErrors))throw e=S(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
106
106
|
${e.join(`
|
|
107
107
|
-------------------------------
|
|
108
108
|
`)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;const n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),w(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
109
109
|
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
110
110
|
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
111
|
-
For further details.`);this.skipValidations=w(r,"skipValidations")?r.skipValidations:dt.skipValidations}}
|
|
111
|
+
For further details.`);this.skipValidations=w(r,"skipValidations")?r.skipValidations:dt.skipValidations}}Fn.DEFER_DEFINITION_ERRORS_HANDLING=!1;_S(Fn,[sS,lS,RS,ES,$S,AS,kS,xS,SS,IS]);class CS extends Fn{constructor(e,r=dt){const n=se(r);n.outputCst=!1,super(e,n)}}function Rr(t,e,r){return`${t.name}_${e}_${r}`}const wt=1,NS=2,Ch=4,Nh=5,Un=7,OS=8,LS=9,PS=10,MS=11,Oh=12;class pu{constructor(e){this.target=e}isEpsilon(){return!1}}class mu extends pu{constructor(e,r){super(e),this.tokenType=r}}class Lh extends pu{constructor(e){super(e)}isEpsilon(){return!0}}class gu extends pu{constructor(e,r,n){super(e),this.rule=r,this.followState=n}isEpsilon(){return!0}}function DS(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};jS(e,t);const r=t.length;for(let n=0;n<r;n++){const i=t[n],a=sr(e,i,i);a!==void 0&&qS(e,i,a)}return e}function jS(t,e){const r=e.length;for(let n=0;n<r;n++){const i=e[n],a=ee(t,i,void 0,{type:NS}),s=ee(t,i,void 0,{type:Un});a.stop=s,t.ruleToStartState.set(i,a),t.ruleToStopState.set(i,s)}}function Ph(t,e,r){return r instanceof K?yu(t,e,r.terminalType,r):r instanceof fe?YS(t,e,r):r instanceof ve?KS(t,e,r):r instanceof ae?VS(t,e,r):r instanceof Y?FS(t,e,r):r instanceof ye?US(t,e,r):r instanceof xe?GS(t,e,r):r instanceof be?BS(t,e,r):sr(t,e,r)}function FS(t,e,r){const n=ee(t,e,r,{type:Nh});Ot(t,n);const i=Sr(t,e,n,r,sr(t,e,r));return Dh(t,e,r,i)}function US(t,e,r){const n=ee(t,e,r,{type:Nh});Ot(t,n);const i=Sr(t,e,n,r,sr(t,e,r)),a=yu(t,e,r.separator,r);return Dh(t,e,r,i,a)}function GS(t,e,r){const n=ee(t,e,r,{type:Ch});Ot(t,n);const i=Sr(t,e,n,r,sr(t,e,r));return Mh(t,e,r,i)}function BS(t,e,r){const n=ee(t,e,r,{type:Ch});Ot(t,n);const i=Sr(t,e,n,r,sr(t,e,r)),a=yu(t,e,r.separator,r);return Mh(t,e,r,i,a)}function KS(t,e,r){const n=ee(t,e,r,{type:wt});Ot(t,n);const i=ot(r.definition,a=>Ph(t,e,a));return Sr(t,e,n,r,...i)}function VS(t,e,r){const n=ee(t,e,r,{type:wt});Ot(t,n);const i=Sr(t,e,n,r,sr(t,e,r));return HS(t,e,r,i)}function sr(t,e,r){const n=Np(ot(r.definition,i=>Ph(t,e,i)),i=>i!==void 0);return n.length===1?n[0]:n.length===0?void 0:WS(t,n)}function Mh(t,e,r,n,i){const a=n.left,s=n.right,o=ee(t,e,r,{type:MS});Ot(t,o);const u=ee(t,e,r,{type:Oh});return a.loopback=o,u.loopback=o,t.decisionMap[Rr(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",r.idx)]=o,X(s,o),i===void 0?(X(o,a),X(o,u)):(X(o,u),X(o,i.left),X(i.right,a)),{left:a,right:u}}function Dh(t,e,r,n,i){const a=n.left,s=n.right,o=ee(t,e,r,{type:PS});Ot(t,o);const u=ee(t,e,r,{type:Oh}),l=ee(t,e,r,{type:LS});return o.loopback=l,u.loopback=l,X(o,a),X(o,u),X(s,l),i!==void 0?(X(l,u),X(l,i.left),X(i.right,a)):X(l,o),t.decisionMap[Rr(e,i?"RepetitionWithSeparator":"Repetition",r.idx)]=o,{left:o,right:u}}function HS(t,e,r,n){const i=n.left,a=n.right;return X(i,a),t.decisionMap[Rr(e,"Option",r.idx)]=i,n}function Ot(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Sr(t,e,r,n,...i){const a=ee(t,e,n,{type:OS,start:r});r.end=a;for(const o of i)o!==void 0?(X(r,o.left),X(o.right,a)):X(r,a);const s={left:r,right:a};return t.decisionMap[Rr(e,zS(n),n.idx)]=r,s}function zS(t){if(t instanceof ve)return"Alternation";if(t instanceof ae)return"Option";if(t instanceof Y)return"Repetition";if(t instanceof ye)return"RepetitionWithSeparator";if(t instanceof xe)return"RepetitionMandatory";if(t instanceof be)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function WS(t,e){const r=e.length;for(let a=0;a<r-1;a++){const s=e[a];let o;s.left.transitions.length===1&&(o=s.left.transitions[0]);const u=o instanceof gu,l=o,c=e[a+1].left;s.left.type===wt&&s.right.type===wt&&o!==void 0&&(u&&l.followState===s.right||o.target===s.right)?(u?l.followState=c:o.target=c,XS(t,s.right)):X(s.right,c)}const n=e[0],i=e[r-1];return{left:n.left,right:i.right}}function yu(t,e,r,n){const i=ee(t,e,n,{type:wt}),a=ee(t,e,n,{type:wt});return vu(i,new mu(a,r)),{left:i,right:a}}function YS(t,e,r){const n=r.referencedRule,i=t.ruleToStartState.get(n),a=ee(t,e,r,{type:wt}),s=ee(t,e,r,{type:wt}),o=new gu(i,n,s);return vu(a,o),{left:a,right:s}}function qS(t,e,r){const n=t.ruleToStartState.get(e);X(n,r.left);const i=t.ruleToStopState.get(e);return X(r.right,i),{left:n,right:i}}function X(t,e){const r=new Lh(e);vu(t,r)}function ee(t,e,r,n){const i=Object.assign({atn:t,production:r,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},n);return t.states.push(i),i}function vu(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function XS(t,e){t.states.splice(t.states.indexOf(e),1)}const Vi={};class oo{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const r=jh(e);r in this.map||(this.map[r]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return ot(this.configs,e=>e.alt)}get key(){let e="";for(const r in this.map)e+=r+":";return e}}function jh(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(r=>r.stateNumber.toString()).join("_")}`}function ZS(t,e){const r={};return n=>{const i=n.toString();let a=r[i];return a!==void 0||(a={atnStartState:t,decision:e,states:{}},r[i]=a),a}}class Fh{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,r){this.predicates[e]=r}toString(){let e="";const r=this.predicates.length;for(let n=0;n<r;n++)e+=this.predicates[n]===!0?"1":"0";return e}}const ac=new Fh;class QS extends hu{constructor(e){var r;super(),this.logging=(r=e==null?void 0:e.logging)!==null&&r!==void 0?r:n=>console.log(n)}initialize(e){this.atn=DS(e.rules),this.dfas=JS(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:r,rule:n,hasPredicates:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,u=Rr(n,"Alternation",r),l=this.atn.decisionMap[u].decision,c=ot(Zl({maxLookahead:1,occurrence:r,prodType:"Alternation",rule:n}),f=>ot(f,d=>d[0]));if(sc(c,!1)&&!a){const f=bu(c,(d,h,m)=>(Fa(h,g=>{g&&(d[g.tokenTypeIdx]=m,Fa(g.categoryMatches,E=>{d[E]=m}))}),d),{});return i?function(d){var h;const m=this.LA(1),g=f[m.tokenTypeIdx];if(d!==void 0&&g!==void 0){const E=(h=d[g])===null||h===void 0?void 0:h.GATE;if(E!==void 0&&E.call(this)===!1)return}return g}:function(){const d=this.LA(1);return f[d.tokenTypeIdx]}}else return i?function(f){const d=new Fh,h=f===void 0?0:f.length;for(let g=0;g<h;g++){const E=f==null?void 0:f[g].GATE;d.set(g,E===void 0||E.call(this))}const m=is.call(this,s,l,d,o);return typeof m=="number"?m:void 0}:function(){const f=is.call(this,s,l,ac,o);return typeof f=="number"?f:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:r,rule:n,prodType:i,dynamicTokensEnabled:a}=e,s=this.dfas,o=this.logging,u=Rr(n,i,r),l=this.atn.decisionMap[u].decision,c=ot(Zl({maxLookahead:1,occurrence:r,prodType:i,rule:n}),f=>ot(f,d=>d[0]));if(sc(c)&&c[0][0]&&!a){const f=c[0],d=_p(f);if(d.length===1&&Ip(d[0].categoryMatches)){const h=d[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===h}}else{const h=bu(d,(m,g)=>(g!==void 0&&(m[g.tokenTypeIdx]=!0,Fa(g.categoryMatches,E=>{m[E]=!0})),m),{});return function(){const m=this.LA(1);return h[m.tokenTypeIdx]===!0}}}return function(){const f=is.call(this,s,l,ac,o);return typeof f=="object"?!1:f===0}}}function sc(t,e=!0){const r=new Set;for(const n of t){const i=new Set;for(const a of n){if(a===void 0){if(e)break;return!1}const s=[a.tokenTypeIdx].concat(a.categoryMatches);for(const o of s)if(r.has(o)){if(!i.has(o))return!1}else r.add(o),i.add(o)}}return!0}function JS(t){const e=t.decisionStates.length,r=Array(e);for(let n=0;n<e;n++)r[n]=ZS(t.decisionStates[n],n);return r}function is(t,e,r,n){const i=t[e](r);let a=i.start;if(a===void 0){const s=cw(i.atnStartState);a=Gh(i,Uh(s)),i.start=a}return ew.apply(this,[i,a,r,n])}function ew(t,e,r,n){let i=e,a=1;const s=[];let o=this.LA(a++);for(;;){let u=sw(i,o);if(u===void 0&&(u=tw.apply(this,[t,i,o,a,r,n])),u===Vi)return aw(s,i,o);if(u.isAcceptState===!0)return u.prediction;i=u,s.push(o),o=this.LA(a++)}}function tw(t,e,r,n,i,a){const s=ow(e.configs,r,i);if(s.size===0)return oc(t,e,r,Vi),Vi;let o=Uh(s);const u=lw(s,i);if(u!==void 0)o.isAcceptState=!0,o.prediction=u,o.configs.uniqueAlt=u;else if(pw(s)){const l=Cp(s.alts);o.isAcceptState=!0,o.prediction=l,o.configs.uniqueAlt=l,rw.apply(this,[t,n,s.alts,a])}return o=oc(t,e,r,o),o}function rw(t,e,r,n){const i=[];for(let l=1;l<=e;l++)i.push(this.LA(l).tokenType);const a=t.atnStartState,s=a.rule,o=a.production,u=nw({topLevelRule:s,ambiguityIndices:r,production:o,prefixPath:i});n(u)}function nw(t){const e=ot(t.prefixPath,i=>mr(i)).join(", "),r=t.production.idx===0?"":t.production.idx;let n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${iw(t.production)}${r}> inside <${t.topLevelRule.name}> Rule,
|
|
112
112
|
<${e}> may appears as a prefix path in all these alternatives.
|
|
113
113
|
`;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
114
|
-
For Further details.`,n}function iw(t){if(t instanceof fe)return"SUBRULE";if(t instanceof ae)return"OPTION";if(t instanceof ve)return"OR";if(t instanceof xe)return"AT_LEAST_ONE";if(t instanceof be)return"AT_LEAST_ONE_SEP";if(t instanceof ye)return"MANY_SEP";if(t instanceof Y)return"MANY";if(t instanceof K)return"CONSUME";throw Error("non exhaustive match")}function aw(t,e,r){const n=jp(e.configs.elements,a=>a.state.transitions),i=Up(n.filter(a=>a instanceof mu).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function sw(t,e){return t.edges[e.tokenTypeIdx]}function ow(t,e,r){const n=new oo,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Fn){i.push(s);continue}const o=s.state.transitions.length;for(let u=0;u<o;u++){const l=s.state.transitions[u],c=uw(l,e);c!==void 0&&n.add({state:c,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new oo;for(const s of n.elements)zi(s,a)}if(i.length>0&&!dw(a))for(const s of i)a.add(s);return a}function uw(t,e){if(t instanceof mu&&dh(e,t.tokenType))return t.target}function lw(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function Fh(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function oc(t,e,r,n){return n=Gh(t,n),e.edges[r.tokenTypeIdx]=n,n}function Gh(t,e){if(e===Vi)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function cw(t){const e=new oo,r=t.transitions.length;for(let n=0;n<r;n++){const i={state:t.transitions[n].target,alt:n,stack:[]};zi(i,e)}return e}function zi(t,e){const r=t.state;if(r.type===Fn){if(t.stack.length>0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};zi(a,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i<n;i++){const a=r.transitions[i],s=fw(t,a);s!==void 0&&zi(s,e)}}function fw(t,e){if(e instanceof Lh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof gu){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function dw(t){for(const e of t.elements)if(e.state.type===Fn)return!0;return!1}function hw(t){for(const e of t.elements)if(e.state.type!==Fn)return!1;return!0}function pw(t){if(hw(t))return!0;const e=mw(t.elements);return gw(e)&&!yw(e)}function mw(t){const e=new Map;for(const r of t){const n=jh(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function gw(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function yw(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var uc;(function(t){function e(r){return typeof r=="string"}t.is=e})(uc||(uc={}));var uo;(function(t){function e(r){return typeof r=="string"}t.is=e})(uo||(uo={}));var lc;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(lc||(lc={}));var Hi;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(Hi||(Hi={}));var D;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=Hi.MAX_VALUE),i===Number.MAX_VALUE&&(i=Hi.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&p.uinteger(i.line)&&p.uinteger(i.character)}t.is=r})(D||(D={}));var L;(function(t){function e(n,i,a,s){if(p.uinteger(n)&&p.uinteger(i)&&p.uinteger(a)&&p.uinteger(s))return{start:D.create(n,i),end:D.create(a,s)};if(D.is(n)&&D.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${a}, ${s}]`)}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&D.is(i.start)&&D.is(i.end)}t.is=r})(L||(L={}));var Wi;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&L.is(i.range)&&(p.string(i.uri)||p.undefined(i.uri))}t.is=r})(Wi||(Wi={}));var cc;(function(t){function e(n,i,a,s){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:s}}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&L.is(i.targetRange)&&p.string(i.targetUri)&&L.is(i.targetSelectionRange)&&(L.is(i.originSelectionRange)||p.undefined(i.originSelectionRange))}t.is=r})(cc||(cc={}));var lo;(function(t){function e(n,i,a,s){return{red:n,green:i,blue:a,alpha:s}}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&p.numberRange(i.red,0,1)&&p.numberRange(i.green,0,1)&&p.numberRange(i.blue,0,1)&&p.numberRange(i.alpha,0,1)}t.is=r})(lo||(lo={}));var fc;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&L.is(i.range)&&lo.is(i.color)}t.is=r})(fc||(fc={}));var dc;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&p.string(i.label)&&(p.undefined(i.textEdit)||Ar.is(i))&&(p.undefined(i.additionalTextEdits)||p.typedArray(i.additionalTextEdits,Ar.is))}t.is=r})(dc||(dc={}));var hc;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(hc||(hc={}));var pc;(function(t){function e(n,i,a,s,o,u){const l={startLine:n,endLine:i};return p.defined(a)&&(l.startCharacter=a),p.defined(s)&&(l.endCharacter=s),p.defined(o)&&(l.kind=o),p.defined(u)&&(l.collapsedText=u),l}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&p.uinteger(i.startLine)&&p.uinteger(i.startLine)&&(p.undefined(i.startCharacter)||p.uinteger(i.startCharacter))&&(p.undefined(i.endCharacter)||p.uinteger(i.endCharacter))&&(p.undefined(i.kind)||p.string(i.kind))}t.is=r})(pc||(pc={}));var co;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&Wi.is(i.location)&&p.string(i.message)}t.is=r})(co||(co={}));var mc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(mc||(mc={}));var gc;(function(t){t.Unnecessary=1,t.Deprecated=2})(gc||(gc={}));var yc;(function(t){function e(r){const n=r;return p.objectLiteral(n)&&p.string(n.href)}t.is=e})(yc||(yc={}));var Yi;(function(t){function e(n,i,a,s,o,u){let l={range:n,message:i};return p.defined(a)&&(l.severity=a),p.defined(s)&&(l.code=s),p.defined(o)&&(l.source=o),p.defined(u)&&(l.relatedInformation=u),l}t.create=e;function r(n){var i;let a=n;return p.defined(a)&&L.is(a.range)&&p.string(a.message)&&(p.number(a.severity)||p.undefined(a.severity))&&(p.integer(a.code)||p.string(a.code)||p.undefined(a.code))&&(p.undefined(a.codeDescription)||p.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(p.string(a.source)||p.undefined(a.source))&&(p.undefined(a.relatedInformation)||p.typedArray(a.relatedInformation,co.is))}t.is=r})(Yi||(Yi={}));var Er;(function(t){function e(n,i,...a){let s={title:n,command:i};return p.defined(a)&&a.length>0&&(s.arguments=a),s}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.title)&&p.string(i.command)}t.is=r})(Er||(Er={}));var Ar;(function(t){function e(a,s){return{range:a,newText:s}}t.replace=e;function r(a,s){return{range:{start:a,end:a},newText:s}}t.insert=r;function n(a){return{range:a,newText:""}}t.del=n;function i(a){const s=a;return p.objectLiteral(s)&&p.string(s.newText)&&L.is(s.range)}t.is=i})(Ar||(Ar={}));var fo;(function(t){function e(n,i,a){const s={label:n};return i!==void 0&&(s.needsConfirmation=i),a!==void 0&&(s.description=a),s}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&p.string(i.label)&&(p.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(p.string(i.description)||i.description===void 0)}t.is=r})(fo||(fo={}));var $r;(function(t){function e(r){const n=r;return p.string(n)}t.is=e})($r||($r={}));var vc;(function(t){function e(a,s,o){return{range:a,newText:s,annotationId:o}}t.replace=e;function r(a,s,o){return{range:{start:a,end:a},newText:s,annotationId:o}}t.insert=r;function n(a,s){return{range:a,newText:"",annotationId:s}}t.del=n;function i(a){const s=a;return Ar.is(s)&&(fo.is(s.annotationId)||$r.is(s.annotationId))}t.is=i})(vc||(vc={}));var ho;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&vo.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(ho||(ho={}));var po;(function(t){function e(n,i,a){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&p.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||$r.is(i.annotationId))}t.is=r})(po||(po={}));var mo;(function(t){function e(n,i,a,s){let o={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&p.string(i.oldUri)&&p.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||$r.is(i.annotationId))}t.is=r})(mo||(mo={}));var go;(function(t){function e(n,i,a){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&p.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||p.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||p.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||$r.is(i.annotationId))}t.is=r})(go||(go={}));var yo;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>p.string(i.kind)?po.is(i)||mo.is(i)||go.is(i):ho.is(i)))}t.is=e})(yo||(yo={}));var Tc;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.uri)}t.is=r})(Tc||(Tc={}));var Rc;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.uri)&&p.integer(i.version)}t.is=r})(Rc||(Rc={}));var vo;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.uri)&&(i.version===null||p.integer(i.version))}t.is=r})(vo||(vo={}));var Ec;(function(t){function e(n,i,a,s){return{uri:n,languageId:i,version:a,text:s}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.uri)&&p.string(i.languageId)&&p.integer(i.version)&&p.string(i.text)}t.is=r})(Ec||(Ec={}));var To;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(To||(To={}));var bn;(function(t){function e(r){const n=r;return p.objectLiteral(r)&&To.is(n.kind)&&p.string(n.value)}t.is=e})(bn||(bn={}));var Ac;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Ac||(Ac={}));var $c;(function(t){t.PlainText=1,t.Snippet=2})($c||($c={}));var kc;(function(t){t.Deprecated=1})(kc||(kc={}));var xc;(function(t){function e(n,i,a){return{newText:n,insert:i,replace:a}}t.create=e;function r(n){const i=n;return i&&p.string(i.newText)&&L.is(i.insert)&&L.is(i.replace)}t.is=r})(xc||(xc={}));var bc;(function(t){t.asIs=1,t.adjustIndentation=2})(bc||(bc={}));var Sc;(function(t){function e(r){const n=r;return n&&(p.string(n.detail)||n.detail===void 0)&&(p.string(n.description)||n.description===void 0)}t.is=e})(Sc||(Sc={}));var wc;(function(t){function e(r){return{label:r}}t.create=e})(wc||(wc={}));var Ic;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(Ic||(Ic={}));var qi;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return p.string(i)||p.objectLiteral(i)&&p.string(i.language)&&p.string(i.value)}t.is=r})(qi||(qi={}));var _c;(function(t){function e(r){let n=r;return!!n&&p.objectLiteral(n)&&(bn.is(n.contents)||qi.is(n.contents)||p.typedArray(n.contents,qi.is))&&(r.range===void 0||L.is(r.range))}t.is=e})(_c||(_c={}));var Cc;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Cc||(Cc={}));var Nc;(function(t){function e(r,n,...i){let a={label:r};return p.defined(n)&&(a.documentation=n),p.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(Nc||(Nc={}));var Oc;(function(t){t.Text=1,t.Read=2,t.Write=3})(Oc||(Oc={}));var Lc;(function(t){function e(r,n){let i={range:r};return p.number(n)&&(i.kind=n),i}t.create=e})(Lc||(Lc={}));var Pc;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Pc||(Pc={}));var Mc;(function(t){t.Deprecated=1})(Mc||(Mc={}));var Dc;(function(t){function e(r,n,i,a,s){let o={name:r,kind:n,location:{uri:a,range:i}};return s&&(o.containerName=s),o}t.create=e})(Dc||(Dc={}));var jc;(function(t){function e(r,n,i,a){return a!==void 0?{name:r,kind:n,location:{uri:i,range:a}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(jc||(jc={}));var Uc;(function(t){function e(n,i,a,s,o,u){let l={name:n,detail:i,kind:a,range:s,selectionRange:o};return u!==void 0&&(l.children=u),l}t.create=e;function r(n){let i=n;return i&&p.string(i.name)&&p.number(i.kind)&&L.is(i.range)&&L.is(i.selectionRange)&&(i.detail===void 0||p.string(i.detail))&&(i.deprecated===void 0||p.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(Uc||(Uc={}));var Fc;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Fc||(Fc={}));var Xi;(function(t){t.Invoked=1,t.Automatic=2})(Xi||(Xi={}));var Gc;(function(t){function e(n,i,a){let s={diagnostics:n};return i!=null&&(s.only=i),a!=null&&(s.triggerKind=a),s}t.create=e;function r(n){let i=n;return p.defined(i)&&p.typedArray(i.diagnostics,Yi.is)&&(i.only===void 0||p.typedArray(i.only,p.string))&&(i.triggerKind===void 0||i.triggerKind===Xi.Invoked||i.triggerKind===Xi.Automatic)}t.is=r})(Gc||(Gc={}));var Bc;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):Er.is(i)?s.command=i:s.edit=i,o&&a!==void 0&&(s.kind=a),s}t.create=e;function r(n){let i=n;return i&&p.string(i.title)&&(i.diagnostics===void 0||p.typedArray(i.diagnostics,Yi.is))&&(i.kind===void 0||p.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Er.is(i.command))&&(i.isPreferred===void 0||p.boolean(i.isPreferred))&&(i.edit===void 0||yo.is(i.edit))}t.is=r})(Bc||(Bc={}));var Kc;(function(t){function e(n,i){let a={range:n};return p.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.command)||Er.is(i.command))}t.is=r})(Kc||(Kc={}));var Vc;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.uinteger(i.tabSize)&&p.boolean(i.insertSpaces)}t.is=r})(Vc||(Vc={}));var zc;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.target)||p.string(i.target))}t.is=r})(zc||(zc={}));var Hc;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&L.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(Hc||(Hc={}));var Wc;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Wc||(Wc={}));var Yc;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Yc||(Yc={}));var qc;(function(t){function e(r){const n=r;return p.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(qc||(qc={}));var Xc;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){const i=n;return i!=null&&L.is(i.range)&&p.string(i.text)}t.is=r})(Xc||(Xc={}));var Zc;(function(t){function e(n,i,a){return{range:n,variableName:i,caseSensitiveLookup:a}}t.create=e;function r(n){const i=n;return i!=null&&L.is(i.range)&&p.boolean(i.caseSensitiveLookup)&&(p.string(i.variableName)||i.variableName===void 0)}t.is=r})(Zc||(Zc={}));var Qc;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){const i=n;return i!=null&&L.is(i.range)&&(p.string(i.expression)||i.expression===void 0)}t.is=r})(Qc||(Qc={}));var Jc;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return p.defined(i)&&L.is(n.stoppedLocation)}t.is=r})(Jc||(Jc={}));var Ro;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(Ro||(Ro={}));var Eo;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&(i.tooltip===void 0||p.string(i.tooltip)||bn.is(i.tooltip))&&(i.location===void 0||Wi.is(i.location))&&(i.command===void 0||Er.is(i.command))}t.is=r})(Eo||(Eo={}));var ef;(function(t){function e(n,i,a){const s={position:n,label:i};return a!==void 0&&(s.kind=a),s}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&D.is(i.position)&&(p.string(i.label)||p.typedArray(i.label,Eo.is))&&(i.kind===void 0||Ro.is(i.kind))&&i.textEdits===void 0||p.typedArray(i.textEdits,Ar.is)&&(i.tooltip===void 0||p.string(i.tooltip)||bn.is(i.tooltip))&&(i.paddingLeft===void 0||p.boolean(i.paddingLeft))&&(i.paddingRight===void 0||p.boolean(i.paddingRight))}t.is=r})(ef||(ef={}));var tf;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(tf||(tf={}));var rf;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(rf||(rf={}));var nf;(function(t){function e(r){return{items:r}}t.create=e})(nf||(nf={}));var af;(function(t){t.Invoked=0,t.Automatic=1})(af||(af={}));var sf;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(sf||(sf={}));var of;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(of||(of={}));var uf;(function(t){function e(r){const n=r;return p.objectLiteral(n)&&uo.is(n.uri)&&p.string(n.name)}t.is=e})(uf||(uf={}));var lf;(function(t){function e(a,s,o,u){return new vw(a,s,o,u)}t.create=e;function r(a){let s=a;return!!(p.defined(s)&&p.string(s.uri)&&(p.undefined(s.languageId)||p.string(s.languageId))&&p.uinteger(s.lineCount)&&p.func(s.getText)&&p.func(s.positionAt)&&p.func(s.offsetAt))}t.is=r;function n(a,s){let o=a.getText(),u=i(s,(c,f)=>{let d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d}),l=o.length;for(let c=u.length-1;c>=0;c--){let f=u[c],d=a.offsetAt(f.range.start),h=a.offsetAt(f.range.end);if(h<=l)o=o.substring(0,d)+f.newText+o.substring(h,o.length);else throw new Error("Overlapping edit");l=d}return o}t.applyEdits=n;function i(a,s){if(a.length<=1)return a;const o=a.length/2|0,u=a.slice(0,o),l=a.slice(o);i(u,s),i(l,s);let c=0,f=0,d=0;for(;c<u.length&&f<l.length;)s(u[c],l[f])<=0?a[d++]=u[c++]:a[d++]=l[f++];for(;c<u.length;)a[d++]=u[c++];for(;f<l.length;)a[d++]=l[f++];return a}})(lf||(lf={}));let vw=class{constructor(t,e,r,n){this._uri=t,this._languageId=e,this._version=r,this._content=n,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let e=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(e,r)}return this._content}update(t,e){this._content=t.text,this._version=e,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],e=this._content,r=!0;for(let n=0;n<e.length;n++){r&&(t.push(n),r=!1);let i=e.charAt(n);r=i==="\r"||i===`
|
|
114
|
+
For Further details.`,n}function iw(t){if(t instanceof fe)return"SUBRULE";if(t instanceof ae)return"OPTION";if(t instanceof ve)return"OR";if(t instanceof xe)return"AT_LEAST_ONE";if(t instanceof be)return"AT_LEAST_ONE_SEP";if(t instanceof ye)return"MANY_SEP";if(t instanceof Y)return"MANY";if(t instanceof K)return"CONSUME";throw Error("non exhaustive match")}function aw(t,e,r){const n=jp(e.configs.elements,a=>a.state.transitions),i=Fp(n.filter(a=>a instanceof mu).map(a=>a.tokenType),a=>a.tokenTypeIdx);return{actualToken:r,possibleTokenTypes:i,tokenPath:t}}function sw(t,e){return t.edges[e.tokenTypeIdx]}function ow(t,e,r){const n=new oo,i=[];for(const s of t.elements){if(r.is(s.alt)===!1)continue;if(s.state.type===Un){i.push(s);continue}const o=s.state.transitions.length;for(let u=0;u<o;u++){const l=s.state.transitions[u],c=uw(l,e);c!==void 0&&n.add({state:c,alt:s.alt,stack:s.stack})}}let a;if(i.length===0&&n.size===1&&(a=n),a===void 0){a=new oo;for(const s of n.elements)Hi(s,a)}if(i.length>0&&!dw(a))for(const s of i)a.add(s);return a}function uw(t,e){if(t instanceof mu&&dh(e,t.tokenType))return t.target}function lw(t,e){let r;for(const n of t.elements)if(e.is(n.alt)===!0){if(r===void 0)r=n.alt;else if(r!==n.alt)return}return r}function Uh(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function oc(t,e,r,n){return n=Gh(t,n),e.edges[r.tokenTypeIdx]=n,n}function Gh(t,e){if(e===Vi)return e;const r=e.configs.key,n=t.states[r];return n!==void 0?n:(e.configs.finalize(),t.states[r]=e,e)}function cw(t){const e=new oo,r=t.transitions.length;for(let n=0;n<r;n++){const i={state:t.transitions[n].target,alt:n,stack:[]};Hi(i,e)}return e}function Hi(t,e){const r=t.state;if(r.type===Un){if(t.stack.length>0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};Hi(a,e)}else e.add(t);return}r.epsilonOnlyTransitions||e.add(t);const n=r.transitions.length;for(let i=0;i<n;i++){const a=r.transitions[i],s=fw(t,a);s!==void 0&&Hi(s,e)}}function fw(t,e){if(e instanceof Lh)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof gu){const r=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:r}}}function dw(t){for(const e of t.elements)if(e.state.type===Un)return!0;return!1}function hw(t){for(const e of t.elements)if(e.state.type!==Un)return!1;return!0}function pw(t){if(hw(t))return!0;const e=mw(t.elements);return gw(e)&&!yw(e)}function mw(t){const e=new Map;for(const r of t){const n=jh(r,!1);let i=e.get(n);i===void 0&&(i={},e.set(n,i)),i[r.alt]=!0}return e}function gw(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function yw(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var uc;(function(t){function e(r){return typeof r=="string"}t.is=e})(uc||(uc={}));var uo;(function(t){function e(r){return typeof r=="string"}t.is=e})(uo||(uo={}));var lc;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(lc||(lc={}));var zi;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(r){return typeof r=="number"&&t.MIN_VALUE<=r&&r<=t.MAX_VALUE}t.is=e})(zi||(zi={}));var D;(function(t){function e(n,i){return n===Number.MAX_VALUE&&(n=zi.MAX_VALUE),i===Number.MAX_VALUE&&(i=zi.MAX_VALUE),{line:n,character:i}}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&p.uinteger(i.line)&&p.uinteger(i.character)}t.is=r})(D||(D={}));var L;(function(t){function e(n,i,a,s){if(p.uinteger(n)&&p.uinteger(i)&&p.uinteger(a)&&p.uinteger(s))return{start:D.create(n,i),end:D.create(a,s)};if(D.is(n)&&D.is(i))return{start:n,end:i};throw new Error(`Range#create called with invalid arguments[${n}, ${i}, ${a}, ${s}]`)}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&D.is(i.start)&&D.is(i.end)}t.is=r})(L||(L={}));var Wi;(function(t){function e(n,i){return{uri:n,range:i}}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&L.is(i.range)&&(p.string(i.uri)||p.undefined(i.uri))}t.is=r})(Wi||(Wi={}));var cc;(function(t){function e(n,i,a,s){return{targetUri:n,targetRange:i,targetSelectionRange:a,originSelectionRange:s}}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&L.is(i.targetRange)&&p.string(i.targetUri)&&L.is(i.targetSelectionRange)&&(L.is(i.originSelectionRange)||p.undefined(i.originSelectionRange))}t.is=r})(cc||(cc={}));var lo;(function(t){function e(n,i,a,s){return{red:n,green:i,blue:a,alpha:s}}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&p.numberRange(i.red,0,1)&&p.numberRange(i.green,0,1)&&p.numberRange(i.blue,0,1)&&p.numberRange(i.alpha,0,1)}t.is=r})(lo||(lo={}));var fc;(function(t){function e(n,i){return{range:n,color:i}}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&L.is(i.range)&&lo.is(i.color)}t.is=r})(fc||(fc={}));var dc;(function(t){function e(n,i,a){return{label:n,textEdit:i,additionalTextEdits:a}}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&p.string(i.label)&&(p.undefined(i.textEdit)||Ar.is(i))&&(p.undefined(i.additionalTextEdits)||p.typedArray(i.additionalTextEdits,Ar.is))}t.is=r})(dc||(dc={}));var hc;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(hc||(hc={}));var pc;(function(t){function e(n,i,a,s,o,u){const l={startLine:n,endLine:i};return p.defined(a)&&(l.startCharacter=a),p.defined(s)&&(l.endCharacter=s),p.defined(o)&&(l.kind=o),p.defined(u)&&(l.collapsedText=u),l}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&p.uinteger(i.startLine)&&p.uinteger(i.startLine)&&(p.undefined(i.startCharacter)||p.uinteger(i.startCharacter))&&(p.undefined(i.endCharacter)||p.uinteger(i.endCharacter))&&(p.undefined(i.kind)||p.string(i.kind))}t.is=r})(pc||(pc={}));var co;(function(t){function e(n,i){return{location:n,message:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&Wi.is(i.location)&&p.string(i.message)}t.is=r})(co||(co={}));var mc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(mc||(mc={}));var gc;(function(t){t.Unnecessary=1,t.Deprecated=2})(gc||(gc={}));var yc;(function(t){function e(r){const n=r;return p.objectLiteral(n)&&p.string(n.href)}t.is=e})(yc||(yc={}));var Yi;(function(t){function e(n,i,a,s,o,u){let l={range:n,message:i};return p.defined(a)&&(l.severity=a),p.defined(s)&&(l.code=s),p.defined(o)&&(l.source=o),p.defined(u)&&(l.relatedInformation=u),l}t.create=e;function r(n){var i;let a=n;return p.defined(a)&&L.is(a.range)&&p.string(a.message)&&(p.number(a.severity)||p.undefined(a.severity))&&(p.integer(a.code)||p.string(a.code)||p.undefined(a.code))&&(p.undefined(a.codeDescription)||p.string((i=a.codeDescription)===null||i===void 0?void 0:i.href))&&(p.string(a.source)||p.undefined(a.source))&&(p.undefined(a.relatedInformation)||p.typedArray(a.relatedInformation,co.is))}t.is=r})(Yi||(Yi={}));var Er;(function(t){function e(n,i,...a){let s={title:n,command:i};return p.defined(a)&&a.length>0&&(s.arguments=a),s}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.title)&&p.string(i.command)}t.is=r})(Er||(Er={}));var Ar;(function(t){function e(a,s){return{range:a,newText:s}}t.replace=e;function r(a,s){return{range:{start:a,end:a},newText:s}}t.insert=r;function n(a){return{range:a,newText:""}}t.del=n;function i(a){const s=a;return p.objectLiteral(s)&&p.string(s.newText)&&L.is(s.range)}t.is=i})(Ar||(Ar={}));var fo;(function(t){function e(n,i,a){const s={label:n};return i!==void 0&&(s.needsConfirmation=i),a!==void 0&&(s.description=a),s}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&p.string(i.label)&&(p.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(p.string(i.description)||i.description===void 0)}t.is=r})(fo||(fo={}));var $r;(function(t){function e(r){const n=r;return p.string(n)}t.is=e})($r||($r={}));var vc;(function(t){function e(a,s,o){return{range:a,newText:s,annotationId:o}}t.replace=e;function r(a,s,o){return{range:{start:a,end:a},newText:s,annotationId:o}}t.insert=r;function n(a,s){return{range:a,newText:"",annotationId:s}}t.del=n;function i(a){const s=a;return Ar.is(s)&&(fo.is(s.annotationId)||$r.is(s.annotationId))}t.is=i})(vc||(vc={}));var ho;(function(t){function e(n,i){return{textDocument:n,edits:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&vo.is(i.textDocument)&&Array.isArray(i.edits)}t.is=r})(ho||(ho={}));var po;(function(t){function e(n,i,a){let s={kind:"create",uri:n};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="create"&&p.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||$r.is(i.annotationId))}t.is=r})(po||(po={}));var mo;(function(t){function e(n,i,a,s){let o={kind:"rename",oldUri:n,newUri:i};return a!==void 0&&(a.overwrite!==void 0||a.ignoreIfExists!==void 0)&&(o.options=a),s!==void 0&&(o.annotationId=s),o}t.create=e;function r(n){let i=n;return i&&i.kind==="rename"&&p.string(i.oldUri)&&p.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||p.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||p.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||$r.is(i.annotationId))}t.is=r})(mo||(mo={}));var go;(function(t){function e(n,i,a){let s={kind:"delete",uri:n};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(s.options=i),a!==void 0&&(s.annotationId=a),s}t.create=e;function r(n){let i=n;return i&&i.kind==="delete"&&p.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||p.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||p.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||$r.is(i.annotationId))}t.is=r})(go||(go={}));var yo;(function(t){function e(r){let n=r;return n&&(n.changes!==void 0||n.documentChanges!==void 0)&&(n.documentChanges===void 0||n.documentChanges.every(i=>p.string(i.kind)?po.is(i)||mo.is(i)||go.is(i):ho.is(i)))}t.is=e})(yo||(yo={}));var Tc;(function(t){function e(n){return{uri:n}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.uri)}t.is=r})(Tc||(Tc={}));var Rc;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.uri)&&p.integer(i.version)}t.is=r})(Rc||(Rc={}));var vo;(function(t){function e(n,i){return{uri:n,version:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.uri)&&(i.version===null||p.integer(i.version))}t.is=r})(vo||(vo={}));var Ec;(function(t){function e(n,i,a,s){return{uri:n,languageId:i,version:a,text:s}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.string(i.uri)&&p.string(i.languageId)&&p.integer(i.version)&&p.string(i.text)}t.is=r})(Ec||(Ec={}));var To;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(r){const n=r;return n===t.PlainText||n===t.Markdown}t.is=e})(To||(To={}));var bn;(function(t){function e(r){const n=r;return p.objectLiteral(r)&&To.is(n.kind)&&p.string(n.value)}t.is=e})(bn||(bn={}));var Ac;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Ac||(Ac={}));var $c;(function(t){t.PlainText=1,t.Snippet=2})($c||($c={}));var kc;(function(t){t.Deprecated=1})(kc||(kc={}));var xc;(function(t){function e(n,i,a){return{newText:n,insert:i,replace:a}}t.create=e;function r(n){const i=n;return i&&p.string(i.newText)&&L.is(i.insert)&&L.is(i.replace)}t.is=r})(xc||(xc={}));var bc;(function(t){t.asIs=1,t.adjustIndentation=2})(bc||(bc={}));var Sc;(function(t){function e(r){const n=r;return n&&(p.string(n.detail)||n.detail===void 0)&&(p.string(n.description)||n.description===void 0)}t.is=e})(Sc||(Sc={}));var wc;(function(t){function e(r){return{label:r}}t.create=e})(wc||(wc={}));var Ic;(function(t){function e(r,n){return{items:r||[],isIncomplete:!!n}}t.create=e})(Ic||(Ic={}));var qi;(function(t){function e(n){return n.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function r(n){const i=n;return p.string(i)||p.objectLiteral(i)&&p.string(i.language)&&p.string(i.value)}t.is=r})(qi||(qi={}));var _c;(function(t){function e(r){let n=r;return!!n&&p.objectLiteral(n)&&(bn.is(n.contents)||qi.is(n.contents)||p.typedArray(n.contents,qi.is))&&(r.range===void 0||L.is(r.range))}t.is=e})(_c||(_c={}));var Cc;(function(t){function e(r,n){return n?{label:r,documentation:n}:{label:r}}t.create=e})(Cc||(Cc={}));var Nc;(function(t){function e(r,n,...i){let a={label:r};return p.defined(n)&&(a.documentation=n),p.defined(i)?a.parameters=i:a.parameters=[],a}t.create=e})(Nc||(Nc={}));var Oc;(function(t){t.Text=1,t.Read=2,t.Write=3})(Oc||(Oc={}));var Lc;(function(t){function e(r,n){let i={range:r};return p.number(n)&&(i.kind=n),i}t.create=e})(Lc||(Lc={}));var Pc;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(Pc||(Pc={}));var Mc;(function(t){t.Deprecated=1})(Mc||(Mc={}));var Dc;(function(t){function e(r,n,i,a,s){let o={name:r,kind:n,location:{uri:a,range:i}};return s&&(o.containerName=s),o}t.create=e})(Dc||(Dc={}));var jc;(function(t){function e(r,n,i,a){return a!==void 0?{name:r,kind:n,location:{uri:i,range:a}}:{name:r,kind:n,location:{uri:i}}}t.create=e})(jc||(jc={}));var Fc;(function(t){function e(n,i,a,s,o,u){let l={name:n,detail:i,kind:a,range:s,selectionRange:o};return u!==void 0&&(l.children=u),l}t.create=e;function r(n){let i=n;return i&&p.string(i.name)&&p.number(i.kind)&&L.is(i.range)&&L.is(i.selectionRange)&&(i.detail===void 0||p.string(i.detail))&&(i.deprecated===void 0||p.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=r})(Fc||(Fc={}));var Uc;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(Uc||(Uc={}));var Xi;(function(t){t.Invoked=1,t.Automatic=2})(Xi||(Xi={}));var Gc;(function(t){function e(n,i,a){let s={diagnostics:n};return i!=null&&(s.only=i),a!=null&&(s.triggerKind=a),s}t.create=e;function r(n){let i=n;return p.defined(i)&&p.typedArray(i.diagnostics,Yi.is)&&(i.only===void 0||p.typedArray(i.only,p.string))&&(i.triggerKind===void 0||i.triggerKind===Xi.Invoked||i.triggerKind===Xi.Automatic)}t.is=r})(Gc||(Gc={}));var Bc;(function(t){function e(n,i,a){let s={title:n},o=!0;return typeof i=="string"?(o=!1,s.kind=i):Er.is(i)?s.command=i:s.edit=i,o&&a!==void 0&&(s.kind=a),s}t.create=e;function r(n){let i=n;return i&&p.string(i.title)&&(i.diagnostics===void 0||p.typedArray(i.diagnostics,Yi.is))&&(i.kind===void 0||p.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Er.is(i.command))&&(i.isPreferred===void 0||p.boolean(i.isPreferred))&&(i.edit===void 0||yo.is(i.edit))}t.is=r})(Bc||(Bc={}));var Kc;(function(t){function e(n,i){let a={range:n};return p.defined(i)&&(a.data=i),a}t.create=e;function r(n){let i=n;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.command)||Er.is(i.command))}t.is=r})(Kc||(Kc={}));var Vc;(function(t){function e(n,i){return{tabSize:n,insertSpaces:i}}t.create=e;function r(n){let i=n;return p.defined(i)&&p.uinteger(i.tabSize)&&p.boolean(i.insertSpaces)}t.is=r})(Vc||(Vc={}));var Hc;(function(t){function e(n,i,a){return{range:n,target:i,data:a}}t.create=e;function r(n){let i=n;return p.defined(i)&&L.is(i.range)&&(p.undefined(i.target)||p.string(i.target))}t.is=r})(Hc||(Hc={}));var zc;(function(t){function e(n,i){return{range:n,parent:i}}t.create=e;function r(n){let i=n;return p.objectLiteral(i)&&L.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=r})(zc||(zc={}));var Wc;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Wc||(Wc={}));var Yc;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(Yc||(Yc={}));var qc;(function(t){function e(r){const n=r;return p.objectLiteral(n)&&(n.resultId===void 0||typeof n.resultId=="string")&&Array.isArray(n.data)&&(n.data.length===0||typeof n.data[0]=="number")}t.is=e})(qc||(qc={}));var Xc;(function(t){function e(n,i){return{range:n,text:i}}t.create=e;function r(n){const i=n;return i!=null&&L.is(i.range)&&p.string(i.text)}t.is=r})(Xc||(Xc={}));var Zc;(function(t){function e(n,i,a){return{range:n,variableName:i,caseSensitiveLookup:a}}t.create=e;function r(n){const i=n;return i!=null&&L.is(i.range)&&p.boolean(i.caseSensitiveLookup)&&(p.string(i.variableName)||i.variableName===void 0)}t.is=r})(Zc||(Zc={}));var Qc;(function(t){function e(n,i){return{range:n,expression:i}}t.create=e;function r(n){const i=n;return i!=null&&L.is(i.range)&&(p.string(i.expression)||i.expression===void 0)}t.is=r})(Qc||(Qc={}));var Jc;(function(t){function e(n,i){return{frameId:n,stoppedLocation:i}}t.create=e;function r(n){const i=n;return p.defined(i)&&L.is(n.stoppedLocation)}t.is=r})(Jc||(Jc={}));var Ro;(function(t){t.Type=1,t.Parameter=2;function e(r){return r===1||r===2}t.is=e})(Ro||(Ro={}));var Eo;(function(t){function e(n){return{value:n}}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&(i.tooltip===void 0||p.string(i.tooltip)||bn.is(i.tooltip))&&(i.location===void 0||Wi.is(i.location))&&(i.command===void 0||Er.is(i.command))}t.is=r})(Eo||(Eo={}));var ef;(function(t){function e(n,i,a){const s={position:n,label:i};return a!==void 0&&(s.kind=a),s}t.create=e;function r(n){const i=n;return p.objectLiteral(i)&&D.is(i.position)&&(p.string(i.label)||p.typedArray(i.label,Eo.is))&&(i.kind===void 0||Ro.is(i.kind))&&i.textEdits===void 0||p.typedArray(i.textEdits,Ar.is)&&(i.tooltip===void 0||p.string(i.tooltip)||bn.is(i.tooltip))&&(i.paddingLeft===void 0||p.boolean(i.paddingLeft))&&(i.paddingRight===void 0||p.boolean(i.paddingRight))}t.is=r})(ef||(ef={}));var tf;(function(t){function e(r){return{kind:"snippet",value:r}}t.createSnippet=e})(tf||(tf={}));var rf;(function(t){function e(r,n,i,a){return{insertText:r,filterText:n,range:i,command:a}}t.create=e})(rf||(rf={}));var nf;(function(t){function e(r){return{items:r}}t.create=e})(nf||(nf={}));var af;(function(t){t.Invoked=0,t.Automatic=1})(af||(af={}));var sf;(function(t){function e(r,n){return{range:r,text:n}}t.create=e})(sf||(sf={}));var of;(function(t){function e(r,n){return{triggerKind:r,selectedCompletionInfo:n}}t.create=e})(of||(of={}));var uf;(function(t){function e(r){const n=r;return p.objectLiteral(n)&&uo.is(n.uri)&&p.string(n.name)}t.is=e})(uf||(uf={}));var lf;(function(t){function e(a,s,o,u){return new vw(a,s,o,u)}t.create=e;function r(a){let s=a;return!!(p.defined(s)&&p.string(s.uri)&&(p.undefined(s.languageId)||p.string(s.languageId))&&p.uinteger(s.lineCount)&&p.func(s.getText)&&p.func(s.positionAt)&&p.func(s.offsetAt))}t.is=r;function n(a,s){let o=a.getText(),u=i(s,(c,f)=>{let d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d}),l=o.length;for(let c=u.length-1;c>=0;c--){let f=u[c],d=a.offsetAt(f.range.start),h=a.offsetAt(f.range.end);if(h<=l)o=o.substring(0,d)+f.newText+o.substring(h,o.length);else throw new Error("Overlapping edit");l=d}return o}t.applyEdits=n;function i(a,s){if(a.length<=1)return a;const o=a.length/2|0,u=a.slice(0,o),l=a.slice(o);i(u,s),i(l,s);let c=0,f=0,d=0;for(;c<u.length&&f<l.length;)s(u[c],l[f])<=0?a[d++]=u[c++]:a[d++]=l[f++];for(;c<u.length;)a[d++]=u[c++];for(;f<l.length;)a[d++]=l[f++];return a}})(lf||(lf={}));let vw=class{constructor(t,e,r,n){this._uri=t,this._languageId=e,this._version=r,this._content=n,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(t){if(t){let e=this.offsetAt(t.start),r=this.offsetAt(t.end);return this._content.substring(e,r)}return this._content}update(t,e){this._content=t.text,this._version=e,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let t=[],e=this._content,r=!0;for(let n=0;n<e.length;n++){r&&(t.push(n),r=!1);let i=e.charAt(n);r=i==="\r"||i===`
|
|
115
115
|
`,i==="\r"&&n+1<e.length&&e.charAt(n+1)===`
|
|
116
|
-
`&&n++}r&&e.length>0&&t.push(e.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let e=this.getLineOffsets(),r=0,n=e.length;if(n===0)return D.create(0,t);for(;r<n;){let a=Math.floor((r+n)/2);e[a]>t?n=a:r=a+1}let i=r-1;return D.create(i,t-e[i])}offsetAt(t){let e=this.getLineOffsets();if(t.line>=e.length)return this._content.length;if(t.line<0)return 0;let r=e[t.line],n=t.line+1<e.length?e[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,n),r)}get lineCount(){return this.getLineOffsets().length}};var p;(function(t){const e=Object.prototype.toString;function r(h){return typeof h<"u"}t.defined=r;function n(h){return typeof h>"u"}t.undefined=n;function i(h){return h===!0||h===!1}t.boolean=i;function a(h){return e.call(h)==="[object String]"}t.string=a;function s(h){return e.call(h)==="[object Number]"}t.number=s;function o(h,m,g){return e.call(h)==="[object Number]"&&m<=h&&h<=g}t.numberRange=o;function u(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=u;function l(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=l;function c(h){return e.call(h)==="[object Function]"}t.func=c;function f(h){return h!==null&&typeof h=="object"}t.objectLiteral=f;function d(h,m){return Array.isArray(h)&&h.every(m)}t.typedArray=d})(p||(p={}));class Tw{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new Kh(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new Tu;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Ao(e.startOffset,e.image.length,js(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new Ao(a.startOffset,a.image.length,js(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}}class Bh{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,r;const n=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(r=this.container)===null||r===void 0?void 0:r.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class Ao extends Bh{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}}class Tu extends Bh{constructor(){super(...arguments),this.content=new Ru(this)}get children(){return this.content}get offset(){var e,r;return(r=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&r!==void 0?r:0}get length(){return this.end-this.offset}get end(){var e,r;return(r=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&r!==void 0?r:0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:D.create(0,0),end:D.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}}class Ru extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Ru.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}}class Kh extends Tu{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const $o=Symbol("Datatype");function as(t){return t.$type===$o}const cf="",Vh=t=>t.endsWith(cf)?t:t+cf;class zh{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";this.wrapper=new kw(r,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Rw extends zh{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Tw,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(Vh(e.name),this.startImplementation(n,r).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment)return Jf(e)?$o:Lo(e)??e.name}parse(e,r={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");const a=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:a,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}startImplementation(e,r){return n=>{const i=!this.isRecording()&&e!==void 0;if(i){const s={$type:e};this.stack.push(s),e===$o&&(s.value="")}let a;try{a=r(n)}catch{a=void 0}return a===void 0&&i&&(a=this.construct()),a}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,isCrossRef:u}=this.getAssignment(n),l=this.current;if(o){const c=Ht(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,c,s,u)}else if(as(l)){let c=i.image;Ht(n)||(c=this.converter.convert(c,s).toString()),l.value+=c}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));const o=this.wrapper.wrapSubrule(e,r,a);!this.isRecording()&&s&&s.length>0&&this.performSubruleAssignment(o,i,s)}performSubruleAssignment(e,r,n){const{assignment:i,isCrossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(as(s))s.value+=e.toString();else if(typeof e=="object"&&e){const o=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(o)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const i={$type:e};this.stack.push(i),this.assign(r.operator,r.feature,n,n.$cstNode,!1)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return dm(e),this.nodeBuilder.construct(e),this.stack.pop(),as(e)?this.converter.convert(e.value,e.$cstNode):(hm(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const r=na(e,zt);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?_o(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class Ew{buildMismatchTokenMessage(e){return dr.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return dr.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return dr.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return dr.buildEarlyExitMessage(e)}}class Hh extends Ew{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class Aw extends zh{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(Vh(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}}const $w={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new Hh};class kw extends CS{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,Object.assign(Object.assign(Object.assign({},$w),{lookaheadStrategy:n?new hu({maxLookahead:r.maxLookahead}):new QS({logging:r.skipValidations?()=>{}:void 0})}),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r){return this.RULE(e,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}}function Wh(t,e,r){return xw({parser:e,tokens:r,ruleNames:new Map},t),e}function xw(t,e){const r=Yf(e,!1),n=ie(e.rules).filter(Ce).filter(i=>r.has(i));for(const i of n){const a=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,Zt(a,i.definition))}}function Zt(t,e,r=!1){let n;if(Ht(e))n=Nw(t,e);else if(ra(e))n=bw(t,e);else if(zt(e))n=Zt(t,e.terminal);else if(_o(e))n=Yh(t,e);else if(Wt(e))n=Sw(t,e);else if(Bf(e))n=Iw(t,e);else if(Kf(e))n=_w(t,e);else if(Co(e))n=Cw(t,e);else if(im(e)){const i=t.consume++;n=()=>t.parser.consume(i,St,e)}else throw new jf(e.$cstNode,`Unexpected element type: ${e.$type}`);return qh(t,r?void 0:Zi(e),n,e.cardinality)}function bw(t,e){const r=Po(e);return()=>t.parser.action(r,e)}function Sw(t,e){const r=e.rule.ref;if(Ce(r)){const n=t.subrule++,i=r.fragment,a=e.arguments.length>0?ww(r,e.arguments):()=>({});return s=>t.parser.subrule(n,Xh(t,r),i,e,a(s))}else if(Jt(r)){const n=t.consume++,i=ko(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)wn();else throw new jf(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function ww(t,e){const r=e.map(n=>st(n.value));return n=>{const i={};for(let a=0;a<r.length;a++){const s=t.parameters[a],o=r[a];i[s.name]=o(n)}return i}}function st(t){if(Qp(t)){const e=st(t.left),r=st(t.right);return n=>e(n)||r(n)}else if(Zp(t)){const e=st(t.left),r=st(t.right);return n=>e(n)&&r(n)}else if(Jp(t)){const e=st(t.value);return r=>!e(r)}else if(em(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Xp(t)){const e=!!t.true;return()=>e}wn()}function Iw(t,e){if(e.elements.length===1)return Zt(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Zt(t,i,!0)},s=Zi(i);s&&(a.GATE=st(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:()=>a.ALT(i)},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}function _w(t,e){if(e.elements.length===1)return Zt(t,e.elements[0]);const r=[];for(const o of e.elements){const u={ALT:Zt(t,o,!0)},l=Zi(o);l&&(u.GATE=st(l)),r.push(u)}const n=t.or++,i=(o,u)=>{const l=u.getRuleStack().join("-");return`uGroup_${o}_${l}`},a=o=>t.parser.alternatives(n,r.map((u,l)=>{const c={ALT:()=>!0},f=t.parser;c.ALT=()=>{if(u.ALT(o),!f.isRecording()){const h=i(n,f);f.unorderedGroups.get(h)||f.unorderedGroups.set(h,[]);const m=f.unorderedGroups.get(h);typeof(m==null?void 0:m[l])>"u"&&(m[l]=!0)}};const d=u.GATE;return d?c.GATE=()=>d(o):c.GATE=()=>{const h=f.unorderedGroups.get(i(n,f));return!(h!=null&&h[l])},c})),s=qh(t,Zi(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function Cw(t,e){const r=e.elements.map(n=>Zt(t,n));return n=>r.forEach(i=>i(n))}function Zi(t){if(Co(t))return t.guardCondition}function Yh(t,e,r=e.terminal){if(r)if(Wt(r)&&Ce(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;return a=>t.parser.subrule(i,Xh(t,n),!1,e,a)}else if(Wt(r)&&Jt(r.rule.ref)){const n=t.consume++,i=ko(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(Ht(r)){const n=t.consume++,i=ko(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=Zf(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Po(e.type.ref));return Yh(t,e,i)}}function Nw(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function qh(t,e,r,n){const i=e&&st(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:ic(),GATE:()=>!i(s)}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(a,{DEF:()=>r(o)}),GATE:()=>i(o)},{ALT:ic(),GATE:()=>!i(o)}])}else return s=>t.parser.atLeastOne(a,{DEF:()=>r(s)})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else wn()}function Xh(t,e){const r=Ow(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function Ow(t,e){if(Ce(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ce(n);)(Co(n)||Bf(n)||Kf(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function ko(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function Lw(t){const e=t.Grammar,r=t.parser.Lexer,n=new Aw(t);return Wh(e,n,r.definition),n.finalize(),n}function Pw(t){const e=Mw(t);return e.finalize(),e}function Mw(t){const e=t.Grammar,r=t.parser.Lexer,n=new Rw(t);return Wh(e,n,r.definition)}class Zh{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=ie(Yf(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return i.forEach(s=>{const o=s.PATTERN;typeof o=="object"&&o&&"test"in o&&Fs(o)?a.unshift(s):a.push(s)}),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Jt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Mo(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Fs(r)?he.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Ce).flatMap(i=>In(i).filter(Ht)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Am(e.value)):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&$m("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class Qh{convert(e,r){let n=r.grammarSource;if(_o(n)&&(n=Sm(n)),Wt(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return nt.convertInt(r);case"STRING":return nt.convertString(r);case"ID":return nt.convertID(r)}switch((i=Lm(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return nt.convertNumber(r);case"boolean":return nt.convertBoolean(r);case"bigint":return nt.convertBigint(r);case"date":return nt.convertDate(r);default:return r}}}var nt;(function(t){function e(l){let c="";for(let f=1;f<l.length-1;f++){const d=l.charAt(f);if(d==="\\"){const h=l.charAt(++f);c+=r(h)}else c+=d}return c}t.convertString=e;function r(l){switch(l){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
117
|
-
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return l}}function n(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=n;function i(l){return parseInt(l)}t.convertInt=i;function a(l){return BigInt(l)}t.convertBigint=a;function s(l){return new Date(l)}t.convertDate=s;function o(l){return Number(l)}t.convertNumber=o;function u(l){return l.toLowerCase()==="true"}t.convertBoolean=u})(nt||(nt={}));var Bt={},ni={},ff;function Jh(){if(ff)return ni;ff=1,Object.defineProperty(ni,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(r){function n(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}r.install=n}(e||(e={})),ni.default=e,ni}var te={},df;function Dw(){if(df)return te;df=1,Object.defineProperty(te,"__esModule",{value:!0}),te.stringArray=te.array=te.func=te.error=te.number=te.string=te.boolean=void 0;function t(o){return o===!0||o===!1}te.boolean=t;function e(o){return typeof o=="string"||o instanceof String}te.string=e;function r(o){return typeof o=="number"||o instanceof Number}te.number=r;function n(o){return o instanceof Error}te.error=n;function i(o){return typeof o=="function"}te.func=i;function a(o){return Array.isArray(o)}te.array=a;function s(o){return a(o)&&o.every(u=>e(u))}return te.stringArray=s,te}var Kt={},hf;function ep(){if(hf)return Kt;hf=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.Emitter=Kt.Event=void 0;const t=Jh();var e;(function(i){const a={dispose(){}};i.None=function(){return a}})(e||(Kt.Event=e={}));class r{add(a,s=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(a),this._contexts.push(s),Array.isArray(o)&&o.push({dispose:()=>this.remove(a,s)})}remove(a,s=null){if(!this._callbacks)return;let o=!1;for(let u=0,l=this._callbacks.length;u<l;u++)if(this._callbacks[u]===a)if(this._contexts[u]===s){this._callbacks.splice(u,1),this._contexts.splice(u,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...a){if(!this._callbacks)return[];const s=[],o=this._callbacks.slice(0),u=this._contexts.slice(0);for(let l=0,c=o.length;l<c;l++)try{s.push(o[l].apply(u[l],a))}catch(f){(0,t.default)().console.error(f)}return s}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class n{constructor(a){this._options=a}get event(){return this._event||(this._event=(a,s,o)=>{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(a,s);const u={dispose:()=>{this._callbacks&&(this._callbacks.remove(a,s),u.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(u),u}),this._event}fire(a){this._callbacks&&this._callbacks.invoke.call(this._callbacks,a)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Kt.Emitter=n,n._noop=function(){},Kt}var pf;function jw(){if(pf)return Bt;pf=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.CancellationTokenSource=Bt.CancellationToken=void 0;const t=Jh(),e=Dw(),r=ep();var n;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function u(l){const c=l;return c&&(c===o.None||c===o.Cancelled||e.boolean(c.isCancellationRequested)&&!!c.onCancellationRequested)}o.is=u})(n||(Bt.CancellationToken=n={}));const i=Object.freeze(function(o,u){const l=(0,t.default)().timer.setTimeout(o.bind(u),0);return{dispose(){l.dispose()}}});class a{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class s{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=n.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=n.None}}return Bt.CancellationTokenSource=s,Bt}var H=jw();function Uw(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Ti=0,Fw=10;function Gw(){return Ti=performance.now(),new H.CancellationTokenSource}const Qi=Symbol("OperationCancelled");function Pa(t){return t===Qi}async function $e(t){if(t===H.CancellationToken.None)return;const e=performance.now();if(e-Ti>=Fw&&(Ti=e,await Uw(),Ti=performance.now()),t.isCancellationRequested)throw Qi}class Eu{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class Sn{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Sn.isIncremental(n)){const i=rp(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),u=Math.max(i.end.line,0);let l=this._lineOffsets;const c=mf(n.text,!1,a);if(u-o===c.length)for(let d=0,h=c.length;d<h;d++)l[d+o+1]=c[d];else c.length<1e4?l.splice(o+1,u-o,...c):this._lineOffsets=l=l.slice(0,o+1).concat(c,l.slice(u+1));const f=n.text.length-(s-a);if(f!==0)for(let d=o+1+c.length,h=l.length;d<h;d++)l[d]=l[d]+f}else if(Sn.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=mf(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){const s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1<r.length?r[e.line+1]:this._content.length,a=Math.min(n+e.character,i);return this.ensureBeforeEOL(a,n)}ensureBeforeEOL(e,r){for(;e>r&&tp(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}}var xo;(function(t){function e(i,a,s,o){return new Sn(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof Sn)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,a){const s=i.getText(),o=bo(a.map(Bw),(c,f)=>{const d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d});let u=0;const l=[];for(const c of o){const f=i.offsetAt(c.range.start);if(f<u)throw new Error("Overlapping edit");f>u&&l.push(s.substring(u,f)),c.newText.length&&l.push(c.newText),u=i.offsetAt(c.range.end)}return l.push(s.substr(u)),l.join("")}t.applyEdits=n})(xo||(xo={}));function bo(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);bo(n,e),bo(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;)e(n[a],i[s])<=0?t[o++]=n[a++]:t[o++]=i[s++];for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}function mf(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);tp(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function tp(t){return t===13||t===10}function rp(t){const e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function Bw(t){const e=rp(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var np;(()=>{var t={470:i=>{function a(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function s(u,l){for(var c,f="",d=0,h=-1,m=0,g=0;g<=u.length;++g){if(g<u.length)c=u.charCodeAt(g);else{if(c===47)break;c=47}if(c===47){if(!(h===g-1||m===1))if(h!==g-1&&m===2){if(f.length<2||d!==2||f.charCodeAt(f.length-1)!==46||f.charCodeAt(f.length-2)!==46){if(f.length>2){var E=f.lastIndexOf("/");if(E!==f.length-1){E===-1?(f="",d=0):d=(f=f.slice(0,E)).length-1-f.lastIndexOf("/"),h=g,m=0;continue}}else if(f.length===2||f.length===1){f="",d=0,h=g,m=0;continue}}l&&(f.length>0?f+="/..":f="..",d=2)}else f.length>0?f+="/"+u.slice(h+1,g):f=u.slice(h+1,g),d=g-h-1;h=g,m=0}else c===46&&m!==-1?++m:m=-1}return f}var o={resolve:function(){for(var u,l="",c=!1,f=arguments.length-1;f>=-1&&!c;f--){var d;f>=0?d=arguments[f]:(u===void 0&&(u=process.cwd()),d=u),a(d),d.length!==0&&(l=d+"/"+l,c=d.charCodeAt(0)===47)}return l=s(l,!c),c?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(u){if(a(u),u.length===0)return".";var l=u.charCodeAt(0)===47,c=u.charCodeAt(u.length-1)===47;return(u=s(u,!l)).length!==0||l||(u="."),u.length>0&&c&&(u+="/"),l?"/"+u:u},isAbsolute:function(u){return a(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,l=0;l<arguments.length;++l){var c=arguments[l];a(c),c.length>0&&(u===void 0?u=c:u+="/"+c)}return u===void 0?".":o.normalize(u)},relative:function(u,l){if(a(u),a(l),u===l||(u=o.resolve(u))===(l=o.resolve(l)))return"";for(var c=1;c<u.length&&u.charCodeAt(c)===47;++c);for(var f=u.length,d=f-c,h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var m=l.length-h,g=d<m?d:m,E=-1,v=0;v<=g;++v){if(v===g){if(m>g){if(l.charCodeAt(h+v)===47)return l.slice(h+v+1);if(v===0)return l.slice(h+v)}else d>g&&(u.charCodeAt(c+v)===47?E=v:v===0&&(E=0));break}var R=u.charCodeAt(c+v);if(R!==l.charCodeAt(h+v))break;R===47&&(E=v)}var T="";for(v=c+E+1;v<=f;++v)v!==f&&u.charCodeAt(v)!==47||(T.length===0?T+="..":T+="/..");return T.length>0?T+l.slice(h+E):(h+=E,l.charCodeAt(h)===47&&++h,l.slice(h))},_makeLong:function(u){return u},dirname:function(u){if(a(u),u.length===0)return".";for(var l=u.charCodeAt(0),c=l===47,f=-1,d=!0,h=u.length-1;h>=1;--h)if((l=u.charCodeAt(h))===47){if(!d){f=h;break}}else d=!1;return f===-1?c?"/":".":c&&f===1?"//":u.slice(0,f)},basename:function(u,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');a(u);var c,f=0,d=-1,h=!0;if(l!==void 0&&l.length>0&&l.length<=u.length){if(l.length===u.length&&l===u)return"";var m=l.length-1,g=-1;for(c=u.length-1;c>=0;--c){var E=u.charCodeAt(c);if(E===47){if(!h){f=c+1;break}}else g===-1&&(h=!1,g=c+1),m>=0&&(E===l.charCodeAt(m)?--m==-1&&(d=c):(m=-1,d=g))}return f===d?d=g:d===-1&&(d=u.length),u.slice(f,d)}for(c=u.length-1;c>=0;--c)if(u.charCodeAt(c)===47){if(!h){f=c+1;break}}else d===-1&&(h=!1,d=c+1);return d===-1?"":u.slice(f,d)},extname:function(u){a(u);for(var l=-1,c=0,f=-1,d=!0,h=0,m=u.length-1;m>=0;--m){var g=u.charCodeAt(m);if(g!==47)f===-1&&(d=!1,f=m+1),g===46?l===-1?l=m:h!==1&&(h=1):l!==-1&&(h=-1);else if(!d){c=m+1;break}}return l===-1||f===-1||h===0||h===1&&l===f-1&&l===c+1?"":u.slice(l,f)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(l,c){var f=c.dir||c.root,d=c.base||(c.name||"")+(c.ext||"");return f?f===c.root?f+d:f+"/"+d:d}(0,u)},parse:function(u){a(u);var l={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return l;var c,f=u.charCodeAt(0),d=f===47;d?(l.root="/",c=1):c=0;for(var h=-1,m=0,g=-1,E=!0,v=u.length-1,R=0;v>=c;--v)if((f=u.charCodeAt(v))!==47)g===-1&&(E=!1,g=v+1),f===46?h===-1?h=v:R!==1&&(R=1):h!==-1&&(R=-1);else if(!E){m=v+1;break}return h===-1||g===-1||R===0||R===1&&h===g-1&&h===m+1?g!==-1&&(l.base=l.name=m===0&&d?u.slice(1,g):u.slice(m,g)):(m===0&&d?(l.name=u.slice(1,h),l.base=u.slice(1,g)):(l.name=u.slice(m,h),l.base=u.slice(m,g)),l.ext=u.slice(h,g)),m>0?l.dir=u.slice(0,m-1):d&&(l.dir="/"),l},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function r(i){var a=e[i];if(a!==void 0)return a.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.d=(i,a)=>{for(var s in a)r.o(a,s)&&!r.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:a[s]})},r.o=(i,a)=>Object.prototype.hasOwnProperty.call(i,a),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;r.r(n),r.d(n,{URI:()=>d,Utils:()=>Se}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function u(k,y){if(!k.scheme&&y)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${k.authority}", path: "${k.path}", query: "${k.query}", fragment: "${k.fragment}"}`);if(k.scheme&&!a.test(k.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(k.path){if(k.authority){if(!s.test(k.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(k.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const l="",c="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{constructor(y,b,x,O,N,C=!1){Gt(this,"scheme"),Gt(this,"authority"),Gt(this,"path"),Gt(this,"query"),Gt(this,"fragment"),typeof y=="object"?(this.scheme=y.scheme||l,this.authority=y.authority||l,this.path=y.path||l,this.query=y.query||l,this.fragment=y.fragment||l):(this.scheme=function(Re,J){return Re||J?Re:"file"}(y,C),this.authority=b||l,this.path=function(Re,J){switch(Re){case"https":case"http":case"file":J?J[0]!==c&&(J=c+J):J=c}return J}(this.scheme,x||l),this.query=O||l,this.fragment=N||l,u(this,C))}static isUri(y){return y instanceof d||!!y&&typeof y.authority=="string"&&typeof y.fragment=="string"&&typeof y.path=="string"&&typeof y.query=="string"&&typeof y.scheme=="string"&&typeof y.fsPath=="string"&&typeof y.with=="function"&&typeof y.toString=="function"}get fsPath(){return R(this)}with(y){if(!y)return this;let{scheme:b,authority:x,path:O,query:N,fragment:C}=y;return b===void 0?b=this.scheme:b===null&&(b=l),x===void 0?x=this.authority:x===null&&(x=l),O===void 0?O=this.path:O===null&&(O=l),N===void 0?N=this.query:N===null&&(N=l),C===void 0?C=this.fragment:C===null&&(C=l),b===this.scheme&&x===this.authority&&O===this.path&&N===this.query&&C===this.fragment?this:new m(b,x,O,N,C)}static parse(y,b=!1){const x=f.exec(y);return x?new m(x[2]||l,oe(x[4]||l),oe(x[5]||l),oe(x[7]||l),oe(x[9]||l),b):new m(l,l,l,l,l)}static file(y){let b=l;if(i&&(y=y.replace(/\\/g,c)),y[0]===c&&y[1]===c){const x=y.indexOf(c,2);x===-1?(b=y.substring(2),y=c):(b=y.substring(2,x),y=y.substring(x)||c)}return new m("file",b,y,l,l)}static from(y){const b=new m(y.scheme,y.authority,y.path,y.query,y.fragment);return u(b,!0),b}toString(y=!1){return T(this,y)}toJSON(){return this}static revive(y){if(y){if(y instanceof d)return y;{const b=new m(y);return b._formatted=y.external,b._fsPath=y._sep===h?y.fsPath:null,b}}return y}}const h=i?1:void 0;class m extends d{constructor(){super(...arguments),Gt(this,"_formatted",null),Gt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=R(this)),this._fsPath}toString(y=!1){return y?T(this,!0):(this._formatted||(this._formatted=T(this,!1)),this._formatted)}toJSON(){const y={$mid:1};return this._fsPath&&(y.fsPath=this._fsPath,y._sep=h),this._formatted&&(y.external=this._formatted),this.path&&(y.path=this.path),this.scheme&&(y.scheme=this.scheme),this.authority&&(y.authority=this.authority),this.query&&(y.query=this.query),this.fragment&&(y.fragment=this.fragment),y}}const g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(k,y,b){let x,O=-1;for(let N=0;N<k.length;N++){const C=k.charCodeAt(N);if(C>=97&&C<=122||C>=65&&C<=90||C>=48&&C<=57||C===45||C===46||C===95||C===126||y&&C===47||b&&C===91||b&&C===93||b&&C===58)O!==-1&&(x+=encodeURIComponent(k.substring(O,N)),O=-1),x!==void 0&&(x+=k.charAt(N));else{x===void 0&&(x=k.substr(0,N));const Re=g[C];Re!==void 0?(O!==-1&&(x+=encodeURIComponent(k.substring(O,N)),O=-1),x+=Re):O===-1&&(O=N)}}return O!==-1&&(x+=encodeURIComponent(k.substring(O))),x!==void 0?x:k}function v(k){let y;for(let b=0;b<k.length;b++){const x=k.charCodeAt(b);x===35||x===63?(y===void 0&&(y=k.substr(0,b)),y+=g[x]):y!==void 0&&(y+=k[b])}return y!==void 0?y:k}function R(k,y){let b;return b=k.authority&&k.path.length>1&&k.scheme==="file"?`//${k.authority}${k.path}`:k.path.charCodeAt(0)===47&&(k.path.charCodeAt(1)>=65&&k.path.charCodeAt(1)<=90||k.path.charCodeAt(1)>=97&&k.path.charCodeAt(1)<=122)&&k.path.charCodeAt(2)===58?k.path[1].toLowerCase()+k.path.substr(2):k.path,i&&(b=b.replace(/\//g,"\\")),b}function T(k,y){const b=y?v:E;let x="",{scheme:O,authority:N,path:C,query:Re,fragment:J}=k;if(O&&(x+=O,x+=":"),(N||O==="file")&&(x+=c,x+=c),N){let W=N.indexOf("@");if(W!==-1){const jt=N.substr(0,W);N=N.substr(W+1),W=jt.lastIndexOf(":"),W===-1?x+=b(jt,!1,!1):(x+=b(jt.substr(0,W),!1,!1),x+=":",x+=b(jt.substr(W+1),!1,!0)),x+="@"}N=N.toLowerCase(),W=N.lastIndexOf(":"),W===-1?x+=b(N,!1,!0):(x+=b(N.substr(0,W),!1,!0),x+=N.substr(W))}if(C){if(C.length>=3&&C.charCodeAt(0)===47&&C.charCodeAt(2)===58){const W=C.charCodeAt(1);W>=65&&W<=90&&(C=`/${String.fromCharCode(W+32)}:${C.substr(3)}`)}else if(C.length>=2&&C.charCodeAt(1)===58){const W=C.charCodeAt(0);W>=65&&W<=90&&(C=`${String.fromCharCode(W+32)}:${C.substr(2)}`)}x+=b(C,!0,!1)}return Re&&(x+="?",x+=b(Re,!1,!1)),J&&(x+="#",x+=y?J:E(J,!1,!1)),x}function $(k){try{return decodeURIComponent(k)}catch{return k.length>3?k.substr(0,3)+$(k.substr(3)):k}}const P=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function oe(k){return k.match(P)?k.replace(P,y=>$(y)):k}var Me=r(470);const Te=Me.posix||Me,Ve="/";var Se;(function(k){k.joinPath=function(y,...b){return y.with({path:Te.join(y.path,...b)})},k.resolvePath=function(y,...b){let x=y.path,O=!1;x[0]!==Ve&&(x=Ve+x,O=!0);let N=Te.resolve(x,...b);return O&&N[0]===Ve&&!y.authority&&(N=N.substring(1)),y.with({path:N})},k.dirname=function(y){if(y.path.length===0||y.path===Ve)return y;let b=Te.dirname(y.path);return b.length===1&&b.charCodeAt(0)===46&&(b=""),y.with({path:b})},k.basename=function(y){return Te.basename(y.path)},k.extname=function(y){return Te.extname(y.path)}})(Se||(Se={}))})(),np=n})();const{URI:Qt,Utils:Nr}=np;var It;(function(t){t.basename=Nr.basename,t.dirname=Nr.dirname,t.extname=Nr.extname,t.joinPath=Nr.joinPath,t.resolvePath=Nr.resolvePath;function e(i,a){return(i==null?void 0:i.toString())===(a==null?void 0:a.toString())}t.equals=e;function r(i,a){const s=typeof i=="string"?i:i.path,o=typeof a=="string"?a:a.path,u=s.split("/").filter(h=>h.length>0),l=o.split("/").filter(h=>h.length>0);let c=0;for(;c<u.length&&u[c]===l[c];c++);const f="../".repeat(u.length-c),d=l.slice(c).join("/");return f+d}t.relative=r;function n(i){return Qt.parse(i.toString()).toString()}t.normalize=n})(It||(It={}));var V;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(V||(V={}));class Kw{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=H.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Qt.parse(e.uri),H.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return H.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:V.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:V.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var n,i;const a=(n=e.parseResult.value.$cstNode)===null||n===void 0?void 0:n.root.fullText,s=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),o=s?s.getText():await this.fileSystemProvider.readFile(e.uri);if(s)Object.defineProperty(e,"textDocument",{value:s});else{const u=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:u})}return a!==o&&(e.parseResult=await this.parseAsync(e.uri,o,r),e.parseResult.value.$document=e),e.state=V.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=xo.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class Vw{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return ie(this.documentMap.values())}addDocument(e){const r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getDocument(e){const r=e.toString();return this.documentMap.get(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(this.serviceRegistry.getServices(e).references.Linker.unlink(n),n.state=V.Changed,n.precomputedScopes=void 0,n.diagnostics=void 0),n}deleteDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=V.Changed,this.documentMap.delete(r)),n}}const ss=Symbol("ref_resolving");class zw{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=H.CancellationToken.None){for(const n of hr(e.parseResult.value))await $e(r),zf(n).forEach(i=>this.doLink(i,e))}doLink(e,r){var n;const i=e.reference;if(i._ref===void 0){i._ref=ss;try{const a=this.getCandidate(e);if(fi(a))i._ref=a;else if(i._nodeDescription=a,this.langiumDocuments().hasDocument(a.documentUri)){const s=this.loadAstNode(a);i._ref=s??this.createLinkingError(e,a)}else i._ref=void 0}catch(a){console.error(`An error occurred while resolving reference to '${i.$refText}':`,a);const s=(n=a.message)!==null&&n!==void 0?n:String(a);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${s}`})}r.references.push(i)}}unlink(e){for(const r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,get ref(){var o;if(le(this._ref))return this._ref;if(Fp(this._nodeDescription)){const u=a.loadAstNode(this._nodeDescription);this._ref=u??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=ss;const u=Us(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&u&&u.state<V.ComputedScopes)return this._ref=void 0;this._ref=(o=l.node)!==null&&o!==void 0?o:l.error,this._nodeDescription=l.descr,u==null||u.references.push(this)}else if(this._ref===ss)throw new Error(`Cyclic reference resolution detected: ${a.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${i}')`);return le(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return fi(this._ref)?this._ref:void 0}};return s}getLinkedNode(e){var r;try{const n=this.getCandidate(e);if(fi(n))return{error:n};const i=this.loadAstNode(n);return i?{node:i,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);const i=(r=n.message)!==null&&r!==void 0?r:String(n);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Us(e.container).$document;n&&n.state<V.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r})}}function Hw(t){return typeof t.name=="string"}class Ww{getName(e){if(Hw(e))return e.name}getNameNode(e){return Xf(e.$cstNode,"name")}}class Yw{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const r=Nm(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(He(i))return i.ref;if(Array.isArray(i)){for(const a of i)if(He(a)&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return a.ref}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||Kp(e,i)))return n}}}findDeclarationNode(e){const r=this.findDeclaration(e);if(r!=null&&r.$cstNode)return this.nameProvider.getNameNode(r)??r.$cstNode}findReferences(e,r){const n=[];if(r.includeDeclaration){const a=this.getReferenceToSelf(e);a&&n.push(a)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>It.equals(a.sourceUri,r.documentUri))),n.push(...i),ie(n)}getReferenceToSelf(e){const r=this.nameProvider.getNameNode(e);if(r){const n=Et(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:wi(r),local:!0}}}}class Ji{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Ms.sum(ie(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ie(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ie(this.map.keys())}values(){return ie(this.map.values()).flat()}entriesGroupedByKey(){return ie(this.map.entries())}}class gf{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}}class qw{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=H.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=No,i=H.CancellationToken.None){const a=[];this.exportNode(e,a,r);for(const s of n(e))await $e(i),this.exportNode(s,a,r);return a}exportNode(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=H.CancellationToken.None){const n=e.parseResult.value,i=new Ji;for(const a of In(n))await $e(r),this.processNode(a,e,i);return i}processNode(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}}class yf{constructor(e,r,n){var i;this.elements=e,this.outerScope=r,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}}class Xw{constructor(e,r,n){var i;this.elements=new Map,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1;for(const a of e){const s=this.caseInsensitive?a.name.toLowerCase():a.name;this.elements.set(s,a)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=ie(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class ip{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Zw extends ip{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class Qw extends ip{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}}class Jw extends Zw{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class eI{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Jw(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Et(e.container).precomputedScopes;if(i){let s=e.container;do{const o=i.get(s);o.length>0&&r.push(ie(o).filter(u=>this.reflection.isSubtype(u.type,n))),s=s.$container}while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new yf(ie(e),r,n)}createScopeForNodes(e,r,n){const i=ie(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new yf(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Xw(this.indexManager.allElements(e)))}}function tI(t){return typeof t.$comment=="string"}function vf(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class rI{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=(o,u)=>this.replacer(o,u,n),s=i?(o,u)=>i(o,u,a):a;try{return this.currentDocument=Et(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var u,l,c,f;if(!this.ignoreProperties.has(e))if(He(r)){const d=r.ref,h=n?r.$refText:void 0;if(d){const m=Et(d);let g="";this.currentDocument&&this.currentDocument!==m&&(o?g=o(m.uri,r):g=m.uri.toString());const E=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${E}`,$refText:h}}else return{$error:(l=(u=r.error)===null||u===void 0?void 0:u.message)!==null&&l!==void 0?l:"Could not resolve reference",$refText:h}}else if(le(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},r)),(!e||r.$document)&&d!=null&&d.$textRegion&&(d.$textRegion.documentURI=(c=this.currentDocument)===null||c===void 0?void 0:c.uri.toString())),i&&!e&&(d??(d=Object.assign({},r)),d.$sourceText=(f=r.$cstNode)===null||f===void 0?void 0:f.text),s){d??(d=Object.assign({},r));const h=this.commentProvider.getComment(r);h&&(d.$comment=h.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=Im(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[u,l]of Object.entries(e))if(Array.isArray(l))for(let c=0;c<l.length;c++){const f=l[c];vf(f)?l[c]=this.reviveReference(e,u,r,f,n):le(f)&&this.linkNode(f,r,n,e,u,c)}else vf(l)?e[u]=this.reviveReference(e,u,r,l,n):le(l)&&this.linkNode(l,r,n,e,u);const o=e;o.$container=i,o.$containerProperty=a,o.$containerIndex=s}reviveReference(e,r,n,i,a){let s=i.$refText,o=i.$error;if(i.$ref){const u=this.getRefNode(n,i.$ref,a.uriConverter);if(le(u))return s||(s=this.nameProvider.getName(u)),{$refText:s??"",ref:u};o=u}if(o){const u={$refText:s??""};return u.error={container:e,property:r,message:o,reference:u},u}else return}getRefNode(e,r,n){try{const i=r.indexOf("#");if(i===0)return this.astNodeLocator.getAstNode(e,r.substring(1))||"Could not resolve path: "+r;if(i<0){const u=n?n(r):Qt.parse(r),l=this.langiumDocuments.getDocument(u);return l?l.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):Qt.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(a);return s?i===r.length-1?s.parseResult.value:this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1))||"Could not resolve URI: "+r:"Could not find document for URI: "+r}catch(i){return String(i)}}}class nI{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const r=e.LanguageMetaData;for(const n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);this.languageIdMap.set(r.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var r,n;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(n=(r=this.textDocuments)===null||r===void 0?void 0:r.get(e))===null||n===void 0?void 0:n.languageId;if(i!==void 0){const o=this.languageIdMap.get(i);if(o)return o}const a=It.extname(e),s=this.fileExtensionMap.get(a);if(!s)throw i?new Error(`The service registry contains no services for the extension '${a}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${a}'.`);return s}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function fn(t){return{code:t}}var ea;(function(t){t.all=["fast","slow","built-in"]})(ea||(ea={}));class iI{constructor(e){this.entries=new Ji,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,a]of Object.entries(e)){const s=a;if(Array.isArray(s))for(const o of s){const u={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,u)}else if(typeof s=="function"){const o={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,o)}else wn()}}wrapValidationException(e,r){return async(n,i,a)=>{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Pa(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=ie(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class aI{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r={},n=H.CancellationToken.None){const i=e.parseResult,a=[];if(await $e(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===je.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===je.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===je.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Pa(s))throw s;console.error("An error occurred during validation:",s)}return await $e(n),a}processLexingErrors(e,r,n){var i,a,s;const o=[...e.lexerErrors,...(a=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&a!==void 0?a:[]];for(const u of o){const l=(s=u.severity)!==null&&s!==void 0?s:"error",c={severity:os(l),range:{start:{line:u.line-1,character:u.column-1},end:{line:u.line-1,character:u.column+u.length-1}},message:u.message,data:oI(l),source:this.getSource()};r.push(c)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=js(i.token);if(a){const s={severity:os("error"),range:a,message:i.message,data:fn(je.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(const i of e.references){const a=i.error;if(a){const s={node:a.container,property:a.property,index:a.index,data:{code:je.LinkingError,containerType:a.container.$type,property:a.property,refText:a.reference.$refText}};r.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,r,n=H.CancellationToken.None){const i=[],a=(s,o,u)=>{i.push(this.toDiagnostic(s,o,u))};return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=H.CancellationToken.None){var a;const s=this.validationRegistry.checksBefore;for(const o of s)await $e(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}async validateAstNodes(e,r,n,i=H.CancellationToken.None){await Promise.all(hr(e).map(async a=>{await $e(i);const s=this.validationRegistry.getChecks(a.$type,r.categories);for(const o of s)await o(a,n,i)}))}async validateAstAfter(e,r,n,i=H.CancellationToken.None){var a;const s=this.validationRegistry.checksAfter;for(const o of s)await $e(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}toDiagnostic(e,r,n){return{message:r,range:sI(n),severity:os(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function sI(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Xf(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=_m(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function os(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function oI(t){switch(t){case"error":return fn(je.LexingError);case"warning":return fn(je.LexingWarning);case"info":return fn(je.LexingInfo);case"hint":return fn(je.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var je;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(je||(je={}));class uI{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Et(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=()=>{var u;return s??(s=wi((u=this.nameProvider.getNameNode(e))!==null&&u!==void 0?u:e.$cstNode))};return{node:e,name:r,get nameSegment(){return o()},selectionSegment:wi(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class lI{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=H.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of hr(i))await $e(r),zf(a).filter(s=>!fi(s)).forEach(s=>{const o=this.createDescription(s);o&&n.push(o)});return n}createDescription(e){const r=e.reference.$nodeDescription,n=e.reference.$refNode;if(!r||!n)return;const i=Et(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:wi(n),local:It.equals(r.documentUri,i)}}}class cI{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((n,i)=>{if(!n||i.length===0)return n;const a=i.indexOf(this.indexSeparator);if(a>0){const s=i.substring(0,a),o=parseInt(i.substring(a+1)),u=n[s];return u==null?void 0:u[o]}return n[i]},e)}}var fI=ep();class dI{constructor(e){this._ready=new Eu,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new fI.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r,n;this.workspaceConfig=(n=(r=e.capabilities.workspace)===null||r===void 0?void 0:r.configuration)!==null&&n!==void 0?n:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(r=>{const n=e.settings[r];this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var vn;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(vn||(vn={}));class hI{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ji,this.documentPhaseListeners=new Ji,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=V.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=H.CancellationToken.None){var i,a;for(const s of e){const o=s.uri.toString();if(s.state===V.Validated){if(typeof r.validation=="boolean"&&r.validation)s.state=V.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(o);else if(typeof r.validation=="object"){const u=this.buildState.get(o),l=(i=u==null?void 0:u.result)===null||i===void 0?void 0:i.validationChecks;if(l){const c=((a=r.validation.categories)!==null&&a!==void 0?a:ea.all).filter(f=>!l.includes(f));c.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},r.validation),{categories:c})},result:u.result}),s.state=V.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=V.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=H.CancellationToken.None){this.currentState=V.Changed;for(const s of r)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString()),this.indexManager.remove(s);for(const s of e){if(!this.langiumDocuments.invalidateDocument(s)){const o=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s);o.state=V.Changed,this.langiumDocuments.addDocument(o)}this.buildState.delete(s.toString())}const i=ie(e).concat(r).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!i.has(s.uri.toString())&&this.shouldRelink(s,i)).forEach(s=>{this.serviceRegistry.getServices(s.uri).references.Linker.unlink(s),s.state=Math.min(s.state,V.ComputedScopes),s.diagnostics=void 0}),await this.emitUpdate(e,r),await $e(n);const a=this.sortDocuments(this.langiumDocuments.all.filter(s=>{var o;return s.state<V.Linked||!(!((o=this.buildState.get(s.uri.toString()))===null||o===void 0)&&o.completed)}).toArray());await this.buildDocuments(a,this.updateBuildOptions,n)}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){var r;return!!(!((r=this.textDocuments)===null||r===void 0)&&r.get(e.uri))}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),vn.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,V.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,V.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,V.ComputedScopes,n,async a=>{const s=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.precomputedScopes=await s.computeLocalScopes(a,n)}),await this.runCancelable(e,V.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(e,V.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));const i=e.filter(a=>this.shouldValidate(a));await this.runCancelable(i,V.Validated,n,a=>this.validate(a,n));for(const a of e){const s=this.buildState.get(a.uri.toString());s&&(s.completed=!0)}}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){const a=e.filter(o=>o.state<r);for(const o of a)await $e(n),await i(o),o.state=r,await this.notifyDocumentPhase(o,r,n);const s=e.filter(o=>o.state===r);await this.notifyBuildPhase(s,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),vn.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),vn.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;if(r&&"path"in r?i=r:n=r,n??(n=H.CancellationToken.None),i){const a=this.langiumDocuments.getDocument(i);if(a&&a.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(Qi):new Promise((a,s)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),u.dispose(),i){const l=this.langiumDocuments.getDocument(i);a(l==null?void 0:l.uri)}else a(void 0)}),u=n.onCancellationRequested(()=>{o.dispose(),u.dispose(),s(Qi)})})}async notifyDocumentPhase(e,r,n){const i=this.documentPhaseListeners.get(r).slice();for(const a of i)try{await a(e,n)}catch(s){if(!Pa(s))throw s}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const i=this.buildPhaseListeners.get(r).slice();for(const a of i)await $e(n),await a(e,n)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){var n,i;const a=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,o=typeof s=="object"?s:void 0,u=await a.validateDocument(e,o,r);e.diagnostics?e.diagnostics.push(...u):e.diagnostics=u;const l=this.buildState.get(e.uri.toString());if(l){(n=l.result)!==null&&n!==void 0||(l.result={});const c=(i=o==null?void 0:o.categories)!==null&&i!==void 0?i:ea.all;l.result.validationChecks?l.result.validationChecks.push(...c):l.result.validationChecks=[...c]}}getBuildOptions(e){var r,n;return(n=(r=this.buildState.get(e.uri.toString()))===null||r===void 0?void 0:r.options)!==null&&n!==void 0?n:{}}}class pI{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Qw,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Et(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{It.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),ie(i)}allElements(e,r){let n=ie(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){var n;return r?this.symbolByTypeIndex.get(e,r,()=>{var i;return((i=this.symbolIndex.get(e))!==null&&i!==void 0?i:[]).filter(a=>this.astReflection.isSubtype(a.type,r))}):(n=this.symbolIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r),this.referenceIndex.delete(r)}async updateContent(e,r=H.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r),i=e.uri.toString();this.symbolIndex.set(i,n),this.symbolByTypeIndex.clear(i)}async updateReferences(e,r=H.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}}class mI{constructor(e){this.initialBuildOptions={},this._ready=new Eu,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var r;this.folders=(r=e.workspaceFolders)!==null&&r!==void 0?r:void 0}initialized(e){return this.mutex.write(r=>{var n;return this.initializeWorkspace((n=this.folders)!==null&&n!==void 0?n:[],r)})}async initializeWorkspace(e,r=H.CancellationToken.None){const n=await this.performStartup(e);await $e(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=this.serviceRegistry.all.flatMap(a=>a.LanguageMetaData.fileExtensions),n=[],i=a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(a=>[a,this.getRootFolder(a)]).map(async a=>this.traverseFolder(...a,r,i))),this._ready.resolve(),n}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Qt.parse(e.uri)}async traverseFolder(e,r,n,i){const a=await this.fileSystemProvider.readDirectory(r);await Promise.all(a.map(async s=>{if(this.includeEntry(e,s,n)){if(s.isDirectory)await this.traverseFolder(e,s.uri,n,i);else if(s.isFile){const o=await this.langiumDocuments.getOrCreateDocument(s.uri);i(o)}}}))}includeEntry(e,r,n){const i=It.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){const a=It.extname(r.uri);return n.includes(a)}return!1}}class gI{buildUnexpectedCharactersMessage(e,r,n,i,a){return eo.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return eo.buildUnableToPopLexerModeMessage(e)}}const yI={mode:"full"};class vI{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=Tf(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new he(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=yI){var n,i,a;const s=this.chevrotainLexer.tokenize(e);return{tokens:s.tokens,errors:s.errors,hidden:(n=s.groups.hidden)!==null&&n!==void 0?n:[],report:(a=(i=this.tokenBuilder).flushLexingReport)===null||a===void 0?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(Tf(e))return e;const r=ap(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function TI(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function ap(t){return t&&"modes"in t&&"defaultMode"in t}function Tf(t){return!TI(t)&&!ap(t)}function RI(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=D.create(0,0));const a=sp(t),s=Au(n),o=$I({lines:a,position:i,options:s});return wI({index:0,tokens:o,position:i})}function EI(t,e){const r=Au(e),n=sp(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}function sp(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(ym)}const Rf=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,AI=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function $I(t){var e,r,n;const i=[];let a=t.position.line,s=t.position.character;for(let o=0;o<t.lines.length;o++){const u=o===0,l=o===t.lines.length-1;let c=t.lines[o],f=0;if(u&&t.options.start){const d=(e=t.options.start)===null||e===void 0?void 0:e.exec(c);d&&(f=d.index+d[0].length)}else{const d=(r=t.options.line)===null||r===void 0?void 0:r.exec(c);d&&(f=d.index+d[0].length)}if(l){const d=(n=t.options.end)===null||n===void 0?void 0:n.exec(c);d&&(c=c.substring(0,d.index))}if(c=c.substring(0,SI(c)),So(c,f)>=c.length){if(i.length>0){const d=D.create(a,s);i.push({type:"break",content:"",range:L.create(d,d)})}}else{Rf.lastIndex=f;const d=Rf.exec(c);if(d){const h=d[0],m=d[1],g=D.create(a,s+f),E=D.create(a,s+f+h.length);i.push({type:"tag",content:m,range:L.create(g,E)}),f+=h.length,f=So(c,f)}if(f<c.length){const h=c.substring(f),m=Array.from(h.matchAll(AI));i.push(...kI(m,h,a,s+f))}}a++,s=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function kI(t,e,r,n){const i=[];if(t.length===0){const a=D.create(r,n),s=D.create(r,n+e.length);i.push({type:"text",content:e,range:L.create(a,s)})}else{let a=0;for(const o of t){const u=o.index,l=e.substring(a,u);l.length>0&&i.push({type:"text",content:e.substring(a,u),range:L.create(D.create(r,a+n),D.create(r,u+n))});let c=l.length+1;const f=o[1];if(i.push({type:"inline-tag",content:f,range:L.create(D.create(r,a+c+n),D.create(r,a+c+f.length+n))}),c+=f.length,o.length===4){c+=o[2].length;const d=o[3];i.push({type:"text",content:d,range:L.create(D.create(r,a+c+n),D.create(r,a+c+d.length+n))})}else i.push({type:"text",content:"",range:L.create(D.create(r,a+c+n),D.create(r,a+c+n))});a=u+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:L.create(D.create(r,a+n),D.create(r,a+n+s.length))})}return i}const xI=/\S/,bI=/\s*$/;function So(t,e){const r=t.substring(e).match(xI);return r?e+r.index:t.length}function SI(t){const e=t.match(bI);if(e&&typeof e.index=="number")return e.index}function wI(t){var e,r,n,i;const a=D.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Ef([],L.create(a,a));const s=[];for(;t.index<t.tokens.length;){const l=II(t,s[s.length-1]);l&&s.push(l)}const o=(r=(e=s[0])===null||e===void 0?void 0:e.range.start)!==null&&r!==void 0?r:a,u=(i=(n=s[s.length-1])===null||n===void 0?void 0:n.range.end)!==null&&i!==void 0?i:a;return new Ef(s,L.create(o,u))}function II(t,e){const r=t.tokens[t.index];if(r.type==="tag")return up(t,!1);if(r.type==="text"||r.type==="inline-tag")return op(t);_I(r,e),t.index++}function _I(t,e){if(e){const r=new cp("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function op(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(CI(t)),n=e,e=t.tokens[t.index];return new wo(i,L.create(r.range.start,n.range.end))}function CI(t){return t.tokens[t.index].type==="inline-tag"?up(t,!0):lp(t)}function up(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const a=lp(t);return new ls(n,new wo([a],a.range),e,L.create(r.range.start,a.range.end))}else{const a=op(t);return new ls(n,a,e,L.create(r.range.start,a.range.end))}else{const a=r.range;return new ls(n,new wo([],a),e,a)}}function lp(t){const e=t.tokens[t.index++];return new cp(e.content,e.range)}function Au(t){if(!t)return Au({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:us(e,!0),end:us(r,!1),line:us(n,!0)}}function us(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?aa(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class Ef{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=Af(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=Af(r)+i}return r.trim()}}class ls{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
|
|
116
|
+
`&&n++}r&&e.length>0&&t.push(e.length),this._lineOffsets=t}return this._lineOffsets}positionAt(t){t=Math.max(Math.min(t,this._content.length),0);let e=this.getLineOffsets(),r=0,n=e.length;if(n===0)return D.create(0,t);for(;r<n;){let a=Math.floor((r+n)/2);e[a]>t?n=a:r=a+1}let i=r-1;return D.create(i,t-e[i])}offsetAt(t){let e=this.getLineOffsets();if(t.line>=e.length)return this._content.length;if(t.line<0)return 0;let r=e[t.line],n=t.line+1<e.length?e[t.line+1]:this._content.length;return Math.max(Math.min(r+t.character,n),r)}get lineCount(){return this.getLineOffsets().length}};var p;(function(t){const e=Object.prototype.toString;function r(h){return typeof h<"u"}t.defined=r;function n(h){return typeof h>"u"}t.undefined=n;function i(h){return h===!0||h===!1}t.boolean=i;function a(h){return e.call(h)==="[object String]"}t.string=a;function s(h){return e.call(h)==="[object Number]"}t.number=s;function o(h,m,g){return e.call(h)==="[object Number]"&&m<=h&&h<=g}t.numberRange=o;function u(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=u;function l(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=l;function c(h){return e.call(h)==="[object Function]"}t.func=c;function f(h){return h!==null&&typeof h=="object"}t.objectLiteral=f;function d(h,m){return Array.isArray(h)&&h.every(m)}t.typedArray=d})(p||(p={}));class Tw{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new Kh(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const r=new Tu;return r.grammarSource=e,r.root=this.rootNode,this.current.content.push(r),this.nodeStack.push(r),r}buildLeafNode(e,r){const n=new Ao(e.startOffset,e.image.length,js(e),e.tokenType,!r);return n.grammarSource=r,n.root=this.rootNode,this.current.content.push(n),n}removeNode(e){const r=e.container;if(r){const n=r.content.indexOf(e);n>=0&&r.content.splice(n,1)}}addHiddenNodes(e){const r=[];for(const a of e){const s=new Ao(a.startOffset,a.image.length,js(a),a.tokenType,!0);s.root=this.rootNode,r.push(s)}let n=this.current,i=!1;if(n.content.length>0){n.content.push(...r);return}for(;n.container;){const a=n.container.content.indexOf(n);if(a>0){n.container.content.splice(a,0,...r),i=!0;break}n=n.container}i||this.rootNode.content.unshift(...r)}construct(e){const r=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=r;const n=this.nodeStack.pop();(n==null?void 0:n.content.length)===0&&this.removeNode(n)}}class Bh{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,r;const n=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(r=this.container)===null||r===void 0?void 0:r.astNode;if(!n)throw new Error("This node has no associated AST element");return n}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class Ao extends Bh{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,r,n,i,a=!1){super(),this._hidden=a,this._offset=e,this._tokenType=i,this._length=r,this._range=n}}class Tu extends Bh{constructor(){super(...arguments),this.content=new Ru(this)}get children(){return this.content}get offset(){var e,r;return(r=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&r!==void 0?r:0}get length(){return this.end-this.offset}get end(){var e,r;return(r=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&r!==void 0?r:0}get range(){const e=this.firstNonHiddenNode,r=this.lastNonHiddenNode;if(e&&r){if(this._rangeCache===void 0){const{range:n}=e,{range:i}=r;this._rangeCache={start:n.start,end:i.end.line<n.start.line?n.start:i.end}}return this._rangeCache}else return{start:D.create(0,0),end:D.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const r=this.content[e];if(!r.hidden)return r}return this.content[this.content.length-1]}}class Ru extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Ru.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,r,...n){return this.addParents(n),super.splice(e,r,...n)}addParents(e){for(const r of e)r.container=this.parent}}class Kh extends Tu{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const $o=Symbol("Datatype");function as(t){return t.$type===$o}const cf="",Vh=t=>t.endsWith(cf)?t:t+cf;class Hh{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const r=this.lexer.definition,n=e.LanguageMetaData.mode==="production";this.wrapper=new kw(r,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:n,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,r){this.wrapper.wrapOr(e,r)}optional(e,r){this.wrapper.wrapOption(e,r)}many(e,r){this.wrapper.wrapMany(e,r)}atLeastOne(e,r){this.wrapper.wrapAtLeastOne(e,r)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Rw extends Hh{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Tw,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,r){const n=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(Vh(e.name),this.startImplementation(n,r).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment)return Jf(e)?$o:Lo(e)??e.name}parse(e,r={}){this.nodeBuilder.buildRootNode(e);const n=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=n.tokens;const i=r.rule?this.allRules.get(r.rule):this.mainRule;if(!i)throw new Error(r.rule?`No rule found with name '${r.rule}'`:"No main rule available.");const a=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(n.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:a,lexerErrors:n.errors,lexerReport:n.report,parserErrors:this.wrapper.errors}}startImplementation(e,r){return n=>{const i=!this.isRecording()&&e!==void 0;if(i){const s={$type:e};this.stack.push(s),e===$o&&(s.value="")}let a;try{a=r(n)}catch{a=void 0}return a===void 0&&i&&(a=this.construct()),a}}extractHiddenTokens(e){const r=this.lexerResult.hidden;if(!r.length)return[];const n=e.startOffset;for(let i=0;i<r.length;i++)if(r[i].startOffset>n)return r.splice(0,i);return r.splice(0,r.length)}consume(e,r,n){const i=this.wrapper.wrapConsume(e,r);if(!this.isRecording()&&this.isValidToken(i)){const a=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(a);const s=this.nodeBuilder.buildLeafNode(i,n),{assignment:o,isCrossRef:u}=this.getAssignment(n),l=this.current;if(o){const c=zt(n)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,c,s,u)}else if(as(l)){let c=i.image;zt(n)||(c=this.converter.convert(c,s).toString()),l.value+=c}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,r,n,i,a){let s;!this.isRecording()&&!n&&(s=this.nodeBuilder.buildCompositeNode(i));const o=this.wrapper.wrapSubrule(e,r,a);!this.isRecording()&&s&&s.length>0&&this.performSubruleAssignment(o,i,s)}performSubruleAssignment(e,r,n){const{assignment:i,isCrossRef:a}=this.getAssignment(r);if(i)this.assign(i.operator,i.feature,e,n,a);else if(!i){const s=this.current;if(as(s))s.value+=e.toString();else if(typeof e=="object"&&e){const o=this.assignWithoutOverride(e,s);this.stack.pop(),this.stack.push(o)}}}action(e,r){if(!this.isRecording()){let n=this.current;if(r.feature&&r.operator){n=this.construct(),this.nodeBuilder.removeNode(n.$cstNode),this.nodeBuilder.buildCompositeNode(r).content.push(n.$cstNode);const i={$type:e};this.stack.push(i),this.assign(r.operator,r.feature,n,n.$cstNode,!1)}else n.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return dm(e),this.nodeBuilder.construct(e),this.stack.pop(),as(e)?this.converter.convert(e.value,e.$cstNode):(hm(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const r=na(e,Ht);this.assignmentMap.set(e,{assignment:r,isCrossRef:r?_o(r.terminal):!1})}return this.assignmentMap.get(e)}assign(e,r,n,i,a){const s=this.current;let o;switch(a&&typeof n=="string"?o=this.linker.buildReference(s,r,i,n):o=n,e){case"=":{s[r]=o;break}case"?=":{s[r]=!0;break}case"+=":Array.isArray(s[r])||(s[r]=[]),s[r].push(o)}}assignWithoutOverride(e,r){for(const[i,a]of Object.entries(r)){const s=e[i];s===void 0?e[i]=a:Array.isArray(s)&&Array.isArray(a)&&(a.push(...s),e[i]=a)}const n=e.$cstNode;return n&&(n.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class Ew{buildMismatchTokenMessage(e){return dr.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return dr.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return dr.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return dr.buildEarlyExitMessage(e)}}class zh extends Ew{buildMismatchTokenMessage({expected:e,actual:r}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${r.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class Aw extends Hh{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const r=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=r.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,r){const n=this.wrapper.DEFINE_RULE(Vh(e.name),this.startImplementation(r).bind(this));return this.allRules.set(e.name,n),e.entry&&(this.mainRule=n),n}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return r=>{const n=this.keepStackSize();try{e(r)}finally{this.resetStackSize(n)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,r,n){this.wrapper.wrapConsume(e,r),this.isRecording()||(this.lastElementStack=[...this.elementStack,n],this.nextTokenIndex=this.currIdx+1)}subrule(e,r,n,i,a){this.before(i),this.wrapper.wrapSubrule(e,r,a),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const r=this.elementStack.lastIndexOf(e);r>=0&&this.elementStack.splice(r)}}get currIdx(){return this.wrapper.currIdx}}const $w={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new zh};class kw extends CS{constructor(e,r){const n=r&&"maxLookahead"in r;super(e,Object.assign(Object.assign(Object.assign({},$w),{lookaheadStrategy:n?new hu({maxLookahead:r.maxLookahead}):new QS({logging:r.skipValidations?()=>{}:void 0})}),r))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,r){return this.RULE(e,r)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,r){return this.consume(e,r)}wrapSubrule(e,r,n){return this.subrule(e,r,{ARGS:[n]})}wrapOr(e,r){this.or(e,r)}wrapOption(e,r){this.option(e,r)}wrapMany(e,r){this.many(e,r)}wrapAtLeastOne(e,r){this.atLeastOne(e,r)}}function Wh(t,e,r){return xw({parser:e,tokens:r,ruleNames:new Map},t),e}function xw(t,e){const r=Yf(e,!1),n=ie(e.rules).filter(Ce).filter(i=>r.has(i));for(const i of n){const a=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,Zt(a,i.definition))}}function Zt(t,e,r=!1){let n;if(zt(e))n=Nw(t,e);else if(ra(e))n=bw(t,e);else if(Ht(e))n=Zt(t,e.terminal);else if(_o(e))n=Yh(t,e);else if(Wt(e))n=Sw(t,e);else if(Bf(e))n=Iw(t,e);else if(Kf(e))n=_w(t,e);else if(Co(e))n=Cw(t,e);else if(im(e)){const i=t.consume++;n=()=>t.parser.consume(i,St,e)}else throw new jf(e.$cstNode,`Unexpected element type: ${e.$type}`);return qh(t,r?void 0:Zi(e),n,e.cardinality)}function bw(t,e){const r=Po(e);return()=>t.parser.action(r,e)}function Sw(t,e){const r=e.rule.ref;if(Ce(r)){const n=t.subrule++,i=r.fragment,a=e.arguments.length>0?ww(r,e.arguments):()=>({});return s=>t.parser.subrule(n,Xh(t,r),i,e,a(s))}else if(Jt(r)){const n=t.consume++,i=ko(t,r.name);return()=>t.parser.consume(n,i,e)}else if(r)wn();else throw new jf(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function ww(t,e){const r=e.map(n=>st(n.value));return n=>{const i={};for(let a=0;a<r.length;a++){const s=t.parameters[a],o=r[a];i[s.name]=o(n)}return i}}function st(t){if(Qp(t)){const e=st(t.left),r=st(t.right);return n=>e(n)||r(n)}else if(Zp(t)){const e=st(t.left),r=st(t.right);return n=>e(n)&&r(n)}else if(Jp(t)){const e=st(t.value);return r=>!e(r)}else if(em(t)){const e=t.parameter.ref.name;return r=>r!==void 0&&r[e]===!0}else if(Xp(t)){const e=!!t.true;return()=>e}wn()}function Iw(t,e){if(e.elements.length===1)return Zt(t,e.elements[0]);{const r=[];for(const i of e.elements){const a={ALT:Zt(t,i,!0)},s=Zi(i);s&&(a.GATE=st(s)),r.push(a)}const n=t.or++;return i=>t.parser.alternatives(n,r.map(a=>{const s={ALT:()=>a.ALT(i)},o=a.GATE;return o&&(s.GATE=()=>o(i)),s}))}}function _w(t,e){if(e.elements.length===1)return Zt(t,e.elements[0]);const r=[];for(const o of e.elements){const u={ALT:Zt(t,o,!0)},l=Zi(o);l&&(u.GATE=st(l)),r.push(u)}const n=t.or++,i=(o,u)=>{const l=u.getRuleStack().join("-");return`uGroup_${o}_${l}`},a=o=>t.parser.alternatives(n,r.map((u,l)=>{const c={ALT:()=>!0},f=t.parser;c.ALT=()=>{if(u.ALT(o),!f.isRecording()){const h=i(n,f);f.unorderedGroups.get(h)||f.unorderedGroups.set(h,[]);const m=f.unorderedGroups.get(h);typeof(m==null?void 0:m[l])>"u"&&(m[l]=!0)}};const d=u.GATE;return d?c.GATE=()=>d(o):c.GATE=()=>{const h=f.unorderedGroups.get(i(n,f));return!(h!=null&&h[l])},c})),s=qh(t,Zi(e),a,"*");return o=>{s(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(n,t.parser))}}function Cw(t,e){const r=e.elements.map(n=>Zt(t,n));return n=>r.forEach(i=>i(n))}function Zi(t){if(Co(t))return t.guardCondition}function Yh(t,e,r=e.terminal){if(r)if(Wt(r)&&Ce(r.rule.ref)){const n=r.rule.ref,i=t.subrule++;return a=>t.parser.subrule(i,Xh(t,n),!1,e,a)}else if(Wt(r)&&Jt(r.rule.ref)){const n=t.consume++,i=ko(t,r.rule.ref.name);return()=>t.parser.consume(n,i,e)}else if(zt(r)){const n=t.consume++,i=ko(t,r.value);return()=>t.parser.consume(n,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const n=Zf(e.type.ref),i=n==null?void 0:n.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Po(e.type.ref));return Yh(t,e,i)}}function Nw(t,e){const r=t.consume++,n=t.tokens[e.value];if(!n)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(r,n,e)}function qh(t,e,r,n){const i=e&&st(e);if(!n)if(i){const a=t.or++;return s=>t.parser.alternatives(a,[{ALT:()=>r(s),GATE:()=>i(s)},{ALT:ic(),GATE:()=>!i(s)}])}else return r;if(n==="*"){const a=t.many++;return s=>t.parser.many(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else if(n==="+"){const a=t.many++;if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>t.parser.atLeastOne(a,{DEF:()=>r(o)}),GATE:()=>i(o)},{ALT:ic(),GATE:()=>!i(o)}])}else return s=>t.parser.atLeastOne(a,{DEF:()=>r(s)})}else if(n==="?"){const a=t.optional++;return s=>t.parser.optional(a,{DEF:()=>r(s),GATE:i?()=>i(s):void 0})}else wn()}function Xh(t,e){const r=Ow(t,e),n=t.parser.getRule(r);if(!n)throw new Error(`Rule "${r}" not found."`);return n}function Ow(t,e){if(Ce(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let r=e,n=r.$container,i=e.$type;for(;!Ce(n);)(Co(n)||Bf(n)||Kf(n))&&(i=n.elements.indexOf(r).toString()+":"+i),r=n,n=n.$container;return i=n.name+":"+i,t.ruleNames.set(e,i),i}}function ko(t,e){const r=t.tokens[e];if(!r)throw new Error(`Token "${e}" not found."`);return r}function Lw(t){const e=t.Grammar,r=t.parser.Lexer,n=new Aw(t);return Wh(e,n,r.definition),n.finalize(),n}function Pw(t){const e=Mw(t);return e.finalize(),e}function Mw(t){const e=t.Grammar,r=t.parser.Lexer,n=new Rw(t);return Wh(e,n,r.definition)}class Zh{constructor(){this.diagnostics=[]}buildTokens(e,r){const n=ie(Yf(e,!1)),i=this.buildTerminalTokens(n),a=this.buildKeywordTokens(n,i,r);return i.forEach(s=>{const o=s.PATTERN;typeof o=="object"&&o&&"test"in o&&Us(o)?a.unshift(s):a.push(s)}),a}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Jt).filter(r=>!r.fragment).map(r=>this.buildTerminalToken(r)).toArray()}buildTerminalToken(e){const r=Mo(e),n=this.requiresCustomPattern(r)?this.regexPatternFunction(r):r,i={name:e.name,PATTERN:n};return typeof n=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Us(r)?he.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const r=new RegExp(e,e.flags+"y");return(n,i)=>(r.lastIndex=i,r.exec(n))}buildKeywordTokens(e,r,n){return e.filter(Ce).flatMap(i=>In(i).filter(zt)).distinct(i=>i.value).toArray().sort((i,a)=>a.value.length-i.value.length).map(i=>this.buildKeywordToken(i,r,!!(n!=null&&n.caseInsensitive)))}buildKeywordToken(e,r,n){const i=this.buildKeywordPattern(e,n),a={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,r)};return typeof i=="function"&&(a.LINE_BREAKS=!0),a}buildKeywordPattern(e,r){return r?new RegExp(Am(e.value)):e.value}findLongerAlt(e,r){return r.reduce((n,i)=>{const a=i==null?void 0:i.PATTERN;return a!=null&&a.source&&$m("^"+a.source+"$",e.value)&&n.push(i),n},[])}}class Qh{convert(e,r){let n=r.grammarSource;if(_o(n)&&(n=Sm(n)),Wt(n)){const i=n.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,r)}return e}runConverter(e,r,n){var i;switch(e.name.toUpperCase()){case"INT":return nt.convertInt(r);case"STRING":return nt.convertString(r);case"ID":return nt.convertID(r)}switch((i=Lm(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return nt.convertNumber(r);case"boolean":return nt.convertBoolean(r);case"bigint":return nt.convertBigint(r);case"date":return nt.convertDate(r);default:return r}}}var nt;(function(t){function e(l){let c="";for(let f=1;f<l.length-1;f++){const d=l.charAt(f);if(d==="\\"){const h=l.charAt(++f);c+=r(h)}else c+=d}return c}t.convertString=e;function r(l){switch(l){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
117
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return l}}function n(l){return l.charAt(0)==="^"?l.substring(1):l}t.convertID=n;function i(l){return parseInt(l)}t.convertInt=i;function a(l){return BigInt(l)}t.convertBigint=a;function s(l){return new Date(l)}t.convertDate=s;function o(l){return Number(l)}t.convertNumber=o;function u(l){return l.toLowerCase()==="true"}t.convertBoolean=u})(nt||(nt={}));var Bt={},ni={},ff;function Jh(){if(ff)return ni;ff=1,Object.defineProperty(ni,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(r){function n(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}r.install=n}(e||(e={})),ni.default=e,ni}var te={},df;function Dw(){if(df)return te;df=1,Object.defineProperty(te,"__esModule",{value:!0}),te.stringArray=te.array=te.func=te.error=te.number=te.string=te.boolean=void 0;function t(o){return o===!0||o===!1}te.boolean=t;function e(o){return typeof o=="string"||o instanceof String}te.string=e;function r(o){return typeof o=="number"||o instanceof Number}te.number=r;function n(o){return o instanceof Error}te.error=n;function i(o){return typeof o=="function"}te.func=i;function a(o){return Array.isArray(o)}te.array=a;function s(o){return a(o)&&o.every(u=>e(u))}return te.stringArray=s,te}var Kt={},hf;function ep(){if(hf)return Kt;hf=1,Object.defineProperty(Kt,"__esModule",{value:!0}),Kt.Emitter=Kt.Event=void 0;const t=Jh();var e;(function(i){const a={dispose(){}};i.None=function(){return a}})(e||(Kt.Event=e={}));class r{add(a,s=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(a),this._contexts.push(s),Array.isArray(o)&&o.push({dispose:()=>this.remove(a,s)})}remove(a,s=null){if(!this._callbacks)return;let o=!1;for(let u=0,l=this._callbacks.length;u<l;u++)if(this._callbacks[u]===a)if(this._contexts[u]===s){this._callbacks.splice(u,1),this._contexts.splice(u,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...a){if(!this._callbacks)return[];const s=[],o=this._callbacks.slice(0),u=this._contexts.slice(0);for(let l=0,c=o.length;l<c;l++)try{s.push(o[l].apply(u[l],a))}catch(f){(0,t.default)().console.error(f)}return s}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class n{constructor(a){this._options=a}get event(){return this._event||(this._event=(a,s,o)=>{this._callbacks||(this._callbacks=new r),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(a,s);const u={dispose:()=>{this._callbacks&&(this._callbacks.remove(a,s),u.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(u),u}),this._event}fire(a){this._callbacks&&this._callbacks.invoke.call(this._callbacks,a)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Kt.Emitter=n,n._noop=function(){},Kt}var pf;function jw(){if(pf)return Bt;pf=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.CancellationTokenSource=Bt.CancellationToken=void 0;const t=Jh(),e=Dw(),r=ep();var n;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None});function u(l){const c=l;return c&&(c===o.None||c===o.Cancelled||e.boolean(c.isCancellationRequested)&&!!c.onCancellationRequested)}o.is=u})(n||(Bt.CancellationToken=n={}));const i=Object.freeze(function(o,u){const l=(0,t.default)().timer.setTimeout(o.bind(u),0);return{dispose(){l.dispose()}}});class a{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class s{get token(){return this._token||(this._token=new a),this._token}cancel(){this._token?this._token.cancel():this._token=n.Cancelled}dispose(){this._token?this._token instanceof a&&this._token.dispose():this._token=n.None}}return Bt.CancellationTokenSource=s,Bt}var z=jw();function Fw(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Ti=0,Uw=10;function Gw(){return Ti=performance.now(),new z.CancellationTokenSource}const Qi=Symbol("OperationCancelled");function Pa(t){return t===Qi}async function $e(t){if(t===z.CancellationToken.None)return;const e=performance.now();if(e-Ti>=Uw&&(Ti=e,await Fw(),Ti=performance.now()),t.isCancellationRequested)throw Qi}class Eu{constructor(){this.promise=new Promise((e,r)=>{this.resolve=n=>(e(n),this),this.reject=n=>(r(n),this)})}}class Sn{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(const n of e)if(Sn.isIncremental(n)){const i=rp(n.range),a=this.offsetAt(i.start),s=this.offsetAt(i.end);this._content=this._content.substring(0,a)+n.text+this._content.substring(s,this._content.length);const o=Math.max(i.start.line,0),u=Math.max(i.end.line,0);let l=this._lineOffsets;const c=mf(n.text,!1,a);if(u-o===c.length)for(let d=0,h=c.length;d<h;d++)l[d+o+1]=c[d];else c.length<1e4?l.splice(o+1,u-o,...c):this._lineOffsets=l=l.slice(0,o+1).concat(c,l.slice(u+1));const f=n.text.length-(s-a);if(f!==0)for(let d=o+1+c.length,h=l.length;d<h;d++)l[d]=l[d]+f}else if(Sn.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=mf(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const r=this.getLineOffsets();let n=0,i=r.length;if(i===0)return{line:0,character:e};for(;n<i;){const s=Math.floor((n+i)/2);r[s]>e?i=s:n=s+1}const a=n-1;return e=this.ensureBeforeEOL(e,r[a]),{line:a,character:e-r[a]}}offsetAt(e){const r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;const n=r[e.line];if(e.character<=0)return n;const i=e.line+1<r.length?r[e.line+1]:this._content.length,a=Math.min(n+e.character,i);return this.ensureBeforeEOL(a,n)}ensureBeforeEOL(e,r){for(;e>r&&tp(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range!==void 0&&(r.rangeLength===void 0||typeof r.rangeLength=="number")}static isFull(e){const r=e;return r!=null&&typeof r.text=="string"&&r.range===void 0&&r.rangeLength===void 0}}var xo;(function(t){function e(i,a,s,o){return new Sn(i,a,s,o)}t.create=e;function r(i,a,s){if(i instanceof Sn)return i.update(a,s),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=r;function n(i,a){const s=i.getText(),o=bo(a.map(Bw),(c,f)=>{const d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d});let u=0;const l=[];for(const c of o){const f=i.offsetAt(c.range.start);if(f<u)throw new Error("Overlapping edit");f>u&&l.push(s.substring(u,f)),c.newText.length&&l.push(c.newText),u=i.offsetAt(c.range.end)}return l.push(s.substr(u)),l.join("")}t.applyEdits=n})(xo||(xo={}));function bo(t,e){if(t.length<=1)return t;const r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);bo(n,e),bo(i,e);let a=0,s=0,o=0;for(;a<n.length&&s<i.length;)e(n[a],i[s])<=0?t[o++]=n[a++]:t[o++]=i[s++];for(;a<n.length;)t[o++]=n[a++];for(;s<i.length;)t[o++]=i[s++];return t}function mf(t,e,r=0){const n=e?[r]:[];for(let i=0;i<t.length;i++){const a=t.charCodeAt(i);tp(a)&&(a===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,n.push(r+i+1))}return n}function tp(t){return t===13||t===10}function rp(t){const e=t.start,r=t.end;return e.line>r.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function Bw(t){const e=rp(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var np;(()=>{var t={470:i=>{function a(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function s(u,l){for(var c,f="",d=0,h=-1,m=0,g=0;g<=u.length;++g){if(g<u.length)c=u.charCodeAt(g);else{if(c===47)break;c=47}if(c===47){if(!(h===g-1||m===1))if(h!==g-1&&m===2){if(f.length<2||d!==2||f.charCodeAt(f.length-1)!==46||f.charCodeAt(f.length-2)!==46){if(f.length>2){var E=f.lastIndexOf("/");if(E!==f.length-1){E===-1?(f="",d=0):d=(f=f.slice(0,E)).length-1-f.lastIndexOf("/"),h=g,m=0;continue}}else if(f.length===2||f.length===1){f="",d=0,h=g,m=0;continue}}l&&(f.length>0?f+="/..":f="..",d=2)}else f.length>0?f+="/"+u.slice(h+1,g):f=u.slice(h+1,g),d=g-h-1;h=g,m=0}else c===46&&m!==-1?++m:m=-1}return f}var o={resolve:function(){for(var u,l="",c=!1,f=arguments.length-1;f>=-1&&!c;f--){var d;f>=0?d=arguments[f]:(u===void 0&&(u=process.cwd()),d=u),a(d),d.length!==0&&(l=d+"/"+l,c=d.charCodeAt(0)===47)}return l=s(l,!c),c?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(u){if(a(u),u.length===0)return".";var l=u.charCodeAt(0)===47,c=u.charCodeAt(u.length-1)===47;return(u=s(u,!l)).length!==0||l||(u="."),u.length>0&&c&&(u+="/"),l?"/"+u:u},isAbsolute:function(u){return a(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,l=0;l<arguments.length;++l){var c=arguments[l];a(c),c.length>0&&(u===void 0?u=c:u+="/"+c)}return u===void 0?".":o.normalize(u)},relative:function(u,l){if(a(u),a(l),u===l||(u=o.resolve(u))===(l=o.resolve(l)))return"";for(var c=1;c<u.length&&u.charCodeAt(c)===47;++c);for(var f=u.length,d=f-c,h=1;h<l.length&&l.charCodeAt(h)===47;++h);for(var m=l.length-h,g=d<m?d:m,E=-1,v=0;v<=g;++v){if(v===g){if(m>g){if(l.charCodeAt(h+v)===47)return l.slice(h+v+1);if(v===0)return l.slice(h+v)}else d>g&&(u.charCodeAt(c+v)===47?E=v:v===0&&(E=0));break}var R=u.charCodeAt(c+v);if(R!==l.charCodeAt(h+v))break;R===47&&(E=v)}var T="";for(v=c+E+1;v<=f;++v)v!==f&&u.charCodeAt(v)!==47||(T.length===0?T+="..":T+="/..");return T.length>0?T+l.slice(h+E):(h+=E,l.charCodeAt(h)===47&&++h,l.slice(h))},_makeLong:function(u){return u},dirname:function(u){if(a(u),u.length===0)return".";for(var l=u.charCodeAt(0),c=l===47,f=-1,d=!0,h=u.length-1;h>=1;--h)if((l=u.charCodeAt(h))===47){if(!d){f=h;break}}else d=!1;return f===-1?c?"/":".":c&&f===1?"//":u.slice(0,f)},basename:function(u,l){if(l!==void 0&&typeof l!="string")throw new TypeError('"ext" argument must be a string');a(u);var c,f=0,d=-1,h=!0;if(l!==void 0&&l.length>0&&l.length<=u.length){if(l.length===u.length&&l===u)return"";var m=l.length-1,g=-1;for(c=u.length-1;c>=0;--c){var E=u.charCodeAt(c);if(E===47){if(!h){f=c+1;break}}else g===-1&&(h=!1,g=c+1),m>=0&&(E===l.charCodeAt(m)?--m==-1&&(d=c):(m=-1,d=g))}return f===d?d=g:d===-1&&(d=u.length),u.slice(f,d)}for(c=u.length-1;c>=0;--c)if(u.charCodeAt(c)===47){if(!h){f=c+1;break}}else d===-1&&(h=!1,d=c+1);return d===-1?"":u.slice(f,d)},extname:function(u){a(u);for(var l=-1,c=0,f=-1,d=!0,h=0,m=u.length-1;m>=0;--m){var g=u.charCodeAt(m);if(g!==47)f===-1&&(d=!1,f=m+1),g===46?l===-1?l=m:h!==1&&(h=1):l!==-1&&(h=-1);else if(!d){c=m+1;break}}return l===-1||f===-1||h===0||h===1&&l===f-1&&l===c+1?"":u.slice(l,f)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(l,c){var f=c.dir||c.root,d=c.base||(c.name||"")+(c.ext||"");return f?f===c.root?f+d:f+"/"+d:d}(0,u)},parse:function(u){a(u);var l={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return l;var c,f=u.charCodeAt(0),d=f===47;d?(l.root="/",c=1):c=0;for(var h=-1,m=0,g=-1,E=!0,v=u.length-1,R=0;v>=c;--v)if((f=u.charCodeAt(v))!==47)g===-1&&(E=!1,g=v+1),f===46?h===-1?h=v:R!==1&&(R=1):h!==-1&&(R=-1);else if(!E){m=v+1;break}return h===-1||g===-1||R===0||R===1&&h===g-1&&h===m+1?g!==-1&&(l.base=l.name=m===0&&d?u.slice(1,g):u.slice(m,g)):(m===0&&d?(l.name=u.slice(1,h),l.base=u.slice(1,g)):(l.name=u.slice(m,h),l.base=u.slice(m,g)),l.ext=u.slice(h,g)),m>0?l.dir=u.slice(0,m-1):d&&(l.dir="/"),l},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function r(i){var a=e[i];if(a!==void 0)return a.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,r),s.exports}r.d=(i,a)=>{for(var s in a)r.o(a,s)&&!r.o(i,s)&&Object.defineProperty(i,s,{enumerable:!0,get:a[s]})},r.o=(i,a)=>Object.prototype.hasOwnProperty.call(i,a),r.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var n={};(()=>{let i;r.r(n),r.d(n,{URI:()=>d,Utils:()=>Se}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const a=/^\w[\w\d+.-]*$/,s=/^\//,o=/^\/\//;function u(k,y){if(!k.scheme&&y)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${k.authority}", path: "${k.path}", query: "${k.query}", fragment: "${k.fragment}"}`);if(k.scheme&&!a.test(k.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(k.path){if(k.authority){if(!s.test(k.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(k.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const l="",c="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{constructor(y,b,x,O,N,C=!1){Gt(this,"scheme"),Gt(this,"authority"),Gt(this,"path"),Gt(this,"query"),Gt(this,"fragment"),typeof y=="object"?(this.scheme=y.scheme||l,this.authority=y.authority||l,this.path=y.path||l,this.query=y.query||l,this.fragment=y.fragment||l):(this.scheme=function(Re,J){return Re||J?Re:"file"}(y,C),this.authority=b||l,this.path=function(Re,J){switch(Re){case"https":case"http":case"file":J?J[0]!==c&&(J=c+J):J=c}return J}(this.scheme,x||l),this.query=O||l,this.fragment=N||l,u(this,C))}static isUri(y){return y instanceof d||!!y&&typeof y.authority=="string"&&typeof y.fragment=="string"&&typeof y.path=="string"&&typeof y.query=="string"&&typeof y.scheme=="string"&&typeof y.fsPath=="string"&&typeof y.with=="function"&&typeof y.toString=="function"}get fsPath(){return R(this)}with(y){if(!y)return this;let{scheme:b,authority:x,path:O,query:N,fragment:C}=y;return b===void 0?b=this.scheme:b===null&&(b=l),x===void 0?x=this.authority:x===null&&(x=l),O===void 0?O=this.path:O===null&&(O=l),N===void 0?N=this.query:N===null&&(N=l),C===void 0?C=this.fragment:C===null&&(C=l),b===this.scheme&&x===this.authority&&O===this.path&&N===this.query&&C===this.fragment?this:new m(b,x,O,N,C)}static parse(y,b=!1){const x=f.exec(y);return x?new m(x[2]||l,oe(x[4]||l),oe(x[5]||l),oe(x[7]||l),oe(x[9]||l),b):new m(l,l,l,l,l)}static file(y){let b=l;if(i&&(y=y.replace(/\\/g,c)),y[0]===c&&y[1]===c){const x=y.indexOf(c,2);x===-1?(b=y.substring(2),y=c):(b=y.substring(2,x),y=y.substring(x)||c)}return new m("file",b,y,l,l)}static from(y){const b=new m(y.scheme,y.authority,y.path,y.query,y.fragment);return u(b,!0),b}toString(y=!1){return T(this,y)}toJSON(){return this}static revive(y){if(y){if(y instanceof d)return y;{const b=new m(y);return b._formatted=y.external,b._fsPath=y._sep===h?y.fsPath:null,b}}return y}}const h=i?1:void 0;class m extends d{constructor(){super(...arguments),Gt(this,"_formatted",null),Gt(this,"_fsPath",null)}get fsPath(){return this._fsPath||(this._fsPath=R(this)),this._fsPath}toString(y=!1){return y?T(this,!0):(this._formatted||(this._formatted=T(this,!1)),this._formatted)}toJSON(){const y={$mid:1};return this._fsPath&&(y.fsPath=this._fsPath,y._sep=h),this._formatted&&(y.external=this._formatted),this.path&&(y.path=this.path),this.scheme&&(y.scheme=this.scheme),this.authority&&(y.authority=this.authority),this.query&&(y.query=this.query),this.fragment&&(y.fragment=this.fragment),y}}const g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(k,y,b){let x,O=-1;for(let N=0;N<k.length;N++){const C=k.charCodeAt(N);if(C>=97&&C<=122||C>=65&&C<=90||C>=48&&C<=57||C===45||C===46||C===95||C===126||y&&C===47||b&&C===91||b&&C===93||b&&C===58)O!==-1&&(x+=encodeURIComponent(k.substring(O,N)),O=-1),x!==void 0&&(x+=k.charAt(N));else{x===void 0&&(x=k.substr(0,N));const Re=g[C];Re!==void 0?(O!==-1&&(x+=encodeURIComponent(k.substring(O,N)),O=-1),x+=Re):O===-1&&(O=N)}}return O!==-1&&(x+=encodeURIComponent(k.substring(O))),x!==void 0?x:k}function v(k){let y;for(let b=0;b<k.length;b++){const x=k.charCodeAt(b);x===35||x===63?(y===void 0&&(y=k.substr(0,b)),y+=g[x]):y!==void 0&&(y+=k[b])}return y!==void 0?y:k}function R(k,y){let b;return b=k.authority&&k.path.length>1&&k.scheme==="file"?`//${k.authority}${k.path}`:k.path.charCodeAt(0)===47&&(k.path.charCodeAt(1)>=65&&k.path.charCodeAt(1)<=90||k.path.charCodeAt(1)>=97&&k.path.charCodeAt(1)<=122)&&k.path.charCodeAt(2)===58?k.path[1].toLowerCase()+k.path.substr(2):k.path,i&&(b=b.replace(/\//g,"\\")),b}function T(k,y){const b=y?v:E;let x="",{scheme:O,authority:N,path:C,query:Re,fragment:J}=k;if(O&&(x+=O,x+=":"),(N||O==="file")&&(x+=c,x+=c),N){let W=N.indexOf("@");if(W!==-1){const jt=N.substr(0,W);N=N.substr(W+1),W=jt.lastIndexOf(":"),W===-1?x+=b(jt,!1,!1):(x+=b(jt.substr(0,W),!1,!1),x+=":",x+=b(jt.substr(W+1),!1,!0)),x+="@"}N=N.toLowerCase(),W=N.lastIndexOf(":"),W===-1?x+=b(N,!1,!0):(x+=b(N.substr(0,W),!1,!0),x+=N.substr(W))}if(C){if(C.length>=3&&C.charCodeAt(0)===47&&C.charCodeAt(2)===58){const W=C.charCodeAt(1);W>=65&&W<=90&&(C=`/${String.fromCharCode(W+32)}:${C.substr(3)}`)}else if(C.length>=2&&C.charCodeAt(1)===58){const W=C.charCodeAt(0);W>=65&&W<=90&&(C=`${String.fromCharCode(W+32)}:${C.substr(2)}`)}x+=b(C,!0,!1)}return Re&&(x+="?",x+=b(Re,!1,!1)),J&&(x+="#",x+=y?J:E(J,!1,!1)),x}function $(k){try{return decodeURIComponent(k)}catch{return k.length>3?k.substr(0,3)+$(k.substr(3)):k}}const P=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function oe(k){return k.match(P)?k.replace(P,y=>$(y)):k}var Me=r(470);const Te=Me.posix||Me,Ve="/";var Se;(function(k){k.joinPath=function(y,...b){return y.with({path:Te.join(y.path,...b)})},k.resolvePath=function(y,...b){let x=y.path,O=!1;x[0]!==Ve&&(x=Ve+x,O=!0);let N=Te.resolve(x,...b);return O&&N[0]===Ve&&!y.authority&&(N=N.substring(1)),y.with({path:N})},k.dirname=function(y){if(y.path.length===0||y.path===Ve)return y;let b=Te.dirname(y.path);return b.length===1&&b.charCodeAt(0)===46&&(b=""),y.with({path:b})},k.basename=function(y){return Te.basename(y.path)},k.extname=function(y){return Te.extname(y.path)}})(Se||(Se={}))})(),np=n})();const{URI:Qt,Utils:Nr}=np;var It;(function(t){t.basename=Nr.basename,t.dirname=Nr.dirname,t.extname=Nr.extname,t.joinPath=Nr.joinPath,t.resolvePath=Nr.resolvePath;function e(i,a){return(i==null?void 0:i.toString())===(a==null?void 0:a.toString())}t.equals=e;function r(i,a){const s=typeof i=="string"?i:i.path,o=typeof a=="string"?a:a.path,u=s.split("/").filter(h=>h.length>0),l=o.split("/").filter(h=>h.length>0);let c=0;for(;c<u.length&&u[c]===l[c];c++);const f="../".repeat(u.length-c),d=l.slice(c).join("/");return f+d}t.relative=r;function n(i){return Qt.parse(i.toString()).toString()}t.normalize=n})(It||(It={}));var V;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(V||(V={}));class Kw{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,r=z.CancellationToken.None){const n=await this.fileSystemProvider.readFile(e);return this.createAsync(e,n,r)}fromTextDocument(e,r,n){return r=r??Qt.parse(e.uri),z.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromString(e,r,n){return z.CancellationToken.is(n)?this.createAsync(r,e,n):this.create(r,e,n)}fromModel(e,r){return this.create(r,{$model:e})}create(e,r,n){if(typeof r=="string"){const i=this.parse(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else if("$model"in r){const i={value:r.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}async createAsync(e,r,n){if(typeof r=="string"){const i=await this.parseAsync(e,r,n);return this.createLangiumDocument(i,e,void 0,r)}else{const i=await this.parseAsync(e,r.getText(),n);return this.createLangiumDocument(i,e,r)}}createLangiumDocument(e,r,n,i){let a;if(n)a={parseResult:e,uri:r,state:V.Parsed,references:[],textDocument:n};else{const s=this.createTextDocumentGetter(r,i);a={parseResult:e,uri:r,state:V.Parsed,references:[],get textDocument(){return s()}}}return e.value.$document=a,a}async update(e,r){var n,i;const a=(n=e.parseResult.value.$cstNode)===null||n===void 0?void 0:n.root.fullText,s=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),o=s?s.getText():await this.fileSystemProvider.readFile(e.uri);if(s)Object.defineProperty(e,"textDocument",{value:s});else{const u=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:u})}return a!==o&&(e.parseResult=await this.parseAsync(e.uri,o,r),e.parseResult.value.$document=e),e.state=V.Parsed,e}parse(e,r,n){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(r,n)}parseAsync(e,r,n){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(r,n)}createTextDocumentGetter(e,r){const n=this.serviceRegistry;let i;return()=>i??(i=xo.create(e.toString(),n.getServices(e).LanguageMetaData.languageId,0,r??""))}}class Vw{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return ie(this.documentMap.values())}addDocument(e){const r=e.uri.toString();if(this.documentMap.has(r))throw new Error(`A document with the URI '${r}' is already present.`);this.documentMap.set(r,e)}getDocument(e){const r=e.toString();return this.documentMap.get(r)}async getOrCreateDocument(e,r){let n=this.getDocument(e);return n||(n=await this.langiumDocumentFactory.fromUri(e,r),this.addDocument(n),n)}createDocument(e,r,n){if(n)return this.langiumDocumentFactory.fromString(r,e,n).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(r,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(this.serviceRegistry.getServices(e).references.Linker.unlink(n),n.state=V.Changed,n.precomputedScopes=void 0,n.diagnostics=void 0),n}deleteDocument(e){const r=e.toString(),n=this.documentMap.get(r);return n&&(n.state=V.Changed,this.documentMap.delete(r)),n}}const ss=Symbol("ref_resolving");class Hw{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,r=z.CancellationToken.None){for(const n of hr(e.parseResult.value))await $e(r),Hf(n).forEach(i=>this.doLink(i,e))}doLink(e,r){var n;const i=e.reference;if(i._ref===void 0){i._ref=ss;try{const a=this.getCandidate(e);if(fi(a))i._ref=a;else if(i._nodeDescription=a,this.langiumDocuments().hasDocument(a.documentUri)){const s=this.loadAstNode(a);i._ref=s??this.createLinkingError(e,a)}else i._ref=void 0}catch(a){console.error(`An error occurred while resolving reference to '${i.$refText}':`,a);const s=(n=a.message)!==null&&n!==void 0?n:String(a);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${s}`})}r.references.push(i)}}unlink(e){for(const r of e.references)delete r._ref,delete r._nodeDescription;e.references=[]}getCandidate(e){return this.scopeProvider.getScope(e).getElement(e.reference.$refText)??this.createLinkingError(e)}buildReference(e,r,n,i){const a=this,s={$refNode:n,$refText:i,get ref(){var o;if(le(this._ref))return this._ref;if(Up(this._nodeDescription)){const u=a.loadAstNode(this._nodeDescription);this._ref=u??a.createLinkingError({reference:s,container:e,property:r},this._nodeDescription)}else if(this._ref===void 0){this._ref=ss;const u=Fs(e).$document,l=a.getLinkedNode({reference:s,container:e,property:r});if(l.error&&u&&u.state<V.ComputedScopes)return this._ref=void 0;this._ref=(o=l.node)!==null&&o!==void 0?o:l.error,this._nodeDescription=l.descr,u==null||u.references.push(this)}else if(this._ref===ss)throw new Error(`Cyclic reference resolution detected: ${a.astNodeLocator.getAstNodePath(e)}/${r} (symbol '${i}')`);return le(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return fi(this._ref)?this._ref:void 0}};return s}getLinkedNode(e){var r;try{const n=this.getCandidate(e);if(fi(n))return{error:n};const i=this.loadAstNode(n);return i?{node:i,descr:n}:{descr:n,error:this.createLinkingError(e,n)}}catch(n){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,n);const i=(r=n.message)!==null&&r!==void 0?r:String(n);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const r=this.langiumDocuments().getDocument(e.documentUri);if(r)return this.astNodeLocator.getAstNode(r.parseResult.value,e.path)}createLinkingError(e,r){const n=Fs(e.container).$document;n&&n.state<V.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${n.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:r})}}function zw(t){return typeof t.name=="string"}class Ww{getName(e){if(zw(e))return e.name}getNameNode(e){return Xf(e.$cstNode,"name")}}class Yw{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const r=Nm(e),n=e.astNode;if(r&&n){const i=n[r.feature];if(ze(i))return i.ref;if(Array.isArray(i)){for(const a of i)if(ze(a)&&a.$refNode&&a.$refNode.offset<=e.offset&&a.$refNode.end>=e.end)return a.ref}}if(n){const i=this.nameProvider.getNameNode(n);if(i&&(i===e||Kp(e,i)))return n}}}findDeclarationNode(e){const r=this.findDeclaration(e);if(r!=null&&r.$cstNode)return this.nameProvider.getNameNode(r)??r.$cstNode}findReferences(e,r){const n=[];if(r.includeDeclaration){const a=this.getReferenceToSelf(e);a&&n.push(a)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return r.documentUri&&(i=i.filter(a=>It.equals(a.sourceUri,r.documentUri))),n.push(...i),ie(n)}getReferenceToSelf(e){const r=this.nameProvider.getNameNode(e);if(r){const n=Et(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:n.uri,sourcePath:i,targetUri:n.uri,targetPath:i,segment:wi(r),local:!0}}}}class Ji{constructor(e){if(this.map=new Map,e)for(const[r,n]of e)this.add(r,n)}get size(){return Ms.sum(ie(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,r){if(r===void 0)return this.map.delete(e);{const n=this.map.get(e);if(n){const i=n.indexOf(r);if(i>=0)return n.length===1?this.map.delete(e):n.splice(i,1),!0}return!1}}get(e){var r;return(r=this.map.get(e))!==null&&r!==void 0?r:[]}has(e,r){if(r===void 0)return this.map.has(e);{const n=this.map.get(e);return n?n.indexOf(r)>=0:!1}}add(e,r){return this.map.has(e)?this.map.get(e).push(r):this.map.set(e,[r]),this}addAll(e,r){return this.map.has(e)?this.map.get(e).push(...r):this.map.set(e,Array.from(r)),this}forEach(e){this.map.forEach((r,n)=>r.forEach(i=>e(i,n,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return ie(this.map.entries()).flatMap(([e,r])=>r.map(n=>[e,n]))}keys(){return ie(this.map.keys())}values(){return ie(this.map.values()).flat()}entriesGroupedByKey(){return ie(this.map.entries())}}class gf{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[r,n]of e)this.set(r,n)}clear(){this.map.clear(),this.inverse.clear()}set(e,r){return this.map.set(e,r),this.inverse.set(r,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const r=this.map.get(e);return r!==void 0?(this.map.delete(e),this.inverse.delete(r),!0):!1}}class qw{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,r=z.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,r)}async computeExportsForNode(e,r,n=No,i=z.CancellationToken.None){const a=[];this.exportNode(e,a,r);for(const s of n(e))await $e(i),this.exportNode(s,a,r);return a}exportNode(e,r,n){const i=this.nameProvider.getName(e);i&&r.push(this.descriptions.createDescription(e,i,n))}async computeLocalScopes(e,r=z.CancellationToken.None){const n=e.parseResult.value,i=new Ji;for(const a of In(n))await $e(r),this.processNode(a,e,i);return i}processNode(e,r,n){const i=e.$container;if(i){const a=this.nameProvider.getName(e);a&&n.add(i,this.descriptions.createDescription(e,a,r))}}}class yf{constructor(e,r,n){var i;this.elements=e,this.outerScope=r,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const r=this.caseInsensitive?this.elements.find(n=>n.name.toLowerCase()===e.toLowerCase()):this.elements.find(n=>n.name===e);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}}class Xw{constructor(e,r,n){var i;this.elements=new Map,this.caseInsensitive=(i=n==null?void 0:n.caseInsensitive)!==null&&i!==void 0?i:!1;for(const a of e){const s=this.caseInsensitive?a.name.toLowerCase():a.name;this.elements.set(s,a)}this.outerScope=r}getElement(e){const r=this.caseInsensitive?e.toLowerCase():e,n=this.elements.get(r);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=ie(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}class ip{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Zw extends ip{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,r){this.throwIfDisposed(),this.cache.set(e,r)}get(e,r){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(r){const n=r();return this.cache.set(e,n),n}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class Qw extends ip{constructor(e){super(),this.cache=new Map,this.converter=e??(r=>r)}has(e,r){return this.throwIfDisposed(),this.cacheForContext(e).has(r)}set(e,r,n){this.throwIfDisposed(),this.cacheForContext(e).set(r,n)}get(e,r,n){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(r))return i.get(r);if(n){const a=n();return i.set(r,a),a}else return}delete(e,r){return this.throwIfDisposed(),this.cacheForContext(e).delete(r)}clear(e){if(this.throwIfDisposed(),e){const r=this.converter(e);this.cache.delete(r)}else this.cache.clear()}cacheForContext(e){const r=this.converter(e);let n=this.cache.get(r);return n||(n=new Map,this.cache.set(r,n)),n}}class Jw extends Zw{constructor(e,r){super(),r?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(r,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((n,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class eI{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new Jw(e.shared)}getScope(e){const r=[],n=this.reflection.getReferenceType(e),i=Et(e.container).precomputedScopes;if(i){let s=e.container;do{const o=i.get(s);o.length>0&&r.push(ie(o).filter(u=>this.reflection.isSubtype(u.type,n))),s=s.$container}while(s)}let a=this.getGlobalScope(n,e);for(let s=r.length-1;s>=0;s--)a=this.createScope(r[s],a);return a}createScope(e,r,n){return new yf(ie(e),r,n)}createScopeForNodes(e,r,n){const i=ie(e).map(a=>{const s=this.nameProvider.getName(a);if(s)return this.descriptions.createDescription(a,s)}).nonNullable();return new yf(i,r,n)}getGlobalScope(e,r){return this.globalScopeCache.get(e,()=>new Xw(this.indexManager.allElements(e)))}}function tI(t){return typeof t.$comment=="string"}function vf(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class rI{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,r){const n=r??{},i=r==null?void 0:r.replacer,a=(o,u)=>this.replacer(o,u,n),s=i?(o,u)=>i(o,u,a):a;try{return this.currentDocument=Et(e),JSON.stringify(e,s,r==null?void 0:r.space)}finally{this.currentDocument=void 0}}deserialize(e,r){const n=r??{},i=JSON.parse(e);return this.linkNode(i,i,n),i}replacer(e,r,{refText:n,sourceText:i,textRegions:a,comments:s,uriConverter:o}){var u,l,c,f;if(!this.ignoreProperties.has(e))if(ze(r)){const d=r.ref,h=n?r.$refText:void 0;if(d){const m=Et(d);let g="";this.currentDocument&&this.currentDocument!==m&&(o?g=o(m.uri,r):g=m.uri.toString());const E=this.astNodeLocator.getAstNodePath(d);return{$ref:`${g}#${E}`,$refText:h}}else return{$error:(l=(u=r.error)===null||u===void 0?void 0:u.message)!==null&&l!==void 0?l:"Could not resolve reference",$refText:h}}else if(le(r)){let d;if(a&&(d=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},r)),(!e||r.$document)&&d!=null&&d.$textRegion&&(d.$textRegion.documentURI=(c=this.currentDocument)===null||c===void 0?void 0:c.uri.toString())),i&&!e&&(d??(d=Object.assign({},r)),d.$sourceText=(f=r.$cstNode)===null||f===void 0?void 0:f.text),s){d??(d=Object.assign({},r));const h=this.commentProvider.getComment(r);h&&(d.$comment=h.replace(/\r/g,""))}return d??r}else return r}addAstNodeRegionWithAssignmentsTo(e){const r=n=>({offset:n.offset,end:n.end,length:n.length,range:n.range});if(e.$cstNode){const n=e.$textRegion=r(e.$cstNode),i=n.assignments={};return Object.keys(e).filter(a=>!a.startsWith("$")).forEach(a=>{const s=Im(e.$cstNode,a).map(r);s.length!==0&&(i[a]=s)}),e}}linkNode(e,r,n,i,a,s){for(const[u,l]of Object.entries(e))if(Array.isArray(l))for(let c=0;c<l.length;c++){const f=l[c];vf(f)?l[c]=this.reviveReference(e,u,r,f,n):le(f)&&this.linkNode(f,r,n,e,u,c)}else vf(l)?e[u]=this.reviveReference(e,u,r,l,n):le(l)&&this.linkNode(l,r,n,e,u);const o=e;o.$container=i,o.$containerProperty=a,o.$containerIndex=s}reviveReference(e,r,n,i,a){let s=i.$refText,o=i.$error;if(i.$ref){const u=this.getRefNode(n,i.$ref,a.uriConverter);if(le(u))return s||(s=this.nameProvider.getName(u)),{$refText:s??"",ref:u};o=u}if(o){const u={$refText:s??""};return u.error={container:e,property:r,message:o,reference:u},u}else return}getRefNode(e,r,n){try{const i=r.indexOf("#");if(i===0)return this.astNodeLocator.getAstNode(e,r.substring(1))||"Could not resolve path: "+r;if(i<0){const u=n?n(r):Qt.parse(r),l=this.langiumDocuments.getDocument(u);return l?l.parseResult.value:"Could not find document for URI: "+r}const a=n?n(r.substring(0,i)):Qt.parse(r.substring(0,i)),s=this.langiumDocuments.getDocument(a);return s?i===r.length-1?s.parseResult.value:this.astNodeLocator.getAstNode(s.parseResult.value,r.substring(i+1))||"Could not resolve URI: "+r:"Could not find document for URI: "+r}catch(i){return String(i)}}}class nI{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e==null?void 0:e.workspace.TextDocuments}register(e){const r=e.LanguageMetaData;for(const n of r.fileExtensions)this.fileExtensionMap.has(n)&&console.warn(`The file extension ${n} is used by multiple languages. It is now assigned to '${r.languageId}'.`),this.fileExtensionMap.set(n,e);this.languageIdMap.set(r.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var r,n;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(n=(r=this.textDocuments)===null||r===void 0?void 0:r.get(e))===null||n===void 0?void 0:n.languageId;if(i!==void 0){const o=this.languageIdMap.get(i);if(o)return o}const a=It.extname(e),s=this.fileExtensionMap.get(a);if(!s)throw i?new Error(`The service registry contains no services for the extension '${a}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${a}'.`);return s}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function fn(t){return{code:t}}var ea;(function(t){t.all=["fast","slow","built-in"]})(ea||(ea={}));class iI{constructor(e){this.entries=new Ji,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,r=this,n="fast"){if(n==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,a]of Object.entries(e)){const s=a;if(Array.isArray(s))for(const o of s){const u={check:this.wrapValidationException(o,r),category:n};this.addEntry(i,u)}else if(typeof s=="function"){const o={check:this.wrapValidationException(s,r),category:n};this.addEntry(i,o)}else wn()}}wrapValidationException(e,r){return async(n,i,a)=>{await this.handleException(()=>e.call(r,n,i,a),"An error occurred during validation",i,n)}}async handleException(e,r,n,i){try{await e()}catch(a){if(Pa(a))throw a;console.error(`${r}:`,a),a instanceof Error&&a.stack&&console.error(a.stack);const s=a instanceof Error?a.message:String(a);n("error",`${r}: ${s}`,{node:i})}}addEntry(e,r){if(e==="AstNode"){this.entries.add("AstNode",r);return}for(const n of this.reflection.getAllSubTypes(e))this.entries.add(n,r)}getChecks(e,r){let n=ie(this.entries.get(e)).concat(this.entries.get("AstNode"));return r&&(n=n.filter(i=>r.includes(i.category))),n.map(i=>i.check)}registerBeforeDocument(e,r=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",r))}registerAfterDocument(e,r=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",r))}wrapPreparationException(e,r,n){return async(i,a,s,o)=>{await this.handleException(()=>e.call(n,i,a,s,o),r,a,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class aI{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,r={},n=z.CancellationToken.None){const i=e.parseResult,a=[];if(await $e(n),(!r.categories||r.categories.includes("built-in"))&&(this.processLexingErrors(i,a,r),r.stopAfterLexingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===je.LexingError})||(this.processParsingErrors(i,a,r),r.stopAfterParsingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===je.ParsingError}))||(this.processLinkingErrors(e,a,r),r.stopAfterLinkingErrors&&a.some(s=>{var o;return((o=s.data)===null||o===void 0?void 0:o.code)===je.LinkingError}))))return a;try{a.push(...await this.validateAst(i.value,r,n))}catch(s){if(Pa(s))throw s;console.error("An error occurred during validation:",s)}return await $e(n),a}processLexingErrors(e,r,n){var i,a,s;const o=[...e.lexerErrors,...(a=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&a!==void 0?a:[]];for(const u of o){const l=(s=u.severity)!==null&&s!==void 0?s:"error",c={severity:os(l),range:{start:{line:u.line-1,character:u.column-1},end:{line:u.line-1,character:u.column+u.length-1}},message:u.message,data:oI(l),source:this.getSource()};r.push(c)}}processParsingErrors(e,r,n){for(const i of e.parserErrors){let a;if(isNaN(i.token.startOffset)){if("previousToken"in i){const s=i.previousToken;if(isNaN(s.startOffset)){const o={line:0,character:0};a={start:o,end:o}}else{const o={line:s.endLine-1,character:s.endColumn};a={start:o,end:o}}}}else a=js(i.token);if(a){const s={severity:os("error"),range:a,message:i.message,data:fn(je.ParsingError),source:this.getSource()};r.push(s)}}}processLinkingErrors(e,r,n){for(const i of e.references){const a=i.error;if(a){const s={node:a.container,property:a.property,index:a.index,data:{code:je.LinkingError,containerType:a.container.$type,property:a.property,refText:a.reference.$refText}};r.push(this.toDiagnostic("error",a.message,s))}}}async validateAst(e,r,n=z.CancellationToken.None){const i=[],a=(s,o,u)=>{i.push(this.toDiagnostic(s,o,u))};return await this.validateAstBefore(e,r,a,n),await this.validateAstNodes(e,r,a,n),await this.validateAstAfter(e,r,a,n),i}async validateAstBefore(e,r,n,i=z.CancellationToken.None){var a;const s=this.validationRegistry.checksBefore;for(const o of s)await $e(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}async validateAstNodes(e,r,n,i=z.CancellationToken.None){await Promise.all(hr(e).map(async a=>{await $e(i);const s=this.validationRegistry.getChecks(a.$type,r.categories);for(const o of s)await o(a,n,i)}))}async validateAstAfter(e,r,n,i=z.CancellationToken.None){var a;const s=this.validationRegistry.checksAfter;for(const o of s)await $e(i),await o(e,n,(a=r.categories)!==null&&a!==void 0?a:[],i)}toDiagnostic(e,r,n){return{message:r,range:sI(n),severity:os(e),code:n.code,codeDescription:n.codeDescription,tags:n.tags,relatedInformation:n.relatedInformation,data:n.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function sI(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=Xf(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=_m(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function os(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function oI(t){switch(t){case"error":return fn(je.LexingError);case"warning":return fn(je.LexingWarning);case"info":return fn(je.LexingInfo);case"hint":return fn(je.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var je;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(je||(je={}));class uI{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,r,n){const i=n??Et(e);r??(r=this.nameProvider.getName(e));const a=this.astNodeLocator.getAstNodePath(e);if(!r)throw new Error(`Node at path ${a} has no name.`);let s;const o=()=>{var u;return s??(s=wi((u=this.nameProvider.getNameNode(e))!==null&&u!==void 0?u:e.$cstNode))};return{node:e,name:r,get nameSegment(){return o()},selectionSegment:wi(e.$cstNode),type:e.$type,documentUri:i.uri,path:a}}}class lI{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,r=z.CancellationToken.None){const n=[],i=e.parseResult.value;for(const a of hr(i))await $e(r),Hf(a).filter(s=>!fi(s)).forEach(s=>{const o=this.createDescription(s);o&&n.push(o)});return n}createDescription(e){const r=e.reference.$nodeDescription,n=e.reference.$refNode;if(!r||!n)return;const i=Et(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:r.documentUri,targetPath:r.path,segment:wi(n),local:It.equals(r.documentUri,i)}}}class cI{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const r=this.getAstNodePath(e.$container),n=this.getPathSegment(e);return r+this.segmentSeparator+n}return""}getPathSegment({$containerProperty:e,$containerIndex:r}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return r!==void 0?e+this.indexSeparator+r:e}getAstNode(e,r){return r.split(this.segmentSeparator).reduce((n,i)=>{if(!n||i.length===0)return n;const a=i.indexOf(this.indexSeparator);if(a>0){const s=i.substring(0,a),o=parseInt(i.substring(a+1)),u=n[s];return u==null?void 0:u[o]}return n[i]},e)}}var fI=ep();class dI{constructor(e){this._ready=new Eu,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new fI.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var r,n;this.workspaceConfig=(n=(r=e.capabilities.workspace)===null||r===void 0?void 0:r.configuration)!==null&&n!==void 0?n:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const r=this.serviceRegistry.all;e.register({section:r.map(n=>this.toSectionName(n.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const r=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),n=await e.fetchConfiguration(r);r.forEach((i,a)=>{this.updateSectionConfiguration(i.section,n[a])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(r=>{const n=e.settings[r];this.updateSectionConfiguration(r,n),this.onConfigurationSectionUpdateEmitter.fire({section:r,configuration:n})})}updateSectionConfiguration(e,r){this.settings[e]=r}async getConfiguration(e,r){await this.ready;const n=this.toSectionName(e);if(this.settings[n])return this.settings[n][r]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var vn;(function(t){function e(r){return{dispose:async()=>await r()}}t.create=e})(vn||(vn={}));class hI{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Ji,this.documentPhaseListeners=new Ji,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=V.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,r={},n=z.CancellationToken.None){var i,a;for(const s of e){const o=s.uri.toString();if(s.state===V.Validated){if(typeof r.validation=="boolean"&&r.validation)s.state=V.IndexedReferences,s.diagnostics=void 0,this.buildState.delete(o);else if(typeof r.validation=="object"){const u=this.buildState.get(o),l=(i=u==null?void 0:u.result)===null||i===void 0?void 0:i.validationChecks;if(l){const c=((a=r.validation.categories)!==null&&a!==void 0?a:ea.all).filter(f=>!l.includes(f));c.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},r.validation),{categories:c})},result:u.result}),s.state=V.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=V.Changed,await this.emitUpdate(e.map(s=>s.uri),[]),await this.buildDocuments(e,r,n)}async update(e,r,n=z.CancellationToken.None){this.currentState=V.Changed;for(const s of r)this.langiumDocuments.deleteDocument(s),this.buildState.delete(s.toString()),this.indexManager.remove(s);for(const s of e){if(!this.langiumDocuments.invalidateDocument(s)){const o=this.langiumDocumentFactory.fromModel({$type:"INVALID"},s);o.state=V.Changed,this.langiumDocuments.addDocument(o)}this.buildState.delete(s.toString())}const i=ie(e).concat(r).map(s=>s.toString()).toSet();this.langiumDocuments.all.filter(s=>!i.has(s.uri.toString())&&this.shouldRelink(s,i)).forEach(s=>{this.serviceRegistry.getServices(s.uri).references.Linker.unlink(s),s.state=Math.min(s.state,V.ComputedScopes),s.diagnostics=void 0}),await this.emitUpdate(e,r),await $e(n);const a=this.sortDocuments(this.langiumDocuments.all.filter(s=>{var o;return s.state<V.Linked||!(!((o=this.buildState.get(s.uri.toString()))===null||o===void 0)&&o.completed)}).toArray());await this.buildDocuments(a,this.updateBuildOptions,n)}async emitUpdate(e,r){await Promise.all(this.updateListeners.map(n=>n(e,r)))}sortDocuments(e){let r=0,n=e.length-1;for(;r<n;){for(;r<e.length&&this.hasTextDocument(e[r]);)r++;for(;n>=0&&!this.hasTextDocument(e[n]);)n--;r<n&&([e[r],e[n]]=[e[n],e[r]])}return e}hasTextDocument(e){var r;return!!(!((r=this.textDocuments)===null||r===void 0)&&r.get(e.uri))}shouldRelink(e,r){return e.references.some(n=>n.error!==void 0)?!0:this.indexManager.isAffected(e,r)}onUpdate(e){return this.updateListeners.push(e),vn.create(()=>{const r=this.updateListeners.indexOf(e);r>=0&&this.updateListeners.splice(r,1)})}async buildDocuments(e,r,n){this.prepareBuild(e,r),await this.runCancelable(e,V.Parsed,n,a=>this.langiumDocumentFactory.update(a,n)),await this.runCancelable(e,V.IndexedContent,n,a=>this.indexManager.updateContent(a,n)),await this.runCancelable(e,V.ComputedScopes,n,async a=>{const s=this.serviceRegistry.getServices(a.uri).references.ScopeComputation;a.precomputedScopes=await s.computeLocalScopes(a,n)}),await this.runCancelable(e,V.Linked,n,a=>this.serviceRegistry.getServices(a.uri).references.Linker.link(a,n)),await this.runCancelable(e,V.IndexedReferences,n,a=>this.indexManager.updateReferences(a,n));const i=e.filter(a=>this.shouldValidate(a));await this.runCancelable(i,V.Validated,n,a=>this.validate(a,n));for(const a of e){const s=this.buildState.get(a.uri.toString());s&&(s.completed=!0)}}prepareBuild(e,r){for(const n of e){const i=n.uri.toString(),a=this.buildState.get(i);(!a||a.completed)&&this.buildState.set(i,{completed:!1,options:r,result:a==null?void 0:a.result})}}async runCancelable(e,r,n,i){const a=e.filter(o=>o.state<r);for(const o of a)await $e(n),await i(o),o.state=r,await this.notifyDocumentPhase(o,r,n);const s=e.filter(o=>o.state===r);await this.notifyBuildPhase(s,r,n),this.currentState=r}onBuildPhase(e,r){return this.buildPhaseListeners.add(e,r),vn.create(()=>{this.buildPhaseListeners.delete(e,r)})}onDocumentPhase(e,r){return this.documentPhaseListeners.add(e,r),vn.create(()=>{this.documentPhaseListeners.delete(e,r)})}waitUntil(e,r,n){let i;if(r&&"path"in r?i=r:n=r,n??(n=z.CancellationToken.None),i){const a=this.langiumDocuments.getDocument(i);if(a&&a.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):n.isCancellationRequested?Promise.reject(Qi):new Promise((a,s)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),u.dispose(),i){const l=this.langiumDocuments.getDocument(i);a(l==null?void 0:l.uri)}else a(void 0)}),u=n.onCancellationRequested(()=>{o.dispose(),u.dispose(),s(Qi)})})}async notifyDocumentPhase(e,r,n){const i=this.documentPhaseListeners.get(r).slice();for(const a of i)try{await a(e,n)}catch(s){if(!Pa(s))throw s}}async notifyBuildPhase(e,r,n){if(e.length===0)return;const i=this.buildPhaseListeners.get(r).slice();for(const a of i)await $e(n),await a(e,n)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,r){var n,i;const a=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,s=this.getBuildOptions(e).validation,o=typeof s=="object"?s:void 0,u=await a.validateDocument(e,o,r);e.diagnostics?e.diagnostics.push(...u):e.diagnostics=u;const l=this.buildState.get(e.uri.toString());if(l){(n=l.result)!==null&&n!==void 0||(l.result={});const c=(i=o==null?void 0:o.categories)!==null&&i!==void 0?i:ea.all;l.result.validationChecks?l.result.validationChecks.push(...c):l.result.validationChecks=[...c]}}getBuildOptions(e){var r,n;return(n=(r=this.buildState.get(e.uri.toString()))===null||r===void 0?void 0:r.options)!==null&&n!==void 0?n:{}}}class pI{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Qw,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,r){const n=Et(e).uri,i=[];return this.referenceIndex.forEach(a=>{a.forEach(s=>{It.equals(s.targetUri,n)&&s.targetPath===r&&i.push(s)})}),ie(i)}allElements(e,r){let n=ie(this.symbolIndex.keys());return r&&(n=n.filter(i=>!r||r.has(i))),n.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,r){var n;return r?this.symbolByTypeIndex.get(e,r,()=>{var i;return((i=this.symbolIndex.get(e))!==null&&i!==void 0?i:[]).filter(a=>this.astReflection.isSubtype(a.type,r))}):(n=this.symbolIndex.get(e))!==null&&n!==void 0?n:[]}remove(e){const r=e.toString();this.symbolIndex.delete(r),this.symbolByTypeIndex.clear(r),this.referenceIndex.delete(r)}async updateContent(e,r=z.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,r),i=e.uri.toString();this.symbolIndex.set(i,n),this.symbolByTypeIndex.clear(i)}async updateReferences(e,r=z.CancellationToken.None){const n=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,r);this.referenceIndex.set(e.uri.toString(),n)}isAffected(e,r){const n=this.referenceIndex.get(e.uri.toString());return n?n.some(i=>!i.local&&r.has(i.targetUri.toString())):!1}}class mI{constructor(e){this.initialBuildOptions={},this._ready=new Eu,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var r;this.folders=(r=e.workspaceFolders)!==null&&r!==void 0?r:void 0}initialized(e){return this.mutex.write(r=>{var n;return this.initializeWorkspace((n=this.folders)!==null&&n!==void 0?n:[],r)})}async initializeWorkspace(e,r=z.CancellationToken.None){const n=await this.performStartup(e);await $e(r),await this.documentBuilder.build(n,this.initialBuildOptions,r)}async performStartup(e){const r=this.serviceRegistry.all.flatMap(a=>a.LanguageMetaData.fileExtensions),n=[],i=a=>{n.push(a),this.langiumDocuments.hasDocument(a.uri)||this.langiumDocuments.addDocument(a)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(a=>[a,this.getRootFolder(a)]).map(async a=>this.traverseFolder(...a,r,i))),this._ready.resolve(),n}loadAdditionalDocuments(e,r){return Promise.resolve()}getRootFolder(e){return Qt.parse(e.uri)}async traverseFolder(e,r,n,i){const a=await this.fileSystemProvider.readDirectory(r);await Promise.all(a.map(async s=>{if(this.includeEntry(e,s,n)){if(s.isDirectory)await this.traverseFolder(e,s.uri,n,i);else if(s.isFile){const o=await this.langiumDocuments.getOrCreateDocument(s.uri);i(o)}}}))}includeEntry(e,r,n){const i=It.basename(r.uri);if(i.startsWith("."))return!1;if(r.isDirectory)return i!=="node_modules"&&i!=="out";if(r.isFile){const a=It.extname(r.uri);return n.includes(a)}return!1}}class gI{buildUnexpectedCharactersMessage(e,r,n,i,a){return eo.buildUnexpectedCharactersMessage(e,r,n,i,a)}buildUnableToPopLexerModeMessage(e){return eo.buildUnableToPopLexerModeMessage(e)}}const yI={mode:"full"};class vI{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const r=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(r);const n=Tf(r)?Object.values(r):r,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new he(n,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,r=yI){var n,i,a;const s=this.chevrotainLexer.tokenize(e);return{tokens:s.tokens,errors:s.errors,hidden:(n=s.groups.hidden)!==null&&n!==void 0?n:[],report:(a=(i=this.tokenBuilder).flushLexingReport)===null||a===void 0?void 0:a.call(i,e)}}toTokenTypeDictionary(e){if(Tf(e))return e;const r=ap(e)?Object.values(e.modes).flat():e,n={};return r.forEach(i=>n[i.name]=i),n}}function TI(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function ap(t){return t&&"modes"in t&&"defaultMode"in t}function Tf(t){return!TI(t)&&!ap(t)}function RI(t,e,r){let n,i;typeof t=="string"?(i=e,n=r):(i=t.range.start,n=e),i||(i=D.create(0,0));const a=sp(t),s=Au(n),o=$I({lines:a,position:i,options:s});return wI({index:0,tokens:o,position:i})}function EI(t,e){const r=Au(e),n=sp(t);if(n.length===0)return!1;const i=n[0],a=n[n.length-1],s=r.start,o=r.end;return!!(s!=null&&s.exec(i))&&!!(o!=null&&o.exec(a))}function sp(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(ym)}const Rf=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,AI=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function $I(t){var e,r,n;const i=[];let a=t.position.line,s=t.position.character;for(let o=0;o<t.lines.length;o++){const u=o===0,l=o===t.lines.length-1;let c=t.lines[o],f=0;if(u&&t.options.start){const d=(e=t.options.start)===null||e===void 0?void 0:e.exec(c);d&&(f=d.index+d[0].length)}else{const d=(r=t.options.line)===null||r===void 0?void 0:r.exec(c);d&&(f=d.index+d[0].length)}if(l){const d=(n=t.options.end)===null||n===void 0?void 0:n.exec(c);d&&(c=c.substring(0,d.index))}if(c=c.substring(0,SI(c)),So(c,f)>=c.length){if(i.length>0){const d=D.create(a,s);i.push({type:"break",content:"",range:L.create(d,d)})}}else{Rf.lastIndex=f;const d=Rf.exec(c);if(d){const h=d[0],m=d[1],g=D.create(a,s+f),E=D.create(a,s+f+h.length);i.push({type:"tag",content:m,range:L.create(g,E)}),f+=h.length,f=So(c,f)}if(f<c.length){const h=c.substring(f),m=Array.from(h.matchAll(AI));i.push(...kI(m,h,a,s+f))}}a++,s=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function kI(t,e,r,n){const i=[];if(t.length===0){const a=D.create(r,n),s=D.create(r,n+e.length);i.push({type:"text",content:e,range:L.create(a,s)})}else{let a=0;for(const o of t){const u=o.index,l=e.substring(a,u);l.length>0&&i.push({type:"text",content:e.substring(a,u),range:L.create(D.create(r,a+n),D.create(r,u+n))});let c=l.length+1;const f=o[1];if(i.push({type:"inline-tag",content:f,range:L.create(D.create(r,a+c+n),D.create(r,a+c+f.length+n))}),c+=f.length,o.length===4){c+=o[2].length;const d=o[3];i.push({type:"text",content:d,range:L.create(D.create(r,a+c+n),D.create(r,a+c+d.length+n))})}else i.push({type:"text",content:"",range:L.create(D.create(r,a+c+n),D.create(r,a+c+n))});a=u+o[0].length}const s=e.substring(a);s.length>0&&i.push({type:"text",content:s,range:L.create(D.create(r,a+n),D.create(r,a+n+s.length))})}return i}const xI=/\S/,bI=/\s*$/;function So(t,e){const r=t.substring(e).match(xI);return r?e+r.index:t.length}function SI(t){const e=t.match(bI);if(e&&typeof e.index=="number")return e.index}function wI(t){var e,r,n,i;const a=D.create(t.position.line,t.position.character);if(t.tokens.length===0)return new Ef([],L.create(a,a));const s=[];for(;t.index<t.tokens.length;){const l=II(t,s[s.length-1]);l&&s.push(l)}const o=(r=(e=s[0])===null||e===void 0?void 0:e.range.start)!==null&&r!==void 0?r:a,u=(i=(n=s[s.length-1])===null||n===void 0?void 0:n.range.end)!==null&&i!==void 0?i:a;return new Ef(s,L.create(o,u))}function II(t,e){const r=t.tokens[t.index];if(r.type==="tag")return up(t,!1);if(r.type==="text"||r.type==="inline-tag")return op(t);_I(r,e),t.index++}function _I(t,e){if(e){const r=new cp("",t.range);"inlines"in e?e.inlines.push(r):e.content.inlines.push(r)}}function op(t){let e=t.tokens[t.index];const r=e;let n=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(CI(t)),n=e,e=t.tokens[t.index];return new wo(i,L.create(r.range.start,n.range.end))}function CI(t){return t.tokens[t.index].type==="inline-tag"?up(t,!0):lp(t)}function up(t,e){const r=t.tokens[t.index++],n=r.content.substring(1),i=t.tokens[t.index];if((i==null?void 0:i.type)==="text")if(e){const a=lp(t);return new ls(n,new wo([a],a.range),e,L.create(r.range.start,a.range.end))}else{const a=op(t);return new ls(n,a,e,L.create(r.range.start,a.range.end))}else{const a=r.range;return new ls(n,new wo([],a),e,a)}}function lp(t){const e=t.tokens[t.index++];return new cp(e.content,e.range)}function Au(t){if(!t)return Au({start:"/**",end:"*/",line:"*"});const{start:e,end:r,line:n}=t;return{start:us(e,!0),end:us(r,!1),line:us(n,!0)}}function us(t,e){if(typeof t=="string"||typeof t=="object"){const r=typeof t=="string"?aa(t):t.source;return e?new RegExp(`^\\s*${r}`):new RegExp(`\\s*${r}\\s*$`)}else return t}class Ef{constructor(e,r){this.elements=e,this.range=r}getTag(e){return this.getAllTags().find(r=>r.name===e)}getTags(e){return this.getAllTags().filter(r=>r.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const r of this.elements)if(e.length===0)e=r.toString();else{const n=r.toString();e+=Af(e)+n}return e.trim()}toMarkdown(e){let r="";for(const n of this.elements)if(r.length===0)r=n.toMarkdown(e);else{const i=n.toMarkdown(e);r+=Af(r)+i}return r.trim()}}class ls{constructor(e,r,n,i){this.name=e,this.content=r,this.inline=n,this.range=i}toString(){let e=`@${this.name}`;const r=this.content.toString();return this.content.inlines.length===1?e=`${e} ${r}`:this.content.inlines.length>1&&(e=`${e}
|
|
118
118
|
${r}`),this.inline?`{${e}}`:e}toMarkdown(e){var r,n;return(n=(r=e==null?void 0:e.renderTag)===null||r===void 0?void 0:r.call(e,this))!==null&&n!==void 0?n:this.toMarkdownDefault(e)}toMarkdownDefault(e){const r=this.content.toMarkdown(e);if(this.inline){const a=NI(this.name,r,e??{});if(typeof a=="string")return a}let n="";(e==null?void 0:e.tag)==="italic"||(e==null?void 0:e.tag)===void 0?n="*":(e==null?void 0:e.tag)==="bold"?n="**":(e==null?void 0:e.tag)==="bold-italic"&&(n="***");let i=`${n}@${this.name}${n}`;return this.content.inlines.length===1?i=`${i} — ${r}`:this.content.inlines.length>1&&(i=`${i}
|
|
119
119
|
${r}`),this.inline?`{${i}}`:i}}function NI(t,e,r){var n,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const a=e.indexOf(" ");let s=e;if(a>0){const o=So(e,a);s=e.substring(o),e=e.substring(0,a)}return(t==="linkcode"||t==="link"&&r.link==="code")&&(s=`\`${s}\``),(i=(n=r.renderLink)===null||n===void 0?void 0:n.call(r,e,s))!==null&&i!==void 0?i:OI(e,s)}}function OI(t,e){try{return Qt.parse(t,!0),`[${e}](${t})`}catch{return t}}class wo{constructor(e,r){this.inlines=e,this.range=r}toString(){let e="";for(let r=0;r<this.inlines.length;r++){const n=this.inlines[r],i=this.inlines[r+1];e+=n.toString(),i&&i.range.start.line>n.range.start.line&&(e+=`
|
|
120
120
|
`)}return e}toMarkdown(e){let r="";for(let n=0;n<this.inlines.length;n++){const i=this.inlines[n],a=this.inlines[n+1];r+=i.toMarkdown(e),a&&a.range.start.line>i.range.start.line&&(r+=`
|
|
@@ -122,7 +122,7 @@ ${r}`),this.inline?`{${i}}`:i}}function NI(t,e,r){var n,i;if(t==="linkplain"||t=
|
|
|
122
122
|
`)?`
|
|
123
123
|
`:`
|
|
124
124
|
|
|
125
|
-
`}class LI{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&EI(r))return RI(r).toMarkdown({renderLink:(n,i)=>this.documentationLinkRenderer(e,n,i),renderTag:n=>this.documentationTagRenderer(e,n)})}documentationLinkRenderer(e,r,n){var i;const a=(i=this.findNameInPrecomputedScopes(e,r))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,r);if(a&&a.nameSegment){const s=a.nameSegment.range.start.line+1,o=a.nameSegment.range.start.character+1,u=a.documentUri.with({fragment:`L${s},${o}`});return`[${n}](${u.toString()})`}else return}documentationTagRenderer(e,r){}findNameInPrecomputedScopes(e,r){const n=Et(e).precomputedScopes;if(!n)return;let i=e;do{const a=n.get(i).find(s=>s.name===r);if(a)return a;i=i.$container}while(i)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(n=>n.name===r)}}class PI{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return tI(e)?e.$comment:(r=Wp(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||r===void 0?void 0:r.text}}class MI{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}}class DI{constructor(){this.previousTokenSource=new H.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Gw();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=H.CancellationToken.None){const i=new Eu,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Pa(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class jI{constructor(e){this.grammarElementIdMap=new gf,this.tokenTypeIdMap=new gf,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>Object.assign(Object.assign({},r),{message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of hr(e))r.set(i,{});if(e.$cstNode)for(const i of Ds(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)le(o)?s.push(this.dehydrateAstNode(o,r)):He(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else le(a)?n[i]=this.dehydrateAstNode(a,r):He(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return Df(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Tn(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Mf(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of hr(e))r.set(a,{});let i;if(e.$cstNode)for(const a of Ds(e.$cstNode)){let s;"fullText"in a?(s=new Kh(a.fullText),i=s):"content"in a?s=new Tu:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)le(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):He(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else le(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):He(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Tn(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,u=e.endColumn,l=e.hidden;return new Ao(n,i,{start:{line:a,character:s},end:{line:o,character:u}},r,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of hr(this.grammar))qp(r)&&this.grammarElementIdMap.set(r,e++)}}function Lt(t){return{documentation:{CommentProvider:e=>new PI(e),DocumentationProvider:e=>new LI(e)},parser:{AsyncParser:e=>new MI(e),GrammarConfig:e=>Fm(e),LangiumParser:e=>Pw(e),CompletionParser:e=>Lw(e),ValueConverter:()=>new Qh,TokenBuilder:()=>new Zh,Lexer:e=>new vI(e),ParserErrorMessageProvider:()=>new Hh,LexerErrorMessageProvider:()=>new gI},workspace:{AstNodeLocator:()=>new cI,AstNodeDescriptionProvider:e=>new uI(e),ReferenceDescriptionProvider:e=>new lI(e)},references:{Linker:e=>new zw(e),NameProvider:()=>new Ww,ScopeProvider:e=>new eI(e),ScopeComputation:e=>new qw(e),References:e=>new Yw(e)},serializer:{Hydrator:e=>new jI(e),JsonSerializer:e=>new rI(e)},validation:{DocumentValidator:e=>new aI(e),ValidationRegistry:e=>new iI(e)},shared:()=>t.shared}}function Pt(t){return{ServiceRegistry:e=>new nI(e),workspace:{LangiumDocuments:e=>new Vw(e),LangiumDocumentFactory:e=>new Kw(e),DocumentBuilder:e=>new hI(e),IndexManager:e=>new pI(e),WorkspaceManager:e=>new mI(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new DI,ConfigurationProvider:e=>new dI(e)}}}var $f;(function(t){t.merge=(e,r)=>ta(ta({},e),r)})($f||($f={}));function ce(t,e,r,n,i,a,s,o,u){const l=[t,e,r,n,i,a,s,o,u].reduce(ta,{});return fp(l)}const UI=Symbol("isProxy");function fp(t,e){const r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===UI?!0:xf(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(xf(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}const kf=Symbol();function xf(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===kf)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=kf;try{t[e]=typeof i=="function"?i(n):fp(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function ta(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!==void 0){const i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=ta(i,n):t[r]=n}}return t}class FI{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const Mt={fileSystemProvider:()=>new FI},GI={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},BI={AstReflection:()=>new Vf};function KI(){const t=ce(Pt(Mt),BI),e=ce(Lt({shared:t}),GI);return t.ServiceRegistry.register(e),e}function or(t){var e;const r=KI(),n=r.serializer.JsonSerializer.deserialize(t);return r.shared.workspace.LangiumDocumentFactory.fromModel(n,Qt.parse(`memory://${(e=n.name)!==null&&e!==void 0?e:"grammar"}.langium`)),n}var VI=Object.defineProperty,A=(t,e)=>VI(t,"name",{value:e,configurable:!0}),bf="Statement",Ri="Architecture";function zI(t){return Ke.isInstance(t,Ri)}A(zI,"isArchitecture");var ii="Axis",dn="Branch";function HI(t){return Ke.isInstance(t,dn)}A(HI,"isBranch");var ai="Checkout",si="CherryPicking",cs="ClassDefStatement",hn="Commit";function WI(t){return Ke.isInstance(t,hn)}A(WI,"isCommit");var fs="Curve",ds="Edge",hs="Entry",pn="GitGraph";function YI(t){return Ke.isInstance(t,pn)}A(YI,"isGitGraph");var ps="Group",Ei="Info";function qI(t){return Ke.isInstance(t,Ei)}A(qI,"isInfo");var oi="Item",ms="Junction",mn="Merge";function XI(t){return Ke.isInstance(t,mn)}A(XI,"isMerge");var gs="Option",Ai="Packet";function ZI(t){return Ke.isInstance(t,Ai)}A(ZI,"isPacket");var $i="PacketBlock";function QI(t){return Ke.isInstance(t,$i)}A(QI,"isPacketBlock");var ki="Pie";function JI(t){return Ke.isInstance(t,ki)}A(JI,"isPie");var xi="PieSection";function e_(t){return Ke.isInstance(t,xi)}A(e_,"isPieSection");var ys="Radar",vs="Service",bi="Treemap";function t_(t){return Ke.isInstance(t,bi)}A(t_,"isTreemap");var Ts="TreemapRow",ui="Direction",li="Leaf",ci="Section",Rs,dp=(Rs=class extends Pf{getAllTypes(){return[Ri,ii,dn,ai,si,cs,hn,fs,ui,ds,hs,pn,ps,Ei,oi,ms,li,mn,gs,Ai,$i,ki,xi,ys,ci,vs,bf,bi,Ts]}computeIsSubtype(t,e){switch(t){case dn:case ai:case si:case hn:case mn:return this.isSubtype(bf,e);case ui:return this.isSubtype(pn,e);case li:case ci:return this.isSubtype(oi,e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;switch(e){case"Entry:axis":return ii;default:throw new Error(`${e} is not a valid reference id.`)}}getTypeMetaData(t){switch(t){case Ri:return{name:Ri,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case ii:return{name:ii,properties:[{name:"label"},{name:"name"}]};case dn:return{name:dn,properties:[{name:"name"},{name:"order"}]};case ai:return{name:ai,properties:[{name:"branch"}]};case si:return{name:si,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case cs:return{name:cs,properties:[{name:"className"},{name:"styleText"}]};case hn:return{name:hn,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case fs:return{name:fs,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case ds:return{name:ds,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case hs:return{name:hs,properties:[{name:"axis"},{name:"value"}]};case pn:return{name:pn,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case ps:return{name:ps,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case Ei:return{name:Ei,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case oi:return{name:oi,properties:[{name:"classSelector"},{name:"name"}]};case ms:return{name:ms,properties:[{name:"id"},{name:"in"}]};case mn:return{name:mn,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case gs:return{name:gs,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case Ai:return{name:Ai,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case $i:return{name:$i,properties:[{name:"bits"},{name:"end"},{name:"label"},{name:"start"}]};case ki:return{name:ki,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case xi:return{name:xi,properties:[{name:"label"},{name:"value"}]};case ys:return{name:ys,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case vs:return{name:vs,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case bi:return{name:bi,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"},{name:"TreemapRows",defaultValue:[]}]};case Ts:return{name:Ts,properties:[{name:"indent"},{name:"item"}]};case ui:return{name:ui,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};case li:return{name:li,properties:[{name:"classSelector"},{name:"name"},{name:"value"}]};case ci:return{name:ci,properties:[{name:"classSelector"},{name:"name"}]};default:return{name:t,properties:[]}}}},A(Rs,"MermaidAstReflection"),Rs),Ke=new dp,Sf,r_=A(()=>Sf??(Sf=or(`{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"InfoGrammar"),wf,n_=A(()=>wf??(wf=or(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"PacketGrammar"),If,i_=A(()=>If??(If=or(`{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"}}]},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"PieGrammar"),_f,a_=A(()=>_f??(_f=or(`{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"ArchitectureGrammar"),Cf,s_=A(()=>Cf??(Cf=or(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"GitGraphGrammar"),Nf,o_=A(()=>Nf??(Nf=or(`{"$type":"Grammar","isDeclared":true,"name":"Radar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"definesHiddenTokens":false,"hiddenTokens":[],"types":[],"usedGrammars":[]}`)),"RadarGrammar"),Of,u_=A(()=>Of??(Of=or(`{"$type":"Grammar","isDeclared":true,"name":"Treemap","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","}},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammar"),l_={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},c_={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},f_={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},d_={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},h_={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},p_={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},m_={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ur={AstReflection:A(()=>new dp,"AstReflection")},g_={Grammar:A(()=>r_(),"Grammar"),LanguageMetaData:A(()=>l_,"LanguageMetaData"),parser:{}},y_={Grammar:A(()=>n_(),"Grammar"),LanguageMetaData:A(()=>c_,"LanguageMetaData"),parser:{}},v_={Grammar:A(()=>i_(),"Grammar"),LanguageMetaData:A(()=>f_,"LanguageMetaData"),parser:{}},T_={Grammar:A(()=>a_(),"Grammar"),LanguageMetaData:A(()=>d_,"LanguageMetaData"),parser:{}},R_={Grammar:A(()=>s_(),"Grammar"),LanguageMetaData:A(()=>h_,"LanguageMetaData"),parser:{}},E_={Grammar:A(()=>o_(),"Grammar"),LanguageMetaData:A(()=>p_,"LanguageMetaData"),parser:{}},A_={Grammar:A(()=>u_(),"Grammar"),LanguageMetaData:A(()=>m_,"LanguageMetaData"),parser:{}},$_=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,k_=/accTitle[\t ]*:([^\n\r]*)/,x_=/title([\t ][^\n\r]*|)/,b_={ACC_DESCR:$_,ACC_TITLE:k_,TITLE:x_},Es,Ma=(Es=class extends Qh{runConverter(t,e,r){let n=this.runCommonConverter(t,e,r);return n===void 0&&(n=this.runCustomConverter(t,e,r)),n===void 0?super.runConverter(t,e,r):n}runCommonConverter(t,e,r){const n=b_[t.name];if(n===void 0)return;const i=n.exec(e);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
|
|
126
|
-
`)}}},A(Es,"AbstractMermaidValueConverter"),Es),As,Da=(As=class extends Ma{runCustomConverter(t,e,r){}},A(As,"CommonValueConverter"),As),$s,Dt=($s=class extends Zh{constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,r){const n=super.buildKeywordTokens(t,e,r);return n.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}},A($s,"AbstractMermaidTokenBuilder"),$s),Lf;Lf=class extends Dt{},A(Lf,"CommonTokenBuilder");var ks,S_=(ks=class extends Dt{constructor(){super(["gitGraph"])}},A(ks,"GitGraphTokenBuilder"),ks),hp={parser:{TokenBuilder:A(()=>new S_,"TokenBuilder"),ValueConverter:A(()=>new Da,"ValueConverter")}};function pp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),R_,hp);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}A(pp,"createGitGraphServices");var xs,w_=(xs=class extends Dt{constructor(){super(["info","showInfo"])}},A(xs,"InfoTokenBuilder"),xs),mp={parser:{TokenBuilder:A(()=>new w_,"TokenBuilder"),ValueConverter:A(()=>new Da,"ValueConverter")}};function gp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),g_,mp);return e.ServiceRegistry.register(r),{shared:e,Info:r}}A(gp,"createInfoServices");var bs,I_=(bs=class extends Dt{constructor(){super(["packet"])}},A(bs,"PacketTokenBuilder"),bs),yp={parser:{TokenBuilder:A(()=>new I_,"TokenBuilder"),ValueConverter:A(()=>new Da,"ValueConverter")}};function vp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),y_,yp);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}A(vp,"createPacketServices");var Ss,__=(Ss=class extends Dt{constructor(){super(["pie","showData"])}},A(Ss,"PieTokenBuilder"),Ss),ws,C_=(ws=class extends Ma{runCustomConverter(t,e,r){if(t.name==="PIE_SECTION_LABEL")return e.replace(/"/g,"").trim()}},A(ws,"PieValueConverter"),ws),Tp={parser:{TokenBuilder:A(()=>new __,"TokenBuilder"),ValueConverter:A(()=>new C_,"ValueConverter")}};function Rp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),v_,Tp);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}A(Rp,"createPieServices");var Is,N_=(Is=class extends Dt{constructor(){super(["architecture"])}},A(Is,"ArchitectureTokenBuilder"),Is),_s,O_=(_s=class extends Ma{runCustomConverter(t,e,r){if(t.name==="ARCH_ICON")return e.replace(/[()]/g,"").trim();if(t.name==="ARCH_TEXT_ICON")return e.replace(/["()]/g,"");if(t.name==="ARCH_TITLE")return e.replace(/[[\]]/g,"").trim()}},A(_s,"ArchitectureValueConverter"),_s),Ep={parser:{TokenBuilder:A(()=>new N_,"TokenBuilder"),ValueConverter:A(()=>new O_,"ValueConverter")}};function Ap(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),T_,Ep);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}A(Ap,"createArchitectureServices");var Cs,L_=(Cs=class extends Dt{constructor(){super(["radar-beta"])}},A(Cs,"RadarTokenBuilder"),Cs),$p={parser:{TokenBuilder:A(()=>new L_,"TokenBuilder"),ValueConverter:A(()=>new Da,"ValueConverter")}};function kp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),E_,$p);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}A(kp,"createRadarServices");var Ns,P_=(Ns=class extends Dt{constructor(){super(["treemap"])}},A(Ns,"TreemapTokenBuilder"),Ns),M_=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Os,D_=(Os=class extends Ma{runCustomConverter(t,e,r){if(t.name==="NUMBER2")return parseFloat(e.replace(/,/g,""));if(t.name==="SEPARATOR"||t.name==="STRING2")return e.substring(1,e.length-1);if(t.name==="INDENTATION")return e.length;if(t.name==="ClassDef"){if(typeof e!="string")return e;const n=M_.exec(e);if(n)return{$type:"ClassDefStatement",className:n[1],styleText:n[2]||void 0}}}},A(Os,"TreemapValueConverter"),Os);function xp(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}A(xp,"registerValidationChecks");var Ls,j_=(Ls=class{checkSingleRoot(t,e){let r;for(const n of t.TreemapRows)n.item&&(r===void 0&&n.indent===void 0?r=0:n.indent===void 0?e("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}):r!==void 0&&r>=parseInt(n.indent,10)&&e("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}))}},A(Ls,"TreemapValidator"),Ls),bp={parser:{TokenBuilder:A(()=>new P_,"TokenBuilder"),ValueConverter:A(()=>new D_,"ValueConverter")},validation:{TreemapValidator:A(()=>new j_,"TreemapValidator")}};function Sp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),A_,bp);return e.ServiceRegistry.register(r),xp(r),{shared:e,Treemap:r}}A(Sp,"createTreemapServices");var it={},
|
|
125
|
+
`}class LI{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const r=this.commentProvider.getComment(e);if(r&&EI(r))return RI(r).toMarkdown({renderLink:(n,i)=>this.documentationLinkRenderer(e,n,i),renderTag:n=>this.documentationTagRenderer(e,n)})}documentationLinkRenderer(e,r,n){var i;const a=(i=this.findNameInPrecomputedScopes(e,r))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,r);if(a&&a.nameSegment){const s=a.nameSegment.range.start.line+1,o=a.nameSegment.range.start.character+1,u=a.documentUri.with({fragment:`L${s},${o}`});return`[${n}](${u.toString()})`}else return}documentationTagRenderer(e,r){}findNameInPrecomputedScopes(e,r){const n=Et(e).precomputedScopes;if(!n)return;let i=e;do{const a=n.get(i).find(s=>s.name===r);if(a)return a;i=i.$container}while(i)}findNameInGlobalScope(e,r){return this.indexManager.allElements().find(n=>n.name===r)}}class PI{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var r;return tI(e)?e.$comment:(r=Wp(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||r===void 0?void 0:r.text}}class MI{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,r){return Promise.resolve(this.syncParser.parse(e))}}class DI{constructor(){this.previousTokenSource=new z.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const r=Gw();return this.previousTokenSource=r,this.enqueue(this.writeQueue,e,r.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,r,n=z.CancellationToken.None){const i=new Eu,a={action:r,deferred:i,cancellationToken:n};return e.push(a),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:r,deferred:n,cancellationToken:i})=>{try{const a=await Promise.resolve().then(()=>r(i));n.resolve(a)}catch(a){Pa(a)?n.resolve(void 0):n.reject(a)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class jI{constructor(e){this.grammarElementIdMap=new gf,this.tokenTypeIdMap=new gf,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(r=>Object.assign(Object.assign({},r),{message:r.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const r=new Map,n=new Map;for(const i of hr(e))r.set(i,{});if(e.$cstNode)for(const i of Ds(e.$cstNode))n.set(i,{});return{astNodes:r,cstNodes:n}}dehydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(n.$cstNode=this.dehydrateCstNode(e.$cstNode,r));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)le(o)?s.push(this.dehydrateAstNode(o,r)):ze(o)?s.push(this.dehydrateReference(o,r)):s.push(o)}else le(a)?n[i]=this.dehydrateAstNode(a,r):ze(a)?n[i]=this.dehydrateReference(a,r):a!==void 0&&(n[i]=a);return n}dehydrateReference(e,r){const n={};return n.$refText=e.$refText,e.$refNode&&(n.$refNode=r.cstNodes.get(e.$refNode)),n}dehydrateCstNode(e,r){const n=r.cstNodes.get(e);return Df(e)?n.fullText=e.fullText:n.grammarSource=this.getGrammarElementId(e.grammarSource),n.hidden=e.hidden,n.astNode=r.astNodes.get(e.astNode),Tn(e)?n.content=e.content.map(i=>this.dehydrateCstNode(i,r)):Mf(e)&&(n.tokenType=e.tokenType.name,n.offset=e.offset,n.length=e.length,n.startLine=e.range.start.line,n.startColumn=e.range.start.character,n.endLine=e.range.end.line,n.endColumn=e.range.end.character),n}hydrate(e){const r=e.value,n=this.createHydrationContext(r);return"$cstNode"in r&&this.hydrateCstNode(r.$cstNode,n),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(r,n)}}createHydrationContext(e){const r=new Map,n=new Map;for(const a of hr(e))r.set(a,{});let i;if(e.$cstNode)for(const a of Ds(e.$cstNode)){let s;"fullText"in a?(s=new Kh(a.fullText),i=s):"content"in a?s=new Tu:"tokenType"in a&&(s=this.hydrateCstLeafNode(a)),s&&(n.set(a,s),s.root=i)}return{astNodes:r,cstNodes:n}}hydrateAstNode(e,r){const n=r.astNodes.get(e);n.$type=e.$type,n.$containerIndex=e.$containerIndex,n.$containerProperty=e.$containerProperty,e.$cstNode&&(n.$cstNode=r.cstNodes.get(e.$cstNode));for(const[i,a]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(a)){const s=[];n[i]=s;for(const o of a)le(o)?s.push(this.setParent(this.hydrateAstNode(o,r),n)):ze(o)?s.push(this.hydrateReference(o,n,i,r)):s.push(o)}else le(a)?n[i]=this.setParent(this.hydrateAstNode(a,r),n):ze(a)?n[i]=this.hydrateReference(a,n,i,r):a!==void 0&&(n[i]=a);return n}setParent(e,r){return e.$container=r,e}hydrateReference(e,r,n,i){return this.linker.buildReference(r,n,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,r,n=0){const i=r.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=r.astNodes.get(e.astNode),Tn(i))for(const a of e.content){const s=this.hydrateCstNode(a,r,n++);i.content.push(s)}return i}hydrateCstLeafNode(e){const r=this.getTokenType(e.tokenType),n=e.offset,i=e.length,a=e.startLine,s=e.startColumn,o=e.endLine,u=e.endColumn,l=e.hidden;return new Ao(n,i,{start:{line:a,character:s},end:{line:o,character:u}},r,l)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const r of hr(this.grammar))qp(r)&&this.grammarElementIdMap.set(r,e++)}}function Lt(t){return{documentation:{CommentProvider:e=>new PI(e),DocumentationProvider:e=>new LI(e)},parser:{AsyncParser:e=>new MI(e),GrammarConfig:e=>Um(e),LangiumParser:e=>Pw(e),CompletionParser:e=>Lw(e),ValueConverter:()=>new Qh,TokenBuilder:()=>new Zh,Lexer:e=>new vI(e),ParserErrorMessageProvider:()=>new zh,LexerErrorMessageProvider:()=>new gI},workspace:{AstNodeLocator:()=>new cI,AstNodeDescriptionProvider:e=>new uI(e),ReferenceDescriptionProvider:e=>new lI(e)},references:{Linker:e=>new Hw(e),NameProvider:()=>new Ww,ScopeProvider:e=>new eI(e),ScopeComputation:e=>new qw(e),References:e=>new Yw(e)},serializer:{Hydrator:e=>new jI(e),JsonSerializer:e=>new rI(e)},validation:{DocumentValidator:e=>new aI(e),ValidationRegistry:e=>new iI(e)},shared:()=>t.shared}}function Pt(t){return{ServiceRegistry:e=>new nI(e),workspace:{LangiumDocuments:e=>new Vw(e),LangiumDocumentFactory:e=>new Kw(e),DocumentBuilder:e=>new hI(e),IndexManager:e=>new pI(e),WorkspaceManager:e=>new mI(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new DI,ConfigurationProvider:e=>new dI(e)}}}var $f;(function(t){t.merge=(e,r)=>ta(ta({},e),r)})($f||($f={}));function ce(t,e,r,n,i,a,s,o,u){const l=[t,e,r,n,i,a,s,o,u].reduce(ta,{});return fp(l)}const FI=Symbol("isProxy");function fp(t,e){const r=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(n,i)=>i===FI?!0:xf(n,i,t,e||r),getOwnPropertyDescriptor:(n,i)=>(xf(n,i,t,e||r),Object.getOwnPropertyDescriptor(n,i)),has:(n,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return r}const kf=Symbol();function xf(t,e,r,n){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===kf)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in r){const i=r[e];t[e]=kf;try{t[e]=typeof i=="function"?i(n):fp(i,n)}catch(a){throw t[e]=a instanceof Error?a:void 0,a}return t[e]}else return}function ta(t,e){if(e){for(const[r,n]of Object.entries(e))if(n!==void 0){const i=t[r];i!==null&&n!==null&&typeof i=="object"&&typeof n=="object"?t[r]=ta(i,n):t[r]=n}}return t}class UI{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const Mt={fileSystemProvider:()=>new UI},GI={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},BI={AstReflection:()=>new Vf};function KI(){const t=ce(Pt(Mt),BI),e=ce(Lt({shared:t}),GI);return t.ServiceRegistry.register(e),e}function or(t){var e;const r=KI(),n=r.serializer.JsonSerializer.deserialize(t);return r.shared.workspace.LangiumDocumentFactory.fromModel(n,Qt.parse(`memory://${(e=n.name)!==null&&e!==void 0?e:"grammar"}.langium`)),n}var VI=Object.defineProperty,A=(t,e)=>VI(t,"name",{value:e,configurable:!0}),bf="Statement",Ri="Architecture";function HI(t){return Ke.isInstance(t,Ri)}A(HI,"isArchitecture");var ii="Axis",dn="Branch";function zI(t){return Ke.isInstance(t,dn)}A(zI,"isBranch");var ai="Checkout",si="CherryPicking",cs="ClassDefStatement",hn="Commit";function WI(t){return Ke.isInstance(t,hn)}A(WI,"isCommit");var fs="Curve",ds="Edge",hs="Entry",pn="GitGraph";function YI(t){return Ke.isInstance(t,pn)}A(YI,"isGitGraph");var ps="Group",Ei="Info";function qI(t){return Ke.isInstance(t,Ei)}A(qI,"isInfo");var oi="Item",ms="Junction",mn="Merge";function XI(t){return Ke.isInstance(t,mn)}A(XI,"isMerge");var gs="Option",Ai="Packet";function ZI(t){return Ke.isInstance(t,Ai)}A(ZI,"isPacket");var $i="PacketBlock";function QI(t){return Ke.isInstance(t,$i)}A(QI,"isPacketBlock");var ki="Pie";function JI(t){return Ke.isInstance(t,ki)}A(JI,"isPie");var xi="PieSection";function e_(t){return Ke.isInstance(t,xi)}A(e_,"isPieSection");var ys="Radar",vs="Service",bi="Treemap";function t_(t){return Ke.isInstance(t,bi)}A(t_,"isTreemap");var Ts="TreemapRow",ui="Direction",li="Leaf",ci="Section",Rs,dp=(Rs=class extends Pf{getAllTypes(){return[Ri,ii,dn,ai,si,cs,hn,fs,ui,ds,hs,pn,ps,Ei,oi,ms,li,mn,gs,Ai,$i,ki,xi,ys,ci,vs,bf,bi,Ts]}computeIsSubtype(t,e){switch(t){case dn:case ai:case si:case hn:case mn:return this.isSubtype(bf,e);case ui:return this.isSubtype(pn,e);case li:case ci:return this.isSubtype(oi,e);default:return!1}}getReferenceType(t){const e=`${t.container.$type}:${t.property}`;switch(e){case"Entry:axis":return ii;default:throw new Error(`${e} is not a valid reference id.`)}}getTypeMetaData(t){switch(t){case Ri:return{name:Ri,properties:[{name:"accDescr"},{name:"accTitle"},{name:"edges",defaultValue:[]},{name:"groups",defaultValue:[]},{name:"junctions",defaultValue:[]},{name:"services",defaultValue:[]},{name:"title"}]};case ii:return{name:ii,properties:[{name:"label"},{name:"name"}]};case dn:return{name:dn,properties:[{name:"name"},{name:"order"}]};case ai:return{name:ai,properties:[{name:"branch"}]};case si:return{name:si,properties:[{name:"id"},{name:"parent"},{name:"tags",defaultValue:[]}]};case cs:return{name:cs,properties:[{name:"className"},{name:"styleText"}]};case hn:return{name:hn,properties:[{name:"id"},{name:"message"},{name:"tags",defaultValue:[]},{name:"type"}]};case fs:return{name:fs,properties:[{name:"entries",defaultValue:[]},{name:"label"},{name:"name"}]};case ds:return{name:ds,properties:[{name:"lhsDir"},{name:"lhsGroup",defaultValue:!1},{name:"lhsId"},{name:"lhsInto",defaultValue:!1},{name:"rhsDir"},{name:"rhsGroup",defaultValue:!1},{name:"rhsId"},{name:"rhsInto",defaultValue:!1},{name:"title"}]};case hs:return{name:hs,properties:[{name:"axis"},{name:"value"}]};case pn:return{name:pn,properties:[{name:"accDescr"},{name:"accTitle"},{name:"statements",defaultValue:[]},{name:"title"}]};case ps:return{name:ps,properties:[{name:"icon"},{name:"id"},{name:"in"},{name:"title"}]};case Ei:return{name:Ei,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"}]};case oi:return{name:oi,properties:[{name:"classSelector"},{name:"name"}]};case ms:return{name:ms,properties:[{name:"id"},{name:"in"}]};case mn:return{name:mn,properties:[{name:"branch"},{name:"id"},{name:"tags",defaultValue:[]},{name:"type"}]};case gs:return{name:gs,properties:[{name:"name"},{name:"value",defaultValue:!1}]};case Ai:return{name:Ai,properties:[{name:"accDescr"},{name:"accTitle"},{name:"blocks",defaultValue:[]},{name:"title"}]};case $i:return{name:$i,properties:[{name:"bits"},{name:"end"},{name:"label"},{name:"start"}]};case ki:return{name:ki,properties:[{name:"accDescr"},{name:"accTitle"},{name:"sections",defaultValue:[]},{name:"showData",defaultValue:!1},{name:"title"}]};case xi:return{name:xi,properties:[{name:"label"},{name:"value"}]};case ys:return{name:ys,properties:[{name:"accDescr"},{name:"accTitle"},{name:"axes",defaultValue:[]},{name:"curves",defaultValue:[]},{name:"options",defaultValue:[]},{name:"title"}]};case vs:return{name:vs,properties:[{name:"icon"},{name:"iconText"},{name:"id"},{name:"in"},{name:"title"}]};case bi:return{name:bi,properties:[{name:"accDescr"},{name:"accTitle"},{name:"title"},{name:"TreemapRows",defaultValue:[]}]};case Ts:return{name:Ts,properties:[{name:"indent"},{name:"item"}]};case ui:return{name:ui,properties:[{name:"accDescr"},{name:"accTitle"},{name:"dir"},{name:"statements",defaultValue:[]},{name:"title"}]};case li:return{name:li,properties:[{name:"classSelector"},{name:"name"},{name:"value"}]};case ci:return{name:ci,properties:[{name:"classSelector"},{name:"name"}]};default:return{name:t,properties:[]}}}},A(Rs,"MermaidAstReflection"),Rs),Ke=new dp,Sf,r_=A(()=>Sf??(Sf=or(`{"$type":"Grammar","isDeclared":true,"name":"Info","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Info","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"info"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"},{"$type":"Group","elements":[{"$type":"Keyword","value":"showInfo"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"*"}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@7"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"InfoGrammar"),wf,n_=A(()=>wf??(wf=or(`{"$type":"Grammar","isDeclared":true,"name":"Packet","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Packet","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"packet"},{"$type":"Keyword","value":"packet-beta"}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"Assignment","feature":"blocks","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PacketBlock","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"start","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"end","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}],"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"+"},{"$type":"Assignment","feature":"bits","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]}]},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@8"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@9"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"PacketGrammar"),If,i_=A(()=>If??(If=or(`{"$type":"Grammar","isDeclared":true,"name":"Pie","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Pie","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"pie"},{"$type":"Assignment","feature":"showData","operator":"?=","terminal":{"$type":"Keyword","value":"showData"},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Assignment","feature":"sections","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PieSection","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"FLOAT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/-?(0|[1-9][0-9]*)(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER_PIE","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@2"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@3"}}]},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@11"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@12"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"PieGrammar"),_f,a_=A(()=>_f??(_f=or(`{"$type":"Grammar","isDeclared":true,"name":"Architecture","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Architecture","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"*"},{"$type":"Keyword","value":"architecture-beta"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"groups","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Assignment","feature":"services","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"junctions","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"edges","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"LeftPort","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":":"},{"$type":"Assignment","feature":"lhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"RightPort","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"rhsDir","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Keyword","value":":"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Arrow","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Assignment","feature":"lhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"--"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Keyword","value":"-"}]}]},{"$type":"Assignment","feature":"rhsInto","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Group","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Service","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"service"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"iconText","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"icon","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]}}],"cardinality":"?"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Junction","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"junction"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"in"},{"$type":"Assignment","feature":"in","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Edge","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"lhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"lhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Assignment","feature":"rhsId","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"rhsGroup","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"ARROW_DIRECTION","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"L"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"R"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"T"}}]},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"B"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_GROUP","definition":{"$type":"RegexToken","regex":"/\\\\{group\\\\}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARROW_INTO","definition":{"$type":"RegexToken","regex":"/<|>/"},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@18"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@19"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","name":"ARCH_ICON","definition":{"$type":"RegexToken","regex":"/\\\\([\\\\w-:]+\\\\)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ARCH_TITLE","definition":{"$type":"RegexToken","regex":"/\\\\[[\\\\w ]+\\\\]/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"ArchitectureGrammar"),Cf,s_=A(()=>Cf??(Cf=or(`{"$type":"Grammar","isDeclared":true,"name":"GitGraph","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"GitGraph","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"Keyword","value":":"}]},{"$type":"Keyword","value":"gitGraph:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"gitGraph"},{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},{"$type":"Keyword","value":":"}]}]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"Assignment","feature":"statements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Statement","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Direction","definition":{"$type":"Assignment","feature":"dir","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"LR"},{"$type":"Keyword","value":"TB"},{"$type":"Keyword","value":"BT"}]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Commit","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"commit"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"msg:","cardinality":"?"},{"$type":"Assignment","feature":"message","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Branch","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"branch"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"order:"},{"$type":"Assignment","feature":"order","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}}],"cardinality":"?"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Merge","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"merge"},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"type:"},{"$type":"Assignment","feature":"type","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"NORMAL"},{"$type":"Keyword","value":"REVERSE"},{"$type":"Keyword","value":"HIGHLIGHT"}]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Checkout","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"checkout"},{"$type":"Keyword","value":"switch"}]},{"$type":"Assignment","feature":"branch","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CherryPicking","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"cherry-pick"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"id:"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"tag:"},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"parent:"},{"$type":"Assignment","feature":"parent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@14"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","name":"REFERENCE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\\\w([-\\\\./\\\\w]*[-\\\\w])?/"},"fragment":false,"hidden":false}],"definesHiddenTokens":false,"hiddenTokens":[],"interfaces":[],"types":[],"usedGrammars":[]}`)),"GitGraphGrammar"),Nf,o_=A(()=>Nf??(Nf=or(`{"$type":"Grammar","isDeclared":true,"name":"Radar","imports":[],"rules":[{"$type":"ParserRule","entry":true,"name":"Radar","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":"radar-beta:"},{"$type":"Group","elements":[{"$type":"Keyword","value":"radar-beta"},{"$type":"Keyword","value":":"}]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Keyword","value":"axis"},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"axes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"curve"},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"curves","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"options","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}}],"cardinality":"*"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Label","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"["},{"$type":"Assignment","feature":"label","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]}},{"$type":"Keyword","value":"]"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Axis","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Curve","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[],"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Entries","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":","},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"},{"$type":"Assignment","feature":"entries","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}}],"cardinality":"*"},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"*"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DetailedEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"axis","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NumberEntry","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Option","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"showLegend"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"ticks"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"max"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"min"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"graticule"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"GRATICULE","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"circle"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"polygon"}}]},"fragment":false,"hidden":false},{"$type":"ParserRule","fragment":true,"name":"EOL","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[],"cardinality":"+"},{"$type":"EndOfFile"}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"FLOAT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/[0-9]+\\\\.[0-9]+(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"INT","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/0|[1-9][0-9]*(?!\\\\.)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@15"}},{"$type":"TerminalRuleCall","rule":{"$ref":"#/rules@16"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STRING","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/\\"([^\\"\\\\\\\\]|\\\\\\\\.)*\\"|'([^'\\\\\\\\]|\\\\\\\\.)*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID","type":{"$type":"ReturnType","name":"string"},"definition":{"$type":"RegexToken","regex":"/[\\\\w]([-\\\\w]*\\\\w)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NEWLINE","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WHITESPACE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"YAML","definition":{"$type":"RegexToken","regex":"/---[\\\\t ]*\\\\r?\\\\n(?:[\\\\S\\\\s]*?\\\\r?\\\\n)?---(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"DIRECTIVE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%{[\\\\S\\\\s]*?}%%(?:\\\\r?\\\\n|(?!\\\\S))/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"SINGLE_LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*%%[^\\\\n\\\\r]*/"},"fragment":false}],"interfaces":[{"$type":"Interface","name":"Entry","attributes":[{"$type":"TypeAttribute","name":"axis","isOptional":true,"type":{"$type":"ReferenceType","referenceType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@2"}}}},{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}],"superTypes":[]}],"definesHiddenTokens":false,"hiddenTokens":[],"types":[],"usedGrammars":[]}`)),"RadarGrammar"),Of,u_=A(()=>Of??(Of=or(`{"$type":"Grammar","isDeclared":true,"name":"Treemap","rules":[{"$type":"ParserRule","fragment":true,"name":"TitleAndAccessibilities","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"accDescr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]}},{"$type":"Assignment","feature":"accTitle","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}],"cardinality":"+"},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"BOOLEAN","type":{"$type":"ReturnType","name":"boolean"},"definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"true"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"false"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_DESCR","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accDescr(?:[\\\\t ]*:([^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)|\\\\s*{([^}]*)})/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ACC_TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*accTitle[\\\\t ]*:(?:[^\\\\n\\\\r]*?(?=%%)|[^\\\\n\\\\r]*)/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"TITLE","definition":{"$type":"RegexToken","regex":"/[\\\\t ]*title(?:[\\\\t ][^\\\\n\\\\r]*?(?=%%)|[\\\\t ][^\\\\n\\\\r]*|)/"},"fragment":false,"hidden":false},{"$type":"ParserRule","entry":true,"name":"Treemap","returnType":{"$ref":"#/interfaces@4"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@0"},"arguments":[]},{"$type":"Assignment","feature":"TreemapRows","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"TREEMAP_KEYWORD","definition":{"$type":"TerminalAlternatives","elements":[{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap-beta"}},{"$type":"CharacterRange","left":{"$type":"Keyword","value":"treemap"}}]},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"CLASS_DEF","definition":{"$type":"RegexToken","regex":"/classDef\\\\s+([a-zA-Z_][a-zA-Z0-9_]+)(?:\\\\s+([^;\\\\r\\\\n]*))?(?:;)?/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"STYLE_SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":::"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"SEPARATOR","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":":"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"COMMA","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":","}},"fragment":false,"hidden":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[ \\\\t]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"ML_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\%\\\\%[^\\\\n]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/\\\\r?\\\\n/"},"fragment":false},{"$type":"ParserRule","name":"TreemapRow","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"indent","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"item","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ClassDef","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Item","returnType":{"$ref":"#/interfaces@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Section","returnType":{"$ref":"#/interfaces@1"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Leaf","returnType":{"$ref":"#/interfaces@2"},"definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[],"cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]},{"$type":"Assignment","feature":"classSelector","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"INDENTATION","definition":{"$type":"RegexToken","regex":"/[ \\\\t]{1,}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"ID2","definition":{"$type":"RegexToken","regex":"/[a-zA-Z_][a-zA-Z0-9_]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NUMBER2","definition":{"$type":"RegexToken","regex":"/[0-9_\\\\.\\\\,]+/"},"fragment":false,"hidden":false},{"$type":"ParserRule","name":"MyNumber","dataType":"number","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","name":"STRING2","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false}],"interfaces":[{"$type":"Interface","name":"Item","attributes":[{"$type":"TypeAttribute","name":"name","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"classSelector","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]},{"$type":"Interface","name":"Section","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[]},{"$type":"Interface","name":"Leaf","superTypes":[{"$ref":"#/interfaces@0"}],"attributes":[{"$type":"TypeAttribute","name":"value","type":{"$type":"SimpleType","primitiveType":"number"},"isOptional":false}]},{"$type":"Interface","name":"ClassDefStatement","attributes":[{"$type":"TypeAttribute","name":"className","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false},{"$type":"TypeAttribute","name":"styleText","type":{"$type":"SimpleType","primitiveType":"string"},"isOptional":false}],"superTypes":[]},{"$type":"Interface","name":"Treemap","attributes":[{"$type":"TypeAttribute","name":"TreemapRows","type":{"$type":"ArrayType","elementType":{"$type":"SimpleType","typeRef":{"$ref":"#/rules@14"}}},"isOptional":false},{"$type":"TypeAttribute","name":"title","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accTitle","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}},{"$type":"TypeAttribute","name":"accDescr","isOptional":true,"type":{"$type":"SimpleType","primitiveType":"string"}}],"superTypes":[]}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"types":[],"usedGrammars":[],"$comment":"/**\\n * Treemap grammar for Langium\\n * Converted from mindmap grammar\\n *\\n * The ML_COMMENT and NL hidden terminals handle whitespace, comments, and newlines\\n * before the treemap keyword, allowing for empty lines and comments before the\\n * treemap declaration.\\n */"}`)),"TreemapGrammar"),l_={languageId:"info",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},c_={languageId:"packet",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},f_={languageId:"pie",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},d_={languageId:"architecture",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},h_={languageId:"gitGraph",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},p_={languageId:"radar",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},m_={languageId:"treemap",fileExtensions:[".mmd",".mermaid"],caseInsensitive:!1,mode:"production"},ur={AstReflection:A(()=>new dp,"AstReflection")},g_={Grammar:A(()=>r_(),"Grammar"),LanguageMetaData:A(()=>l_,"LanguageMetaData"),parser:{}},y_={Grammar:A(()=>n_(),"Grammar"),LanguageMetaData:A(()=>c_,"LanguageMetaData"),parser:{}},v_={Grammar:A(()=>i_(),"Grammar"),LanguageMetaData:A(()=>f_,"LanguageMetaData"),parser:{}},T_={Grammar:A(()=>a_(),"Grammar"),LanguageMetaData:A(()=>d_,"LanguageMetaData"),parser:{}},R_={Grammar:A(()=>s_(),"Grammar"),LanguageMetaData:A(()=>h_,"LanguageMetaData"),parser:{}},E_={Grammar:A(()=>o_(),"Grammar"),LanguageMetaData:A(()=>p_,"LanguageMetaData"),parser:{}},A_={Grammar:A(()=>u_(),"Grammar"),LanguageMetaData:A(()=>m_,"LanguageMetaData"),parser:{}},$_=/accDescr(?:[\t ]*:([^\n\r]*)|\s*{([^}]*)})/,k_=/accTitle[\t ]*:([^\n\r]*)/,x_=/title([\t ][^\n\r]*|)/,b_={ACC_DESCR:$_,ACC_TITLE:k_,TITLE:x_},Es,Ma=(Es=class extends Qh{runConverter(t,e,r){let n=this.runCommonConverter(t,e,r);return n===void 0&&(n=this.runCustomConverter(t,e,r)),n===void 0?super.runConverter(t,e,r):n}runCommonConverter(t,e,r){const n=b_[t.name];if(n===void 0)return;const i=n.exec(e);if(i!==null){if(i[1]!==void 0)return i[1].trim().replace(/[\t ]{2,}/gm," ");if(i[2]!==void 0)return i[2].replace(/^\s*/gm,"").replace(/\s+$/gm,"").replace(/[\t ]{2,}/gm," ").replace(/[\n\r]{2,}/gm,`
|
|
126
|
+
`)}}},A(Es,"AbstractMermaidValueConverter"),Es),As,Da=(As=class extends Ma{runCustomConverter(t,e,r){}},A(As,"CommonValueConverter"),As),$s,Dt=($s=class extends Zh{constructor(t){super(),this.keywords=new Set(t)}buildKeywordTokens(t,e,r){const n=super.buildKeywordTokens(t,e,r);return n.forEach(i=>{this.keywords.has(i.name)&&i.PATTERN!==void 0&&(i.PATTERN=new RegExp(i.PATTERN.toString()+"(?:(?=%%)|(?!\\S))"))}),n}},A($s,"AbstractMermaidTokenBuilder"),$s),Lf;Lf=class extends Dt{},A(Lf,"CommonTokenBuilder");var ks,S_=(ks=class extends Dt{constructor(){super(["gitGraph"])}},A(ks,"GitGraphTokenBuilder"),ks),hp={parser:{TokenBuilder:A(()=>new S_,"TokenBuilder"),ValueConverter:A(()=>new Da,"ValueConverter")}};function pp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),R_,hp);return e.ServiceRegistry.register(r),{shared:e,GitGraph:r}}A(pp,"createGitGraphServices");var xs,w_=(xs=class extends Dt{constructor(){super(["info","showInfo"])}},A(xs,"InfoTokenBuilder"),xs),mp={parser:{TokenBuilder:A(()=>new w_,"TokenBuilder"),ValueConverter:A(()=>new Da,"ValueConverter")}};function gp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),g_,mp);return e.ServiceRegistry.register(r),{shared:e,Info:r}}A(gp,"createInfoServices");var bs,I_=(bs=class extends Dt{constructor(){super(["packet"])}},A(bs,"PacketTokenBuilder"),bs),yp={parser:{TokenBuilder:A(()=>new I_,"TokenBuilder"),ValueConverter:A(()=>new Da,"ValueConverter")}};function vp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),y_,yp);return e.ServiceRegistry.register(r),{shared:e,Packet:r}}A(vp,"createPacketServices");var Ss,__=(Ss=class extends Dt{constructor(){super(["pie","showData"])}},A(Ss,"PieTokenBuilder"),Ss),ws,C_=(ws=class extends Ma{runCustomConverter(t,e,r){if(t.name==="PIE_SECTION_LABEL")return e.replace(/"/g,"").trim()}},A(ws,"PieValueConverter"),ws),Tp={parser:{TokenBuilder:A(()=>new __,"TokenBuilder"),ValueConverter:A(()=>new C_,"ValueConverter")}};function Rp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),v_,Tp);return e.ServiceRegistry.register(r),{shared:e,Pie:r}}A(Rp,"createPieServices");var Is,N_=(Is=class extends Dt{constructor(){super(["architecture"])}},A(Is,"ArchitectureTokenBuilder"),Is),_s,O_=(_s=class extends Ma{runCustomConverter(t,e,r){if(t.name==="ARCH_ICON")return e.replace(/[()]/g,"").trim();if(t.name==="ARCH_TEXT_ICON")return e.replace(/["()]/g,"");if(t.name==="ARCH_TITLE")return e.replace(/[[\]]/g,"").trim()}},A(_s,"ArchitectureValueConverter"),_s),Ep={parser:{TokenBuilder:A(()=>new N_,"TokenBuilder"),ValueConverter:A(()=>new O_,"ValueConverter")}};function Ap(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),T_,Ep);return e.ServiceRegistry.register(r),{shared:e,Architecture:r}}A(Ap,"createArchitectureServices");var Cs,L_=(Cs=class extends Dt{constructor(){super(["radar-beta"])}},A(Cs,"RadarTokenBuilder"),Cs),$p={parser:{TokenBuilder:A(()=>new L_,"TokenBuilder"),ValueConverter:A(()=>new Da,"ValueConverter")}};function kp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),E_,$p);return e.ServiceRegistry.register(r),{shared:e,Radar:r}}A(kp,"createRadarServices");var Ns,P_=(Ns=class extends Dt{constructor(){super(["treemap"])}},A(Ns,"TreemapTokenBuilder"),Ns),M_=/classDef\s+([A-Z_a-z]\w+)(?:\s+([^\n\r;]*))?;?/,Os,D_=(Os=class extends Ma{runCustomConverter(t,e,r){if(t.name==="NUMBER2")return parseFloat(e.replace(/,/g,""));if(t.name==="SEPARATOR"||t.name==="STRING2")return e.substring(1,e.length-1);if(t.name==="INDENTATION")return e.length;if(t.name==="ClassDef"){if(typeof e!="string")return e;const n=M_.exec(e);if(n)return{$type:"ClassDefStatement",className:n[1],styleText:n[2]||void 0}}}},A(Os,"TreemapValueConverter"),Os);function xp(t){const e=t.validation.TreemapValidator,r=t.validation.ValidationRegistry;if(r){const n={Treemap:e.checkSingleRoot.bind(e)};r.register(n,e)}}A(xp,"registerValidationChecks");var Ls,j_=(Ls=class{checkSingleRoot(t,e){let r;for(const n of t.TreemapRows)n.item&&(r===void 0&&n.indent===void 0?r=0:n.indent===void 0?e("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}):r!==void 0&&r>=parseInt(n.indent,10)&&e("error","Multiple root nodes are not allowed in a treemap.",{node:n,property:"item"}))}},A(Ls,"TreemapValidator"),Ls),bp={parser:{TokenBuilder:A(()=>new P_,"TokenBuilder"),ValueConverter:A(()=>new D_,"ValueConverter")},validation:{TreemapValidator:A(()=>new j_,"TreemapValidator")}};function Sp(t=Mt){const e=ce(Pt(t),ur),r=ce(Lt({shared:e}),A_,bp);return e.ServiceRegistry.register(r),xp(r),{shared:e,Treemap:r}}A(Sp,"createTreemapServices");var it={},F_={info:A(async()=>{const{createInfoServices:t}=await Ut(async()=>{const{createInfoServices:r}=await Promise.resolve().then(()=>B_);return{createInfoServices:r}},void 0),e=t().Info.parser.LangiumParser;it.info=e},"info"),packet:A(async()=>{const{createPacketServices:t}=await Ut(async()=>{const{createPacketServices:r}=await Promise.resolve().then(()=>K_);return{createPacketServices:r}},void 0),e=t().Packet.parser.LangiumParser;it.packet=e},"packet"),pie:A(async()=>{const{createPieServices:t}=await Ut(async()=>{const{createPieServices:r}=await Promise.resolve().then(()=>V_);return{createPieServices:r}},void 0),e=t().Pie.parser.LangiumParser;it.pie=e},"pie"),architecture:A(async()=>{const{createArchitectureServices:t}=await Ut(async()=>{const{createArchitectureServices:r}=await Promise.resolve().then(()=>H_);return{createArchitectureServices:r}},void 0),e=t().Architecture.parser.LangiumParser;it.architecture=e},"architecture"),gitGraph:A(async()=>{const{createGitGraphServices:t}=await Ut(async()=>{const{createGitGraphServices:r}=await Promise.resolve().then(()=>z_);return{createGitGraphServices:r}},void 0),e=t().GitGraph.parser.LangiumParser;it.gitGraph=e},"gitGraph"),radar:A(async()=>{const{createRadarServices:t}=await Ut(async()=>{const{createRadarServices:r}=await Promise.resolve().then(()=>W_);return{createRadarServices:r}},void 0),e=t().Radar.parser.LangiumParser;it.radar=e},"radar"),treemap:A(async()=>{const{createTreemapServices:t}=await Ut(async()=>{const{createTreemapServices:r}=await Promise.resolve().then(()=>Y_);return{createTreemapServices:r}},void 0),e=t().Treemap.parser.LangiumParser;it.treemap=e},"treemap")};async function U_(t,e){const r=F_[t];if(!r)throw new Error(`Unknown diagram type: ${t}`);it[t]||await r();const n=it[t].parse(e);if(n.lexerErrors.length>0||n.parserErrors.length>0)throw new G_(n);return n.value}A(U_,"parse");var Ps,G_=(Ps=class extends Error{constructor(t){const e=t.lexerErrors.map(n=>n.message).join(`
|
|
127
127
|
`),r=t.parserErrors.map(n=>n.message).join(`
|
|
128
|
-
`);super(`Parsing failed: ${e} ${r}`),this.result=t}},A(Ps,"MermaidParseError"),Ps);const B_=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:mp,createInfoServices:gp},Symbol.toStringTag,{value:"Module"})),K_=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:yp,createPacketServices:vp},Symbol.toStringTag,{value:"Module"})),V_=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Tp,createPieServices:Rp},Symbol.toStringTag,{value:"Module"})),
|
|
128
|
+
`);super(`Parsing failed: ${e} ${r}`),this.result=t}},A(Ps,"MermaidParseError"),Ps);const B_=Object.freeze(Object.defineProperty({__proto__:null,InfoModule:mp,createInfoServices:gp},Symbol.toStringTag,{value:"Module"})),K_=Object.freeze(Object.defineProperty({__proto__:null,PacketModule:yp,createPacketServices:vp},Symbol.toStringTag,{value:"Module"})),V_=Object.freeze(Object.defineProperty({__proto__:null,PieModule:Tp,createPieServices:Rp},Symbol.toStringTag,{value:"Module"})),H_=Object.freeze(Object.defineProperty({__proto__:null,ArchitectureModule:Ep,createArchitectureServices:Ap},Symbol.toStringTag,{value:"Module"})),z_=Object.freeze(Object.defineProperty({__proto__:null,GitGraphModule:hp,createGitGraphServices:pp},Symbol.toStringTag,{value:"Module"})),W_=Object.freeze(Object.defineProperty({__proto__:null,RadarModule:$p,createRadarServices:kp},Symbol.toStringTag,{value:"Module"})),Y_=Object.freeze(Object.defineProperty({__proto__:null,TreemapModule:bp,createTreemapServices:Sp},Symbol.toStringTag,{value:"Module"}));export{U_ as j};
|